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