Changeset 278602 in webkit
- Timestamp:
- Jun 8, 2021 5:11:32 AM (14 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/shadow-dom/effective-text-decoration-inheritance-expected.html (added)
-
LayoutTests/fast/shadow-dom/effective-text-decoration-inheritance.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/style/StyleAdjuster.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r278594 r278602 1 2021-06-08 Antti Koivisto <antti@apple.com> 2 3 `text-decoration: underline` is not applied to web component 4 https://bugs.webkit.org/show_bug.cgi?id=226724 5 <rdar://problem/78987286> 6 7 Reviewed by Ryosuke Niwa. 8 9 * fast/shadow-dom/effective-text-decoration-inheritance-expected.html: Added. 10 * fast/shadow-dom/effective-text-decoration-inheritance.html: Added. 11 1 12 2021-06-08 Fujii Hironori <Hironori.Fujii@sony.com> 2 13 -
trunk/Source/WebCore/ChangeLog
r278593 r278602 1 2021-06-08 Antti Koivisto <antti@apple.com> 2 3 `text-decoration: underline` is not applied to web component 4 https://bugs.webkit.org/show_bug.cgi?id=226724 5 <rdar://problem/78987286> 6 7 Reviewed by Ryosuke Niwa. 8 9 'text-decoration' is not an inherited property in itself but its effective value 10 behaves as it was. We fail to inherit this effective value into author shadow trees. 11 12 Test case by Jeroen Zwartepoorte. 13 14 Test: fast/shadow-dom/effective-text-decoration-inheritance.html 15 16 * style/StyleAdjuster.cpp: 17 (WebCore::Style::shouldInheritEffectiveTextDecorations): 18 19 Test for user agent shadow tree, not a shadow tree in general. 20 Also inverse the logic and refactor a bit. 21 22 (WebCore::Style::Adjuster::adjust const): 23 (WebCore::Style::isAtShadowBoundary): Deleted. 24 (WebCore::Style::doesNotInheritTextDecoration): Deleted. 25 1 26 2021-06-08 Frédéric Wang <fwang@igalia.com> 2 27 -
trunk/Source/WebCore/style/StyleAdjuster.cpp
r277949 r278602 142 142 } 143 143 144 static inline bool isAtShadowBoundary(const Element& element) 145 { 146 auto* parentNode = element.parentNode(); 147 return parentNode && parentNode->isShadowRoot(); 148 } 149 150 // CSS requires text-decoration to be reset at each DOM element for tables, 151 // inline blocks, inline tables, shadow DOM crossings, floating elements, 152 // and absolute or relatively positioned elements. 153 static bool doesNotInheritTextDecoration(const RenderStyle& style, const Element* element) 154 { 155 return style.display() == DisplayType::Table || style.display() == DisplayType::InlineTable 156 || style.display() == DisplayType::InlineBlock || style.display() == DisplayType::InlineBox || (element && isAtShadowBoundary(*element)) 157 || style.isFloating() || style.hasOutOfFlowPosition(); 144 static bool shouldInheritTextDecorationsInEffect(const RenderStyle& style, const Element* element) 145 { 146 if (style.isFloating() || style.hasOutOfFlowPosition()) 147 return false; 148 149 auto isAtUserAgentShadowBoundary = [&] { 150 if (!element) 151 return false; 152 auto* parentNode = element->parentNode(); 153 return parentNode && parentNode->isUserAgentShadowRoot(); 154 }(); 155 156 // There is no other good way to prevent decorations from affecting user agent shadow trees. 157 if (isAtUserAgentShadowBoundary) 158 return false; 159 160 switch (style.display()) { 161 case DisplayType::Table: 162 case DisplayType::InlineTable: 163 case DisplayType::InlineBlock: 164 case DisplayType::InlineBox: 165 return false; 166 default: 167 break; 168 }; 169 170 return true; 158 171 } 159 172 … … 394 407 } 395 408 396 if (doesNotInheritTextDecoration(style, m_element)) 409 if (shouldInheritTextDecorationsInEffect(style, m_element)) 410 style.addToTextDecorationsInEffect(style.textDecoration()); 411 else 397 412 style.setTextDecorationsInEffect(style.textDecoration()); 398 else399 style.addToTextDecorationsInEffect(style.textDecoration());400 413 401 414 // If either overflow value is not visible, change to auto.
Note: See TracChangeset
for help on using the changeset viewer.