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

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

Issue 2730343003: Fix overflow:overlay scrollbar width for paint. (Closed)
Patch Set: Add OverlayScrollbarClipBehavior value 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))
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 (box().style()->overflowY() == EOverflow::kOverlay &&
1300 box().style()->overflowY() == EOverflow::kOverlay) && 1303 overlayScrollbarClipBehavior ==
1301 (overlayScrollbarClipBehavior == IgnoreOverlayScrollbarSize || 1304 IgnorePlatformAndCSSOverlayScrollbarSize) {
1305 return 0;
1306 }
1307 if (verticalScrollbar()->isOverlayScrollbar() &&
1308 (overlayScrollbarClipBehavior == IgnorePlatformOverlayScrollbarSize ||
skobes 2017/03/07 19:28:07 Don't you need to check for IgnorePlatformAndCSSOv
szager1 2017/03/07 19:44:38 Whoops! Fixed.
1302 !verticalScrollbar()->shouldParticipateInHitTesting())) { 1309 !verticalScrollbar()->shouldParticipateInHitTesting())) {
1303 return 0; 1310 return 0;
1304 } 1311 }
1305 return verticalScrollbar()->scrollbarThickness(); 1312 return verticalScrollbar()->scrollbarThickness();
1306 } 1313 }
1307 1314
1308 int PaintLayerScrollableArea::horizontalScrollbarHeight( 1315 int PaintLayerScrollableArea::horizontalScrollbarHeight(
1309 OverlayScrollbarClipBehavior overlayScrollbarClipBehavior) const { 1316 OverlayScrollbarClipBehavior overlayScrollbarClipBehavior) const {
1310 if (!hasHorizontalScrollbar()) 1317 if (!hasHorizontalScrollbar())
1311 return 0; 1318 return 0;
1312 if ((horizontalScrollbar()->isOverlayScrollbar() || 1319 if (overlayScrollbarClipBehavior ==
1313 box().style()->overflowX() == EOverflow::kOverlay) && 1320 IgnorePlatformAndCSSOverlayScrollbarSize &&
1314 (overlayScrollbarClipBehavior == IgnoreOverlayScrollbarSize || 1321 box().style()->overflowX() == EOverflow::kOverlay) {
1322 return 0;
1323 }
1324 if (horizontalScrollbar()->isOverlayScrollbar() &&
1325 (overlayScrollbarClipBehavior == IgnorePlatformOverlayScrollbarSize ||
1315 !horizontalScrollbar()->shouldParticipateInHitTesting())) { 1326 !horizontalScrollbar()->shouldParticipateInHitTesting())) {
1316 return 0; 1327 return 0;
1317 } 1328 }
1318 return horizontalScrollbar()->scrollbarThickness(); 1329 return horizontalScrollbar()->scrollbarThickness();
1319 } 1330 }
1320 1331
1321 void PaintLayerScrollableArea::positionOverflowControls() { 1332 void PaintLayerScrollableArea::positionOverflowControls() {
1322 if (!hasScrollbar() && !box().canResize()) 1333 if (!hasScrollbar() && !box().canResize())
1323 return; 1334 return;
1324 1335
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after
2130 2141
2131 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: 2142 void PaintLayerScrollableArea::DelayScrollOffsetClampScope::
2132 clampScrollableAreas() { 2143 clampScrollableAreas() {
2133 for (auto& scrollableArea : *s_needsClamp) 2144 for (auto& scrollableArea : *s_needsClamp)
2134 scrollableArea->clampScrollOffsetAfterOverflowChange(); 2145 scrollableArea->clampScrollOffsetAfterOverflowChange();
2135 delete s_needsClamp; 2146 delete s_needsClamp;
2136 s_needsClamp = nullptr; 2147 s_needsClamp = nullptr;
2137 } 2148 }
2138 2149
2139 } // namespace blink 2150 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698