Changeset 259630 in webkit
- Timestamp:
- Apr 7, 2020 1:25:59 AM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r259629 r259630 1 2020-04-07 Doug Kelly <dougk@apple.com> 2 3 Add release asserts to KeyframeEffectStack::ensureEffectsAreSorted() 4 https://bugs.webkit.org/show_bug.cgi?id=210084 5 <rdar://problem/61359275> 6 7 Reviewed by Ryosuke Niwa. 8 9 To ensure any potential problems in KeyframeEffectStack::ensureEffectsAreSorted() are found closer to the 10 root cause, add several RELEASE_ASSERTs throughout this function (and its associated comparison function). 11 This should guard against null pointers/null WeakPtrs, as well as other state problems which would be 12 unexpected for the comparison function used by std::sort. 13 14 No new tests; this only adds additional asserts, so there is no change to functionality, and this code is 15 covered by existing tests. 16 17 * animation/KeyframeEffectStack.cpp: 18 (WebCore::KeyframeEffectStack::ensureEffectsAreSorted): 19 * animation/WebAnimationUtilities.cpp: 20 (WebCore::compareAnimationsByCompositeOrder): 21 1 22 2020-04-07 Rob Buis <rbuis@igalia.com> 2 23 -
trunk/Source/WebCore/animation/KeyframeEffectStack.cpp
r258913 r259630 81 81 82 82 std::sort(m_effects.begin(), m_effects.end(), [&](auto& lhs, auto& rhs) { 83 RELEASE_ASSERT(lhs.get()); 84 RELEASE_ASSERT(rhs.get()); 85 83 86 auto* lhsAnimation = lhs->animation(); 84 87 auto* rhsAnimation = rhs->animation(); 85 88 86 ASSERT(lhsAnimation);87 ASSERT(rhsAnimation);89 RELEASE_ASSERT(lhsAnimation); 90 RELEASE_ASSERT(rhsAnimation); 88 91 89 92 return compareAnimationsByCompositeOrder(*lhsAnimation, *rhsAnimation, m_cssAnimationList.get()); -
trunk/Source/WebCore/animation/WebAnimationUtilities.cpp
r259538 r259630 85 85 86 86 // We should have found either of those CSS animations in the CSS animations list. 87 ASSERT_NOT_REACHED();87 RELEASE_ASSERT_NOT_REACHED(); 88 88 } 89 89 90 90 // JS-originated animations sort last based on their position in the global animation list. 91 91 // https://drafts.csswg.org/web-animations-1/#animation-composite-order 92 RELEASE_ASSERT(lhsAnimation.globalPosition() != rhsAnimation.globalPosition() || &lhsAnimation == &rhsAnimation); 92 93 return lhsAnimation.globalPosition() < rhsAnimation.globalPosition(); 93 94 }
Note: See TracChangeset
for help on using the changeset viewer.