Changeset 254201 in webkit
- Timestamp:
- Jan 8, 2020, 8:30:39 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/webanimations/no-css-animation-on-noscript-expected.txt (added)
-
LayoutTests/webanimations/no-css-animation-on-noscript.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/dom/Element.cpp (modified) (1 diff)
-
Source/WebCore/dom/Element.h (modified) (1 diff)
-
Source/WebCore/html/HTMLElement.cpp (modified) (2 diffs)
-
Source/WebCore/html/HTMLElement.h (modified) (1 diff)
-
Source/WebCore/style/StyleTreeResolver.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r254194 r254201 1 2020-01-08 Antoine Quint <graouts@apple.com> 2 3 [Web Animations] Stop creating CSS Animations for <noscript> elements 4 https://bugs.webkit.org/show_bug.cgi?id=205925 5 <rdar://problem/58158479> 6 7 Reviewed by Antti Koivisto. 8 9 Add a new test that checks that setting the `animation` property on a <noscript> element does not yield the creation of a CSSAnimation object. 10 11 * webanimations/no-css-animation-on-noscript-expected.txt: Added. 12 * webanimations/no-css-animation-on-noscript.html: Added. 13 1 14 2020-01-08 youenn fablet <youenn@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r254200 r254201 1 2020-01-08 Antoine Quint <graouts@apple.com> 2 3 [Web Animations] Stop creating CSS Animations for <noscript> elements 4 https://bugs.webkit.org/show_bug.cgi?id=205925 5 <rdar://problem/58158479> 6 7 Reviewed by Antti Koivisto. 8 9 Test: webanimations/no-css-animation-on-noscript.html 10 11 It makes no sense to create CSS Animations for a <noscript> element and it has the side effect of potential crashes. 12 Indeed, AnimationTimeline::updateCSSAnimationsForElement() may be called without a currentStyle and so we never have 13 a list of previously-applied animations to compare to the list of animations in afterChangeStyle. So on each call we 14 end up creating a new CSSAnimation and the previous animation for the same name is never explicitly removed from the 15 effect stack and is eventually destroyed and the WeakPtr for it in the stack ends up being null, which would cause a 16 crash under KeyframeEffectStack::ensureEffectsAreSorted(). 17 18 We now prevent elements such as <noscript> from being considered for CSS Animations in TreeResolver::resolveElement(). 19 20 * dom/Element.cpp: 21 (WebCore::Element::rendererIsNeeded): 22 * dom/Element.h: 23 (WebCore::Element::rendererIsEverNeeded): 24 * html/HTMLElement.cpp: 25 (WebCore::HTMLElement::rendererIsEverNeeded): 26 (WebCore::HTMLElement::rendererIsNeeded): Deleted. 27 * html/HTMLElement.h: 28 * style/StyleTreeResolver.cpp: 29 (WebCore::Style::TreeResolver::resolveElement): 30 1 31 2020-01-08 Alicia Boya García <aboya@igalia.com> 2 32 -
trunk/Source/WebCore/dom/Element.cpp
r254087 r254201 2115 2115 bool Element::rendererIsNeeded(const RenderStyle& style) 2116 2116 { 2117 return style.display() != DisplayType::None && style.display() != DisplayType::Contents;2117 return rendererIsEverNeeded() && style.display() != DisplayType::None && style.display() != DisplayType::Contents; 2118 2118 } 2119 2119 -
trunk/Source/WebCore/dom/Element.h
r254087 r254201 286 286 virtual RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&); 287 287 virtual bool rendererIsNeeded(const RenderStyle&); 288 virtual bool rendererIsEverNeeded() { return true; } 288 289 289 290 WEBCORE_EXPORT ShadowRoot* shadowRoot() const; -
trunk/Source/WebCore/html/HTMLElement.cpp
r254121 r254201 734 734 } 735 735 736 bool HTMLElement::rendererIs Needed(const RenderStyle& style)736 bool HTMLElement::rendererIsEverNeeded() 737 737 { 738 738 if (hasTagName(noscriptTag)) { … … 745 745 return false; 746 746 } 747 return StyledElement::rendererIs Needed(style);747 return StyledElement::rendererIsEverNeeded(); 748 748 } 749 749 -
trunk/Source/WebCore/html/HTMLElement.h
r254121 r254201 71 71 void accessKeyAction(bool sendMouseEvents) override; 72 72 73 bool rendererIsNeeded(const RenderStyle&) override;74 73 RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override; 74 bool rendererIsEverNeeded() final; 75 75 76 76 WEBCORE_EXPORT virtual HTMLFormElement* form() const; -
trunk/Source/WebCore/style/StyleTreeResolver.cpp
r254054 r254201 199 199 } 200 200 201 if (!element.rendererIsEverNeeded()) 202 return { }; 203 201 204 auto newStyle = styleForElement(element, parent().style); 202 205
Note:
See TracChangeset
for help on using the changeset viewer.