Fix polygon() rounding radius clamping formula [chromium/src : main]

0 views
Skip to first unread message

Jason Leo (Gerrit)

unread,
Apr 10, 2026, 7:03:39 AM (9 days ago) Apr 10
to Fredrik Söderquist, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
Attention needed from Fredrik Söderquist

Jason Leo added 1 comment

Patchset-level comments
Open in Gerrit

Related details

Attention is currently required from:
  • Fredrik Söderquist
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
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: I1e55f843d07b5688ad045e1b062461381379c5d5
Gerrit-Change-Number: 7738471
Gerrit-PatchSet: 3
Gerrit-Owner: Jason Leo <cg...@chromium.org>
Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
Gerrit-Reviewer: Jason Leo <cg...@chromium.org>
Gerrit-Attention: Fredrik Söderquist <f...@opera.com>
Gerrit-Comment-Date: Fri, 10 Apr 2026 11:03:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Fredrik Söderquist (Gerrit)

unread,
Apr 10, 2026, 7:55:24 AM (9 days ago) Apr 10
to Jason Leo, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
Attention needed from Jason Leo

Fredrik Söderquist added 1 comment

File third_party/blink/web_tests/external/wpt/css/css-borders/border-shape/border-shape-polygon-rounding-clamp.html
Fredrik Söderquist . unresolved

It feels like these tests should have a stronger affinity to `css-shapes` (rather than `css-borders`) since it's testing behavior from that spec. I think it would also be better to not rely on `border-shape` for these tests.

Open in Gerrit

Related details

Attention is currently required from:
  • Jason Leo
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    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: I1e55f843d07b5688ad045e1b062461381379c5d5
    Gerrit-Change-Number: 7738471
    Gerrit-PatchSet: 3
    Gerrit-Owner: Jason Leo <cg...@chromium.org>
    Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
    Gerrit-Reviewer: Jason Leo <cg...@chromium.org>
    Gerrit-Attention: Jason Leo <cg...@chromium.org>
    Gerrit-Comment-Date: Fri, 10 Apr 2026 11:55:20 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Jason Leo (Gerrit)

    unread,
    Apr 15, 2026, 7:40:13 AM (4 days ago) Apr 15
    to Fredrik Söderquist, chromiu...@luci-project-accounts.iam.gserviceaccount.com, chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from Fredrik Söderquist

    Jason Leo voted and added 1 comment

    Votes added by Jason Leo

    Commit-Queue+1

    1 comment

    File third_party/blink/web_tests/external/wpt/css/css-borders/border-shape/border-shape-polygon-rounding-clamp.html
    File-level comment, Patchset 3:
    Fredrik Söderquist . resolved

    It feels like these tests should have a stronger affinity to `css-shapes` (rather than `css-borders`) since it's testing behavior from that spec. I think it would also be better to not rely on `border-shape` for these tests.

    Jason Leo

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Fredrik Söderquist
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      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: I1e55f843d07b5688ad045e1b062461381379c5d5
      Gerrit-Change-Number: 7738471
      Gerrit-PatchSet: 5
      Gerrit-Owner: Jason Leo <cg...@chromium.org>
      Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
      Gerrit-Reviewer: Jason Leo <cg...@chromium.org>
      Gerrit-Attention: Fredrik Söderquist <f...@opera.com>
      Gerrit-Comment-Date: Wed, 15 Apr 2026 11:39:49 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Fredrik Söderquist <f...@opera.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Fredrik Söderquist (Gerrit)

      unread,
      Apr 15, 2026, 8:28:23 AM (4 days ago) Apr 15
      to Jason Leo, chromiu...@luci-project-accounts.iam.gserviceaccount.com, chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
      Attention needed from Jason Leo

      Fredrik Söderquist voted Code-Review+1

      Code-Review+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Jason Leo
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      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: I1e55f843d07b5688ad045e1b062461381379c5d5
      Gerrit-Change-Number: 7738471
      Gerrit-PatchSet: 5
      Gerrit-Owner: Jason Leo <cg...@chromium.org>
      Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
      Gerrit-Reviewer: Jason Leo <cg...@chromium.org>
      Gerrit-Attention: Jason Leo <cg...@chromium.org>
      Gerrit-Comment-Date: Wed, 15 Apr 2026 12:28:08 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Jason Leo (Gerrit)

      unread,
      Apr 15, 2026, 9:16:25 AM (3 days ago) Apr 15
      to Fredrik Söderquist, chromiu...@luci-project-accounts.iam.gserviceaccount.com, chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org

      Jason Leo voted and added 1 comment

      Votes added by Jason Leo

      Commit-Queue+2

      1 comment

      Patchset-level comments
      File-level comment, Patchset 6 (Latest):
      Jason Leo . resolved

      Thanks!

      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        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: I1e55f843d07b5688ad045e1b062461381379c5d5
        Gerrit-Change-Number: 7738471
        Gerrit-PatchSet: 6
        Gerrit-Owner: Jason Leo <cg...@chromium.org>
        Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
        Gerrit-Reviewer: Jason Leo <cg...@chromium.org>
        Gerrit-Comment-Date: Wed, 15 Apr 2026 13:16:00 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Blink W3C Test Autoroller (Gerrit)

        unread,
        Apr 15, 2026, 9:22:28 AM (3 days ago) Apr 15
        to Jason Leo, Fredrik Söderquist, chromiu...@luci-project-accounts.iam.gserviceaccount.com, chromium...@chromium.org, blink-rev...@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/59236.

        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
        • requirement satisfiedReview-Enforcement
        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: I1e55f843d07b5688ad045e1b062461381379c5d5
        Gerrit-Change-Number: 7738471
        Gerrit-PatchSet: 6
        Gerrit-Owner: Jason Leo <cg...@chromium.org>
        Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
        Gerrit-Reviewer: Jason Leo <cg...@chromium.org>
        Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
        Gerrit-Comment-Date: Wed, 15 Apr 2026 13:22:16 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: No
        satisfied_requirement
        open
        diffy

        chromium-scoped@luci-project-accounts.iam.gserviceaccount.com (Gerrit)

        unread,
        Apr 15, 2026, 9:26:58 AM (3 days ago) Apr 15
        to Jason Leo, Blink W3C Test Autoroller, Fredrik Söderquist, chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org

        chromiu...@luci-project-accounts.iam.gserviceaccount.com submitted the change

        Unreviewed changes

        5 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 polygon() rounding radius clamping formula

        The clamping formula in ComputeRoundedPolygonVertex used tan(θ/2) where
        θ is the angle between the edge direction vectors, but the spec defines
        the clamp in terms of the interior angle α = π − θ, giving tan(α/2) =
        1/tan(θ/2).

        This caused max_radius and tangent_distance to use inverted factors:
        multiplication instead of division and vice-versa. The bug was invisible
        at 90° vertices (tan(45°) = 1) but produced wrong clamping at all other
        angles — triangles, pentagons, and other non-rectangular polygons.

        The fix computes the interior angle directly (by negating the dot
        product) so the clamping and tangent-distance formulas read exactly as
        the spec writes them:
        max_radius = tan(α/2) × segment / 2
        tangent_distance = radius / tan(α/2)

        A WPT reftest under css-shapes/shape-functions exercises clamping across
        five polygon shapes using clip-path. The reference uses exact clamped
        radii where possible (rectangle, equilateral triangle, diamond) and
        overclamped 9999px for shapes with non-uniform vertex angles (pentagon,
        isosceles triangle).
        Bug: 329302249
        Change-Id: I1e55f843d07b5688ad045e1b062461381379c5d5
        Commit-Queue: Jason Leo <cg...@chromium.org>
        Reviewed-by: Fredrik Söderquist <f...@opera.com>
        Cr-Commit-Position: refs/heads/main@{#1615110}
        Files:
        • M third_party/blink/renderer/core/style/basic_shapes.cc
        • A third_party/blink/web_tests/external/wpt/css/css-shapes/shape-functions/polygon-function-rounding-clamp-ref.html
        • A third_party/blink/web_tests/external/wpt/css/css-shapes/shape-functions/polygon-function-rounding-clamp.html
        Change size: M
        Delta: 3 files changed, 111 insertions(+), 11 deletions(-)
        Branch: refs/heads/main
        Submit Requirements:
        • requirement satisfiedCode-Review: +1 by Fredrik Söderquist
        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: I1e55f843d07b5688ad045e1b062461381379c5d5
        Gerrit-Change-Number: 7738471
        Gerrit-PatchSet: 7
        Gerrit-Owner: Jason Leo <cg...@chromium.org>
        Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
        Gerrit-Reviewer: Jason Leo <cg...@chromium.org>
        open
        diffy
        satisfied_requirement

        Blink W3C Test Autoroller (Gerrit)

        unread,
        Apr 15, 2026, 10:34:52 AM (3 days ago) Apr 15
        to chromiu...@luci-project-accounts.iam.gserviceaccount.com, Jason Leo, Fredrik Söderquist, chromium...@chromium.org, blink-rev...@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/59236

        Open in Gerrit

        Related details

        Attention set is empty
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        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: I1e55f843d07b5688ad045e1b062461381379c5d5
        Gerrit-Change-Number: 7738471
        Gerrit-PatchSet: 7
        Gerrit-Owner: Jason Leo <cg...@chromium.org>
        Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
        Gerrit-Reviewer: Jason Leo <cg...@chromium.org>
        Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
        Gerrit-Comment-Date: Wed, 15 Apr 2026 14:34:46 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: No
        satisfied_requirement
        open
        diffy
        Reply all
        Reply to author
        Forward
        0 new messages