[SVG] Implement SVG text-decoration fill/stroke styling [chromium/src : main]

0 views
Skip to first unread message

Vinay Singh (Gerrit)

unread,
Apr 10, 2026, 1:30:15 AMApr 10
to Fredrik Söderquist, Virali Purbey, Divyansh Mangal, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, kinuko...@chromium.org, jmedle...@chromium.org, blink-revie...@chromium.org, mac-r...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
Attention needed from Divyansh Mangal, Fredrik Söderquist and Virali Purbey

Vinay Singh voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Divyansh Mangal
  • Fredrik Söderquist
  • Virali Purbey
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: I1307abd2d10ea2f847d1e32a2ca581e650a484e6
Gerrit-Change-Number: 7524829
Gerrit-PatchSet: 33
Gerrit-Owner: Vinay Singh <vinay...@microsoft.com>
Gerrit-Reviewer: Divyansh Mangal <dma...@microsoft.com>
Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
Gerrit-Reviewer: Vinay Singh <vinay...@microsoft.com>
Gerrit-Reviewer: Virali Purbey <virali...@microsoft.com>
Gerrit-Attention: Virali Purbey <virali...@microsoft.com>
Gerrit-Attention: Fredrik Söderquist <f...@opera.com>
Gerrit-Attention: Divyansh Mangal <dma...@microsoft.com>
Gerrit-Comment-Date: Fri, 10 Apr 2026 05:29:45 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Fredrik Söderquist (Gerrit)

unread,
Apr 10, 2026, 8:53:13 AMApr 10
to Vinay Singh, Virali Purbey, Divyansh Mangal, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, kinuko...@chromium.org, jmedle...@chromium.org, blink-revie...@chromium.org, mac-r...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
Attention needed from Divyansh Mangal, Vinay Singh and Virali Purbey

Fredrik Söderquist added 8 comments

Patchset-level comments
File-level comment, Patchset 33 (Latest):
Fredrik Söderquist . resolved

Haven't looked at the implementation, but based on the description this is pretty far up the wrong tree. I suggest fixing one case at a time (wavy is obviously the most complex one).

Commit Message
Line 16, Patchset 33 (Latest):Previously, SVG text decorations were painted using a single color
(text-decoration-color) without respecting the element's fill/stroke
properties. This CL adds two-pass rendering for decoration lines:
Fredrik Söderquist . unresolved

Not really true, though? `solid` was definitely painted with `fill` and `stroke`.

Line 18, Patchset 33 (Latest):properties. This CL adds two-pass rendering for decoration lines:
Fredrik Söderquist . unresolved

There was two-pass rendering before as well?

Line 25, Patchset 33 (Latest):For decorations with stroke, the paint order is fixed to stroke-first to
ensure the border effect renders correctly. This is a deliberate
deviation from the paint-order property for text decorations, as the
visual result matches the expected SVG text-decoration rendering per the
verified behavior in crbug.com/40789409#comment27.
Fredrik Söderquist . unresolved

This is broken and you shouldn't do this. This is also breaking existing rendering behavior. I don't understand why you're doing this.

Line 32, Patchset 33 (Latest):- decoration_line_painter.cc: Adds fill/stroke-aware rendering for
DrawLineAsStroke (dashed/dotted), DrawLineAsRect (solid/double),
Fredrik Söderquist . unresolved

I did this already in https://chromium-review.googlesource.com/c/chromium/src/+/7233381 - and asked you to review it (which you haven't). Doing this piecemeal is generally a quite workable strategy.

File third_party/blink/renderer/core/paint/text_painter.cc
Line 545, Patchset 26: // For decorations with stroke, always draw stroke first (before fill)
// to create proper border effect, regardless of paint-order property.
Vinay Singh . unresolved

The SVG spec doesn't explicitly address paint-order for text decorations. The CSS Text Decoration spec defines decoration painting order but doesn't account for SVG's fill/stroke two-pass model.

The stroke-first ordering here is intentional to create the correct bordered appearance (stroke forms the border, fill is inset). This was verified against expected renders in crbug.com/40789409#comment27. Using the element's `paint-order` property would produce incorrect visual results — e.g., fill-first would hide the stroke border.

This is called out in the CL description as a deliberate deviation, tracked for spec discussion.

Divyansh Mangal

Do we have a corresponding spec issue link this in that case?

Fredrik Söderquist

We've supported paint-order on decorations before this CL, so changing it here would be a regression (as indicated by the `TestExpectations` change). FWIW, I consider "text" to include decorations, so that's a no-brainer for me. `svg/painting/reftests/paint-order-text-decorations.svg`[1] appears to be passing everywhere already as well, so there's not a strong case here.

[1] Gecko fails due to minor issues with the text, but the decorations are painted in the correct order.

Line 558, Patchset 33 (Latest): // When text-decoration-color is explicitly set (not currentColor),
// it overrides the fill color of the decoration while preserving
// the stroke border effect.
Fredrik Söderquist . unresolved

I rather think that `fill` and `stroke` should always take precedence (until there is a mechanism like `text-decoration-fill/stroke`). I don't think that any changes should be needed at this level.

Open in Gerrit

Related details

Attention is currently required from:
  • Divyansh Mangal
  • Vinay Singh
  • Virali Purbey
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: I1307abd2d10ea2f847d1e32a2ca581e650a484e6
Gerrit-Change-Number: 7524829
Gerrit-PatchSet: 33
Gerrit-Owner: Vinay Singh <vinay...@microsoft.com>
Gerrit-Reviewer: Divyansh Mangal <dma...@microsoft.com>
Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
Gerrit-Reviewer: Vinay Singh <vinay...@microsoft.com>
Gerrit-Reviewer: Virali Purbey <virali...@microsoft.com>
Gerrit-Attention: Vinay Singh <vinay...@microsoft.com>
Gerrit-Attention: Virali Purbey <virali...@microsoft.com>
Gerrit-Attention: Divyansh Mangal <dma...@microsoft.com>
Gerrit-Comment-Date: Fri, 10 Apr 2026 12:52:56 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Vinay Singh <vinay...@microsoft.com>
Comment-In-Reply-To: Divyansh Mangal <dma...@microsoft.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Vinay Singh (Gerrit)

unread,
Apr 30, 2026, 1:49:45 AMApr 30
to Fredrik Söderquist, Virali Purbey, Divyansh Mangal, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, kinuko...@chromium.org, jmedle...@chromium.org, blink-revie...@chromium.org, mac-r...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
Attention needed from Divyansh Mangal, Fredrik Söderquist and Virali Purbey

Vinay Singh added 1 comment

Commit Message
Line 32, Patchset 33 (Latest):- decoration_line_painter.cc: Adds fill/stroke-aware rendering for
DrawLineAsStroke (dashed/dotted), DrawLineAsRect (solid/double),
Fredrik Söderquist . unresolved

I did this already in https://chromium-review.googlesource.com/c/chromium/src/+/7233381 - and asked you to review it (which you haven't). Doing this piecemeal is generally a quite workable strategy.

Vinay Singh

I'll be sending more bite-sized CLs instead of this CL with remaining changes clubbed together making it cumbersome to review as well as agreeing to a common behavior.

Open in Gerrit

Related details

Attention is currently required from:
  • Divyansh Mangal
  • Fredrik Söderquist
  • Virali Purbey
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: I1307abd2d10ea2f847d1e32a2ca581e650a484e6
Gerrit-Change-Number: 7524829
Gerrit-PatchSet: 33
Gerrit-Owner: Vinay Singh <vinay...@microsoft.com>
Gerrit-Reviewer: Divyansh Mangal <dma...@microsoft.com>
Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
Gerrit-Reviewer: Vinay Singh <vinay...@microsoft.com>
Gerrit-Reviewer: Virali Purbey <virali...@microsoft.com>
Gerrit-Attention: Virali Purbey <virali...@microsoft.com>
Gerrit-Attention: Fredrik Söderquist <f...@opera.com>
Gerrit-Attention: Divyansh Mangal <dma...@microsoft.com>
Gerrit-Comment-Date: Thu, 30 Apr 2026 05:49:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Fredrik Söderquist <f...@opera.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Vinay Singh (Gerrit)

unread,
May 6, 2026, 1:03:56 PM (9 days ago) May 6
to Fredrik Söderquist, Virali Purbey, Divyansh Mangal, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, kinuko...@chromium.org, jmedle...@chromium.org, blink-revie...@chromium.org, mac-r...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org

Vinay Singh abandoned this change.

View Change

Abandoned

Vinay Singh abandoned this change

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • 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: abandon
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages