RESOLVED FIXED233171
SVG: Do not apply text-decoration on elements with display:contents
https://bugs.webkit.org/show_bug.cgi?id=233171
Summary SVG: Do not apply text-decoration on elements with display:contents
Tim Nguyen (:ntim)
Reported 2021-11-15 22:21:01 PST
Port https://chromium-review.googlesource.com/c/chromium/src/+/3192872 It's already done for non-SVG elements, SVG should match. Test: imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-propagation-display-contents.html
Attachments
Radar WebKit Bug Importer
Comment 1 2021-11-22 22:21:22 PST
Karl Dubost
Comment 2 2026-05-25 00:43:15 PDT
css-text-decor §line-decoration (https://drafts.csswg.org/css-text-decor/#line-decoration) — "Line decorations are propagated through the box tree, not through inheritance" WebKit propagates text-decoration-line-in-effect from a display: contents element to its descendants. Since that element generates no box, it shouldn't act as a decoration source. Source/WebCore/style/StyleAdjuster.cpp:162-172 — shouldInheritTextDecorationsInEffect switches on style.display().value and returns false for InlineFlowRoot, InlineTable, InlineFlex, InlineGrid, InlineGridLanes, InlineDeprecatedFlex. DisplayType::Contents is missing from the list. As a result, line 637-640 of StyleAdjuster.cpp ORs the display:contents element's text-decoration-line into the inherited textDecorationLineInEffect, which descendants then paint. Fix sketch: add case DisplayType::Contents: return false; to the switch.
Ahmad Saleem
Comment 3 2026-06-04 21:07:35 PDT
EWS
Comment 4 2026-06-09 13:30:45 PDT
Committed 314830@main (f149be78a28f): <https://commits.webkit.org/314830@main> Reviewed commits have been landed. Closing PR #66515 and removing active labels.
Ahmad Saleem
Comment 5 2026-06-19 23:43:50 PDT
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/60767
Note You need to log in before you can comment on or make changes to this bug.