Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(635)

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Issue 2730343003: Fix overflow:overlay scrollbar width for paint. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();
}
« no previous file with comments | « third_party/WebKit/LayoutTests/virtual/prefer_compositing_to_lcd_text/compositing/overflow/overflow-overlay-with-touch-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698