Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f149be78a28fae1b717de0a0b10bf485945f5b5e
      
https://github.com/WebKit/WebKit/commit/f149be78a28fae1b717de0a0b10bf485945f5b5e
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-06-09 (Tue, 09 Jun 2026)

  Changed paths:
    M LayoutTests/TestExpectations
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-propagation-display-contents-002-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-propagation-display-contents-002-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-propagation-display-contents-002.html
    M Source/WebCore/style/StyleAdjuster.cpp

  Log Message:
  -----------
  SVG: Do not apply text-decoration on elements with display:contents
https://bugs.webkit.org/show_bug.cgi?id=233171
rdar://85691104

Reviewed by Alan Baradlay.

Per the spec [1], line decorations are propagated through the box tree, not 
through
inheritance, and thus have no effect on descendants when specified on an 
element with
display: contents.

textDecorationLineInEffect is an inherited flag, so at adjustment time it 
already holds
the decorations contributed by ancestor boxes. Only a box-generating element 
should fold
its own text-decoration-line into that value, so do this in the else-if branch 
that
already gates such elements (display is neither contents nor none). A boxless 
element
then leaves the inherited in-effect value unchanged, while a decoration on an 
ancestor
box still reaches a descendant box through it, since each box-generating 
descendant
re-folds the inherited value. This covers the HTML <span>, SVG <tspan>, and SVG 
<use>
cases the test exercises.

Add a test covering that a line decoration on an ancestor box still propagates 
through a
display: contents element to a descendant box, while the display: contents 
element's own
decoration does not.

[1] https://drafts.csswg.org/css-text-decor/#line-decoration

* LayoutTests/TestExpectations: Progression
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-propagation-display-contents-002-expected.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-propagation-display-contents-002-ref.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-text-decor/text-decoration-propagation-display-contents-002.html:
 Added.
* Source/WebCore/style/StyleAdjuster.cpp:
(WebCore::Style::Adjuster::adjust const):

Canonical link: https://commits.webkit.org/314830@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to