| 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 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1101 IntRect resizeControlRect; | 1101 IntRect resizeControlRect; |
| 1102 if (box().style()->resize() != RESIZE_NONE) { | 1102 if (box().style()->resize() != RESIZE_NONE) { |
| 1103 resizeControlRect = resizerCornerRect(box().pixelSnappedBorderBoxRect(),
ResizerForPointer); | 1103 resizeControlRect = resizerCornerRect(box().pixelSnappedBorderBoxRect(),
ResizerForPointer); |
| 1104 if (resizeControlRect.contains(localPoint)) | 1104 if (resizeControlRect.contains(localPoint)) |
| 1105 return true; | 1105 return true; |
| 1106 } | 1106 } |
| 1107 | 1107 |
| 1108 int resizeControlSize = max(resizeControlRect.height(), 0); | 1108 int resizeControlSize = max(resizeControlRect.height(), 0); |
| 1109 if (hasVerticalScrollbar() && verticalScrollbar()->shouldParticipateInHitTes
ting()) { | 1109 if (hasVerticalScrollbar() && verticalScrollbar()->shouldParticipateInHitTes
ting()) { |
| 1110 LayoutRect vBarRect(verticalScrollbarStart(0, box().size().width()), | 1110 LayoutRect vBarRect(verticalScrollbarStart(0, box().size().width()), |
| 1111 box().borderTop(), | 1111 LayoutUnit(box().borderTop()), |
| 1112 verticalScrollbar()->width(), | 1112 verticalScrollbar()->width(), |
| 1113 box().size().height() - (box().borderTop() + box().borderBottom()) -
(hasHorizontalScrollbar() ? horizontalScrollbar()->height() : resizeControlSize
)); | 1113 box().size().height() - (box().borderTop() + box().borderBottom()) -
(hasHorizontalScrollbar() ? horizontalScrollbar()->height() : resizeControlSize
)); |
| 1114 if (vBarRect.contains(localPoint)) { | 1114 if (vBarRect.contains(localPoint)) { |
| 1115 result.setScrollbar(verticalScrollbar()); | 1115 result.setScrollbar(verticalScrollbar()); |
| 1116 return true; | 1116 return true; |
| 1117 } | 1117 } |
| 1118 } | 1118 } |
| 1119 | 1119 |
| 1120 resizeControlSize = max(resizeControlRect.width(), 0); | 1120 resizeControlSize = max(resizeControlRect.width(), 0); |
| 1121 if (hasHorizontalScrollbar() && horizontalScrollbar()->shouldParticipateInHi
tTesting()) { | 1121 if (hasHorizontalScrollbar() && horizontalScrollbar()->shouldParticipateInHi
tTesting()) { |
| 1122 LayoutRect hBarRect(horizontalScrollbarStart(0), | 1122 LayoutRect hBarRect(horizontalScrollbarStart(LayoutUnit()), |
| 1123 box().size().height() - box().borderBottom() - horizontalScrollbar()
->height(), | 1123 box().size().height() - box().borderBottom() - horizontalScrollbar()
->height(), |
| 1124 box().size().width() - (box().borderLeft() + box().borderRight()) -
(hasVerticalScrollbar() ? verticalScrollbar()->width() : resizeControlSize), | 1124 box().size().width() - (box().borderLeft() + box().borderRight()) -
(hasVerticalScrollbar() ? verticalScrollbar()->width() : resizeControlSize), |
| 1125 horizontalScrollbar()->height()); | 1125 horizontalScrollbar()->height()); |
| 1126 if (hBarRect.contains(localPoint)) { | 1126 if (hBarRect.contains(localPoint)) { |
| 1127 result.setScrollbar(horizontalScrollbar()); | 1127 result.setScrollbar(horizontalScrollbar()); |
| 1128 return true; | 1128 return true; |
| 1129 } | 1129 } |
| 1130 } | 1130 } |
| 1131 | 1131 |
| 1132 // FIXME: We should hit test the m_scrollCorner and pass it back through the
result. | 1132 // FIXME: We should hit test the m_scrollCorner and pass it back through the
result. |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1309 | 1309 |
| 1310 document.updateLayout(); | 1310 document.updateLayout(); |
| 1311 | 1311 |
| 1312 // FIXME (Radar 4118564): We should also autoscroll the window as necessary
to keep the point under the cursor in view. | 1312 // FIXME (Radar 4118564): We should also autoscroll the window as necessary
to keep the point under the cursor in view. |
| 1313 } | 1313 } |
| 1314 | 1314 |
| 1315 LayoutRect PaintLayerScrollableArea::scrollIntoView(const LayoutRect& rect, cons
t ScrollAlignment& alignX, const ScrollAlignment& alignY, ScrollType scrollType) | 1315 LayoutRect PaintLayerScrollableArea::scrollIntoView(const LayoutRect& rect, cons
t ScrollAlignment& alignX, const ScrollAlignment& alignY, ScrollType scrollType) |
| 1316 { | 1316 { |
| 1317 LayoutRect localExposeRect(box().absoluteToLocalQuad(FloatQuad(FloatRect(rec
t)), UseTransforms).boundingBox()); | 1317 LayoutRect localExposeRect(box().absoluteToLocalQuad(FloatQuad(FloatRect(rec
t)), UseTransforms).boundingBox()); |
| 1318 localExposeRect.move(-box().borderLeft(), -box().borderTop()); | 1318 localExposeRect.move(-box().borderLeft(), -box().borderTop()); |
| 1319 LayoutRect layerBounds(0, 0, box().clientWidth(), box().clientHeight()); | 1319 LayoutRect layerBounds(LayoutPoint(), LayoutSize(box().clientWidth(), box().
clientHeight())); |
| 1320 LayoutRect r = ScrollAlignment::getRectToExpose(layerBounds, localExposeRect
, alignX, alignY); | 1320 LayoutRect r = ScrollAlignment::getRectToExpose(layerBounds, localExposeRect
, alignX, alignY); |
| 1321 | 1321 |
| 1322 DoublePoint clampedScrollPosition = clampScrollPosition(scrollPositionDouble
() + roundedIntSize(r.location())); | 1322 DoublePoint clampedScrollPosition = clampScrollPosition(scrollPositionDouble
() + roundedIntSize(r.location())); |
| 1323 if (clampedScrollPosition == scrollPositionDouble()) | 1323 if (clampedScrollPosition == scrollPositionDouble()) |
| 1324 return rect; | 1324 return rect; |
| 1325 | 1325 |
| 1326 DoubleSize oldScrollOffset = adjustedScrollOffset(); | 1326 DoubleSize oldScrollOffset = adjustedScrollOffset(); |
| 1327 scrollToPosition(clampedScrollPosition, ScrollOffsetUnclamped, ScrollBehavio
rInstant, scrollType); | 1327 scrollToPosition(clampedScrollPosition, ScrollOffsetUnclamped, ScrollBehavio
rInstant, scrollType); |
| 1328 DoubleSize scrollOffsetDifference = adjustedScrollOffset() - oldScrollOffset
; | 1328 DoubleSize scrollOffsetDifference = adjustedScrollOffset() - oldScrollOffset
; |
| 1329 localExposeRect.move(-LayoutSize(scrollOffsetDifference)); | 1329 localExposeRect.move(-LayoutSize(scrollOffsetDifference)); |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1545 } | 1545 } |
| 1546 | 1546 |
| 1547 DEFINE_TRACE(PaintLayerScrollableArea::ScrollbarManager) | 1547 DEFINE_TRACE(PaintLayerScrollableArea::ScrollbarManager) |
| 1548 { | 1548 { |
| 1549 visitor->trace(m_scrollableArea); | 1549 visitor->trace(m_scrollableArea); |
| 1550 visitor->trace(m_hBar); | 1550 visitor->trace(m_hBar); |
| 1551 visitor->trace(m_vBar); | 1551 visitor->trace(m_vBar); |
| 1552 } | 1552 } |
| 1553 | 1553 |
| 1554 } // namespace blink | 1554 } // namespace blink |
| OLD | NEW |