Chromium Code Reviews| Index: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
| diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
| index 8a5fd7f3bc135dc51d8b1fe6a2e3615ff0f209be..8c71e109d785caac9c34f54e2adf271af7ea3cbe 100644 |
| --- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
| +++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
| @@ -506,6 +506,15 @@ IntSize PaintLayerScrollableArea::maximumScrollOffsetInt() const { |
| IntSize visibleSize = |
| pixelSnappedIntRect(box().overflowClipRect(box().location())).size(); |
|
skobes
2017/03/07 16:42:47
Could we add a value to the OverlayScrollbarClipBe
szager1
2017/03/07 19:01:31
Yeah, that was my first attempt. It works, but it
skobes
2017/03/07 19:09:12
I probably do, though I'll have to see the patch.
|
| + // When computing scroll limits, overflow:overlay scrollbars should not be |
| + // subtracted from the visible content size. |
| + if (hasVerticalScrollbar() && |
| + box().style()->overflowY() == EOverflow::kOverlay) |
| + visibleSize.expand(verticalScrollbar()->scrollbarThickness(), 0); |
| + if (hasHorizontalScrollbar() && |
| + box().style()->overflowX() == EOverflow::kOverlay) |
| + visibleSize.expand(0, horizontalScrollbar()->scrollbarThickness()); |
| + |
| FrameHost* host = layoutBox()->document().frameHost(); |
| DCHECK(host); |
| TopDocumentRootScrollerController& controller = |
| @@ -1296,12 +1305,10 @@ int PaintLayerScrollableArea::verticalScrollbarWidth( |
| OverlayScrollbarClipBehavior overlayScrollbarClipBehavior) const { |
| if (!hasVerticalScrollbar()) |
| return 0; |
| - if ((verticalScrollbar()->isOverlayScrollbar() || |
| - box().style()->overflowY() == EOverflow::kOverlay) && |
| + if (verticalScrollbar()->isOverlayScrollbar() && |
| (overlayScrollbarClipBehavior == IgnoreOverlayScrollbarSize || |
| - !verticalScrollbar()->shouldParticipateInHitTesting())) { |
| + !verticalScrollbar()->shouldParticipateInHitTesting())) |
| return 0; |
| - } |
| return verticalScrollbar()->scrollbarThickness(); |
| } |
| @@ -1309,12 +1316,10 @@ int PaintLayerScrollableArea::horizontalScrollbarHeight( |
| OverlayScrollbarClipBehavior overlayScrollbarClipBehavior) const { |
| if (!hasHorizontalScrollbar()) |
| return 0; |
| - if ((horizontalScrollbar()->isOverlayScrollbar() || |
| - box().style()->overflowX() == EOverflow::kOverlay) && |
| + if (horizontalScrollbar()->isOverlayScrollbar() && |
| (overlayScrollbarClipBehavior == IgnoreOverlayScrollbarSize || |
| - !horizontalScrollbar()->shouldParticipateInHitTesting())) { |
| + !horizontalScrollbar()->shouldParticipateInHitTesting())) |
| return 0; |
| - } |
| return horizontalScrollbar()->scrollbarThickness(); |
| } |