Changeset 254598 in webkit
- Timestamp:
- Jan 15, 2020, 11:15:10 AM (7 years ago)
- Location:
- branches/safari-609-branch
- 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
-
branches/safari-609-branch/LayoutTests/ChangeLog
r254595 r254598 1 2020-01-14 Alan Coon <alancoon@apple.com> 2 3 Cherry-pick r254201. rdar://problem/58552859 4 5 [Web Animations] Stop creating CSS Animations for <noscript> elements 6 https://bugs.webkit.org/show_bug.cgi?id=205925 7 <rdar://problem/58158479> 8 9 Reviewed by Antti Koivisto. 10 11 Source/WebCore: 12 13 Test: webanimations/no-css-animation-on-noscript.html 14 15 It makes no sense to create CSS Animations for a <noscript> element and it has the side effect of potential crashes. 16 Indeed, AnimationTimeline::updateCSSAnimationsForElement() may be called without a currentStyle and so we never have 17 a list of previously-applied animations to compare to the list of animations in afterChangeStyle. So on each call we 18 end up creating a new CSSAnimation and the previous animation for the same name is never explicitly removed from the 19 effect stack and is eventually destroyed and the WeakPtr for it in the stack ends up being null, which would cause a 20 crash under KeyframeEffectStack::ensureEffectsAreSorted(). 21 22 We now prevent elements such as <noscript> from being considered for CSS Animations in TreeResolver::resolveElement(). 23 24 * dom/Element.cpp: 25 (WebCore::Element::rendererIsNeeded): 26 * dom/Element.h: 27 (WebCore::Element::rendererIsEverNeeded): 28 * html/HTMLElement.cpp: 29 (WebCore::HTMLElement::rendererIsEverNeeded): 30 (WebCore::HTMLElement::rendererIsNeeded): Deleted. 31 * html/HTMLElement.h: 32 * style/StyleTreeResolver.cpp: 33 (WebCore::Style::TreeResolver::resolveElement): 34 35 LayoutTests: 36 37 Add a new test that checks that setting the `animation` property on a <noscript> element does not yield the creation of a CSSAnimation object. 38 39 * webanimations/no-css-animation-on-noscript-expected.txt: Added. 40 * webanimations/no-css-animation-on-noscript.html: Added. 41 42 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254201 268f45cc-cd09-0410-ab3c-d52691b4dbfc 43 44 2020-01-08 Antoine Quint <graouts@apple.com> 45 46 [Web Animations] Stop creating CSS Animations for <noscript> elements 47 https://bugs.webkit.org/show_bug.cgi?id=205925 48 <rdar://problem/58158479> 49 50 Reviewed by Antti Koivisto. 51 52 Add a new test that checks that setting the `animation` property on a <noscript> element does not yield the creation of a CSSAnimation object. 53 54 * webanimations/no-css-animation-on-noscript-expected.txt: Added. 55 * webanimations/no-css-animation-on-noscript.html: Added. 56 1 57 2020-01-14 Alan Coon <alancoon@apple.com> 2 58 -
branches/safari-609-branch/Source/WebCore/ChangeLog
r254594 r254598 1 2020-01-14 Alan Coon <alancoon@apple.com> 2 3 Cherry-pick r254201. rdar://problem/58552859 4 5 [Web Animations] Stop creating CSS Animations for <noscript> elements 6 https://bugs.webkit.org/show_bug.cgi?id=205925 7 <rdar://problem/58158479> 8 9 Reviewed by Antti Koivisto. 10 11 Source/WebCore: 12 13 Test: webanimations/no-css-animation-on-noscript.html 14 15 It makes no sense to create CSS Animations for a <noscript> element and it has the side effect of potential crashes. 16 Indeed, AnimationTimeline::updateCSSAnimationsForElement() may be called without a currentStyle and so we never have 17 a list of previously-applied animations to compare to the list of animations in afterChangeStyle. So on each call we 18 end up creating a new CSSAnimation and the previous animation for the same name is never explicitly removed from the 19 effect stack and is eventually destroyed and the WeakPtr for it in the stack ends up being null, which would cause a 20 crash under KeyframeEffectStack::ensureEffectsAreSorted(). 21 22 We now prevent elements such as <noscript> from being considered for CSS Animations in TreeResolver::resolveElement(). 23 24 * dom/Element.cpp: 25 (WebCore::Element::rendererIsNeeded): 26 * dom/Element.h: 27 (WebCore::Element::rendererIsEverNeeded): 28 * html/HTMLElement.cpp: 29 (WebCore::HTMLElement::rendererIsEverNeeded): 30 (WebCore::HTMLElement::rendererIsNeeded): Deleted. 31 * html/HTMLElement.h: 32 * style/StyleTreeResolver.cpp: 33 (WebCore::Style::TreeResolver::resolveElement): 34 35 LayoutTests: 36 37 Add a new test that checks that setting the `animation` property on a <noscript> element does not yield the creation of a CSSAnimation object. 38 39 * webanimations/no-css-animation-on-noscript-expected.txt: Added. 40 * webanimations/no-css-animation-on-noscript.html: Added. 41 42 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254201 268f45cc-cd09-0410-ab3c-d52691b4dbfc 43 44 2020-01-08 Antoine Quint <graouts@apple.com> 45 46 [Web Animations] Stop creating CSS Animations for <noscript> elements 47 https://bugs.webkit.org/show_bug.cgi?id=205925 48 <rdar://problem/58158479> 49 50 Reviewed by Antti Koivisto. 51 52 Test: webanimations/no-css-animation-on-noscript.html 53 54 It makes no sense to create CSS Animations for a <noscript> element and it has the side effect of potential crashes. 55 Indeed, AnimationTimeline::updateCSSAnimationsForElement() may be called without a currentStyle and so we never have 56 a list of previously-applied animations to compare to the list of animations in afterChangeStyle. So on each call we 57 end up creating a new CSSAnimation and the previous animation for the same name is never explicitly removed from the 58 effect stack and is eventually destroyed and the WeakPtr for it in the stack ends up being null, which would cause a 59 crash under KeyframeEffectStack::ensureEffectsAreSorted(). 60 61 We now prevent elements such as <noscript> from being considered for CSS Animations in TreeResolver::resolveElement(). 62 63 * dom/Element.cpp: 64 (WebCore::Element::rendererIsNeeded): 65 * dom/Element.h: 66 (WebCore::Element::rendererIsEverNeeded): 67 * html/HTMLElement.cpp: 68 (WebCore::HTMLElement::rendererIsEverNeeded): 69 (WebCore::HTMLElement::rendererIsNeeded): Deleted. 70 * html/HTMLElement.h: 71 * style/StyleTreeResolver.cpp: 72 (WebCore::Style::TreeResolver::resolveElement): 73 1 74 2020-01-14 Alan Coon <alancoon@apple.com> 2 75 -
branches/safari-609-branch/Source/WebCore/dom/Element.cpp
r254582 r254598 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 -
branches/safari-609-branch/Source/WebCore/dom/Element.h
r254582 r254598 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; -
branches/safari-609-branch/Source/WebCore/html/HTMLElement.cpp
r252392 r254598 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 -
branches/safari-609-branch/Source/WebCore/html/HTMLElement.h
r251686 r254598 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; -
branches/safari-609-branch/Source/WebCore/style/StyleTreeResolver.cpp
r254582 r254598 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.