Calling FrameView::viewportContentsChanged() after style recalcs is too expensive
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Jun 2015 20:20:41 +0000 (20:20 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Jun 2015 20:20:41 +0000 (20:20 +0000)
commit4b88516627f3c4a35f6f3a2da1ac1aa85668e463
tree0761113383258361e4745c7b199c85a7e610bf93
parent4a8b78dbe497ca6e7340b2e5752d5c068a44d1fc
Calling FrameView::viewportContentsChanged() after style recalcs is too expensive
https://bugs.webkit.org/show_bug.cgi?id=145554
<rdar://problem/21189478>

Reviewed by Darin Adler and Simon Fraser.

Only call FrameView::viewportContentsChanged() after a style recalc if
composited layers have been updated (and there is no pending layout).

We already viewportContentsChanged() after layout so we only need to
call viewportContentsChanged() after a style recalc if it did not cause
a layout but may have caused an element to become visible. In
particular, this can happen in the case of composited animations (e.g.
using -webkit-transform to move an element inside the viewport).
Therefore, we now only call viewportContentsChanged() after a style
recalc if it caused composited layers to be updated. This avoids a lot
of unnecessary calls to viewportContentsChanged(), which is expensive.

No new tests, already covered by:
fast/images/animated-gif-webkit-transform.html

* dom/Document.cpp:
(WebCore::Document::recalcStyle):
* page/FrameView.cpp:
(WebCore::FrameView::updateCompositingLayersAfterStyleChange):
* page/FrameView.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
(WebCore::RenderLayerCompositor::updateCompositingLayers):
* rendering/RenderLayerCompositor.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185118 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/FrameView.h
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderLayerCompositor.h