Changeset 234017 in webkit
- Timestamp:
- Jul 19, 2018 5:06:10 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r234015 r234017 1 2018-07-19 Antoine Quint <graouts@apple.com> 2 3 Flaky crash in AnimationTimeline::cancelOrRemoveDeclarativeAnimation 4 https://bugs.webkit.org/show_bug.cgi?id=187530 5 <rdar://problem/42095186> 6 7 Reviewed by Dean Jackson. 8 9 Adjust an existing test which assumes an animation might be running when it's not really, so we test the animation is 10 not running using an alternate method. 11 12 * animations/keyframes-dynamic-expected.txt: 13 * animations/keyframes-dynamic.html: 14 1 15 2018-07-19 Ryan Haddad <ryanhaddad@apple.com> 2 16 -
trunk/LayoutTests/animations/keyframes-dynamic-expected.txt
r231766 r234017 4 4 PASS - "left" property for "box2" element at 0.3s saw something close to: 100 5 5 PASS - "left" property for "box2" element at 0.7s saw something close to: 200 6 PASS - "left" property for "box3" element at 0.3s saw something close to: 07 PASS - "left" property for "box3" element at 0.7s saw something close to: 08 6 -
trunk/LayoutTests/animations/keyframes-dynamic.html
r231977 r234017 28 28 ["anim2", 0.3, "box2", "left", 100, 1], 29 29 ["anim2", 0.7, "box2", "left", 200, 1], 30 ["anim3", 0.3, "box3", "left", 0, 0],31 ["anim3", 0.7, "box3", "left", 0, 0],32 30 ]; 33 31 … … 65 63 style.sheet.removeRule(box3Index); 66 64 67 runAnimationTest(expectedValues); 65 runAnimationTest(expectedValues, () => { 66 setTimeout(() => { 67 document.getElementById("result").appendChild(document.createTextNode(`${!box3.getAnimations().length ? "PASS" : "FAIL"} - Animation is not running on box3.`)); 68 }) 69 }); 68 70 } 69 71 -
trunk/LayoutTests/imported/mozilla/ChangeLog
r233459 r234017 1 2018-07-19 Antoine Quint <graouts@apple.com> 2 3 Flaky crash in AnimationTimeline::cancelOrRemoveDeclarativeAnimation 4 https://bugs.webkit.org/show_bug.cgi?id=187530 5 <rdar://problem/42095186> 6 7 Reviewed by Dean Jackson. 8 9 Mark a WPT progression now that we correctly ignore animation names that have no matching @keyframes rule. 10 11 * css-animations/test_element-get-animations-expected.txt: 12 1 13 2018-07-03 Antoine Quint <graouts@apple.com> 2 14 -
trunk/LayoutTests/imported/mozilla/css-animations/test_element-get-animations-expected.txt
r233010 r234017 8 8 PASS getAnimations for CSS Animations that have finished but are forwards filling 9 9 PASS getAnimations for CSS Animations with animation-name: none 10 FAIL getAnimations for CSS Animations with animation-name: missing assert_equals: getAnimations returns an empty sequence for an element with animation-name: missing expected 0 but got 1 11 FAIL getAnimations for CSS Animations where the @keyframes rule is added later assert_equals: getAnimations in itally only returns Animations for CSS Animations whose animation-name is found expected 1 but got 210 PASS getAnimations for CSS Animations with animation-name: missing 11 FAIL getAnimations for CSS Animations where the @keyframes rule is added later assert_equals: getAnimations includes Animation when @keyframes rule is added later expected 2 but got 1 12 12 PASS getAnimations for CSS Animations with duplicated animation-name 13 13 PASS getAnimations for CSS Animations with empty keyframes rule -
trunk/Source/WebCore/ChangeLog
r234013 r234017 1 2018-07-19 Antoine Quint <graouts@apple.com> 2 3 Flaky crash in AnimationTimeline::cancelOrRemoveDeclarativeAnimation 4 https://bugs.webkit.org/show_bug.cgi?id=187530 5 <rdar://problem/42095186> 6 7 Reviewed by Dean Jackson. 8 9 We would crash in cancelOrRemoveDeclarativeAnimation() because updateCSSAnimationsForElement() would pass 10 nullptr values due to the return value of cssAnimationsByName.take(nameOfAnimationToRemove). This is because 11 we would create animations for animation names that may be empty or not match an existing @keyframes rule. 12 Not only was that wasteful, but it was also non-compliant, and as a result of fixing this we're actually 13 seeing a progression in the CSS Animations WPT tests. 14 15 * animation/AnimationTimeline.cpp: 16 (WebCore::shouldConsiderAnimation): New function that performs all required steps to see if a provided animation 17 is valid and has a name that is not "none", not the empty string and matches the name of a @keyframes rule. 18 (WebCore::AnimationTimeline::updateCSSAnimationsForElement): 19 * animation/KeyframeEffectReadOnly.cpp: 20 (WebCore::KeyframeEffectReadOnly::computeCSSAnimationBlendingKeyframes): We no longer need to check whether we have 21 an empty animation name since we're no longer creating CSSAnimation objects in that circumstance. 22 * css/StyleResolver.cpp: 23 (WebCore::StyleResolver::isAnimationNameValid): Add a new method that checks whether the provided animation name 24 a known @keyframes rule. 25 * css/StyleResolver.h: 26 1 27 2018-07-19 Chris Dumez <cdumez@apple.com> 2 28 -
trunk/Source/WebCore/animation/AnimationTimeline.cpp
r233585 r234017 40 40 #include "RenderView.h" 41 41 #include "StylePropertyShorthand.h" 42 #include "StyleResolver.h" 42 43 #include "WebAnimationUtilities.h" 43 44 #include <wtf/text/TextStream.h> … … 196 197 } 197 198 199 static bool shouldConsiderAnimation(Element& element, const Animation& animation) 200 { 201 if (!animation.isValidAnimation()) 202 return false; 203 204 static NeverDestroyed<const String> animationNameNone(MAKE_STATIC_STRING_IMPL("none")); 205 206 auto& name = animation.name(); 207 if (name == animationNameNone || name.isEmpty()) 208 return false; 209 210 if (auto* styleScope = Style::Scope::forOrdinal(element, animation.nameStyleScopeOrdinal())) 211 return styleScope->resolver().isAnimationNameValid(name); 212 213 return false; 214 } 215 198 216 void AnimationTimeline::updateCSSAnimationsForElement(Element& element, const RenderStyle* currentStyle, const RenderStyle& afterChangeStyle) 199 217 { … … 209 227 if (currentStyle && currentStyle->hasAnimations() && afterChangeStyle.hasAnimations() && *(currentStyle->animations()) == *(afterChangeStyle.animations())) 210 228 return; 211 212 static NeverDestroyed<const String> animationNameNone(MAKE_STATIC_STRING_IMPL("none"));213 229 214 230 // First, compile the list of animation names that were applied to this element up to this point. … … 218 234 for (size_t i = 0; i < previousAnimations->size(); ++i) { 219 235 auto& previousAnimation = previousAnimations->animation(i); 220 if ( previousAnimation.isValidAnimation() && previousAnimation.name() != animationNameNone)236 if (shouldConsiderAnimation(element, previousAnimation)) 221 237 namesOfPreviousAnimations.add(previousAnimation.name()); 222 238 } … … 237 253 // animation object for this animation name. 238 254 cssAnimationsByName.get(name)->setBackingAnimation(currentAnimation); 239 } else if ( currentAnimation.isValidAnimation() && name != animationNameNone) {255 } else if (shouldConsiderAnimation(element, currentAnimation)) { 240 256 // Otherwise we are dealing with a new animation name and must create a CSSAnimation for it. 241 257 cssAnimationsByName.set(name, CSSAnimation::create(element, currentAnimation, currentStyle, afterChangeStyle)); -
trunk/Source/WebCore/animation/KeyframeEffectReadOnly.cpp
r233903 r234017 872 872 auto cssAnimation = downcast<CSSAnimation>(animation()); 873 873 auto& backingAnimation = cssAnimation->backingAnimation(); 874 if (backingAnimation.name().isEmpty())875 return;876 874 877 875 KeyframeList keyframeList(backingAnimation.name()); -
trunk/Source/WebCore/css/StyleResolver.cpp
r233877 r234017 461 461 } 462 462 463 bool StyleResolver::isAnimationNameValid(const String& name) 464 { 465 return m_keyframesRuleMap.find(AtomicString(name).impl()) != m_keyframesRuleMap.end(); 466 } 467 463 468 void StyleResolver::keyframeStylesForAnimation(const Element& element, const RenderStyle* elementStyle, KeyframeList& list) 464 469 { -
trunk/Source/WebCore/css/StyleResolver.h
r233838 r234017 162 162 void setNewStateWithElement(const Element&); 163 163 std::unique_ptr<RenderStyle> styleForKeyframe(const RenderStyle*, const StyleRuleKeyframe*, KeyframeValue&); 164 bool isAnimationNameValid(const String&); 164 165 165 166 public:
Note: See TracChangeset
for help on using the changeset viewer.