| 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 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 void DeprecatedPaintLayerScrollableArea::computeScrollDimensions() | 631 void DeprecatedPaintLayerScrollableArea::computeScrollDimensions() |
| 632 { | 632 { |
| 633 m_overflowRect = box().layoutOverflowRect(); | 633 m_overflowRect = box().layoutOverflowRect(); |
| 634 box().flipForWritingMode(m_overflowRect); | 634 box().flipForWritingMode(m_overflowRect); |
| 635 | 635 |
| 636 int scrollableLeftOverflow = m_overflowRect.x() - box().borderLeft() - (box(
).style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft() ? box().verticalScr
ollbarWidth() : 0); | 636 int scrollableLeftOverflow = m_overflowRect.x() - box().borderLeft() - (box(
).style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft() ? box().verticalScr
ollbarWidth() : 0); |
| 637 int scrollableTopOverflow = m_overflowRect.y() - box().borderTop(); | 637 int scrollableTopOverflow = m_overflowRect.y() - box().borderTop(); |
| 638 setScrollOrigin(IntPoint(-scrollableLeftOverflow, -scrollableTopOverflow)); | 638 setScrollOrigin(IntPoint(-scrollableLeftOverflow, -scrollableTopOverflow)); |
| 639 } | 639 } |
| 640 | 640 |
| 641 void DeprecatedPaintLayerScrollableArea::scrollToPosition(const DoublePoint& scr
ollPosition, ScrollOffsetClamping clamp, ScrollBehavior scrollBehavior) | 641 void DeprecatedPaintLayerScrollableArea::scrollToPosition(const DoublePoint& scr
ollPosition, ScrollOffsetClamping clamp, ScrollBehavior scrollBehavior, ScrollTy
pe scrollType) |
| 642 { | 642 { |
| 643 cancelProgrammaticScrollAnimation(); | 643 cancelProgrammaticScrollAnimation(); |
| 644 | 644 |
| 645 DoublePoint newScrollPosition = clamp == ScrollOffsetClamped ? clampScrollPo
sition(scrollPosition) : scrollPosition; | 645 DoublePoint newScrollPosition = clamp == ScrollOffsetClamped ? clampScrollPo
sition(scrollPosition) : scrollPosition; |
| 646 if (newScrollPosition != scrollPositionDouble()) | 646 if (newScrollPosition != scrollPositionDouble()) |
| 647 ScrollableArea::setScrollPosition(newScrollPosition, ProgrammaticScroll,
scrollBehavior); | 647 ScrollableArea::setScrollPosition(newScrollPosition, scrollType, scrollB
ehavior); |
| 648 } | 648 } |
| 649 | 649 |
| 650 void DeprecatedPaintLayerScrollableArea::updateScrollDimensions(DoubleSize& scro
llOffset, bool& autoHorizontalScrollBarChanged, bool& autoVerticalScrollBarChang
ed) | 650 void DeprecatedPaintLayerScrollableArea::updateScrollDimensions(DoubleSize& scro
llOffset, bool& autoHorizontalScrollBarChanged, bool& autoVerticalScrollBarChang
ed) |
| 651 { | 651 { |
| 652 ASSERT(box().hasOverflowClip()); | 652 ASSERT(box().hasOverflowClip()); |
| 653 | 653 |
| 654 if (needsScrollbarReconstruction()) { | 654 if (needsScrollbarReconstruction()) { |
| 655 m_scrollbarManager.setCanDetachScrollbars(false); | 655 m_scrollbarManager.setCanDetachScrollbars(false); |
| 656 setHasHorizontalScrollbar(false); | 656 setHasHorizontalScrollbar(false); |
| 657 setHasVerticalScrollbar(false); | 657 setHasVerticalScrollbar(false); |
| (...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1344 LayoutUnit baseHeight = box().size().height() - (isBoxSizingBorder ? Lay
outUnit() : box().borderAndPaddingHeight()); | 1344 LayoutUnit baseHeight = box().size().height() - (isBoxSizingBorder ? Lay
outUnit() : box().borderAndPaddingHeight()); |
| 1345 baseHeight = baseHeight / zoomFactor; | 1345 baseHeight = baseHeight / zoomFactor; |
| 1346 element->setInlineStyleProperty(CSSPropertyHeight, roundToInt(baseHeight
+ difference.height()), CSSPrimitiveValue::UnitType::Pixels); | 1346 element->setInlineStyleProperty(CSSPropertyHeight, roundToInt(baseHeight
+ difference.height()), CSSPrimitiveValue::UnitType::Pixels); |
| 1347 } | 1347 } |
| 1348 | 1348 |
| 1349 document.updateLayout(); | 1349 document.updateLayout(); |
| 1350 | 1350 |
| 1351 // FIXME (Radar 4118564): We should also autoscroll the window as necessary
to keep the point under the cursor in view. | 1351 // FIXME (Radar 4118564): We should also autoscroll the window as necessary
to keep the point under the cursor in view. |
| 1352 } | 1352 } |
| 1353 | 1353 |
| 1354 LayoutRect DeprecatedPaintLayerScrollableArea::scrollIntoView(const LayoutRect&
rect, const ScrollAlignment& alignX, const ScrollAlignment& alignY) | 1354 LayoutRect DeprecatedPaintLayerScrollableArea::scrollIntoView(const LayoutRect&
rect, const ScrollAlignment& alignX, const ScrollAlignment& alignY, ScrollType s
crollType) |
| 1355 { | 1355 { |
| 1356 LayoutRect localExposeRect(box().absoluteToLocalQuad(FloatQuad(FloatRect(rec
t)), UseTransforms).boundingBox()); | 1356 LayoutRect localExposeRect(box().absoluteToLocalQuad(FloatQuad(FloatRect(rec
t)), UseTransforms).boundingBox()); |
| 1357 localExposeRect.move(-box().borderLeft(), -box().borderTop()); | 1357 localExposeRect.move(-box().borderLeft(), -box().borderTop()); |
| 1358 LayoutRect layerBounds(0, 0, box().clientWidth(), box().clientHeight()); | 1358 LayoutRect layerBounds(0, 0, box().clientWidth(), box().clientHeight()); |
| 1359 LayoutRect r = ScrollAlignment::getRectToExpose(layerBounds, localExposeRect
, alignX, alignY); | 1359 LayoutRect r = ScrollAlignment::getRectToExpose(layerBounds, localExposeRect
, alignX, alignY); |
| 1360 | 1360 |
| 1361 DoublePoint clampedScrollPosition = clampScrollPosition(scrollPositionDouble
() + roundedIntSize(r.location())); | 1361 DoublePoint clampedScrollPosition = clampScrollPosition(scrollPositionDouble
() + roundedIntSize(r.location())); |
| 1362 if (clampedScrollPosition == scrollPositionDouble()) | 1362 if (clampedScrollPosition == scrollPositionDouble()) |
| 1363 return rect; | 1363 return rect; |
| 1364 | 1364 |
| 1365 DoubleSize oldScrollOffset = adjustedScrollOffset(); | 1365 DoubleSize oldScrollOffset = adjustedScrollOffset(); |
| 1366 scrollToPosition(clampedScrollPosition); | 1366 scrollToPosition(clampedScrollPosition, ScrollOffsetUnclamped, ScrollBehavio
rInstant, scrollType); |
| 1367 DoubleSize scrollOffsetDifference = adjustedScrollOffset() - oldScrollOffset
; | 1367 DoubleSize scrollOffsetDifference = adjustedScrollOffset() - oldScrollOffset
; |
| 1368 localExposeRect.move(-LayoutSize(scrollOffsetDifference)); | 1368 localExposeRect.move(-LayoutSize(scrollOffsetDifference)); |
| 1369 return LayoutRect(box().localToAbsoluteQuad(FloatQuad(FloatRect(localExposeR
ect)), UseTransforms).boundingBox()); | 1369 return LayoutRect(box().localToAbsoluteQuad(FloatQuad(FloatRect(localExposeR
ect)), UseTransforms).boundingBox()); |
| 1370 } | 1370 } |
| 1371 | 1371 |
| 1372 void DeprecatedPaintLayerScrollableArea::updateScrollableAreaSet(bool hasOverflo
w) | 1372 void DeprecatedPaintLayerScrollableArea::updateScrollableAreaSet(bool hasOverflo
w) |
| 1373 { | 1373 { |
| 1374 LocalFrame* frame = box().frame(); | 1374 LocalFrame* frame = box().frame(); |
| 1375 if (!frame) | 1375 if (!frame) |
| 1376 return; | 1376 return; |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1562 } | 1562 } |
| 1563 | 1563 |
| 1564 DEFINE_TRACE(DeprecatedPaintLayerScrollableArea::ScrollbarManager) | 1564 DEFINE_TRACE(DeprecatedPaintLayerScrollableArea::ScrollbarManager) |
| 1565 { | 1565 { |
| 1566 visitor->trace(m_scrollableArea); | 1566 visitor->trace(m_scrollableArea); |
| 1567 visitor->trace(m_hBar); | 1567 visitor->trace(m_hBar); |
| 1568 visitor->trace(m_vBar); | 1568 visitor->trace(m_vBar); |
| 1569 } | 1569 } |
| 1570 | 1570 |
| 1571 } // namespace blink | 1571 } // namespace blink |
| OLD | NEW |