| 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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 bool hasHorizontalBar = horizontalScrollbar(); | 307 bool hasHorizontalBar = horizontalScrollbar(); |
| 308 bool hasVerticalBar = verticalScrollbar(); | 308 bool hasVerticalBar = verticalScrollbar(); |
| 309 bool hasResizer = box().style()->resize() != RESIZE_NONE; | 309 bool hasResizer = box().style()->resize() != RESIZE_NONE; |
| 310 if ((hasHorizontalBar && hasVerticalBar) || | 310 if ((hasHorizontalBar && hasVerticalBar) || |
| 311 (hasResizer && (hasHorizontalBar || hasVerticalBar))) | 311 (hasResizer && (hasHorizontalBar || hasVerticalBar))) |
| 312 return cornerRect(box(), horizontalScrollbar(), verticalScrollbar(), | 312 return cornerRect(box(), horizontalScrollbar(), verticalScrollbar(), |
| 313 box().pixelSnappedBorderBoxRect()); | 313 box().pixelSnappedBorderBoxRect()); |
| 314 return IntRect(); | 314 return IntRect(); |
| 315 } | 315 } |
| 316 | 316 |
| 317 IntRect PaintLayerScrollableArea::convertFromScrollbarToContainingWidget( | 317 IntRect PaintLayerScrollableArea::convertFromScrollbarToContainingFrameViewBase( |
| 318 const Scrollbar& scrollbar, | 318 const Scrollbar& scrollbar, |
| 319 const IntRect& scrollbarRect) const { | 319 const IntRect& scrollbarRect) const { |
| 320 LayoutView* view = box().view(); | 320 LayoutView* view = box().view(); |
| 321 if (!view) | 321 if (!view) |
| 322 return scrollbarRect; | 322 return scrollbarRect; |
| 323 | 323 |
| 324 IntRect rect = scrollbarRect; | 324 IntRect rect = scrollbarRect; |
| 325 rect.move(scrollbarOffset(scrollbar)); | 325 rect.move(scrollbarOffset(scrollbar)); |
| 326 | 326 |
| 327 return view->frameView()->convertFromLayoutItem(LayoutBoxItem(&box()), rect); | 327 return view->frameView()->convertFromLayoutItem(LayoutBoxItem(&box()), rect); |
| 328 } | 328 } |
| 329 | 329 |
| 330 IntRect PaintLayerScrollableArea::convertFromContainingWidgetToScrollbar( | 330 IntRect PaintLayerScrollableArea::convertFromContainingFrameViewBaseToScrollbar( |
| 331 const Scrollbar& scrollbar, | 331 const Scrollbar& scrollbar, |
| 332 const IntRect& parentRect) const { | 332 const IntRect& parentRect) const { |
| 333 LayoutView* view = box().view(); | 333 LayoutView* view = box().view(); |
| 334 if (!view) | 334 if (!view) |
| 335 return parentRect; | 335 return parentRect; |
| 336 | 336 |
| 337 IntRect rect = | 337 IntRect rect = |
| 338 view->frameView()->convertToLayoutItem(LayoutBoxItem(&box()), parentRect); | 338 view->frameView()->convertToLayoutItem(LayoutBoxItem(&box()), parentRect); |
| 339 rect.move(-scrollbarOffset(scrollbar)); | 339 rect.move(-scrollbarOffset(scrollbar)); |
| 340 return rect; | 340 return rect; |
| 341 } | 341 } |
| 342 | 342 |
| 343 IntPoint PaintLayerScrollableArea::convertFromScrollbarToContainingWidget( | 343 IntPoint |
| 344 PaintLayerScrollableArea::convertFromScrollbarToContainingFrameViewBase( |
| 344 const Scrollbar& scrollbar, | 345 const Scrollbar& scrollbar, |
| 345 const IntPoint& scrollbarPoint) const { | 346 const IntPoint& scrollbarPoint) const { |
| 346 LayoutView* view = box().view(); | 347 LayoutView* view = box().view(); |
| 347 if (!view) | 348 if (!view) |
| 348 return scrollbarPoint; | 349 return scrollbarPoint; |
| 349 | 350 |
| 350 IntPoint point = scrollbarPoint; | 351 IntPoint point = scrollbarPoint; |
| 351 point.move(scrollbarOffset(scrollbar)); | 352 point.move(scrollbarOffset(scrollbar)); |
| 352 return view->frameView()->convertFromLayoutItem(LayoutBoxItem(&box()), point); | 353 return view->frameView()->convertFromLayoutItem(LayoutBoxItem(&box()), point); |
| 353 } | 354 } |
| 354 | 355 |
| 355 IntPoint PaintLayerScrollableArea::convertFromContainingWidgetToScrollbar( | 356 IntPoint |
| 357 PaintLayerScrollableArea::convertFromContainingFrameViewBaseToScrollbar( |
| 356 const Scrollbar& scrollbar, | 358 const Scrollbar& scrollbar, |
| 357 const IntPoint& parentPoint) const { | 359 const IntPoint& parentPoint) const { |
| 358 LayoutView* view = box().view(); | 360 LayoutView* view = box().view(); |
| 359 if (!view) | 361 if (!view) |
| 360 return parentPoint; | 362 return parentPoint; |
| 361 | 363 |
| 362 IntPoint point = view->frameView()->convertToLayoutItem(LayoutBoxItem(&box()), | 364 IntPoint point = view->frameView()->convertToLayoutItem(LayoutBoxItem(&box()), |
| 363 parentPoint); | 365 parentPoint); |
| 364 | 366 |
| 365 point.move(-scrollbarOffset(scrollbar)); | 367 point.move(-scrollbarOffset(scrollbar)); |
| (...skipping 1527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1893 if (!frame->settings()->getViewportEnabled()) | 1895 if (!frame->settings()->getViewportEnabled()) |
| 1894 return false; | 1896 return false; |
| 1895 | 1897 |
| 1896 const TopDocumentRootScrollerController& controller = | 1898 const TopDocumentRootScrollerController& controller = |
| 1897 layoutBox()->document().frameHost()->globalRootScrollerController(); | 1899 layoutBox()->document().frameHost()->globalRootScrollerController(); |
| 1898 | 1900 |
| 1899 return RootScrollerUtil::scrollableAreaForRootScroller( | 1901 return RootScrollerUtil::scrollableAreaForRootScroller( |
| 1900 controller.globalRootScroller()) == this; | 1902 controller.globalRootScroller()) == this; |
| 1901 } | 1903 } |
| 1902 | 1904 |
| 1903 FrameViewBase* PaintLayerScrollableArea::getWidget() { | 1905 FrameViewBase* PaintLayerScrollableArea::getFrameViewBase() { |
| 1904 return box().frame()->view(); | 1906 return box().frame()->view(); |
| 1905 } | 1907 } |
| 1906 | 1908 |
| 1907 void PaintLayerScrollableArea::resetRebuildScrollbarLayerFlags() { | 1909 void PaintLayerScrollableArea::resetRebuildScrollbarLayerFlags() { |
| 1908 m_rebuildHorizontalScrollbarLayer = false; | 1910 m_rebuildHorizontalScrollbarLayer = false; |
| 1909 m_rebuildVerticalScrollbarLayer = false; | 1911 m_rebuildVerticalScrollbarLayer = false; |
| 1910 } | 1912 } |
| 1911 | 1913 |
| 1912 CompositorAnimationHost* PaintLayerScrollableArea::compositorAnimationHost() | 1914 CompositorAnimationHost* PaintLayerScrollableArea::compositorAnimationHost() |
| 1913 const { | 1915 const { |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2130 | 2132 |
| 2131 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: | 2133 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: |
| 2132 clampScrollableAreas() { | 2134 clampScrollableAreas() { |
| 2133 for (auto& scrollableArea : *s_needsClamp) | 2135 for (auto& scrollableArea : *s_needsClamp) |
| 2134 scrollableArea->clampScrollOffsetAfterOverflowChange(); | 2136 scrollableArea->clampScrollOffsetAfterOverflowChange(); |
| 2135 delete s_needsClamp; | 2137 delete s_needsClamp; |
| 2136 s_needsClamp = nullptr; | 2138 s_needsClamp = nullptr; |
| 2137 } | 2139 } |
| 2138 | 2140 |
| 2139 } // namespace blink | 2141 } // namespace blink |
| OLD | NEW |