| OLD | NEW |
| 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 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 IntSize PaintLayerScrollableArea::minimumScrollOffsetInt() const { | 499 IntSize PaintLayerScrollableArea::minimumScrollOffsetInt() const { |
| 500 return toIntSize(-scrollOrigin()); | 500 return toIntSize(-scrollOrigin()); |
| 501 } | 501 } |
| 502 | 502 |
| 503 IntSize PaintLayerScrollableArea::maximumScrollOffsetInt() const { | 503 IntSize PaintLayerScrollableArea::maximumScrollOffsetInt() const { |
| 504 if (!box().hasOverflowClip()) | 504 if (!box().hasOverflowClip()) |
| 505 return toIntSize(-scrollOrigin()); | 505 return toIntSize(-scrollOrigin()); |
| 506 | 506 |
| 507 IntSize contentSize = contentsSize(); | 507 IntSize contentSize = contentsSize(); |
| 508 IntSize visibleSize = | 508 IntSize visibleSize = |
| 509 pixelSnappedIntRect( | 509 pixelSnappedIntRect(box().overflowClipRect(box().location())).size(); |
| 510 box().overflowClipRect(box().location(), | |
| 511 IgnorePlatformAndCSSOverlayScrollbarSize)) | |
| 512 .size(); | |
| 513 | 510 |
| 514 Page* page = layoutBox()->document().page(); | 511 Page* page = layoutBox()->document().page(); |
| 515 DCHECK(page); | 512 DCHECK(page); |
| 516 TopDocumentRootScrollerController& controller = | 513 TopDocumentRootScrollerController& controller = |
| 517 page->globalRootScrollerController(); | 514 page->globalRootScrollerController(); |
| 518 | 515 |
| 519 // The global root scroller should be clipped by the top FrameView rather | 516 // The global root scroller should be clipped by the top FrameView rather |
| 520 // than it's overflow clipping box. This is to ensure that content exposed by | 517 // than it's overflow clipping box. This is to ensure that content exposed by |
| 521 // hiding the URL bar at the bottom of the screen is visible. | 518 // hiding the URL bar at the bottom of the screen is visible. |
| 522 if (this == controller.rootScrollerArea()) | 519 if (this == controller.rootScrollerArea()) |
| (...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1296 // Force an update since we know the scrollbars have changed things. | 1293 // Force an update since we know the scrollbars have changed things. |
| 1297 if (box().document().hasAnnotatedRegions()) | 1294 if (box().document().hasAnnotatedRegions()) |
| 1298 box().document().setAnnotatedRegionsDirty(true); | 1295 box().document().setAnnotatedRegionsDirty(true); |
| 1299 return true; | 1296 return true; |
| 1300 } | 1297 } |
| 1301 | 1298 |
| 1302 int PaintLayerScrollableArea::verticalScrollbarWidth( | 1299 int PaintLayerScrollableArea::verticalScrollbarWidth( |
| 1303 OverlayScrollbarClipBehavior overlayScrollbarClipBehavior) const { | 1300 OverlayScrollbarClipBehavior overlayScrollbarClipBehavior) const { |
| 1304 if (!hasVerticalScrollbar()) | 1301 if (!hasVerticalScrollbar()) |
| 1305 return 0; | 1302 return 0; |
| 1306 if (overlayScrollbarClipBehavior == | 1303 if ((verticalScrollbar()->isOverlayScrollbar() || |
| 1307 IgnorePlatformAndCSSOverlayScrollbarSize && | 1304 box().style()->overflowY() == EOverflow::kOverlay) && |
| 1308 box().style()->overflowY() == EOverflow::kOverlay) { | 1305 (overlayScrollbarClipBehavior == IgnoreOverlayScrollbarSize || |
| 1309 return 0; | 1306 !verticalScrollbar()->shouldParticipateInHitTesting())) { |
| 1310 } | |
| 1311 if ((overlayScrollbarClipBehavior == IgnorePlatformOverlayScrollbarSize || | |
| 1312 overlayScrollbarClipBehavior == | |
| 1313 IgnorePlatformAndCSSOverlayScrollbarSize || | |
| 1314 !verticalScrollbar()->shouldParticipateInHitTesting()) && | |
| 1315 verticalScrollbar()->isOverlayScrollbar()) { | |
| 1316 return 0; | 1307 return 0; |
| 1317 } | 1308 } |
| 1318 return verticalScrollbar()->scrollbarThickness(); | 1309 return verticalScrollbar()->scrollbarThickness(); |
| 1319 } | 1310 } |
| 1320 | 1311 |
| 1321 int PaintLayerScrollableArea::horizontalScrollbarHeight( | 1312 int PaintLayerScrollableArea::horizontalScrollbarHeight( |
| 1322 OverlayScrollbarClipBehavior overlayScrollbarClipBehavior) const { | 1313 OverlayScrollbarClipBehavior overlayScrollbarClipBehavior) const { |
| 1323 if (!hasHorizontalScrollbar()) | 1314 if (!hasHorizontalScrollbar()) |
| 1324 return 0; | 1315 return 0; |
| 1325 if (overlayScrollbarClipBehavior == | 1316 if ((horizontalScrollbar()->isOverlayScrollbar() || |
| 1326 IgnorePlatformAndCSSOverlayScrollbarSize && | 1317 box().style()->overflowX() == EOverflow::kOverlay) && |
| 1327 box().style()->overflowX() == EOverflow::kOverlay) { | 1318 (overlayScrollbarClipBehavior == IgnoreOverlayScrollbarSize || |
| 1328 return 0; | 1319 !horizontalScrollbar()->shouldParticipateInHitTesting())) { |
| 1329 } | |
| 1330 if ((overlayScrollbarClipBehavior == IgnorePlatformOverlayScrollbarSize || | |
| 1331 overlayScrollbarClipBehavior == | |
| 1332 IgnorePlatformAndCSSOverlayScrollbarSize || | |
| 1333 !horizontalScrollbar()->shouldParticipateInHitTesting()) && | |
| 1334 horizontalScrollbar()->isOverlayScrollbar()) { | |
| 1335 return 0; | 1320 return 0; |
| 1336 } | 1321 } |
| 1337 return horizontalScrollbar()->scrollbarThickness(); | 1322 return horizontalScrollbar()->scrollbarThickness(); |
| 1338 } | 1323 } |
| 1339 | 1324 |
| 1340 void PaintLayerScrollableArea::positionOverflowControls() { | 1325 void PaintLayerScrollableArea::positionOverflowControls() { |
| 1341 if (!hasScrollbar() && !box().canResize()) | 1326 if (!hasScrollbar() && !box().canResize()) |
| 1342 return; | 1327 return; |
| 1343 | 1328 |
| 1344 const IntRect borderBox = box().pixelSnappedBorderBoxRect(); | 1329 const IntRect borderBox = box().pixelSnappedBorderBoxRect(); |
| (...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2149 | 2134 |
| 2150 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: | 2135 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: |
| 2151 clampScrollableAreas() { | 2136 clampScrollableAreas() { |
| 2152 for (auto& scrollableArea : *s_needsClamp) | 2137 for (auto& scrollableArea : *s_needsClamp) |
| 2153 scrollableArea->clampScrollOffsetAfterOverflowChange(); | 2138 scrollableArea->clampScrollOffsetAfterOverflowChange(); |
| 2154 delete s_needsClamp; | 2139 delete s_needsClamp; |
| 2155 s_needsClamp = nullptr; | 2140 s_needsClamp = nullptr; |
| 2156 } | 2141 } |
| 2157 | 2142 |
| 2158 } // namespace blink | 2143 } // namespace blink |
| OLD | NEW |