Composited frames incorrectly get requestAnimationFrame throttled
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Dec 2017 23:30:48 +0000 (23:30 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Dec 2017 23:30:48 +0000 (23:30 +0000)
commitd20a4ce7357339f416491c45fb01c482e5863a93
tree47f824d9e912e4554653c2cd3604f86322651796
parent3cf6627b3cc8910369b57d8920fafe12c3d27a26
Composited frames incorrectly get requestAnimationFrame throttled
https://bugs.webkit.org/show_bug.cgi?id=178396

Reviewed by Zalan Bujtas.

Source/WebCore:

If a composited iframe was inside overflow:scroll, and the overflow was scrolled to the left
further than the window width, then RenderLayer::childrenClipRect() would return an empty rectangle
and we'd incorrectly consider the iframe out of view, and thus throttle its requestAnimationFrame.

childrenClipRect() was taking unscaledDocumentRect(), applying the clip, and then mapping the result
from local to absolute coordinates (which mapped it through the overflow scroll offset). This is incorrect
because it considers the unscaledDocumentRect() to be in local coordinates, which it is not.

Instead, start with the infinite rect, which essentially tells us if we have any clipping, and then
intersect that with the document rect at the end. Something similar is done in other places that call.
calculateRects().

Test: fast/animation/request-animation-frame-throttle-inside-overflow-scroll.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):

LayoutTests:

* fast/animation/request-animation-frame-throttle-inside-overflow-scroll-expected.txt: Added.
* fast/animation/request-animation-frame-throttle-inside-overflow-scroll.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225554 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/animation/request-animation-frame-throttle-inside-overflow-scroll-expected.txt [new file with mode: 0644]
LayoutTests/fast/animation/request-animation-frame-throttle-inside-overflow-scroll.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayer.cpp