Fix category calculation for complex-typed expressions [chromium/src : main]

0 views
Skip to first unread message

Anders Hartvoll Ruud (Gerrit)

unread,
Sep 24, 2025, 6:43:41 AM (7 days ago) Sep 24
to Daniil Sakhapov, AyeAye, Chromium LUCI CQ, AI Code Reviewer, Alexis Menard, chromium...@chromium.org, blink-rev...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
Attention needed from Daniil Sakhapov

Anders Hartvoll Ruud added 2 comments

File third_party/blink/renderer/core/css/css_math_expression_node.cc
Line 353, Patchset 7 (Latest): // If we didn't have percent hint context, we still might end up with:
Anders Hartvoll Ruud . unresolved

You ended up *not* adding this context, right? Adjust the comment?

Line 354, Patchset 7 (Latest): // (1% * 1%) / 1px -> category should be kLength. So just add the power of
Anders Hartvoll Ruud . unresolved

Please add unit tests for this, if we don't have them already. E.g.:

```
1% / 1px;
(1% * 1%) / 1px;
(1% * 1% * 1%) / 1px;
(1% * 1deg) / 1px; (Nothing will parse this, but is it possible to express with CSSMathType using its API?)
```

Open in Gerrit

Related details

Attention is currently required from:
  • Daniil Sakhapov
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4fd179efea371a93ce671027b2e66e9ef564d1c8
Gerrit-Change-Number: 6973396
Gerrit-PatchSet: 7
Gerrit-Owner: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Reviewer: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
Gerrit-CC: Alexis Menard <alexis...@intel.com>
Gerrit-Attention: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-Comment-Date: Wed, 24 Sep 2025 10:43:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Daniil Sakhapov (Gerrit)

unread,
Sep 24, 2025, 8:42:04 AM (7 days ago) Sep 24
to Anders Hartvoll Ruud, AyeAye, Chromium LUCI CQ, AI Code Reviewer, Alexis Menard, chromium...@chromium.org, blink-rev...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
Attention needed from Anders Hartvoll Ruud

Daniil Sakhapov voted and added 2 comments

Votes added by Daniil Sakhapov

Commit-Queue+1

2 comments

File third_party/blink/renderer/core/css/css_math_expression_node.cc
Line 353, Patchset 7: // If we didn't have percent hint context, we still might end up with:
Anders Hartvoll Ruud . resolved

You ended up *not* adding this context, right? Adjust the comment?

Daniil Sakhapov

Done

Line 354, Patchset 7: // (1% * 1%) / 1px -> category should be kLength. So just add the power of
Anders Hartvoll Ruud . resolved

Please add unit tests for this, if we don't have them already. E.g.:

```
1% / 1px;
(1% * 1%) / 1px;
(1% * 1% * 1%) / 1px;
(1% * 1deg) / 1px; (Nothing will parse this, but is it possible to express with CSSMathType using its API?)
```

Daniil Sakhapov

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Anders Hartvoll Ruud
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4fd179efea371a93ce671027b2e66e9ef564d1c8
Gerrit-Change-Number: 6973396
Gerrit-PatchSet: 8
Gerrit-Owner: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Reviewer: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
Gerrit-CC: Alexis Menard <alexis...@intel.com>
Gerrit-Attention: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Comment-Date: Wed, 24 Sep 2025 12:41:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Anders Hartvoll Ruud <and...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Anders Hartvoll Ruud (Gerrit)

unread,
Sep 24, 2025, 10:50:44 AM (7 days ago) Sep 24
to Daniil Sakhapov, AyeAye, Chromium LUCI CQ, AI Code Reviewer, Alexis Menard, chromium...@chromium.org, blink-rev...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
Attention needed from Daniil Sakhapov

Anders Hartvoll Ruud added 1 comment

File third_party/blink/renderer/core/css/css_math_expression_node.cc
Line 370, Patchset 8 (Latest): if (percentage_hint_) {
Anders Hartvoll Ruud . unresolved

I guess dividing by `1px` does _not_ result in a percentage hint, then? (Please remind me where percentage hints come from in the first place.)

Open in Gerrit

Related details

Attention is currently required from:
  • Daniil Sakhapov
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I4fd179efea371a93ce671027b2e66e9ef564d1c8
    Gerrit-Change-Number: 6973396
    Gerrit-PatchSet: 8
    Gerrit-Owner: Daniil Sakhapov <sakh...@chromium.org>
    Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
    Gerrit-Reviewer: Daniil Sakhapov <sakh...@chromium.org>
    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Gerrit-CC: Alexis Menard <alexis...@intel.com>
    Gerrit-Attention: Daniil Sakhapov <sakh...@chromium.org>
    Gerrit-Comment-Date: Wed, 24 Sep 2025 14:50:31 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Daniil Sakhapov (Gerrit)

    unread,
    Sep 24, 2025, 11:28:57 AM (7 days ago) Sep 24
    to Anders Hartvoll Ruud, AyeAye, Chromium LUCI CQ, AI Code Reviewer, Alexis Menard, chromium...@chromium.org, blink-rev...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from Anders Hartvoll Ruud

    Daniil Sakhapov voted and added 2 comments

    Votes added by Daniil Sakhapov

    Commit-Queue+1

    2 comments

    Patchset-level comments
    File-level comment, Patchset 8:
    Daniil Sakhapov . unresolved

    I've updated the test to correct values.
    But I found the bug for cases where we have percents inside complex-typed arithmetic exression, that's not realted to this CL, so I suggest keep expectations for that test case and I come up with a fix in following CL.

    File third_party/blink/renderer/core/css/css_math_expression_node.cc
    Line 370, Patchset 8: if (percentage_hint_) {
    Anders Hartvoll Ruud . unresolved

    I guess dividing by `1px` does _not_ result in a percentage hint, then? (Please remind me where percentage hints come from in the first place.)

    Daniil Sakhapov

    Percent hint comes from the context an expression will be used in. E.g. for width that would be Length.
    The idea is to know what to do with percentes in typed arithmetic.
    `/ 1px` doesn't give you enough info, as the whole expression can be `1% * 1% / 1px / 1deg * 1deg / 1deg * 1px` and used in Angle context later.
    For us the problem is we do type checking at parse time, but for e.g. CSSOM we don't know the context beforhand, hence this percent trick is used to deduce percent hint by looking at the final type info (for given example we end up with `[percent -> 2], [angle -> -1], ([length -> 0])`), so we can check that we only have one non-percent entry and emulate `applying percent hint` Angle here. But if we saw `1% / 1px` and applied percent hint Legnth, that would cause kill the whole expression.
    That percent hint helps us to know the final category of expression, so later the call side checks result category of an expression with what it expects and accepts/not accepts it.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Anders Hartvoll Ruud
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I4fd179efea371a93ce671027b2e66e9ef564d1c8
    Gerrit-Change-Number: 6973396
    Gerrit-PatchSet: 9
    Gerrit-Owner: Daniil Sakhapov <sakh...@chromium.org>
    Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
    Gerrit-Reviewer: Daniil Sakhapov <sakh...@chromium.org>
    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Gerrit-CC: Alexis Menard <alexis...@intel.com>
    Gerrit-Attention: Anders Hartvoll Ruud <and...@chromium.org>
    Gerrit-Comment-Date: Wed, 24 Sep 2025 15:28:43 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Anders Hartvoll Ruud (Gerrit)

    unread,
    Sep 25, 2025, 8:26:49 AM (6 days ago) Sep 25
    to Daniil Sakhapov, AyeAye, Chromium LUCI CQ, AI Code Reviewer, Alexis Menard, chromium...@chromium.org, blink-rev...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from Daniil Sakhapov

    Anders Hartvoll Ruud voted and added 3 comments

    Votes added by Anders Hartvoll Ruud

    Code-Review+1

    3 comments

    File third_party/blink/renderer/core/css/css_math_expression_node.cc
    Line 353, Patchset 9 (Latest): // Since we don't have percent hint context, we might end up with:

    // (1% * 1%) / 1px -> category should be kLength.
    // So just add the power of percent as if we deduced percent hint from the
    // expression itself (note that correctness will be checked at the call
    // side - e.g. that category is Length if the call side expects Length).
    Anders Hartvoll Ruud . unresolved
    ```suggestion
    DCHECK(!percentage_hint_.has_value());
    // Because we don't provide the percent hint from the "outside"
    // as css-values expects [1], it's possible for the percentage
    // hint to be unset even for expressions that involve percentages
    // as well some other type, e.g.:
    //
    // width: (1% * 1%) / 1px;
    //
    // The CSSMathType for the above expression would contain
    // [percent -> 2, length -> -1] with a null percent hint.
    // However, the expression is clearly valid for 'width', since
    // the percentages resolve against lengths. To address this,
    // we effectively deduce what the percent hint should have been
    // from the other (non-percent) base type powers:
    //
    // If there is more than one non-percent base type with non-zero power,
    // it's intermediate (handled by early-out above).
    //
    // Otherwise, if there is exactly *one* other (non-percent) base type
    // with a non-zero power, then we assume that percentages were intended
    // to resolve against that base type, and basically move the powers from
    // "percent" to the other base type. Continuing the example from before:
    //
    // [percent -> 2, length -> -1] => [percent -> 0, length -> 1]
    //
    // However, we do not actually need to modify `base_type_powers_`
    // according to the above; the remainder of this function only
    // checks `types_sum`, so it's enough to "pretend" that these numbers
    // were combined all along.
    //
    // Note: This relies on kPercent appearing *last* in the enum.
    //
    // Note: Whether or not this deduced category is valid for
    // the relevant context will be determined by the call
    // site. For example, "width:(1% * 1%) / 1deg" would produce
    // kAngle for this algorithm, but ultimately be rejected.
    //
    // [1] https://drafts.csswg.org/css-values-4/#determine-the-type-of-a-calculation
    ```
    Line 370, Patchset 8: if (percentage_hint_) {
    Anders Hartvoll Ruud . resolved

    I guess dividing by `1px` does _not_ result in a percentage hint, then? (Please remind me where percentage hints come from in the first place.)

    Daniil Sakhapov

    Percent hint comes from the context an expression will be used in. E.g. for width that would be Length.
    The idea is to know what to do with percentes in typed arithmetic.
    `/ 1px` doesn't give you enough info, as the whole expression can be `1% * 1% / 1px / 1deg * 1deg / 1deg * 1px` and used in Angle context later.
    For us the problem is we do type checking at parse time, but for e.g. CSSOM we don't know the context beforhand, hence this percent trick is used to deduce percent hint by looking at the final type info (for given example we end up with `[percent -> 2], [angle -> -1], ([length -> 0])`), so we can check that we only have one non-percent entry and emulate `applying percent hint` Angle here. But if we saw `1% / 1px` and applied percent hint Legnth, that would cause kill the whole expression.
    That percent hint helps us to know the final category of expression, so later the call side checks result category of an expression with what it expects and accepts/not accepts it.

    Anders Hartvoll Ruud

    Thanks, I think I finally understand everything. I suggested an improvement to the comment.

    File third_party/blink/web_tests/external/wpt/css/css-values/typed_arithmetic.html
    Line 45, Patchset 9 (Latest):test_math_used("calc(10% / 1px)", "1px", {"prop": "line-height"});
    Anders Hartvoll Ruud . unresolved

    So the used value when literally specifying `line-height:0.1` under `font-size:10px` should serialize as `1px` and not `0.1`? Is that correct?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Daniil Sakhapov
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I4fd179efea371a93ce671027b2e66e9ef564d1c8
      Gerrit-Change-Number: 6973396
      Gerrit-PatchSet: 9
      Gerrit-Owner: Daniil Sakhapov <sakh...@chromium.org>
      Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
      Gerrit-Reviewer: Daniil Sakhapov <sakh...@chromium.org>
      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      Gerrit-CC: Alexis Menard <alexis...@intel.com>
      Gerrit-Attention: Daniil Sakhapov <sakh...@chromium.org>
      Gerrit-Comment-Date: Thu, 25 Sep 2025 12:26:36 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Anders Hartvoll Ruud <and...@chromium.org>
      Comment-In-Reply-To: Daniil Sakhapov <sakh...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Daniil Sakhapov (Gerrit)

      unread,
      Sep 25, 2025, 10:23:04 AM (6 days ago) Sep 25
      to Anders Hartvoll Ruud, AyeAye, Chromium LUCI CQ, AI Code Reviewer, Alexis Menard, chromium...@chromium.org, blink-rev...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
      Attention needed from Anders Hartvoll Ruud

      Daniil Sakhapov voted and added 3 comments

      Votes added by Daniil Sakhapov

      Commit-Queue+1

      3 comments

      Patchset-level comments
      File-level comment, Patchset 8:
      Daniil Sakhapov . resolved

      I've updated the test to correct values.
      But I found the bug for cases where we have percents inside complex-typed arithmetic exression, that's not realted to this CL, so I suggest keep expectations for that test case and I come up with a fix in following CL.

      Daniil Sakhapov

      Done

      File third_party/blink/renderer/core/css/css_math_expression_node.cc
      Line 353, Patchset 9: // Since we don't have percent hint context, we might end up with:

      // (1% * 1%) / 1px -> category should be kLength.
      // So just add the power of percent as if we deduced percent hint from the
      // expression itself (note that correctness will be checked at the call
      // side - e.g. that category is Length if the call side expects Length).
      Anders Hartvoll Ruud . resolved
      Daniil Sakhapov

      Done

      File third_party/blink/web_tests/external/wpt/css/css-values/typed_arithmetic.html
      Line 45, Patchset 9:test_math_used("calc(10% / 1px)", "1px", {"prop": "line-height"});
      Anders Hartvoll Ruud . resolved

      So the used value when literally specifying `line-height:0.1` under `font-size:10px` should serialize as `1px` and not `0.1`? Is that correct?

      Daniil Sakhapov

      Should be number per spec, fixed.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Anders Hartvoll Ruud
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I4fd179efea371a93ce671027b2e66e9ef564d1c8
        Gerrit-Change-Number: 6973396
        Gerrit-PatchSet: 10
        Gerrit-Owner: Daniil Sakhapov <sakh...@chromium.org>
        Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
        Gerrit-Reviewer: Daniil Sakhapov <sakh...@chromium.org>
        Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
        Gerrit-CC: Alexis Menard <alexis...@intel.com>
        Gerrit-Attention: Anders Hartvoll Ruud <and...@chromium.org>
        Gerrit-Comment-Date: Thu, 25 Sep 2025 14:22:44 +0000
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Anders Hartvoll Ruud (Gerrit)

        unread,
        Sep 26, 2025, 6:30:50 AM (5 days ago) Sep 26
        to Daniil Sakhapov, AyeAye, Chromium LUCI CQ, AI Code Reviewer, Alexis Menard, chromium...@chromium.org, blink-rev...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
        Attention needed from Daniil Sakhapov

        Anders Hartvoll Ruud added 1 comment

        File third_party/blink/renderer/core/css/resolver/style_builder_converter.cc
        Line 2089, Patchset 11 (Latest): // If line-height is set as number, it should be used as a multiplier to
        // font-size.
        if (primitive_value->IsNumber()) {
        return Length::Percent(
        ClampTo<float>(100.f * zoomed_length.NonNanCalculatedValue(
        computed_font_size, {})));
        }
        Anders Hartvoll Ruud . unresolved

        This looks like the wrong fix to me. I think you should not tackle this problem in this CL, and just land with an -expected.txt file.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Daniil Sakhapov
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I4fd179efea371a93ce671027b2e66e9ef564d1c8
          Gerrit-Change-Number: 6973396
          Gerrit-PatchSet: 11
          Gerrit-Owner: Daniil Sakhapov <sakh...@chromium.org>
          Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
          Gerrit-Reviewer: Daniil Sakhapov <sakh...@chromium.org>
          Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
          Gerrit-CC: Alexis Menard <alexis...@intel.com>
          Gerrit-Attention: Daniil Sakhapov <sakh...@chromium.org>
          Gerrit-Comment-Date: Fri, 26 Sep 2025 10:30:34 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Daniil Sakhapov (Gerrit)

          unread,
          Sep 26, 2025, 7:48:44 AM (5 days ago) Sep 26
          to Anders Hartvoll Ruud, AyeAye, Chromium LUCI CQ, AI Code Reviewer, Alexis Menard, chromium...@chromium.org, blink-rev...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
          Attention needed from Anders Hartvoll Ruud

          Daniil Sakhapov voted and added 1 comment

          Votes added by Daniil Sakhapov

          Commit-Queue+1

          1 comment

          File third_party/blink/renderer/core/css/resolver/style_builder_converter.cc
          Line 2089, Patchset 11: // If line-height is set as number, it should be used as a multiplier to

          // font-size.
          if (primitive_value->IsNumber()) {
          return Length::Percent(
          ClampTo<float>(100.f * zoomed_length.NonNanCalculatedValue(
          computed_font_size, {})));
          }
          Anders Hartvoll Ruud . resolved

          This looks like the wrong fix to me. I think you should not tackle this problem in this CL, and just land with an -expected.txt file.

          Daniil Sakhapov

          agree to disagree, but ok, will delay till next CL

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Anders Hartvoll Ruud
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I4fd179efea371a93ce671027b2e66e9ef564d1c8
          Gerrit-Change-Number: 6973396
          Gerrit-PatchSet: 12
          Gerrit-Owner: Daniil Sakhapov <sakh...@chromium.org>
          Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
          Gerrit-Reviewer: Daniil Sakhapov <sakh...@chromium.org>
          Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
          Gerrit-CC: Alexis Menard <alexis...@intel.com>
          Gerrit-Attention: Anders Hartvoll Ruud <and...@chromium.org>
          Gerrit-Comment-Date: Fri, 26 Sep 2025 11:48:30 +0000
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Anders Hartvoll Ruud (Gerrit)

          unread,
          Sep 26, 2025, 9:00:21 AM (5 days ago) Sep 26
          to Daniil Sakhapov, AyeAye, Chromium LUCI CQ, AI Code Reviewer, Alexis Menard, chromium...@chromium.org, blink-rev...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
          Attention needed from Daniil Sakhapov

          Anders Hartvoll Ruud voted and added 1 comment

          Votes added by Anders Hartvoll Ruud

          Code-Review+1

          1 comment

          Commit Message
          Line 32, Patchset 12 (Latest):Also, this CL fixes line-height calculation in style builder converter.
          Anders Hartvoll Ruud . unresolved

          nit

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Daniil Sakhapov
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I4fd179efea371a93ce671027b2e66e9ef564d1c8
            Gerrit-Change-Number: 6973396
            Gerrit-PatchSet: 12
            Gerrit-Owner: Daniil Sakhapov <sakh...@chromium.org>
            Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
            Gerrit-Reviewer: Daniil Sakhapov <sakh...@chromium.org>
            Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
            Gerrit-CC: Alexis Menard <alexis...@intel.com>
            Gerrit-Attention: Daniil Sakhapov <sakh...@chromium.org>
            Gerrit-Comment-Date: Fri, 26 Sep 2025 13:00:05 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Daniil Sakhapov (Gerrit)

            unread,
            Sep 26, 2025, 9:01:48 AM (5 days ago) Sep 26
            to Anders Hartvoll Ruud, AyeAye, Chromium LUCI CQ, AI Code Reviewer, Alexis Menard, chromium...@chromium.org, blink-rev...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org

            Daniil Sakhapov voted and added 1 comment

            Votes added by Daniil Sakhapov

            Commit-Queue+2

            1 comment

            Commit Message
            Line 32, Patchset 12:Also, this CL fixes line-height calculation in style builder converter.
            Anders Hartvoll Ruud . resolved

            nit

            Daniil Sakhapov

            ah, removed it in local commit message, but it didn't propagate to the CL description.

            Open in Gerrit

            Related details

            Attention set is empty
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement satisfiedCode-Owners
            • requirement satisfiedCode-Review
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I4fd179efea371a93ce671027b2e66e9ef564d1c8
            Gerrit-Change-Number: 6973396
            Gerrit-PatchSet: 13
            Gerrit-Owner: Daniil Sakhapov <sakh...@chromium.org>
            Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
            Gerrit-Reviewer: Daniil Sakhapov <sakh...@chromium.org>
            Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
            Gerrit-CC: Alexis Menard <alexis...@intel.com>
            Gerrit-Comment-Date: Fri, 26 Sep 2025 13:01:33 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            open
            diffy

            Chromium LUCI CQ (Gerrit)

            unread,
            Sep 26, 2025, 9:08:25 AM (5 days ago) Sep 26
            to Daniil Sakhapov, Anders Hartvoll Ruud, AyeAye, AI Code Reviewer, Alexis Menard, chromium...@chromium.org, blink-rev...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org

            Chromium LUCI CQ submitted the change

            Unreviewed changes

            12 is the latest approved patch-set.
            No files were changed between the latest approved patch-set and the submitted one.

            Change information

            Commit message:
            Fix category calculation for complex-typed expressions

            Category can only be determined for a math node if a final sum of all
            powers is either 0 (then it's a number), or 1 (then it's that 1 type).
            But there has been a problem that powers weren't summed up in abs
            values, leading to e.g. (1px / 1Hz) resulting in number, since the final
            sum ended up being 0. So, this CL reworks category calculation code a
            bit by checking that if we have more than one non-null type powers, the
            category should be kCalcIntermediate.

            But there is still a problem left with kPercent and percent_hint:
            Currently, we don't supply percent hint context (info about what
            percents in an expression would be resolved against, e.g. kCalcLength),
            we rather check at a call side that category of a parsed expression is
            the same as we expect. But we can end up in situation like: (1% * 1%) /
            1px - which would have two powers (+2 for percent, -1 for length). To
            solve this, this CL does a trick in which if we have only two non-null
            type powers, once of which is percent, we simulate ApplyPercentHint to
            the expression in Category() call. With this, we don't need to supply
            the percent hint context info, but solve the problem of not knowing it.
            Note also that this solves CSSOM problem, since there we don't know
            percent hint context at all during parse time.

            Also this CL adds printing for CSSMathType to ease future debugging.
            Fixed: 445824614
            Change-Id: I4fd179efea371a93ce671027b2e66e9ef564d1c8
            Reviewed-by: Anders Hartvoll Ruud <and...@chromium.org>
            Commit-Queue: Daniil Sakhapov <sakh...@chromium.org>
            Cr-Commit-Position: refs/heads/main@{#1521219}
            Files:
            • M third_party/blink/renderer/core/css/css_math_expression_node.cc
            • M third_party/blink/renderer/core/css/css_math_expression_node.h
            • A third_party/blink/web_tests/external/wpt/css/css-values/typed-arithmetic-different-categories-crash.html
            • A third_party/blink/web_tests/external/wpt/css/css-values/typed_arithmetic-expected.txt
            • M third_party/blink/web_tests/external/wpt/css/css-values/typed_arithmetic.html
            Change size: M
            Delta: 5 files changed, 124 insertions(+), 4 deletions(-)
            Branch: refs/heads/main
            Submit Requirements:
            • requirement satisfiedCode-Review: +1 by Anders Hartvoll Ruud
            Open in Gerrit
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: merged
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I4fd179efea371a93ce671027b2e66e9ef564d1c8
            Gerrit-Change-Number: 6973396
            Gerrit-PatchSet: 14
            Gerrit-Owner: Daniil Sakhapov <sakh...@chromium.org>
            Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
            Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
            Gerrit-Reviewer: Daniil Sakhapov <sakh...@chromium.org>
            Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
            Gerrit-CC: Alexis Menard <alexis...@intel.com>
            open
            diffy
            satisfied_requirement

            Blink W3C Test Autoroller (Gerrit)

            unread,
            Sep 26, 2025, 9:09:03 AM (5 days ago) Sep 26
            to Chromium LUCI CQ, Daniil Sakhapov, Anders Hartvoll Ruud, AyeAye, AI Code Reviewer, Alexis Menard, chromium...@chromium.org, blink-rev...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org

            Message from Blink W3C Test Autoroller

            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/55096.

            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

            Open in Gerrit

            Related details

            Attention set is empty
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement satisfiedCode-Owners
            • requirement satisfiedCode-Review
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I4fd179efea371a93ce671027b2e66e9ef564d1c8
            Gerrit-Change-Number: 6973396
            Gerrit-PatchSet: 14
            Gerrit-Owner: Daniil Sakhapov <sakh...@chromium.org>
            Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
            Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
            Gerrit-Reviewer: Daniil Sakhapov <sakh...@chromium.org>
            Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
            Gerrit-CC: Alexis Menard <alexis...@intel.com>
            Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
            Gerrit-Comment-Date: Fri, 26 Sep 2025 13:08:58 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: No
            satisfied_requirement
            open
            diffy

            Blink W3C Test Autoroller (Gerrit)

            unread,
            Sep 26, 2025, 9:48:14 AM (5 days ago) Sep 26
            to Chromium LUCI CQ, Daniil Sakhapov, Anders Hartvoll Ruud, AyeAye, AI Code Reviewer, Alexis Menard, chromium...@chromium.org, blink-rev...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org

            Message from Blink W3C Test Autoroller

            The WPT PR for this CL has been merged upstream! https://github.com/web-platform-tests/wpt/pull/55096

            Open in Gerrit

            Related details

            Attention set is empty
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement satisfiedCode-Owners
            • requirement satisfiedCode-Review
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I4fd179efea371a93ce671027b2e66e9ef564d1c8
            Gerrit-Change-Number: 6973396
            Gerrit-PatchSet: 14
            Gerrit-Owner: Daniil Sakhapov <sakh...@chromium.org>
            Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
            Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
            Gerrit-Reviewer: Daniil Sakhapov <sakh...@chromium.org>
            Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
            Gerrit-CC: Alexis Menard <alexis...@intel.com>
            Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
            Gerrit-Comment-Date: Fri, 26 Sep 2025 13:48:08 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: No
            satisfied_requirement
            open
            diffy
            Reply all
            Reply to author
            Forward
            0 new messages