Title: [259630] trunk/Source/WebCore
- Revision
- 259630
- Author
- [email protected]
- Date
- 2020-04-07 01:25:59 -0700 (Tue, 07 Apr 2020)
Log Message
Add release asserts to KeyframeEffectStack::ensureEffectsAreSorted()
https://bugs.webkit.org/show_bug.cgi?id=210084
<rdar://problem/61359275>
Reviewed by Ryosuke Niwa.
To ensure any potential problems in KeyframeEffectStack::ensureEffectsAreSorted() are found closer to the
root cause, add several RELEASE_ASSERTs throughout this function (and its associated comparison function).
This should guard against null pointers/null WeakPtrs, as well as other state problems which would be
unexpected for the comparison function used by std::sort.
No new tests; this only adds additional asserts, so there is no change to functionality, and this code is
covered by existing tests.
* animation/KeyframeEffectStack.cpp:
(WebCore::KeyframeEffectStack::ensureEffectsAreSorted):
* animation/WebAnimationUtilities.cpp:
(WebCore::compareAnimationsByCompositeOrder):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (259629 => 259630)
--- trunk/Source/WebCore/ChangeLog 2020-04-07 07:55:57 UTC (rev 259629)
+++ trunk/Source/WebCore/ChangeLog 2020-04-07 08:25:59 UTC (rev 259630)
@@ -1,3 +1,24 @@
+2020-04-07 Doug Kelly <[email protected]>
+
+ Add release asserts to KeyframeEffectStack::ensureEffectsAreSorted()
+ https://bugs.webkit.org/show_bug.cgi?id=210084
+ <rdar://problem/61359275>
+
+ Reviewed by Ryosuke Niwa.
+
+ To ensure any potential problems in KeyframeEffectStack::ensureEffectsAreSorted() are found closer to the
+ root cause, add several RELEASE_ASSERTs throughout this function (and its associated comparison function).
+ This should guard against null pointers/null WeakPtrs, as well as other state problems which would be
+ unexpected for the comparison function used by std::sort.
+
+ No new tests; this only adds additional asserts, so there is no change to functionality, and this code is
+ covered by existing tests.
+
+ * animation/KeyframeEffectStack.cpp:
+ (WebCore::KeyframeEffectStack::ensureEffectsAreSorted):
+ * animation/WebAnimationUtilities.cpp:
+ (WebCore::compareAnimationsByCompositeOrder):
+
2020-04-07 Rob Buis <[email protected]>
Use GlobalFrameIdentifier in NavigationAction
Modified: trunk/Source/WebCore/animation/KeyframeEffectStack.cpp (259629 => 259630)
--- trunk/Source/WebCore/animation/KeyframeEffectStack.cpp 2020-04-07 07:55:57 UTC (rev 259629)
+++ trunk/Source/WebCore/animation/KeyframeEffectStack.cpp 2020-04-07 08:25:59 UTC (rev 259630)
@@ -80,11 +80,14 @@
return;
std::sort(m_effects.begin(), m_effects.end(), [&](auto& lhs, auto& rhs) {
+ RELEASE_ASSERT(lhs.get());
+ RELEASE_ASSERT(rhs.get());
+
auto* lhsAnimation = lhs->animation();
auto* rhsAnimation = rhs->animation();
- ASSERT(lhsAnimation);
- ASSERT(rhsAnimation);
+ RELEASE_ASSERT(lhsAnimation);
+ RELEASE_ASSERT(rhsAnimation);
return compareAnimationsByCompositeOrder(*lhsAnimation, *rhsAnimation, m_cssAnimationList.get());
});
Modified: trunk/Source/WebCore/animation/WebAnimationUtilities.cpp (259629 => 259630)
--- trunk/Source/WebCore/animation/WebAnimationUtilities.cpp 2020-04-07 07:55:57 UTC (rev 259629)
+++ trunk/Source/WebCore/animation/WebAnimationUtilities.cpp 2020-04-07 08:25:59 UTC (rev 259630)
@@ -84,11 +84,12 @@
}
// We should have found either of those CSS animations in the CSS animations list.
- ASSERT_NOT_REACHED();
+ RELEASE_ASSERT_NOT_REACHED();
}
// JS-originated animations sort last based on their position in the global animation list.
// https://drafts.csswg.org/web-animations-1/#animation-composite-order
+ RELEASE_ASSERT(lhsAnimation.globalPosition() != rhsAnimation.globalPosition() || &lhsAnimation == &rhsAnimation);
return lhsAnimation.globalPosition() < rhsAnimation.globalPosition();
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes