Support unresolved calc() values in Canvas 2D color parsing [chromium/src : main]

0 views
Skip to first unread message

Felipe Erias (Gerrit)

unread,
Nov 21, 2025, 12:33:23 AMNov 21
to Aaron Krajeski, Rune Lillesveen, Justin Novosad, Jean-Philippe Gravel, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
Attention needed from Aaron Krajeski, Jean-Philippe Gravel, Justin Novosad and Rune Lillesveen

Felipe Erias added 1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Felipe Erias . resolved

Hello,

This CL fixes a bug with color functions using calc() in Canvas.

See https://issues.chromium.org/issues/459135661 for details and an example.

The fix itself is very small. I've added a thorough test file to catch similar issues in the future.

Thank you for your feedback.

Best,
Felipe

Open in Gerrit

Related details

Attention is currently required from:
  • Aaron Krajeski
  • Jean-Philippe Gravel
  • Justin Novosad
  • Rune Lillesveen
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: I3c1be6fc07c1b5d40deaf0cdca22f9e14da22048
Gerrit-Change-Number: 7182583
Gerrit-PatchSet: 1
Gerrit-Owner: Felipe Erias <felip...@igalia.com>
Gerrit-Reviewer: Aaron Krajeski <aar...@chromium.org>
Gerrit-Reviewer: Felipe Erias <felip...@igalia.com>
Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
Gerrit-Attention: Justin Novosad <ju...@chromium.org>
Gerrit-Attention: Jean-Philippe Gravel <jpgr...@chromium.org>
Gerrit-Attention: Rune Lillesveen <fut...@chromium.org>
Gerrit-Attention: Aaron Krajeski <aar...@chromium.org>
Gerrit-Comment-Date: Fri, 21 Nov 2025 05:33:01 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Rune Lillesveen (Gerrit)

unread,
Nov 21, 2025, 8:55:37 AMNov 21
to Felipe Erias, Rune Lillesveen, Aaron Krajeski, Justin Novosad, Jean-Philippe Gravel, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
Attention needed from Aaron Krajeski, Felipe Erias, Jean-Philippe Gravel and Justin Novosad

Rune Lillesveen voted and added 1 comment

Votes added by Rune Lillesveen

Code-Review+1

1 comment

Patchset-level comments
Rune Lillesveen . resolved

lgtm

Open in Gerrit

Related details

Attention is currently required from:
  • Aaron Krajeski
  • Felipe Erias
  • Jean-Philippe Gravel
  • Justin Novosad
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement 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: I3c1be6fc07c1b5d40deaf0cdca22f9e14da22048
Gerrit-Change-Number: 7182583
Gerrit-PatchSet: 1
Gerrit-Owner: Felipe Erias <felip...@igalia.com>
Gerrit-Reviewer: Aaron Krajeski <aar...@chromium.org>
Gerrit-Reviewer: Felipe Erias <felip...@igalia.com>
Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
Gerrit-Attention: Justin Novosad <ju...@chromium.org>
Gerrit-Attention: Jean-Philippe Gravel <jpgr...@chromium.org>
Gerrit-Attention: Felipe Erias <felip...@igalia.com>
Gerrit-Attention: Aaron Krajeski <aar...@chromium.org>
Gerrit-Comment-Date: Fri, 21 Nov 2025 13:55:10 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Jean-Philippe Gravel (Gerrit)

unread,
Nov 25, 2025, 9:39:23 AMNov 25
to Felipe Erias, Rune Lillesveen, Aaron Krajeski, Justin Novosad, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
Attention needed from Aaron Krajeski, Felipe Erias and Justin Novosad

Jean-Philippe Gravel voted and added 3 comments

Votes added by Jean-Philippe Gravel

Code-Review+1

3 comments

Patchset-level comments
Jean-Philippe Gravel . resolved

Thanks!

File third_party/blink/web_tests/fast/canvas/canvas-fillStyle-color-functions-with-calc.html
Line 7, Patchset 1 (Latest):// Helper function to render a color and return its pixel value as rgba string
Jean-Philippe Gravel . unresolved

Nit: consider ending comment sentences with a period. We often view one-line code snippets in tools like code search. Seeing this line without the next one might trick a reader into thinking that the sentence isn't complete and spans over multiple lines. Proper punctuation can avoid this confusion.

I can't find a guideline specific to JavaScript, but some Google style guides call this out explicitly, for instance:

“Comments should be as readable as narrative text, with proper capitalization and punctuation. In many cases, complete sentences are more readable than sentence fragments. Shorter comments, such as comments at the end of a line of code, can sometimes be less formal, but you should be consistent with your style.

Although it can be frustrating to have a code reviewer point out that you are using a comma when you should be using a semicolon, it is very important that source code maintain a high level of clarity and readability. Proper punctuation, spelling, and grammar help with that goal.”
https://google.github.io/styleguide/cppguide.html#Punctuation_Spelling_and_Grammar

Line 16, Patchset 1 (Latest):function assertColorsEqual(ctx, colorGroup, description) {
Jean-Philippe Gravel . unresolved

`description` is unused. Remove?

Open in Gerrit

Related details

Attention is currently required from:
  • Aaron Krajeski
  • Felipe Erias
  • Justin Novosad
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • 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: I3c1be6fc07c1b5d40deaf0cdca22f9e14da22048
    Gerrit-Change-Number: 7182583
    Gerrit-PatchSet: 1
    Gerrit-Owner: Felipe Erias <felip...@igalia.com>
    Gerrit-Reviewer: Aaron Krajeski <aar...@chromium.org>
    Gerrit-Reviewer: Felipe Erias <felip...@igalia.com>
    Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
    Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
    Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
    Gerrit-Attention: Justin Novosad <ju...@chromium.org>
    Gerrit-Attention: Felipe Erias <felip...@igalia.com>
    Gerrit-Attention: Aaron Krajeski <aar...@chromium.org>
    Gerrit-Comment-Date: Tue, 25 Nov 2025 14:39:16 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Felipe Erias (Gerrit)

    unread,
    Nov 27, 2025, 9:55:12 PM (12 days ago) Nov 27
    to Jean-Philippe Gravel, Rune Lillesveen, Aaron Krajeski, Justin Novosad, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
    Attention needed from Aaron Krajeski, Jean-Philippe Gravel, Justin Novosad and Rune Lillesveen

    Felipe Erias added 3 comments

    Patchset-level comments
    File-level comment, Patchset 2 (Latest):
    Felipe Erias . resolved

    Thank you for the feedback, I have updated the test file as suggested.

    File third_party/blink/web_tests/fast/canvas/canvas-fillStyle-color-functions-with-calc.html
    Line 7, Patchset 1:// Helper function to render a color and return its pixel value as rgba string
    Jean-Philippe Gravel . resolved

    Nit: consider ending comment sentences with a period. We often view one-line code snippets in tools like code search. Seeing this line without the next one might trick a reader into thinking that the sentence isn't complete and spans over multiple lines. Proper punctuation can avoid this confusion.

    I can't find a guideline specific to JavaScript, but some Google style guides call this out explicitly, for instance:

    “Comments should be as readable as narrative text, with proper capitalization and punctuation. In many cases, complete sentences are more readable than sentence fragments. Shorter comments, such as comments at the end of a line of code, can sometimes be less formal, but you should be consistent with your style.

    Although it can be frustrating to have a code reviewer point out that you are using a comma when you should be using a semicolon, it is very important that source code maintain a high level of clarity and readability. Proper punctuation, spelling, and grammar help with that goal.”
    https://google.github.io/styleguide/cppguide.html#Punctuation_Spelling_and_Grammar

    Felipe Erias

    Done

    Line 16, Patchset 1:function assertColorsEqual(ctx, colorGroup, description) {
    Jean-Philippe Gravel . resolved

    `description` is unused. Remove?

    Felipe Erias

    Done

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Aaron Krajeski
    • Jean-Philippe Gravel
    • Justin Novosad
    • Rune Lillesveen
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement 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: I3c1be6fc07c1b5d40deaf0cdca22f9e14da22048
        Gerrit-Change-Number: 7182583
        Gerrit-PatchSet: 2
        Gerrit-Owner: Felipe Erias <felip...@igalia.com>
        Gerrit-Reviewer: Aaron Krajeski <aar...@chromium.org>
        Gerrit-Reviewer: Felipe Erias <felip...@igalia.com>
        Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
        Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
        Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
        Gerrit-Attention: Justin Novosad <ju...@chromium.org>
        Gerrit-Attention: Jean-Philippe Gravel <jpgr...@chromium.org>
        Gerrit-Attention: Rune Lillesveen <fut...@chromium.org>
        Gerrit-Attention: Aaron Krajeski <aar...@chromium.org>
        Gerrit-Comment-Date: Fri, 28 Nov 2025 02:54:51 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Jean-Philippe Gravel <jpgr...@chromium.org>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Rune Lillesveen (Gerrit)

        unread,
        Nov 28, 2025, 3:45:10 AM (12 days ago) Nov 28
        to Felipe Erias, Rune Lillesveen, Jean-Philippe Gravel, Aaron Krajeski, Justin Novosad, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
        Attention needed from Aaron Krajeski, Felipe Erias, Jean-Philippe Gravel and Justin Novosad

        Rune Lillesveen voted Code-Review+1

        Code-Review+1
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Aaron Krajeski
        • Felipe Erias
        • Jean-Philippe Gravel
        • Justin Novosad
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement 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: I3c1be6fc07c1b5d40deaf0cdca22f9e14da22048
        Gerrit-Change-Number: 7182583
        Gerrit-PatchSet: 2
        Gerrit-Owner: Felipe Erias <felip...@igalia.com>
        Gerrit-Reviewer: Aaron Krajeski <aar...@chromium.org>
        Gerrit-Reviewer: Felipe Erias <felip...@igalia.com>
        Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
        Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
        Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
        Gerrit-Attention: Justin Novosad <ju...@chromium.org>
        Gerrit-Attention: Jean-Philippe Gravel <jpgr...@chromium.org>
        Gerrit-Attention: Felipe Erias <felip...@igalia.com>
        Gerrit-Attention: Aaron Krajeski <aar...@chromium.org>
        Gerrit-Comment-Date: Fri, 28 Nov 2025 08:44:55 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Jean-Philippe Gravel (Gerrit)

        unread,
        Nov 28, 2025, 8:20:25 AM (12 days ago) Nov 28
        to Felipe Erias, Rune Lillesveen, Aaron Krajeski, Justin Novosad, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
        Attention needed from Aaron Krajeski, Felipe Erias and Justin Novosad

        Jean-Philippe Gravel voted Code-Review+1

        Code-Review+1
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Aaron Krajeski
        • Felipe Erias
        • Justin Novosad
        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: I3c1be6fc07c1b5d40deaf0cdca22f9e14da22048
          Gerrit-Change-Number: 7182583
          Gerrit-PatchSet: 2
          Gerrit-Owner: Felipe Erias <felip...@igalia.com>
          Gerrit-Reviewer: Aaron Krajeski <aar...@chromium.org>
          Gerrit-Reviewer: Felipe Erias <felip...@igalia.com>
          Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
          Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
          Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
          Gerrit-Attention: Justin Novosad <ju...@chromium.org>
          Gerrit-Attention: Felipe Erias <felip...@igalia.com>
          Gerrit-Attention: Aaron Krajeski <aar...@chromium.org>
          Gerrit-Comment-Date: Fri, 28 Nov 2025 13:20:17 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          open
          diffy

          Felipe Erias (Gerrit)

          unread,
          Nov 28, 2025, 8:55:08 AM (12 days ago) Nov 28
          to Jean-Philippe Gravel, Rune Lillesveen, Aaron Krajeski, Justin Novosad, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
          Attention needed from Aaron Krajeski and Justin Novosad

          Felipe Erias voted Commit-Queue+2

          Commit-Queue+2
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Aaron Krajeski
          • Justin Novosad
          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: I3c1be6fc07c1b5d40deaf0cdca22f9e14da22048
          Gerrit-Change-Number: 7182583
          Gerrit-PatchSet: 2
          Gerrit-Owner: Felipe Erias <felip...@igalia.com>
          Gerrit-Reviewer: Aaron Krajeski <aar...@chromium.org>
          Gerrit-Reviewer: Felipe Erias <felip...@igalia.com>
          Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
          Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
          Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
          Gerrit-Attention: Justin Novosad <ju...@chromium.org>
          Gerrit-Attention: Aaron Krajeski <aar...@chromium.org>
          Gerrit-Comment-Date: Fri, 28 Nov 2025 13:54:32 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          open
          diffy

          Chromium LUCI CQ (Gerrit)

          unread,
          Nov 28, 2025, 9:08:49 AM (12 days ago) Nov 28
          to Felipe Erias, Jean-Philippe Gravel, Rune Lillesveen, Aaron Krajeski, Justin Novosad, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org

          Chromium LUCI CQ submitted the change

          Change information

          Commit message:
          Support unresolved calc() values in Canvas 2D color parsing

          Add IsUnresolvedColorValue() check in canvas color parsing to properly
          handle CSS color functions containing calc() expressions. Without this,
          colors with calc() were being rendered inaccurately.
          Test: fast/canvas/canvas-fillStyle-color-functions-with-calc
          Bug: 459135661
          Change-Id: I3c1be6fc07c1b5d40deaf0cdca22f9e14da22048
          Reviewed-by: Rune Lillesveen <fut...@chromium.org>
          Reviewed-by: Jean-Philippe Gravel <jpgr...@chromium.org>
          Commit-Queue: Felipe Erias <felip...@igalia.com>
          Cr-Commit-Position: refs/heads/main@{#1551488}
          Files:
          • M third_party/blink/renderer/modules/canvas/canvas2d/canvas_style.cc
          • A third_party/blink/web_tests/fast/canvas/canvas-fillStyle-color-functions-with-calc.html
          Change size: M
          Delta: 2 files changed, 209 insertions(+), 1 deletion(-)
          Branch: refs/heads/main
          Submit Requirements:
          • requirement satisfiedCode-Review: +1 by Rune Lillesveen, +1 by Jean-Philippe Gravel
          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: I3c1be6fc07c1b5d40deaf0cdca22f9e14da22048
          Gerrit-Change-Number: 7182583
          Gerrit-PatchSet: 3
          Gerrit-Owner: Felipe Erias <felip...@igalia.com>
          Gerrit-Reviewer: Aaron Krajeski <aar...@chromium.org>
          Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
          Gerrit-Reviewer: Felipe Erias <felip...@igalia.com>
          Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
          Gerrit-Reviewer: Justin Novosad <ju...@chromium.org>
          Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
          open
          diffy
          satisfied_requirement
          Reply all
          Reply to author
          Forward
          0 new messages