Commit e5ab5d23 authored by esprehn@chromium.org's avatar esprehn@chromium.org

Merge the multiple frame tree walks in PageAnimator::serviceScriptedAnimations.

There's no real reason to do all this work in multiple passes over the Vector
of Documents. This change does alter the web exposed behavior slightly since
now given two same origin iframes that are siblings in the frame tree:

   A
  / \
 B   C

when B runs if it looks at C's scroll position during a scroll animation and
SMIL animation state it may see slightly different results, especially if the
B frame actually started the animation in the C frame. This is already very
racing and unpredictable in browsers since it's an obscure edge case, so I'm
not too worried it'll break content.

This will allow easily skipping iframes that are still loading when processing
the blink pipeline.

BUG=521692

Review URL: https://codereview.chromium.org/1298253003

git-svn-id: svn://svn.chromium.org/blink/trunk@200761 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent aa87d529
......@@ -43,11 +43,11 @@ void PageAnimator::serviceScriptedAnimations(double monotonicAnimationStartTime)
documents.append(toLocalFrame(frame)->document());
}
for (size_t i = 0; i < documents.size(); ++i) {
if (documents[i]->view()) {
documents[i]->view()->scrollableArea()->serviceScrollAnimations(monotonicAnimationStartTime);
for (auto& document : documents) {
if (document->view()) {
document->view()->scrollableArea()->serviceScrollAnimations(monotonicAnimationStartTime);
if (const FrameView::ScrollableAreaSet* animatingScrollableAreas = documents[i]->view()->animatingScrollableAreas()) {
if (const FrameView::ScrollableAreaSet* animatingScrollableAreas = document->view()->animatingScrollableAreas()) {
// Iterate over a copy, since ScrollableAreas may deregister
// themselves during the iteration.
Vector<ScrollableArea*> animatingScrollableAreasCopy;
......@@ -56,17 +56,14 @@ void PageAnimator::serviceScriptedAnimations(double monotonicAnimationStartTime)
scrollableArea->serviceScrollAnimations(monotonicAnimationStartTime);
}
}
DocumentAnimations::updateAnimationTimingForAnimationFrame(*document, monotonicAnimationStartTime);
SVGDocumentExtensions::serviceOnAnimationFrame(*document, monotonicAnimationStartTime);
document->serviceScriptedAnimations(monotonicAnimationStartTime);
}
for (size_t i = 0; i < documents.size(); ++i) {
DocumentAnimations::updateAnimationTimingForAnimationFrame(*documents[i], monotonicAnimationStartTime);
SVGDocumentExtensions::serviceOnAnimationFrame(*documents[i], monotonicAnimationStartTime);
}
for (size_t i = 0; i < documents.size(); ++i)
documents[i]->serviceScriptedAnimations(monotonicAnimationStartTime);
#if ENABLE(OILPAN)
// TODO(esprehn): Why is this here? It doesn't make sense to explicitly
// clear a stack allocated vector.
documents.clear();
#endif
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment