REGRESSION (r155660): box-shadow causes overlay scrollbars to be in the wrong positio...
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Nov 2013 00:50:29 +0000 (00:50 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Nov 2013 00:50:29 +0000 (00:50 +0000)
commit7d867f2ff55ad353c19f3fd01ad60fb3e368b12c
tree866ad37a49ad1cf718275ad37141d7e6a4aca369
parentd146dbdd01f9ad6f9f9714b4c96ee8f1e235b2b2
REGRESSION (r155660): box-shadow causes overlay scrollbars to be in the wrong position when element is composited (85647)
https://bugs.webkit.org/show_bug.cgi?id=124090

Source/WebCore:

Reviewed by Beth Dakin.

After r155660 we did fewer layouts, so were left with overlay scrollbars in the
wrong locations because nothing would update them after RenderLayerBacking
computed a new offsetFromRenderer.

First part of the fix is to wean positionOverflowControlsLayers() off of
an absolute offset from the root. Do this by not using Widget::frameRect()
to position the layers, but instead RenderLayer::rectFor{Horizontal|Vertical}Scrollbar
which is what we used to position the scrollbars in the first place.

Second part of the fix is to call positionOverflowControlsLayers() from
RenderLayerBacking::updateGraphicsLayerGeometry() if the offsetFromRenderer
changed.

Test: compositing/overflow/overflow-scrollbar-layer-positions.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::positionOverflowControls):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
(WebCore::RenderLayerBacking::positionOverflowControlsLayers):
* rendering/RenderLayerBacking.h:

LayoutTests:

Reviewed by Beth Dakin.

Test, but it doesn't actually test the fix until we enable overlay scrollbars
in tests (bug 60716).

* compositing/overflow/overflow-scrollbar-layer-positions-expected.txt: Added.
* compositing/overflow/overflow-scrollbar-layer-positions.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@159082 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/compositing/overflow/overflow-scrollbar-layer-positions-expected.txt [new file with mode: 0644]
LayoutTests/compositing/overflow/overflow-scrollbar-layer-positions.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerBacking.h