| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. |
| 3 * | 3 * |
| 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 5 * | 5 * |
| 6 * Other contributors: | 6 * Other contributors: |
| 7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
| 9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
| 10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 // (a) A resizer is present and at least one scrollbar is present | 263 // (a) A resizer is present and at least one scrollbar is present |
| 264 // (b) Both scrollbars are present. | 264 // (b) Both scrollbars are present. |
| 265 bool hasHorizontalBar = horizontalScrollbar(); | 265 bool hasHorizontalBar = horizontalScrollbar(); |
| 266 bool hasVerticalBar = verticalScrollbar(); | 266 bool hasVerticalBar = verticalScrollbar(); |
| 267 bool hasResizer = box().style()->resize() != RESIZE_NONE; | 267 bool hasResizer = box().style()->resize() != RESIZE_NONE; |
| 268 if ((hasHorizontalBar && hasVerticalBar) || (hasResizer && (hasHorizontalBar
|| hasVerticalBar))) | 268 if ((hasHorizontalBar && hasVerticalBar) || (hasResizer && (hasHorizontalBar
|| hasVerticalBar))) |
| 269 return cornerRect(box(), horizontalScrollbar(), verticalScrollbar(), box
().pixelSnappedBorderBoxRect()); | 269 return cornerRect(box(), horizontalScrollbar(), verticalScrollbar(), box
().pixelSnappedBorderBoxRect()); |
| 270 return IntRect(); | 270 return IntRect(); |
| 271 } | 271 } |
| 272 | 272 |
| 273 IntRect PaintLayerScrollableArea::convertFromScrollbarToContainingView(const Scr
ollbar* scrollbar, const IntRect& scrollbarRect) const | 273 IntRect PaintLayerScrollableArea::convertFromScrollbarToContainingWidget(const S
crollbar* scrollbar, const IntRect& scrollbarRect) const |
| 274 { | 274 { |
| 275 LayoutView* view = box().view(); | 275 LayoutView* view = box().view(); |
| 276 if (!view) | 276 if (!view) |
| 277 return scrollbarRect; | 277 return scrollbarRect; |
| 278 | 278 |
| 279 IntRect rect = scrollbarRect; | 279 IntRect rect = scrollbarRect; |
| 280 rect.move(scrollbarOffset(scrollbar)); | 280 rect.move(scrollbarOffset(scrollbar)); |
| 281 | 281 |
| 282 return view->frameView()->convertFromLayoutObject(box(), rect); | 282 return view->frameView()->convertFromLayoutObject(box(), rect); |
| 283 } | 283 } |
| 284 | 284 |
| 285 IntRect PaintLayerScrollableArea::convertFromContainingViewToScrollbar(const Scr
ollbar* scrollbar, const IntRect& parentRect) const | 285 IntRect PaintLayerScrollableArea::convertFromContainingWidgetToScrollbar(const S
crollbar* scrollbar, const IntRect& parentRect) const |
| 286 { | 286 { |
| 287 LayoutView* view = box().view(); | 287 LayoutView* view = box().view(); |
| 288 if (!view) | 288 if (!view) |
| 289 return parentRect; | 289 return parentRect; |
| 290 | 290 |
| 291 IntRect rect = view->frameView()->convertToLayoutObject(box(), parentRect); | 291 IntRect rect = view->frameView()->convertToLayoutObject(box(), parentRect); |
| 292 rect.move(-scrollbarOffset(scrollbar)); | 292 rect.move(-scrollbarOffset(scrollbar)); |
| 293 return rect; | 293 return rect; |
| 294 } | 294 } |
| 295 | 295 |
| 296 IntPoint PaintLayerScrollableArea::convertFromScrollbarToContainingView(const Sc
rollbar* scrollbar, const IntPoint& scrollbarPoint) const | 296 IntPoint PaintLayerScrollableArea::convertFromScrollbarToContainingWidget(const
Scrollbar* scrollbar, const IntPoint& scrollbarPoint) const |
| 297 { | 297 { |
| 298 LayoutView* view = box().view(); | 298 LayoutView* view = box().view(); |
| 299 if (!view) | 299 if (!view) |
| 300 return scrollbarPoint; | 300 return scrollbarPoint; |
| 301 | 301 |
| 302 IntPoint point = scrollbarPoint; | 302 IntPoint point = scrollbarPoint; |
| 303 point.move(scrollbarOffset(scrollbar)); | 303 point.move(scrollbarOffset(scrollbar)); |
| 304 return view->frameView()->convertFromLayoutObject(box(), point); | 304 return view->frameView()->convertFromLayoutObject(box(), point); |
| 305 } | 305 } |
| 306 | 306 |
| 307 IntPoint PaintLayerScrollableArea::convertFromContainingViewToScrollbar(const Sc
rollbar* scrollbar, const IntPoint& parentPoint) const | 307 IntPoint PaintLayerScrollableArea::convertFromContainingWidgetToScrollbar(const
Scrollbar* scrollbar, const IntPoint& parentPoint) const |
| 308 { | 308 { |
| 309 LayoutView* view = box().view(); | 309 LayoutView* view = box().view(); |
| 310 if (!view) | 310 if (!view) |
| 311 return parentPoint; | 311 return parentPoint; |
| 312 | 312 |
| 313 IntPoint point = view->frameView()->convertToLayoutObject(box(), parentPoint
); | 313 IntPoint point = view->frameView()->convertToLayoutObject(box(), parentPoint
); |
| 314 | 314 |
| 315 point.move(-scrollbarOffset(scrollbar)); | 315 point.move(-scrollbarOffset(scrollbar)); |
| 316 return point; | 316 return point; |
| 317 } | 317 } |
| (...skipping 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1518 } | 1518 } |
| 1519 | 1519 |
| 1520 DEFINE_TRACE(PaintLayerScrollableArea::ScrollbarManager) | 1520 DEFINE_TRACE(PaintLayerScrollableArea::ScrollbarManager) |
| 1521 { | 1521 { |
| 1522 visitor->trace(m_scrollableArea); | 1522 visitor->trace(m_scrollableArea); |
| 1523 visitor->trace(m_hBar); | 1523 visitor->trace(m_hBar); |
| 1524 visitor->trace(m_vBar); | 1524 visitor->trace(m_vBar); |
| 1525 } | 1525 } |
| 1526 | 1526 |
| 1527 } // namespace blink | 1527 } // namespace blink |
| OLD | NEW |