Changeset 288054 in webkit
- Timestamp:
- Jan 15, 2022 5:32:05 AM (6 months ago)
- Location:
- trunk
- Files:
-
- 10 edited
- 1 copied
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/marker-computed-size-expected.txt (modified) (1 diff)
-
LayoutTests/platform/gtk/imported/w3c/web-platform-tests/css/css-pseudo/marker-computed-size-expected.txt (copied) (copied from trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/marker-computed-size-expected.txt) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/css/CSSComputedStyleDeclaration.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderThemeIOS.mm (modified) (1 diff)
-
Source/WebCore/rendering/style/RenderStyle.cpp (modified) (1 diff)
-
Source/WebCore/rendering/style/RenderStyle.h (modified) (4 diffs)
-
Source/WebCore/style/StyleBuilderCustom.h (modified) (2 diffs)
-
Source/WebCore/style/Styleable.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r288052 r288054 1 2022-01-14 Antoine Quint <graouts@webkit.org> 2 3 Setting `content: normal` on a ::marker should make computed style return resolved values 4 https://bugs.webkit.org/show_bug.cgi?id=235222 5 6 Reviewed by Aditya Keerthi. 7 8 * platform/gtk/imported/w3c/web-platform-tests/css/css-pseudo/marker-computed-size-expected.txt: 9 1 10 2022-01-14 Frederic Wang <fwang@igalia.com> 2 11 -
trunk/LayoutTests/imported/w3c/ChangeLog
r288049 r288054 1 2022-01-14 Antoine Quint <graouts@webkit.org> 2 3 Setting `content: normal` on a ::marker should make computed style return resolved values 4 https://bugs.webkit.org/show_bug.cgi?id=235222 5 6 Reviewed by Aditya Keerthi. 7 8 Mark WPT progressions. 9 10 * web-platform-tests/css/css-pseudo/marker-computed-size-expected.txt: 11 1 12 2022-01-14 Yusuke Suzuki <ysuzuki@apple.com> 2 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/marker-computed-size-expected.txt
r267650 r288054 1 1 2 FAIL Decimal ::marker assert_equals: width expected "30px" but got "auto" 3 FAIL Decimal ::marker with custom value assert_equals: width expected "40px" but got "auto" 4 FAIL String ::marker assert_equals: width expected "20px" but got "auto" 2 PASS Decimal ::marker 3 PASS Decimal ::marker with custom value 4 PASS String ::marker 5 5 PASS ::marker with no box due to 'list-style' 6 6 FAIL ::marker with custom string contents assert_equals: width expected "60px" but got "auto" -
trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/css/css-pseudo/marker-computed-size-expected.txt
r288053 r288054 1 1 2 FAIL Decimal ::marker assert_equals: width expected "30px" but got " auto"3 FAIL Decimal ::marker with custom value assert_equals: width expected "40px" but got " auto"4 FAIL String ::marker assert_equals: width expected "20px" but got " auto"2 FAIL Decimal ::marker assert_equals: width expected "30px" but got "11px" 3 FAIL Decimal ::marker with custom value assert_equals: width expected "40px" but got "16px" 4 FAIL String ::marker assert_equals: width expected "20px" but got "7px" 5 5 PASS ::marker with no box due to 'list-style' 6 6 FAIL ::marker with custom string contents assert_equals: width expected "60px" but got "auto" -
trunk/Source/WebCore/ChangeLog
r288053 r288054 1 2022-01-14 Antoine Quint <graouts@webkit.org> 2 3 Setting `content: normal` on a ::marker should make computed style return resolved values 4 https://bugs.webkit.org/show_bug.cgi?id=235222 5 6 Reviewed by Aditya Keerthi. 7 8 Until now, StyleBuilder would treat "none" and "normal" values the same way for the "content" 9 CSS property. However, "normal", the initial value, is not the same as "none" which explicitly 10 states that we do not have any content. The WPT test css/css-pseudo/marker-computed-size.html 11 checks on this by setting `content: normal` on a ::marker and expecting the computed style 12 for "width" and "height" to be pixel values and not "auto". 13 14 We already have a bit in RenderStyle that would be turned on when we would parse either "none" 15 or "normal". We're now only setting that bit, with a better name when the value is explicitly "none". 16 17 So we now remove hasExplicitlyClearedContent() and instead expose hasEffectiveContentNone() 18 on RenderStyle. 19 20 We also remove a stale comment in applyInheritContent() since the spec has not changed to make 21 "content" inherited. 22 23 Finally, Styleable::renderer() now returns the markerRenderer() unless 24 RenderStyle::hasEffectiveContentNone() is true. 25 26 For reference, the relevant spec is https://drafts.csswg.org/css-content-3/#content-property. 27 28 * css/CSSComputedStyleDeclaration.cpp: 29 (WebCore::contentToCSSValue): 30 * rendering/RenderThemeIOS.mm: 31 (WebCore::RenderThemeIOS::isControlStyled const): 32 * rendering/style/RenderStyle.cpp: 33 (WebCore::RenderStyle::RenderStyle): 34 * rendering/style/RenderStyle.h: 35 (WebCore::RenderStyle::hasEffectiveContentNone const): 36 (WebCore::RenderStyle::setHasContentNone): 37 (WebCore::RenderStyle::NonInheritedFlags::operator== const): 38 (WebCore::RenderStyle::setHasExplicitlyClearedContent): Deleted. 39 (WebCore::RenderStyle::hasExplicitlyClearedContent const): Deleted. 40 * style/StyleBuilderCustom.h: 41 (WebCore::Style::BuilderCustom::applyInitialContent): 42 (WebCore::Style::BuilderCustom::applyInheritContent): 43 (WebCore::Style::BuilderCustom::applyValueContent): 44 * style/Styleable.cpp: 45 (WebCore::Styleable::renderer const): 46 1 47 2022-01-14 Peng Liu <peng.liu6@apple.com> 2 48 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r287987 r288054 1925 1925 list->append(cssValuePool.createValue(downcast<TextContentData>(*contentData).text(), CSSUnitType::CSS_STRING)); 1926 1926 } 1927 if (!list->length()) { 1928 auto isBeforeOrAfter = style.styleType() == PseudoId::Before || style.styleType() == PseudoId::After; 1929 list->append(cssValuePool.createIdentifierValue(isBeforeOrAfter ? CSSValueNone : CSSValueNormal)); 1930 } 1927 if (!list->length()) 1928 list->append(cssValuePool.createIdentifierValue(style.hasEffectiveContentNone() ? CSSValueNone : CSSValueNormal)); 1931 1929 return list; 1932 1930 } -
trunk/Source/WebCore/rendering/RenderThemeIOS.mm
r287552 r288054 497 497 #if ENABLE(DATALIST_ELEMENT) 498 498 if (style.effectiveAppearance() == ListButtonPart) 499 return style.hasContent() || style.hasE xplicitlyClearedContent();499 return style.hasContent() || style.hasEffectiveContentNone(); 500 500 #endif 501 501 -
trunk/Source/WebCore/rendering/style/RenderStyle.cpp
r287757 r288054 195 195 m_nonInheritedFlags.lastChildState = false; 196 196 m_nonInheritedFlags.isLink = false; 197 m_nonInheritedFlags.has ExplicitlyClearedContent= false;197 m_nonInheritedFlags.hasContentNone = false; 198 198 m_nonInheritedFlags.styleType = static_cast<unsigned>(PseudoId::None); 199 199 m_nonInheritedFlags.pseudoBits = static_cast<unsigned>(PseudoId::None); -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r288035 r288054 1472 1472 static PathOperation* initialClipPath() { return nullptr; } 1473 1473 1474 bool hasEffectiveContentNone() const { return !contentData() && (m_nonInheritedFlags.hasContentNone || styleType() == PseudoId::Before || styleType() == PseudoId::After); } 1474 1475 bool hasContent() const { return contentData(); } 1475 1476 const ContentData* contentData() const { return m_rareNonInheritedData->content.get(); } … … 1477 1478 bool contentDataEquivalent(const RenderStyle* otherStyle) const { return const_cast<RenderStyle*>(this)->m_rareNonInheritedData->contentDataEquivalent(*const_cast<RenderStyle*>(otherStyle)->m_rareNonInheritedData); } 1478 1479 void clearContent(); 1479 void setHasExplicitlyClearedContent(bool v) { m_nonInheritedFlags.hasExplicitlyClearedContent = v; } 1480 bool hasExplicitlyClearedContent() const { return m_nonInheritedFlags.hasExplicitlyClearedContent; }; 1480 void setHasContentNone(bool v) { m_nonInheritedFlags.hasContentNone = v; } 1481 1481 void setContent(const String&, bool add = false); 1482 1482 void setContent(RefPtr<StyleImage>&&, bool add = false); … … 1942 1942 unsigned lastChildState : 1; 1943 1943 unsigned isLink : 1; 1944 unsigned has ExplicitlyClearedContent: 1;1944 unsigned hasContentNone : 1; 1945 1945 1946 1946 unsigned styleType : 4; // PseudoId … … 2079 2079 && lastChildState == other.lastChildState 2080 2080 && isLink == other.isLink 2081 && has ExplicitlyClearedContent == other.hasExplicitlyClearedContent2081 && hasContentNone == other.hasContentNone 2082 2082 && styleType == other.styleType 2083 2083 && pseudoBits == other.pseudoBits; -
trunk/Source/WebCore/style/StyleBuilderCustom.h
r287430 r288054 1521 1521 { 1522 1522 builderState.style().clearContent(); 1523 builderState.style().setHas ExplicitlyClearedContent(true);1523 builderState.style().setHasContentNone(false); 1524 1524 } 1525 1525 1526 1526 inline void BuilderCustom::applyInheritContent(BuilderState&) 1527 1527 { 1528 // FIXME: In CSS3, it will be possible to inherit content. In CSS2 it is not. This1529 // note is a reminder that eventually "inherit" needs to be supported.1530 1528 } 1531 1529 … … 1536 1534 ASSERT_UNUSED(primitiveValue, primitiveValue.valueID() == CSSValueNormal || primitiveValue.valueID() == CSSValueNone); 1537 1535 builderState.style().clearContent(); 1538 builderState.style().setHas ExplicitlyClearedContent(true);1536 builderState.style().setHasContentNone(primitiveValue.valueID() == CSSValueNone); 1539 1537 return; 1540 1538 } -
trunk/Source/WebCore/style/Styleable.cpp
r287987 r288054 101 101 if (is<RenderListItem>(element.renderer())) { 102 102 auto* markerRenderer = downcast<RenderListItem>(*element.renderer()).markerRenderer(); 103 if (markerRenderer && markerRenderer->style().hasContent())103 if (markerRenderer && !markerRenderer->style().hasEffectiveContentNone()) 104 104 return markerRenderer; 105 105 }
Note: See TracChangeset
for help on using the changeset viewer.