Add CSSTrigonometricFunctions feature flag and sin() function [chromium/src : main]

0 views
Skip to first unread message

Seokho Song (Gerrit)

unread,
Jun 23, 2022, 8:05:25 AM6/23/22
to Xiaocheng Hu, Mason Freed, apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org

Attention is currently required from: Mason Freed, Xiaocheng Hu.

Seokho Song would like Xiaocheng Hu and Mason Freed to review this change.

View Change

Add CSSTrigonometricFunctions feature flag and sin() function

According to the CSS Values and Units Module Level 4 [1], the trigonometric function should be parsed and evaluated.

Therefore, this initial feature CL adds the feature flag 'CSSTrigonometricFunctions' and 'sin, cos, asin, acos, atan, atan2' keywords to css_value_keywords.json5. (tan keyword is already defined)
Also, Implement parsing and evaluation for sin().

Feature status: [2]
Intent to prototype: [3]

[1] https://www.w3.org/TR/css-values-4/#trig-funcs
[2] https://chromestatus.com/feature/5165381072191488
[3]https://groups.google.com/a/chromium.org/g/blink-dev/c/-c9p-Sq_gWg

Bug: 1190444
Change-Id: Ibd190fcdc61980f81e456b259ecd5bac86c4612b
---
M third_party/blink/renderer/core/css/css_math_expression_node.cc
M third_party/blink/renderer/core/css/css_math_expression_node.h
M third_party/blink/renderer/core/css/css_value_keywords.json5
M third_party/blink/renderer/platform/runtime_enabled_features.json5
M third_party/blink/web_tests/external/wpt/css/css-values/sin-cos-tan-serialize.html
M third_party/blink/web_tests/platform/generic/external/wpt/css/css-values/sin-cos-tan-computed-expected.txt
M third_party/blink/web_tests/platform/generic/external/wpt/css/css-values/sin-cos-tan-serialize-expected.txt
7 files changed, 178 insertions(+), 87 deletions(-)


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

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ibd190fcdc61980f81e456b259ecd5bac86c4612b
Gerrit-Change-Number: 3713201
Gerrit-PatchSet: 7
Gerrit-Owner: Seokho Song <seo...@chromium.org>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-Reviewer: Seokho Song <seo...@chromium.org>
Gerrit-Reviewer: Xiaocheng Hu <xiaoc...@chromium.org>
Gerrit-CC: Alexis Menard <alexis...@intel.com>
Gerrit-Attention: Xiaocheng Hu <xiaoc...@chromium.org>
Gerrit-Attention: Mason Freed <mas...@chromium.org>
Gerrit-MessageType: newchange

Seokho Song (Gerrit)

unread,
Jun 23, 2022, 8:05:28 AM6/23/22
to apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, Xiaocheng Hu, Mason Freed, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org

Attention is currently required from: Mason Freed, Xiaocheng Hu.

View Change

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

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ibd190fcdc61980f81e456b259ecd5bac86c4612b
    Gerrit-Change-Number: 3713201
    Gerrit-PatchSet: 7
    Gerrit-Owner: Seokho Song <seo...@chromium.org>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-Reviewer: Seokho Song <seo...@chromium.org>
    Gerrit-Reviewer: Xiaocheng Hu <xiaoc...@chromium.org>
    Gerrit-CC: Alexis Menard <alexis...@intel.com>
    Gerrit-Attention: Xiaocheng Hu <xiaoc...@chromium.org>
    Gerrit-Attention: Mason Freed <mas...@chromium.org>
    Gerrit-Comment-Date: Thu, 23 Jun 2022 12:05:18 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Blink W3C Test Autoroller (Gerrit)

    unread,
    Jun 23, 2022, 8:08:46 AM6/23/22
    to Seokho Song, apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, Xiaocheng Hu, Mason Freed, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org

    Attention is currently required from: Mason Freed, Xiaocheng Hu.

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

    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 3713201. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ibd190fcdc61980f81e456b259ecd5bac86c4612b
      Gerrit-Change-Number: 3713201
      Gerrit-PatchSet: 7
      Gerrit-Owner: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Xiaocheng Hu <xiaoc...@chromium.org>
      Gerrit-CC: Alexis Menard <alexis...@intel.com>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-Attention: Xiaocheng Hu <xiaoc...@chromium.org>
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Comment-Date: Thu, 23 Jun 2022 12:08:34 +0000

      Xiaocheng Hu (Gerrit)

      unread,
      Jun 23, 2022, 3:12:55 PM6/23/22
      to Seokho Song, apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, Blink W3C Test Autoroller, Mason Freed, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org

      Attention is currently required from: Mason Freed, Seokho Song.

      View Change

      5 comments:

      • File third_party/blink/renderer/core/css/css_math_expression_node.h:

        • Patch Set #7, Line 227: CreateTrigonometricSimplifiedValue

          nit: How about `CreateTrigonometricFunctionSimplified`, to be more consistent with the function below?

      • File third_party/blink/renderer/core/css/css_math_expression_node.cc:

        • Patch Set #7, Line 465: static double DoubleValueAsRadian(const CSSMathExpressionNode* node,

          I think this function should be

          ```
          static double ValueAsRadian(const CSSMathExpressionNode& node) {
          // if node category is angle, use ComputeValueInCanonicalUnit() to get the degree value, then convert to radian
          // if node category is number, return DoubleValue()
          }
          ```
        • Patch Set #7, Line 493: ResolvedUnitType

          We should check `Category()` instead of `ResolvedUnitType()`.

          `ResolvedUnitType()` doesn't do any unit conversion, not even between same-type units (e.g., `deg` and `rad`). Its only purpose is to check if `DoubleValue()` can be safely called.

      • File third_party/blink/web_tests/external/wpt/css/css-values/sin-cos-tan-serialize.html:

        • Patch Set #7, Line 11: t,s, {prop="transform"}={}

          Better to avoid single-letter variable names. Could you change `t` and `s` to `specified` and `expected`?

          And the last parameter can be removed because no test case specifies a different value.

        • Patch Set #7, Line 43: "scale(calc("+exp+"))"

          nit: better to use the JS template string

          ```
          `scale(calc(${exp}))`
          ```

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

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ibd190fcdc61980f81e456b259ecd5bac86c4612b
      Gerrit-Change-Number: 3713201
      Gerrit-PatchSet: 7
      Gerrit-Owner: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Xiaocheng Hu <xiaoc...@chromium.org>
      Gerrit-CC: Alexis Menard <alexis...@intel.com>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-Attention: Seokho Song <seo...@chromium.org>
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Comment-Date: Thu, 23 Jun 2022 19:12:46 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Gerrit-MessageType: comment

      Mason Freed (Gerrit)

      unread,
      Jun 23, 2022, 4:49:29 PM6/23/22
      to Seokho Song, apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, Blink W3C Test Autoroller, Xiaocheng Hu, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org

      Attention is currently required from: Seokho Song.

      View Change

      9 comments:

      • Patchset:

      • File third_party/blink/renderer/core/css/css_math_expression_node.cc:

        • Patch Set #7, Line 467: ||

          I'm fairly sure this should be == for both comparisons, and && instead of ||. As written it is always true.

        • Patch Set #7, Line 478: default:

          I think it's worth converting to this:

           case CSSPrimitiveValue::UnitType::kNumber:
          case CSSPrimitiveValue::UnitType::kInteger:
          case CSSPrimitiveValue::UnitType::kDegrees:
          return value;
          default:
          NOTREACHED();
          return value;

          This could perhaps be instead of the DCHECK at the top checking the UnitCategory.
        • Patch Set #7, Line 494:

            if (UnitCategory(unit_type) != kCalcNumber &&
          UnitCategory(unit_type) != kCalcAngle) {
          return nullptr;
          }

          This logic exists essentially two places. Perhaps you could convert DoubleValueAsRadian() to return a bool, which if false means the number can't be converted. It could take a reference to the double for the output value, instead of returning it. Then you could simplify this code here to:


          double radians;
          if (!DoubleValueAsRadian(operands[0], operands[0]->ResolvedUnitType(),
          radians)) {
          return nullptr;
          }
          double value;
          switch (function_id) {
          case CSSValueID::kSin:
          value = sin(radians);
          ...
        • Patch Set #7, Line 1155: true

          Should this be

           return RuntimeEnabledFeatures::CSSTrigonometricFunctionsEnabled();

          ?
        • Patch Set #7, Line 1254:

          if (!RuntimeEnabledFeatures::CSSTrigonometricFunctionsEnabled())
          break;

          With the above code, this might be able to be a DCHECK() instead of an if().

        • Patch Set #7, Line 1297:

           if (!RuntimeEnabledFeatures::CSSTrigonometricFunctionsEnabled())
          return nullptr;

          ditto

      • File third_party/blink/renderer/core/css/css_value_keywords.json5:

        • Patch Set #7, Line 1311:

            "cos",
          // "tan" - already declared for color value
          "atan",
          "atan2",
          "acos",
          "asin",

          Perhaps wait to add these until they're supported?

      • File third_party/blink/web_tests/external/wpt/css/css-values/sin-cos-tan-serialize.html:

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

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ibd190fcdc61980f81e456b259ecd5bac86c4612b
      Gerrit-Change-Number: 3713201
      Gerrit-PatchSet: 7
      Gerrit-Owner: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Xiaocheng Hu <xiaoc...@chromium.org>
      Gerrit-CC: Alexis Menard <alexis...@intel.com>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-Attention: Seokho Song <seo...@chromium.org>
      Gerrit-Comment-Date: Thu, 23 Jun 2022 20:49:22 +0000

      Seokho Song (Gerrit)

      unread,
      Jun 26, 2022, 8:18:23 AM6/26/22
      to apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, Blink W3C Test Autoroller, Xiaocheng Hu, Mason Freed, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org

      Attention is currently required from: Mason Freed, Xiaocheng Hu.

      View Change

      13 comments:

      • File third_party/blink/renderer/core/css/css_math_expression_node.h:

        • nit: How about `CreateTrigonometricFunctionSimplified`, to be more consistent with the function belo […]

          Done

      • File third_party/blink/renderer/core/css/css_math_expression_node.cc:

        • Patch Set #7, Line 465: static double DoubleValueAsRadian(const CSSMathExpressionNode* node,

          I think this function should be […]

          Done

        • I'm fairly sure this should be == for both comparisons, and && instead of ||. […]

          Thanks! I've changed != to ==. However, || should be kept because it produce always true if changed.

        • I think it's worth converting to this: […]

          I've changed to @xiaocheng's review. I guess it is already dechecked by:
          DCHECK(node->Category() == kCalcNumber || node->Category() == kCalcAngle);
        • We should check `Category()` instead of `ResolvedUnitType()`. […]

          Ack

        • Patch Set #7, Line 494:

            if (UnitCategory(unit_type) != kCalcNumber &&
          UnitCategory(unit_type) != kCalcAngle) {
          return nullptr;
          }

        • This logic exists essentially two places. […]

          I think the validation of the unit type and convert utility should be separated.
          Because asin, acos, atan consumes single parameter of <number> value and atan2 consume two-parameter of <number> and <percent> value.

          Perhaps we should need multiple switch-case to simplify.

          How about current patch set? validate first, and evaluate later.

        • Should this be […]

          Done

        • Patch Set #7, Line 1254:

          if (!RuntimeEnabledFeatures::CSSTrigonometricFunctionsEnabled())
          break;

          With the above code, this might be able to be a DCHECK() instead of an if().

        • Done

        • Done

      • File third_party/blink/renderer/core/css/css_value_keywords.json5:

        • Patch Set #7, Line 1311:

            "cos",
          // "tan" - already declared for color value
          "atan",
          "atan2",
          "acos",
          "asin",

          Perhaps wait to add these until they're supported?

        • Done

      • File third_party/blink/web_tests/external/wpt/css/css-values/sin-cos-tan-serialize.html:

        • Done

        • nit: better to use the JS template string […]

          Done

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

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ibd190fcdc61980f81e456b259ecd5bac86c4612b
      Gerrit-Change-Number: 3713201
      Gerrit-PatchSet: 8
      Gerrit-Owner: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Xiaocheng Hu <xiaoc...@chromium.org>
      Gerrit-CC: Alexis Menard <alexis...@intel.com>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-Attention: Xiaocheng Hu <xiaoc...@chromium.org>
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Comment-Date: Sun, 26 Jun 2022 12:18:12 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Xiaocheng Hu <xiaoc...@chromium.org>
      Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
      Gerrit-MessageType: comment

      Mason Freed (Gerrit)

      unread,
      Jun 27, 2022, 11:36:38 AM6/27/22
      to Seokho Song, apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, Blink W3C Test Autoroller, Xiaocheng Hu, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org

      Attention is currently required from: Seokho Song, Xiaocheng Hu.

      View Change

      4 comments:

      • File third_party/blink/renderer/core/css/css_math_expression_node.cc:

        • Done

          Note the request for the new name, |ValueAsRadian|, which I agree with.

        • Thanks! I've changed != to ==. However, || should be kept because it produce always true if changed.

          You're right, sorry about that. But I'm glad you changed to ==.

        • I've changed to @xiaocheng's review. I guess it is already dechecked by: […]

          Ok, I like the new approach. Please just convert to this:

            if (node->Category() == kCalcAngle) {
          return Deg2rad(node->ComputeValueInCanonicalUnit().value());
          }
          DCHECK_EQ(node->Category(), kCalcNumber);
          return node->DoubleValue();

          (and remove the DCHECK at the top)

        • Patch Set #7, Line 494:

            if (UnitCategory(unit_type) != kCalcNumber &&
          UnitCategory(unit_type) != kCalcAngle) {
          return nullptr;
          }

        • I think the validation of the unit type and convert utility should be separated. […]

          I still think you'll have a bunch of duplicated code. Your ValueAsRadian() function should be where inputs are converted to angles, or rejected with an error code. Then your (single) case/switch in CreateTrigonometricFunctionSimplified() can just be something like

            bool error=false;

        • switch (function_id) {
          case CSSValueID::kSin: {
        •       value = sin(ValueAsRadian(operands[0],error));
          break;
          case CSSValueID::kCos: {
          value = cos(ValueAsRadian(operands[0],error));
          break;
          case CSSValueID::kTan: {
          value = tan(ValueAsRadian(operands[0],error));
          break;

          Maybe I'm wrong. Perhaps it would be worthwhile adding at least Cos and Tan now, so we can get a sense for how repetitive it actually looks? I suspect the existing structure will have tons of copy/paste code in it, but maybe I'm wrong. What do you think?

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

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ibd190fcdc61980f81e456b259ecd5bac86c4612b
      Gerrit-Change-Number: 3713201
      Gerrit-PatchSet: 8
      Gerrit-Owner: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Xiaocheng Hu <xiaoc...@chromium.org>
      Gerrit-CC: Alexis Menard <alexis...@intel.com>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-Attention: Seokho Song <seo...@chromium.org>
      Gerrit-Attention: Xiaocheng Hu <xiaoc...@chromium.org>
      Gerrit-Comment-Date: Mon, 27 Jun 2022 15:36:25 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Seokho Song <seo...@chromium.org>

      Seokho Song (Gerrit)

      unread,
      Jun 27, 2022, 7:55:51 PM6/27/22
      to apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, Blink W3C Test Autoroller, Xiaocheng Hu, Mason Freed, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org

      Attention is currently required from: Mason Freed, Xiaocheng Hu.

      Patch set 9:Commit-Queue +1

      View Change

      3 comments:

      • File third_party/blink/renderer/core/css/css_math_expression_node.cc:

        • Note the request for the new name, |ValueAsRadian|, which I agree with.

          Done

        • Ok, I like the new approach. Please just convert to this: […]

          Done

        • Patch Set #7, Line 494:

            if (UnitCategory(unit_type) != kCalcNumber &&
          UnitCategory(unit_type) != kCalcAngle) {
          return nullptr;
          }

        • I still think you'll have a bunch of duplicated code. […]

          Oh I see that can be possible to handle as single branch with the error variable...
          I guess your approach is fine.

        •   bool error=false;
          switch (function_id) {
          case CSSValueID::kSin: {
          value = sin(ValueAsRadian(operands[0],error));
          break;
          case CSSValueID::kCos: {
          value = cos(ValueAsRadian(operands[0],error));
          break;
          case CSSValueID::kTan: {
          value = tan(ValueAsRadian(operands[0],error));
          break;
        •     case CSSValueID::kAsin: {
          value = asin(DoubleNumberValue(operands[0], error))
          break;
          ...
          case CSSValueID::kAtan2: {
          value = atan2(Func(operands[0], error), Func(opernads[1], error));
          break;
          }
          }

          I wrote pseudo-code for what will be looks like from your code.

          How would you think @xiaocheng?

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

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ibd190fcdc61980f81e456b259ecd5bac86c4612b
      Gerrit-Change-Number: 3713201
      Gerrit-PatchSet: 9
      Gerrit-Owner: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Xiaocheng Hu <xiaoc...@chromium.org>
      Gerrit-CC: Alexis Menard <alexis...@intel.com>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-Attention: Xiaocheng Hu <xiaoc...@chromium.org>
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Comment-Date: Mon, 27 Jun 2022 23:55:41 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes

      Mason Freed (Gerrit)

      unread,
      Jun 28, 2022, 12:00:06 PM6/28/22
      to Seokho Song, apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, Blink W3C Test Autoroller, Xiaocheng Hu, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org

      Attention is currently required from: Seokho Song, Xiaocheng Hu.

      View Change

      1 comment:

        •   if (UnitCategory(unit_type) != kCalcNumber &&
          UnitCategory(unit_type) != kCalcAngle) {
          return nullptr;
          }

        • Oh I see that can be possible to handle as single branch with the error variable... […]

          Your pseudo code is exactly what I was thinking. Then the error handling is local to the conversion methods, and CreateTrigonometricFunctionSimplified() is clean and easy to read.

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

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ibd190fcdc61980f81e456b259ecd5bac86c4612b
      Gerrit-Change-Number: 3713201
      Gerrit-PatchSet: 9
      Gerrit-Owner: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Xiaocheng Hu <xiaoc...@chromium.org>
      Gerrit-CC: Alexis Menard <alexis...@intel.com>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-Attention: Seokho Song <seo...@chromium.org>
      Gerrit-Attention: Xiaocheng Hu <xiaoc...@chromium.org>
      Gerrit-Comment-Date: Tue, 28 Jun 2022 15:59:58 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Seokho Song <seo...@chromium.org>

      Seokho Song (Gerrit)

      unread,
      Jun 30, 2022, 9:27:50 AM6/30/22
      to apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, Blink W3C Test Autoroller, Xiaocheng Hu, Mason Freed, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org

      Attention is currently required from: Xiaocheng Hu.

      View Change

      1 comment:

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

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ibd190fcdc61980f81e456b259ecd5bac86c4612b
      Gerrit-Change-Number: 3713201
      Gerrit-PatchSet: 9
      Gerrit-Owner: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Xiaocheng Hu <xiaoc...@chromium.org>
      Gerrit-CC: Alexis Menard <alexis...@intel.com>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-Attention: Xiaocheng Hu <xiaoc...@chromium.org>
      Gerrit-Comment-Date: Thu, 30 Jun 2022 13:27:41 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Gerrit-MessageType: comment

      Xiaocheng Hu (Gerrit)

      unread,
      Jul 6, 2022, 2:31:47 PM7/6/22
      to Seokho Song, apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, Blink W3C Test Autoroller, Mason Freed, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org

      Attention is currently required from: Mason Freed, Seokho Song.

      View Change

      4 comments:

      • File third_party/blink/renderer/core/css/css_math_expression_node.cc:

        • Patch Set #7, Line 494:

            if (UnitCategory(unit_type) != kCalcNumber &&
          UnitCategory(unit_type) != kCalcAngle) {
          return nullptr;
          }

        • Your pseudo code is exactly what I was thinking. […]

          atan2 is a bit more complicated because it allows more types in the parameters, but we don't need to deal with it in this patch.

          Other than that the pseudo code looks fine to me.

      • File third_party/blink/renderer/core/css/css_math_expression_node.cc:

        • Patch Set #9, Line 465: static double ValueAsRadian(const CSSMathExpressionNode* node) {

          nit: Better add a comment saying that this is a helper function for parsing parameters of sin(), cos() and tan(), to prevent misuse.

        • Patch Set #9, Line 466: if (node->Category() == kCalcAngle) {

          nit: remove unnecessary braces

        • Patch Set #9, Line 485: if (operands[0]->Category() != kCalcNumber &&

          nit: Can we `DCHECK_EQ(operands.size(), 1u)` here?

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

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ibd190fcdc61980f81e456b259ecd5bac86c4612b
      Gerrit-Change-Number: 3713201
      Gerrit-PatchSet: 9
      Gerrit-Owner: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Xiaocheng Hu <xiaoc...@chromium.org>
      Gerrit-CC: Alexis Menard <alexis...@intel.com>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-Attention: Seokho Song <seo...@chromium.org>
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Comment-Date: Wed, 06 Jul 2022 18:31:40 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No

      Seokho Song (Gerrit)

      unread,
      Jul 6, 2022, 7:47:33 PM7/6/22
      to apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, Blink W3C Test Autoroller, Xiaocheng Hu, Mason Freed, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org

      Attention is currently required from: Mason Freed, Xiaocheng Hu.

      View Change

      5 comments:

      • Patchset:

      • File third_party/blink/renderer/core/css/css_math_expression_node.cc:

        • Patch Set #7, Line 494:

            if (UnitCategory(unit_type) != kCalcNumber &&
          UnitCategory(unit_type) != kCalcAngle) {
          return nullptr;
          }

        • atan2 is a bit more complicated because it allows more types in the parameters, but we don't need to […]

          Thanks! I changed that to use the error variable.

      • File third_party/blink/renderer/core/css/css_math_expression_node.cc:

        • nit: Better add a comment saying that this is a helper function for parsing parameters of sin(), cos […]

          Done

        • Done

        • nit: Can we `DCHECK_EQ(operands. […]

          Done

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

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ibd190fcdc61980f81e456b259ecd5bac86c4612b
      Gerrit-Change-Number: 3713201
      Gerrit-PatchSet: 10
      Gerrit-Owner: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Xiaocheng Hu <xiaoc...@chromium.org>
      Gerrit-CC: Alexis Menard <alexis...@intel.com>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-Attention: Xiaocheng Hu <xiaoc...@chromium.org>
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Comment-Date: Wed, 06 Jul 2022 23:47:23 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Seokho Song <seo...@chromium.org>
      Comment-In-Reply-To: Xiaocheng Hu <xiaoc...@chromium.org>

      Xiaocheng Hu (Gerrit)

      unread,
      Jul 6, 2022, 8:25:48 PM7/6/22
      to Seokho Song, apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, Blink W3C Test Autoroller, Mason Freed, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org

      Attention is currently required from: Mason Freed, Seokho Song.

      View Change

      3 comments:

      • File third_party/blink/renderer/core/css/css_math_expression_node.cc:

        • Patch Set #10, Line 448: return node->DoubleValue();

          Hmm, it doesn't look good to call DoubleValue when there's error...

          How about:

          ```
          static double ValueAsRadian(... ) {
          if (node->Category() == kCalcNumber)
          return ...

        • if (node->Category() == kCalcAngle)
        •     return ...
          error = true;
          return 0;
          }
          ```
        • Patch Set #10, Line 462: CHECK_EQ

          Use DCHECK_EQ. We don't want to add the overhead to production build.

        • Patch Set #10, Line 1274: DCHECK(RuntimeEnabledFeatures::CSSTrigonometricFunctionsEnabled());

          I think this is still reachable when the RuntimeEnabledFeature is disabled, in which case we should return nullptr.

          Could you add a unit test with the feature disabled, and verify that `sin()` doesn't parse?

          (Sorry, should have pointed it out earlier)

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

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ibd190fcdc61980f81e456b259ecd5bac86c4612b
      Gerrit-Change-Number: 3713201
      Gerrit-PatchSet: 10
      Gerrit-Owner: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Xiaocheng Hu <xiaoc...@chromium.org>
      Gerrit-CC: Alexis Menard <alexis...@intel.com>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-Attention: Seokho Song <seo...@chromium.org>
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Comment-Date: Thu, 07 Jul 2022 00:25:39 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Gerrit-MessageType: comment

      Seokho Song (Gerrit)

      unread,
      Jul 8, 2022, 12:14:43 AM7/8/22
      to apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, Blink W3C Test Autoroller, Xiaocheng Hu, Mason Freed, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org

      Attention is currently required from: Xiaocheng Hu.

      View Change

      3 comments:

      • File third_party/blink/renderer/core/css/css_math_expression_node.cc:

        • Hmm, it doesn't look good to call DoubleValue when there's error... […]

          Done

        • Oops! I missed it

        • I think this is still reachable when the RuntimeEnabledFeature is disabled, in which case we should […]

          Oh, I see. It could be reached because of not checking `IsSupportedMathFunction` on `CSSMathExpressionNodeParser.ParseMathFunction`.

          So I added the branch for checking the supported functions and add VirtualTestSuite `css-trigonometric-functions-disabled` to check parsing without the flag using `DCHECK` and `expected` files. PTAL!

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

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ibd190fcdc61980f81e456b259ecd5bac86c4612b
      Gerrit-Change-Number: 3713201
      Gerrit-PatchSet: 13
      Gerrit-Owner: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Xiaocheng Hu <xiaoc...@chromium.org>
      Gerrit-CC: Alexis Menard <alexis...@intel.com>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-Attention: Xiaocheng Hu <xiaoc...@chromium.org>
      Gerrit-Comment-Date: Fri, 08 Jul 2022 04:14:33 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Xiaocheng Hu <xiaoc...@chromium.org>
      Gerrit-MessageType: comment

      Xiaocheng Hu (Gerrit)

      unread,
      Jul 8, 2022, 2:19:30 PM7/8/22
      to Seokho Song, apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, Blink W3C Test Autoroller, Mason Freed, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org

      Attention is currently required from: Seokho Song.

      View Change

      1 comment:

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

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ibd190fcdc61980f81e456b259ecd5bac86c4612b
      Gerrit-Change-Number: 3713201
      Gerrit-PatchSet: 13
      Gerrit-Owner: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Xiaocheng Hu <xiaoc...@chromium.org>
      Gerrit-CC: Alexis Menard <alexis...@intel.com>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-Attention: Seokho Song <seo...@chromium.org>
      Gerrit-Comment-Date: Fri, 08 Jul 2022 18:19:19 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Seokho Song <seo...@chromium.org>

      Seokho Song (Gerrit)

      unread,
      Jul 10, 2022, 2:50:56 AM7/10/22
      to apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, Blink W3C Test Autoroller, Xiaocheng Hu, Mason Freed, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org

      Attention is currently required from: Mason Freed.

      View Change

      1 comment:

      • File third_party/blink/renderer/core/css/css_math_expression_node.cc:

        • Normally we just add a unit test to verify that they don't parse (see example [1]). […]

          Mason, PTAL! :)

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

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ibd190fcdc61980f81e456b259ecd5bac86c4612b
      Gerrit-Change-Number: 3713201
      Gerrit-PatchSet: 13
      Gerrit-Owner: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Xiaocheng Hu <xiaoc...@chromium.org>
      Gerrit-CC: Alexis Menard <alexis...@intel.com>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Comment-Date: Sun, 10 Jul 2022 06:50:48 +0000

      Mason Freed (Gerrit)

      unread,
      Jul 11, 2022, 6:37:15 PM7/11/22
      to Seokho Song, apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, Blink W3C Test Autoroller, Xiaocheng Hu, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org

      Attention is currently required from: Seokho Song.

      View Change

      1 comment:

      • File third_party/blink/web_tests/VirtualTestSuites:

        • Patch Set #13, Line 649: external/wpt/css/css-values/

          Hmm, yeah this is a few hundred files. I tend to agree that we should make this more limited. Either scope this down to a small list of files, or convert to a unit test, please.

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

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ibd190fcdc61980f81e456b259ecd5bac86c4612b
      Gerrit-Change-Number: 3713201
      Gerrit-PatchSet: 13
      Gerrit-Owner: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Xiaocheng Hu <xiaoc...@chromium.org>
      Gerrit-CC: Alexis Menard <alexis...@intel.com>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-Attention: Seokho Song <seo...@chromium.org>
      Gerrit-Comment-Date: Mon, 11 Jul 2022 22:37:07 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Gerrit-MessageType: comment

      Seokho Song (Gerrit)

      unread,
      Jul 11, 2022, 7:34:44 PM7/11/22
      to apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, Blink W3C Test Autoroller, Xiaocheng Hu, Mason Freed, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org

      Attention is currently required from: Mason Freed.

      View Change

      1 comment:

      • File third_party/blink/web_tests/VirtualTestSuites:

        • Hmm, yeah this is a few hundred files. I tend to agree that we should make this more limited. […]

          Added 3 test scope for trigonometric functions.
          PTAL!

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

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ibd190fcdc61980f81e456b259ecd5bac86c4612b
      Gerrit-Change-Number: 3713201
      Gerrit-PatchSet: 14
      Gerrit-Owner: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Xiaocheng Hu <xiaoc...@chromium.org>
      Gerrit-CC: Alexis Menard <alexis...@intel.com>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-Attention: Mason Freed <mas...@chromium.org>
      Gerrit-Comment-Date: Mon, 11 Jul 2022 23:34:35 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No

      Mason Freed (Gerrit)

      unread,
      Jul 12, 2022, 1:55:47 PM7/12/22
      to Seokho Song, apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, Blink W3C Test Autoroller, Xiaocheng Hu, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org

      Attention is currently required from: Seokho Song.

      Patch set 14:Code-Review +1

      View Change

      3 comments:

        • According to the CSS Values and Units Module Level 4 [1], the trigonometric function should be parsed and evaluated.

          Therefore, this initial feature CL adds the feature flag 'CSSTrigonometricFunctions' and 'sin, cos, asin, acos, atan, atan2' keywords to css_value_keywords.json5. (tan keyword is already defined)
          Also, Implement parsing and evaluation for sin().

        • Can you please line-wrap this at 72 characters?

      • Patchset:

        • Patch Set #14:

          Code looks good here, and so does the test. Just a few very small things left from my side. Please also wait for xiaochengh@'s +1. Thanks!

      • File third_party/blink/web_tests/VirtualTestSuites:

        • Added 3 test scope for trigonometric functions. […]

          Thanks for reducing this list. I think perhaps it might have been better to just put a dedicated test in the virtual/css-trigonometric-functions-disabled folder that tests sin(), cos(), etc. directly and has a note that they should fail.

          Perhaps this is fine. But please add a sentence to the README.md explaining that these tests should FAIL because sin(), etc. should not parse.

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

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ibd190fcdc61980f81e456b259ecd5bac86c4612b
      Gerrit-Change-Number: 3713201
      Gerrit-PatchSet: 14
      Gerrit-Owner: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-Reviewer: Seokho Song <seo...@chromium.org>
      Gerrit-Reviewer: Xiaocheng Hu <xiaoc...@chromium.org>
      Gerrit-CC: Alexis Menard <alexis...@intel.com>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-Attention: Seokho Song <seo...@chromium.org>
      Gerrit-Comment-Date: Tue, 12 Jul 2022 17:55:36 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Seokho Song <seo...@chromium.org>

      Xiaocheng Hu (Gerrit)

      unread,
      Jul 12, 2022, 2:52:13 PM7/12/22
      to Seokho Song, apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, Mason Freed, Blink W3C Test Autoroller, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org

      Attention is currently required from: Seokho Song.

      Patch set 14:Code-Review +1

      View Change

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

        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Ibd190fcdc61980f81e456b259ecd5bac86c4612b
        Gerrit-Change-Number: 3713201
        Gerrit-PatchSet: 14
        Gerrit-Owner: Seokho Song <seo...@chromium.org>
        Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
        Gerrit-Reviewer: Seokho Song <seo...@chromium.org>
        Gerrit-Reviewer: Xiaocheng Hu <xiaoc...@chromium.org>
        Gerrit-CC: Alexis Menard <alexis...@intel.com>
        Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
        Gerrit-Attention: Seokho Song <seo...@chromium.org>
        Gerrit-Comment-Date: Tue, 12 Jul 2022 18:52:03 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        Gerrit-MessageType: comment

        Seokho Song (Gerrit)

        unread,
        Jul 19, 2022, 12:17:37 AM7/19/22
        to apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org

        Attention is currently required from: Seokho Song.

        Seokho Song uploaded patch set #16 to this change.

        View Change

        Add CSSTrigonometricFunctions feature flag and sin() function

        According to the CSS Values and Units Module Level 4 [1],
        the trigonometric function should be parsed and evaluated.

        Therefore, this initial feature CL adds
        the feature flag 'CSSTrigonometricFunctions'
        and 'sin, cos, asin, acos, atan, atan2' keywords
        to css_value_keywords.json5. (tan keyword is already defined)
        Also, Implement parsing and evaluation for sin().

        Feature status: [2]
        Intent to prototype: [3]

        [1] https://www.w3.org/TR/css-values-4/#trig-funcs
        [2] https://chromestatus.com/feature/5165381072191488
        [3]https://groups.google.com/a/chromium.org/g/blink-dev/c/-c9p-Sq_gWg

        Bug: 1190444
        Change-Id: Ibd190fcdc61980f81e456b259ecd5bac86c4612b
        ---
        M third_party/blink/renderer/core/css/css_math_expression_node.cc
        M third_party/blink/renderer/core/css/css_math_expression_node.h
        M third_party/blink/renderer/core/css/css_value_keywords.json5
        M third_party/blink/renderer/platform/runtime_enabled_features.json5
        M third_party/blink/web_tests/VirtualTestSuites

        M third_party/blink/web_tests/external/wpt/css/css-values/sin-cos-tan-serialize.html
        M third_party/blink/web_tests/platform/generic/external/wpt/css/css-values/sin-cos-tan-computed-expected.txt
        M third_party/blink/web_tests/platform/generic/external/wpt/css/css-values/sin-cos-tan-serialize-expected.txt
        A third_party/blink/web_tests/platform/generic/virtual/css-trigonometric-functions-disabled/external/wpt/css/css-values/sin-cos-tan-computed-expected.txt
        A third_party/blink/web_tests/platform/generic/virtual/css-trigonometric-functions-disabled/external/wpt/css/css-values/sin-cos-tan-serialize-expected.txt
        A third_party/blink/web_tests/virtual/css-trigonometric-functions-disabled/README.md
        11 files changed, 267 insertions(+), 89 deletions(-)

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

        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Ibd190fcdc61980f81e456b259ecd5bac86c4612b
        Gerrit-Change-Number: 3713201
        Gerrit-PatchSet: 16
        Gerrit-Owner: Seokho Song <seo...@chromium.org>
        Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
        Gerrit-Reviewer: Seokho Song <seo...@chromium.org>
        Gerrit-Reviewer: Xiaocheng Hu <xiaoc...@chromium.org>
        Gerrit-CC: Alexis Menard <alexis...@intel.com>
        Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
        Gerrit-Attention: Seokho Song <seo...@chromium.org>
        Gerrit-MessageType: newpatchset

        Seokho Song (Gerrit)

        unread,
        Jul 19, 2022, 7:10:21 AM7/19/22
        to apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, Xiaocheng Hu, Mason Freed, Blink W3C Test Autoroller, Chromium LUCI CQ, Alexis Menard, chromium...@chromium.org

        Patch set 16:Commit-Queue +2

        View Change

        2 comments:

        • Commit Message:

          • According to the CSS Values and Units Module Level 4 [1], the trigonometric function should be parsed and evaluated.



          • Therefore, this initial feature CL adds the feature flag 'CSSTrigonometricFunctions' and 'sin, cos, asin, acos, atan, atan2' keywords to css_value_keywords.json5. (tan keyword is already defined)
            Also, Implement parsing and evaluation for sin().

          • Can you please line-wrap this at 72 characters?

          • Done

        • File third_party/blink/web_tests/VirtualTestSuites:

          • Thanks for reducing this list. […]

            Added description into README.md.

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

        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Ibd190fcdc61980f81e456b259ecd5bac86c4612b
        Gerrit-Change-Number: 3713201
        Gerrit-PatchSet: 16
        Gerrit-Owner: Seokho Song <seo...@chromium.org>
        Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
        Gerrit-Reviewer: Seokho Song <seo...@chromium.org>
        Gerrit-Reviewer: Xiaocheng Hu <xiaoc...@chromium.org>
        Gerrit-CC: Alexis Menard <alexis...@intel.com>
        Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
        Gerrit-Comment-Date: Tue, 19 Jul 2022 11:10:05 +0000

        Chromium LUCI CQ (Gerrit)

        unread,
        Jul 19, 2022, 8:15:18 AM7/19/22
        to Seokho Song, apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, Xiaocheng Hu, Mason Freed, Blink W3C Test Autoroller, Alexis Menard, chromium...@chromium.org

        Chromium LUCI CQ submitted this change.

        View Change



        14 is the latest approved patch-set.
        The change was submitted with unreviewed changes in the following files:

        ```
        The name of the file: third_party/blink/web_tests/virtual/css-trigonometric-functions-disabled/README.md
        Insertions: 2, Deletions: 1.

        @@ -1,2 +1,3 @@
        This suite runs the tests with
        ---disable-blink-features=CSSTrigonometricFunctions
        +--disable-blink-features=CSSTrigonometricFunctions.
        +That should be failed because sin(), cos(), ...etc should not be parsed and evaluated.
        ```

        Approvals: Mason Freed: Looks good to me Xiaocheng Hu: Looks good to me Seokho Song: Commit
        Add CSSTrigonometricFunctions feature flag and sin() function

        According to the CSS Values and Units Module Level 4 [1],
        the trigonometric function should be parsed and evaluated.

        Therefore, this initial feature CL adds
        the feature flag 'CSSTrigonometricFunctions'
        and 'sin, cos, asin, acos, atan, atan2' keywords
        to css_value_keywords.json5. (tan keyword is already defined)
        Also, Implement parsing and evaluation for sin().

        Feature status: [2]
        Intent to prototype: [3]

        [1] https://www.w3.org/TR/css-values-4/#trig-funcs
        [2] https://chromestatus.com/feature/5165381072191488
        [3]https://groups.google.com/a/chromium.org/g/blink-dev/c/-c9p-Sq_gWg

        Bug: 1190444
        Change-Id: Ibd190fcdc61980f81e456b259ecd5bac86c4612b
        Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3713201
        Reviewed-by: Mason Freed <mas...@chromium.org>
        Reviewed-by: Xiaocheng Hu <xiaoc...@chromium.org>
        Commit-Queue: Seokho Song <seo...@chromium.org>
        Cr-Commit-Position: refs/heads/main@{#1025665}

        ---
        M third_party/blink/renderer/core/css/css_math_expression_node.cc
        M third_party/blink/renderer/core/css/css_math_expression_node.h
        M third_party/blink/renderer/core/css/css_value_keywords.json5
        M third_party/blink/renderer/platform/runtime_enabled_features.json5
        M third_party/blink/web_tests/VirtualTestSuites
        M third_party/blink/web_tests/external/wpt/css/css-values/sin-cos-tan-serialize.html
        M third_party/blink/web_tests/platform/generic/external/wpt/css/css-values/sin-cos-tan-computed-expected.txt
        M third_party/blink/web_tests/platform/generic/external/wpt/css/css-values/sin-cos-tan-serialize-expected.txt
        A third_party/blink/web_tests/platform/generic/virtual/css-trigonometric-functions-disabled/external/wpt/css/css-values/sin-cos-tan-computed-expected.txt
        A third_party/blink/web_tests/platform/generic/virtual/css-trigonometric-functions-disabled/external/wpt/css/css-values/sin-cos-tan-serialize-expected.txt
        A third_party/blink/web_tests/virtual/css-trigonometric-functions-disabled/README.md
        11 files changed, 272 insertions(+), 89 deletions(-)


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

        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Ibd190fcdc61980f81e456b259ecd5bac86c4612b
        Gerrit-Change-Number: 3713201
        Gerrit-PatchSet: 17
        Gerrit-Owner: Seokho Song <seo...@chromium.org>
        Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
        Gerrit-Reviewer: Seokho Song <seo...@chromium.org>
        Gerrit-Reviewer: Xiaocheng Hu <xiaoc...@chromium.org>
        Gerrit-CC: Alexis Menard <alexis...@intel.com>
        Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
        Gerrit-MessageType: merged

        Blink W3C Test Autoroller (Gerrit)

        unread,
        Jul 19, 2022, 8:39:40 AM7/19/22
        to Seokho Song, Chromium LUCI CQ, apavlo...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, Xiaocheng Hu, Mason Freed, Alexis Menard, chromium...@chromium.org

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

        View Change

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

          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: Ibd190fcdc61980f81e456b259ecd5bac86c4612b
          Gerrit-Change-Number: 3713201
          Gerrit-PatchSet: 17
          Gerrit-Owner: Seokho Song <seo...@chromium.org>
          Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
          Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
          Gerrit-Reviewer: Seokho Song <seo...@chromium.org>
          Gerrit-Reviewer: Xiaocheng Hu <xiaoc...@chromium.org>
          Gerrit-CC: Alexis Menard <alexis...@intel.com>
          Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
          Gerrit-Comment-Date: Tue, 19 Jul 2022 12:39:31 +0000
          Reply all
          Reply to author
          Forward
          0 new messages