Changeset 271435 in webkit
- Timestamp:
- Jan 13, 2021, 2:11:25 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt (modified) (2 diffs)
-
LayoutTests/webanimations/no-transition-on-after-pseudo-element-upon-creation-expected.html (added)
-
LayoutTests/webanimations/no-transition-on-after-pseudo-element-upon-creation.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/dom/Element.cpp (modified) (2 diffs)
-
Source/WebCore/dom/Element.h (modified) (1 diff)
-
Source/WebCore/style/StyleTreeResolver.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r271431 r271435 1 2021-01-12 Antoine Quint <graouts@webkit.org> 2 3 REGRESSION (r267571): black line appears upon navigating back from apple.com shopping bag 4 https://bugs.webkit.org/show_bug.cgi?id=220550 5 <rdar://problem/72459816> 6 7 Reviewed by Antti Koivisto. 8 9 Add a test that checks that adding a pseudo-element for an existing host element does not use 10 the host element's style to consider starting a transition. 11 12 * webanimations/no-transition-on-after-pseudo-element-upon-creation-expected.html: Added. 13 * webanimations/no-transition-on-after-pseudo-element-upon-creation.html: Added. 14 1 15 2021-01-12 Lauro Moura <lmoura@igalia.com> 2 16 -
trunk/LayoutTests/imported/w3c/ChangeLog
r271434 r271435 1 2021-01-12 Antoine Quint <graouts@webkit.org> 2 3 REGRESSION (r267571): black line appears upon navigating back from apple.com shopping bag 4 https://bugs.webkit.org/show_bug.cgi?id=220550 5 <rdar://problem/72459816> 6 7 Reviewed by Antti Koivisto. 8 9 Mark two additional PASS results for ::marker tests. 10 11 * web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt: 12 1 13 2021-01-13 Youenn Fablet <youenn@apple.com> 2 14 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt
r269813 r271435 30 30 PASS Animation of list-style-type in ::marker 31 31 FAIL Animation of line-height in ::marker assert_equals: expected "normal" but got "35px" 32 FAIL Transition of font in ::marker assert_in_array: value "italic small-caps 500 expanded 15px/35px Ahem" not in array ["italic small-caps 500 expanded 15px Ahem", "italic small-caps 500 expanded 15px/normal Ahem"] 32 PASS Transition of font in ::marker 33 33 PASS Transition of font-family in ::marker 34 34 PASS Transition of font-feature-settings in ::marker … … 59 59 PASS Transition of list-style-position in ::marker 60 60 PASS Transition of list-style-type in ::marker 61 FAIL Transition of line-height in ::marker assert_equals: expected "normal" but got "35px" 61 PASS Transition of line-height in ::marker 62 62 target -
trunk/Source/WebCore/ChangeLog
r271433 r271435 1 2021-01-12 Antoine Quint <graouts@webkit.org> 2 3 REGRESSION (r267571): black line appears upon navigating back from apple.com shopping bag 4 https://bugs.webkit.org/show_bug.cgi?id=220550 5 <rdar://problem/72459816> 6 7 Reviewed by Antti Koivisto. 8 9 Test: webanimations/no-transition-on-after-pseudo-element-upon-creation.html 10 11 In r267571, we refactored the code to use Styleable instead of Element in pseudo-element resolution code. While there 12 should have been no behavior change, there was a change in Style::TreeResolver::createAnimatedElementUpdate() that 13 mistakenly introduced one. 14 15 In order to get the "before" style to be used to consider CSS Transitions, we used to simply call Element::renderOrDisplayContentsStyle() 16 on the element provided to createAnimatedElementUpdate(), which would be either an Element or a PseudoElement in the 17 case of ::before and ::after. When we switched to using Styleable, we made a change where we'd call renderOrDisplayContentsStyle() 18 on the Styleable's element, if it didn't a pseudo-element, or try to get the matching PseudoElement in the case of 19 ::before and ::after. However, if we got a nullptr RenderStyle in the PseudoElement case, we'd fall back to using the 20 style from the host element. 21 22 This yielded this regression on apple.com where a transition is started on an ::after pseudo-element which has an 23 "opacity: 0" style and a "transition" style set for "opacity". The host element is created first, and later the 24 ::after pseudo-element added. While it should not consider starting a transition in this case since upon creation 25 there is no existing style to work with, it did start a transition since it would use the host element's style 26 and see "opacity: 1" to start a transition. 27 28 In this patch, we address the FIXME we'd left behind in TreeResolver::createAnimatedElementUpdate() and make 29 Element::renderOrDisplayContentsStyle() take in a PseudoId, defaulting to PseudoId::None. In case we have a 30 pseudo-element, we first try to call renderOrDisplayContentsStyle() on the matching PseudoElement if it exists, 31 or we return the existing computed style for this pseudo-element. 32 33 If there is no existing computed style, we return nullptr, which means that in the apple.com scenario, no transition 34 is started because we correctly don't have a "before" style to work within upon creation of the ::after pseudo-element. 35 36 * dom/Element.cpp: 37 (WebCore::beforeOrAfterPseudoElement): 38 (WebCore::Element::renderOrDisplayContentsStyle const): 39 * dom/Element.h: 40 * style/StyleTreeResolver.cpp: 41 (WebCore::Style::TreeResolver::createAnimatedElementUpdate): 42 1 43 2021-01-12 Cathie Chen <cathiechen@igalia.com> 2 44 -
trunk/Source/WebCore/dom/Element.cpp
r271382 r271435 3294 3294 } 3295 3295 3296 static PseudoElement* beforeOrAfterPseudoElement( Element& host, PseudoId pseudoElementSpecifier)3296 static PseudoElement* beforeOrAfterPseudoElement(const Element& host, PseudoId pseudoElementSpecifier) 3297 3297 { 3298 3298 switch (pseudoElementSpecifier) { … … 3316 3316 } 3317 3317 3318 const RenderStyle* Element::renderOrDisplayContentsStyle() const 3319 { 3318 const RenderStyle* Element::renderOrDisplayContentsStyle(PseudoId pseudoId) const 3319 { 3320 if (pseudoId != PseudoId::None) { 3321 if (auto* pseudoElement = beforeOrAfterPseudoElement(*this, pseudoId)) 3322 return pseudoElement->renderOrDisplayContentsStyle(); 3323 3324 if (auto* computedStyle = existingComputedStyle()) { 3325 if (auto* cachedPseudoStyle = computedStyle->getCachedPseudoStyle(pseudoId)) 3326 return cachedPseudoStyle; 3327 } 3328 3329 return nullptr; 3330 } 3331 3320 3332 if (auto* style = renderStyle()) 3321 3333 return style; -
trunk/Source/WebCore/dom/Element.h
r270297 r271435 553 553 554 554 const RenderStyle* existingComputedStyle() const; 555 WEBCORE_EXPORT const RenderStyle* renderOrDisplayContentsStyle( ) const;555 WEBCORE_EXPORT const RenderStyle* renderOrDisplayContentsStyle(PseudoId = PseudoId::None) const; 556 556 557 557 void clearBeforePseudoElement(); -
trunk/Source/WebCore/style/StyleTreeResolver.cpp
r270837 r271435 317 317 { 318 318 auto& element = styleable.element; 319 320 // FIXME: Ideally we could just call Element::renderOrDisplayContentsStyle() with a PseudoId 321 // and get the style for any PseudoId, not just PseudoId::Before or PseudoId::After. 322 auto* pseudoElement = [styleable]() -> PseudoElement* { 323 switch (styleable.pseudoId) { 324 case PseudoId::Before: 325 return styleable.element.beforePseudoElement(); 326 case PseudoId::After: 327 return styleable.element.afterPseudoElement(); 328 default: 329 return nullptr; 330 } 331 }(); 332 auto* oldStyle = pseudoElement ? pseudoElement->renderOrDisplayContentsStyle() : element.renderOrDisplayContentsStyle(); 319 auto* oldStyle = element.renderOrDisplayContentsStyle(styleable.pseudoId); 333 320 334 321 OptionSet<AnimationImpact> animationImpact;
Note:
See TracChangeset
for help on using the changeset viewer.