[initial-letter] Implement parsing CSS property initail-letter [chromium/src : main]

1 view
Skip to first unread message

Yoshifumi Inoue (Gerrit)

unread,
Oct 11, 2022, 3:53:05 AM10/11/22
to Kent Tamura, Koji Ishii, apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org

Attention is currently required from: Kent Tamura, Koji Ishii.

Yoshifumi Inoue would like Kent Tamura and Koji Ishii to review this change.

View Change

[initial-letter] Implement parsing CSS property initail-letter

This patch introduces parsing CSS property "initail-letter". Following
CLs will implement layout and paint[1].

[1] http://crrev.com/c/3874383: [initial-letter] all in one

Bug: 1276900
Change-Id: Id0b7dedd30a62ce4658262b6f7c86424ce18766d
---
M third_party/blink/public/mojom/use_counter/metrics/css_property_id.mojom
M third_party/blink/renderer/build/scripts/core/style/make_computed_style_base.py
M third_party/blink/renderer/core/css/css_properties.json5
M third_party/blink/renderer/core/css/css_value_keywords.json5
M third_party/blink/renderer/core/css/properties/css_parsing_utils.cc
M third_party/blink/renderer/core/css/properties/css_parsing_utils.h
M third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc
M third_party/blink/renderer/core/css/resolver/style_builder_converter.cc
M third_party/blink/renderer/core/css/resolver/style_builder_converter.h
M third_party/blink/renderer/core/style/build.gni
A third_party/blink/renderer/core/style/style_initial_letter.cc
A third_party/blink/renderer/core/style/style_initial_letter.h
M third_party/blink/renderer/platform/runtime_enabled_features.json5
A third_party/blink/web_tests/external/wpt/css/css-initial-letter/initial-letter-valid.html
14 files changed, 276 insertions(+), 0 deletions(-)


To view, visit change 3944351. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id0b7dedd30a62ce4658262b6f7c86424ce18766d
Gerrit-Change-Number: 3944351
Gerrit-PatchSet: 2
Gerrit-Owner: Yoshifumi Inoue <yo...@chromium.org>
Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
Gerrit-Reviewer: Koji Ishii <ko...@chromium.org>
Gerrit-Reviewer: Yoshifumi Inoue <yo...@chromium.org>
Gerrit-CC: Alexis Menard <alexis...@intel.com>
Gerrit-Attention: Kent Tamura <tk...@chromium.org>
Gerrit-Attention: Koji Ishii <ko...@chromium.org>
Gerrit-MessageType: newchange

Yoshifumi Inoue (Gerrit)

unread,
Oct 11, 2022, 3:55:03 AM10/11/22
to apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, Kent Tamura, Koji Ishii, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org

Attention is currently required from: Kent Tamura, Koji Ishii.

Patch set 2:Auto-Submit +1Commit-Queue +1

View Change

1 comment:

To view, visit change 3944351. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id0b7dedd30a62ce4658262b6f7c86424ce18766d
Gerrit-Change-Number: 3944351
Gerrit-PatchSet: 2
Gerrit-Owner: Yoshifumi Inoue <yo...@chromium.org>
Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
Gerrit-Reviewer: Koji Ishii <ko...@chromium.org>
Gerrit-Reviewer: Yoshifumi Inoue <yo...@chromium.org>
Gerrit-CC: Alexis Menard <alexis...@intel.com>
Gerrit-Attention: Kent Tamura <tk...@chromium.org>
Gerrit-Attention: Koji Ishii <ko...@chromium.org>
Gerrit-Comment-Date: Tue, 11 Oct 2022 07:53:00 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

Blink W3C Test Autoroller (Gerrit)

unread,
Oct 11, 2022, 4:01:49 AM10/11/22
to apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, Kent Tamura, Koji Ishii, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org

Attention is currently required from: Kent Tamura, Koji Ishii.

Exportable changes to web-platform-tests were detected in this CL and a pull request in the upstream repo has been made: https://github.com/web-platform-tests/wpt/pull/36395.

When this CL lands, the bot will automatically merge the PR on GitHub if the required GitHub checks pass; otherwise, ecosystem-infra@ team will triage the failures and may contact you.

WPT Export docs:
https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_platform_tests.md#Automatic-export-process

View Change

    To view, visit change 3944351. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Id0b7dedd30a62ce4658262b6f7c86424ce18766d
    Gerrit-Change-Number: 3944351
    Gerrit-PatchSet: 2
    Gerrit-Owner: Yoshifumi Inoue <yo...@chromium.org>
    Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
    Gerrit-Reviewer: Koji Ishii <ko...@chromium.org>
    Gerrit-Reviewer: Yoshifumi Inoue <yo...@chromium.org>
    Gerrit-CC: Alexis Menard <alexis...@intel.com>
    Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
    Gerrit-Attention: Kent Tamura <tk...@chromium.org>
    Gerrit-Attention: Koji Ishii <ko...@chromium.org>
    Gerrit-Comment-Date: Tue, 11 Oct 2022 07:58:12 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Kent Tamura (Gerrit)

    unread,
    Oct 11, 2022, 4:02:41 AM10/11/22
    to apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, Blink W3C Test Autoroller, Kent Tamura, Koji Ishii, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org

    Attention is currently required from: Koji Ishii, Yoshifumi Inoue.

    View Change

    3 comments:

    To view, visit change 3944351. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Id0b7dedd30a62ce4658262b6f7c86424ce18766d
    Gerrit-Change-Number: 3944351
    Gerrit-PatchSet: 2
    Gerrit-Owner: Yoshifumi Inoue <yo...@chromium.org>
    Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
    Gerrit-Reviewer: Koji Ishii <ko...@chromium.org>
    Gerrit-Reviewer: Yoshifumi Inoue <yo...@chromium.org>
    Gerrit-CC: Alexis Menard <alexis...@intel.com>
    Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
    Gerrit-Attention: Yoshifumi Inoue <yo...@chromium.org>
    Gerrit-Attention: Koji Ishii <ko...@chromium.org>
    Gerrit-Comment-Date: Tue, 11 Oct 2022 08:01:07 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Koji Ishii (Gerrit)

    unread,
    Oct 11, 2022, 4:09:02 AM10/11/22
    to Rune Lillesveen, apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, Kent Tamura

    Attention is currently required from: Rune Lillesveen, Yoshifumi Inoue.

    Koji Ishii would like Rune Lillesveen to review this change authored by Yoshifumi Inoue.

    View Change

    [initial-letter] Implement parsing CSS property initail-letter

    This patch introduces parsing CSS property "initail-letter". Following
    CLs will implement layout and paint[1].

    [1] http://crrev.com/c/3874383: [initial-letter] all in one

    Bug: 1276900
    Change-Id: Id0b7dedd30a62ce4658262b6f7c86424ce18766d
    ---
    M third_party/blink/public/mojom/use_counter/metrics/css_property_id.mojom
    M third_party/blink/renderer/build/scripts/core/style/make_computed_style_base.py
    M third_party/blink/renderer/core/css/css_properties.json5
    M third_party/blink/renderer/core/css/css_value_keywords.json5
    M third_party/blink/renderer/core/css/properties/css_parsing_utils.cc
    M third_party/blink/renderer/core/css/properties/css_parsing_utils.h
    M third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc
    M third_party/blink/renderer/core/css/resolver/style_builder_converter.cc
    M third_party/blink/renderer/core/css/resolver/style_builder_converter.h
    M third_party/blink/renderer/core/style/build.gni
    A third_party/blink/renderer/core/style/style_initial_letter.cc
    A third_party/blink/renderer/core/style/style_initial_letter.h
    M third_party/blink/renderer/platform/runtime_enabled_features.json5
    A third_party/blink/web_tests/external/wpt/css/css-initial-letter/initial-letter-valid.html
    14 files changed, 276 insertions(+), 0 deletions(-)


    To view, visit change 3944351. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Id0b7dedd30a62ce4658262b6f7c86424ce18766d
    Gerrit-Change-Number: 3944351
    Gerrit-PatchSet: 2
    Gerrit-Owner: Yoshifumi Inoue <yo...@chromium.org>
    Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
    Gerrit-Reviewer: Koji Ishii <ko...@chromium.org>
    Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
    Gerrit-Reviewer: Yoshifumi Inoue <yo...@chromium.org>
    Gerrit-CC: Alexis Menard <alexis...@intel.com>
    Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
    Gerrit-Attention: Yoshifumi Inoue <yo...@chromium.org>
    Gerrit-Attention: Rune Lillesveen <fut...@chromium.org>
    Gerrit-MessageType: newchange

    Koji Ishii (Gerrit)

    unread,
    Oct 11, 2022, 4:10:44 AM10/11/22
    to apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, Rune Lillesveen, Blink W3C Test Autoroller, Kent Tamura, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org

    Attention is currently required from: Rune Lillesveen, Yoshifumi Inoue.

    View Change

    1 comment:

    To view, visit change 3944351. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Id0b7dedd30a62ce4658262b6f7c86424ce18766d
    Gerrit-Change-Number: 3944351
    Gerrit-PatchSet: 2
    Gerrit-Owner: Yoshifumi Inoue <yo...@chromium.org>
    Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
    Gerrit-Reviewer: Koji Ishii <ko...@chromium.org>
    Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
    Gerrit-Reviewer: Yoshifumi Inoue <yo...@chromium.org>
    Gerrit-CC: Alexis Menard <alexis...@intel.com>
    Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
    Gerrit-Attention: Yoshifumi Inoue <yo...@chromium.org>
    Gerrit-Attention: Rune Lillesveen <fut...@chromium.org>
    Gerrit-Comment-Date: Tue, 11 Oct 2022 08:08:57 +0000

    Koji Ishii (Gerrit)

    unread,
    Oct 11, 2022, 4:46:48 AM10/11/22
    to apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, Rune Lillesveen, Blink W3C Test Autoroller, Kent Tamura, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org

    Attention is currently required from: Rune Lillesveen, Yoshifumi Inoue.

    View Change

    2 comments:

    To view, visit change 3944351. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Id0b7dedd30a62ce4658262b6f7c86424ce18766d
    Gerrit-Change-Number: 3944351
    Gerrit-PatchSet: 2
    Gerrit-Owner: Yoshifumi Inoue <yo...@chromium.org>
    Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
    Gerrit-Reviewer: Koji Ishii <ko...@chromium.org>
    Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
    Gerrit-Reviewer: Yoshifumi Inoue <yo...@chromium.org>
    Gerrit-CC: Alexis Menard <alexis...@intel.com>
    Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
    Gerrit-Attention: Yoshifumi Inoue <yo...@chromium.org>
    Gerrit-Attention: Rune Lillesveen <fut...@chromium.org>
    Gerrit-Comment-Date: Tue, 11 Oct 2022 08:44:12 +0000

    Koji Ishii (Gerrit)

    unread,
    Oct 11, 2022, 1:01:08 PM10/11/22
    to Anders Hartvoll Ruud, apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, Rune Lillesveen, Kent Tamura

    Attention is currently required from: Anders Hartvoll Ruud, Rune Lillesveen, Yoshifumi Inoue.

    Koji Ishii would like Anders Hartvoll Ruud to review this change authored by Yoshifumi Inoue.

    View Change

    [initial-letter] Implement parsing CSS property initail-letter

    This patch introduces parsing CSS property "initail-letter". Following
    CLs will implement layout and paint[1].

    [1] http://crrev.com/c/3874383: [initial-letter] all in one

    Bug: 1276900
    Change-Id: Id0b7dedd30a62ce4658262b6f7c86424ce18766d
    ---
    M third_party/blink/public/mojom/use_counter/metrics/css_property_id.mojom
    M third_party/blink/renderer/build/scripts/core/style/make_computed_style_base.py
    M third_party/blink/renderer/core/css/css_properties.json5
    M third_party/blink/renderer/core/css/css_value_keywords.json5
    M third_party/blink/renderer/core/css/properties/css_parsing_utils.cc
    M third_party/blink/renderer/core/css/properties/css_parsing_utils.h
    M third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc
    M third_party/blink/renderer/core/css/resolver/style_builder_converter.cc
    M third_party/blink/renderer/core/css/resolver/style_builder_converter.h
    M third_party/blink/renderer/core/style/build.gni
    A third_party/blink/renderer/core/style/style_initial_letter.cc
    A third_party/blink/renderer/core/style/style_initial_letter.h
    M third_party/blink/renderer/platform/runtime_enabled_features.json5
    A third_party/blink/web_tests/external/wpt/css/css-initial-letter/initial-letter-valid.html
    14 files changed, 276 insertions(+), 0 deletions(-)


    To view, visit change 3944351. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Id0b7dedd30a62ce4658262b6f7c86424ce18766d
    Gerrit-Change-Number: 3944351
    Gerrit-PatchSet: 2
    Gerrit-Owner: Yoshifumi Inoue <yo...@chromium.org>
    Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
    Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
    Gerrit-Reviewer: Koji Ishii <ko...@chromium.org>
    Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
    Gerrit-Reviewer: Yoshifumi Inoue <yo...@chromium.org>
    Gerrit-CC: Alexis Menard <alexis...@intel.com>
    Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
    Gerrit-Attention: Yoshifumi Inoue <yo...@chromium.org>
    Gerrit-Attention: Rune Lillesveen <fut...@chromium.org>
    Gerrit-Attention: Anders Hartvoll Ruud <and...@chromium.org>
    Gerrit-MessageType: newchange

    Koji Ishii (Gerrit)

    unread,
    Oct 11, 2022, 1:03:21 PM10/11/22
    to apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, Anders Hartvoll Ruud, Rune Lillesveen, Blink W3C Test Autoroller, Kent Tamura, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org

    Attention is currently required from: Anders Hartvoll Ruud, Rune Lillesveen, Yoshifumi Inoue.

    View Change

    1 comment:

    To view, visit change 3944351. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Id0b7dedd30a62ce4658262b6f7c86424ce18766d
    Gerrit-Change-Number: 3944351
    Gerrit-PatchSet: 2
    Gerrit-Owner: Yoshifumi Inoue <yo...@chromium.org>
    Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
    Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
    Gerrit-Reviewer: Koji Ishii <ko...@chromium.org>
    Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
    Gerrit-Reviewer: Yoshifumi Inoue <yo...@chromium.org>
    Gerrit-CC: Alexis Menard <alexis...@intel.com>
    Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
    Gerrit-Attention: Yoshifumi Inoue <yo...@chromium.org>
    Gerrit-Attention: Rune Lillesveen <fut...@chromium.org>
    Gerrit-Attention: Anders Hartvoll Ruud <and...@chromium.org>
    Gerrit-Comment-Date: Tue, 11 Oct 2022 17:01:03 +0000

    Anders Hartvoll Ruud (Gerrit)

    unread,
    Oct 11, 2022, 7:43:32 PM10/11/22
    to apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, Rune Lillesveen, Blink W3C Test Autoroller, Kent Tamura, Koji Ishii, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org

    Attention is currently required from: Rune Lillesveen, Yoshifumi Inoue.

    View Change

    10 comments:

    • Commit Message:

    • File third_party/blink/renderer/core/css/properties/css_parsing_utils.cc:

    • File third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc:

      • Patch Set #2, Line 3687:

        if (initial_letter.IsNormal())
        return CSSIdentifierValue::Create(CSSValueID::kNormal);

        In that case, maybe it's more consistent to also return a `CSSIdentifierValue::Create(CSSValueID::kNormal)` directly from `ConsumeInitialLetter` rather than wrapping it in a list.

      • Patch Set #2, Line 3694: kNumber

        kInteger?

    • File third_party/blink/renderer/core/css/resolver/style_builder_converter.cc:

      • Patch Set #2, Line 1413: const auto& list = To<CSSValueList>(value);

        This function does too much fallback to `StyleInitialLetter()` if something unexpected happens, which isn't really right. Generally the parsing function must emit something compatible, and we should DCHECK if something unexpected is observed.

        I'd get the `normal` case out of the way first, then do something like:

        ```
        DCHECK(list->length() == 1 || list->length() == 2);
        CSSValue* first = list->Item(0);
        CSSValue* second = list->length() == 2 ? list->Item(1) : nullptr;
        // std::swap items if `first` contains drop/raise ident, then take it from there.
        ```

      • Patch Set #2, Line 1446: size->GetFloatValue() >= 1

        We should DCHECK this, it should not be possible to be out-of-range here.

      • Patch Set #2, Line 1450:

        size->GetFloatValue() >= 1) {
        if (sink && sink->GetIntValue() >= 1

        Same with these range checks.

    • File third_party/blink/web_tests/external/wpt/css/css-initial-letter/initial-letter-valid.html:

      • Patch Set #2, Line 1: <!DOCTYPE html>

        You probably also want to get coverage on _computed values_, see e.g. aspect-ratio-computed.html for inspiration.

      • Patch Set #2, Line 21: test_valid_value('initial-letter', '1.23 456');

        Recommend e.g. `test_valid_value('initial-letter', '1.23 calc(45.1)');` as well.

    To view, visit change 3944351. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Id0b7dedd30a62ce4658262b6f7c86424ce18766d
    Gerrit-Change-Number: 3944351
    Gerrit-PatchSet: 2
    Gerrit-Owner: Yoshifumi Inoue <yo...@chromium.org>
    Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
    Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
    Gerrit-Reviewer: Koji Ishii <ko...@chromium.org>
    Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
    Gerrit-Reviewer: Yoshifumi Inoue <yo...@chromium.org>
    Gerrit-CC: Alexis Menard <alexis...@intel.com>
    Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
    Gerrit-Attention: Yoshifumi Inoue <yo...@chromium.org>
    Gerrit-Attention: Rune Lillesveen <fut...@chromium.org>
    Gerrit-Comment-Date: Tue, 11 Oct 2022 23:40:12 +0000
    Reply all
    Reply to author
    Forward
    0 new messages