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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Issue 2730343003: Fix overflow:overlay scrollbar width for paint. (Closed)
Patch Set: logic fix 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * 4 *
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
6 * 6 *
7 * Other contributors: 7 * Other contributors:
8 * Robert O'Callahan <roc+@cs.cmu.edu> 8 * Robert O'Callahan <roc+@cs.cmu.edu>
9 * David Baron <dbaron@fas.harvard.edu> 9 * David Baron <dbaron@fas.harvard.edu>
10 * Christian Biesinger <cbiesinger@gmail.com> 10 * Christian Biesinger <cbiesinger@gmail.com>
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 IntSize PaintLayerScrollableArea::minimumScrollOffsetInt() const { 497 IntSize PaintLayerScrollableArea::minimumScrollOffsetInt() const {
498 return toIntSize(-scrollOrigin()); 498 return toIntSize(-scrollOrigin());
499 } 499 }
500 500
501 IntSize PaintLayerScrollableArea::maximumScrollOffsetInt() const { 501 IntSize PaintLayerScrollableArea::maximumScrollOffsetInt() const {
502 if (!box().hasOverflowClip()) 502 if (!box().hasOverflowClip())
503 return toIntSize(-scrollOrigin()); 503 return toIntSize(-scrollOrigin());
504 504
505 IntSize contentSize = contentsSize(); 505 IntSize contentSize = contentsSize();
506 IntSize visibleSize = 506 IntSize visibleSize =
507 pixelSnappedIntRect(box().overflowClipRect(box().location())).size(); 507 pixelSnappedIntRect(
508 box().overflowClipRect(box().location(),
509 IgnorePlatformAndCSSOverlayScrollbarSize))
pdr. 2017/03/08 20:33:20 Is this the only callsite using IgnorePlatformAndC
szager1 2017/03/08 20:43:09 My initial patch did something like that, but skob
510 .size();
508 511
509 FrameHost* host = layoutBox()->document().frameHost(); 512 FrameHost* host = layoutBox()->document().frameHost();
510 DCHECK(host); 513 DCHECK(host);
511 TopDocumentRootScrollerController& controller = 514 TopDocumentRootScrollerController& controller =
512 host->globalRootScrollerController(); 515 host->globalRootScrollerController();
513 516
514 // The global root scroller should be clipped by the top FrameView rather 517 // The global root scroller should be clipped by the top FrameView rather
515 // than it's overflow clipping box. This is to ensure that content exposed by 518 // than it's overflow clipping box. This is to ensure that content exposed by
516 // hiding the URL bar at the bottom of the screen is visible. 519 // hiding the URL bar at the bottom of the screen is visible.
517 if (this == controller.rootScrollerArea()) 520 if (this == controller.rootScrollerArea())
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 // Force an update since we know the scrollbars have changed things. 1292 // Force an update since we know the scrollbars have changed things.
1290 if (box().document().hasAnnotatedRegions()) 1293 if (box().document().hasAnnotatedRegions())
1291 box().document().setAnnotatedRegionsDirty(true); 1294 box().document().setAnnotatedRegionsDirty(true);
1292 return true; 1295 return true;
1293 } 1296 }
1294 1297
1295 int PaintLayerScrollableArea::verticalScrollbarWidth( 1298 int PaintLayerScrollableArea::verticalScrollbarWidth(
1296 OverlayScrollbarClipBehavior overlayScrollbarClipBehavior) const { 1299 OverlayScrollbarClipBehavior overlayScrollbarClipBehavior) const {
1297 if (!hasVerticalScrollbar()) 1300 if (!hasVerticalScrollbar())
1298 return 0; 1301 return 0;
1299 if ((verticalScrollbar()->isOverlayScrollbar() || 1302 if (overlayScrollbarClipBehavior ==
1300 box().style()->overflowY() == EOverflow::kOverlay) && 1303 IgnorePlatformAndCSSOverlayScrollbarSize &&
1301 (overlayScrollbarClipBehavior == IgnoreOverlayScrollbarSize || 1304 box().style()->overflowY() == EOverflow::kOverlay) {
1302 !verticalScrollbar()->shouldParticipateInHitTesting())) { 1305 return 0;
1306 }
1307 if ((overlayScrollbarClipBehavior == IgnorePlatformOverlayScrollbarSize ||
1308 overlayScrollbarClipBehavior ==
1309 IgnorePlatformAndCSSOverlayScrollbarSize ||
1310 !verticalScrollbar()->shouldParticipateInHitTesting()) &&
1311 verticalScrollbar()->isOverlayScrollbar()) {
1303 return 0; 1312 return 0;
1304 } 1313 }
1305 return verticalScrollbar()->scrollbarThickness(); 1314 return verticalScrollbar()->scrollbarThickness();
1306 } 1315 }
1307 1316
1308 int PaintLayerScrollableArea::horizontalScrollbarHeight( 1317 int PaintLayerScrollableArea::horizontalScrollbarHeight(
1309 OverlayScrollbarClipBehavior overlayScrollbarClipBehavior) const { 1318 OverlayScrollbarClipBehavior overlayScrollbarClipBehavior) const {
1310 if (!hasHorizontalScrollbar()) 1319 if (!hasHorizontalScrollbar())
1311 return 0; 1320 return 0;
1312 if ((horizontalScrollbar()->isOverlayScrollbar() || 1321 if (overlayScrollbarClipBehavior ==
1313 box().style()->overflowX() == EOverflow::kOverlay) && 1322 IgnorePlatformAndCSSOverlayScrollbarSize &&
1314 (overlayScrollbarClipBehavior == IgnoreOverlayScrollbarSize || 1323 box().style()->overflowX() == EOverflow::kOverlay) {
1315 !horizontalScrollbar()->shouldParticipateInHitTesting())) { 1324 return 0;
1325 }
1326 if ((overlayScrollbarClipBehavior == IgnorePlatformOverlayScrollbarSize ||
1327 overlayScrollbarClipBehavior ==
1328 IgnorePlatformAndCSSOverlayScrollbarSize ||
1329 !horizontalScrollbar()->shouldParticipateInHitTesting()) &&
1330 horizontalScrollbar()->isOverlayScrollbar()) {
1316 return 0; 1331 return 0;
1317 } 1332 }
1318 return horizontalScrollbar()->scrollbarThickness(); 1333 return horizontalScrollbar()->scrollbarThickness();
1319 } 1334 }
1320 1335
1321 void PaintLayerScrollableArea::positionOverflowControls() { 1336 void PaintLayerScrollableArea::positionOverflowControls() {
1322 if (!hasScrollbar() && !box().canResize()) 1337 if (!hasScrollbar() && !box().canResize())
1323 return; 1338 return;
1324 1339
1325 const IntRect borderBox = box().pixelSnappedBorderBoxRect(); 1340 const IntRect borderBox = box().pixelSnappedBorderBoxRect();
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after
2130 2145
2131 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: 2146 void PaintLayerScrollableArea::DelayScrollOffsetClampScope::
2132 clampScrollableAreas() { 2147 clampScrollableAreas() {
2133 for (auto& scrollableArea : *s_needsClamp) 2148 for (auto& scrollableArea : *s_needsClamp)
2134 scrollableArea->clampScrollOffsetAfterOverflowChange(); 2149 scrollableArea->clampScrollOffsetAfterOverflowChange();
2135 delete s_needsClamp; 2150 delete s_needsClamp;
2136 s_needsClamp = nullptr; 2151 s_needsClamp = nullptr;
2137 } 2152 }
2138 2153
2139 } // namespace blink 2154 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698