| 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@gmail.com> | 9 * Christian Biesinger <cbiesinger@gmail.com> |
| 10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 | 600 |
| 601 void PaintLayerScrollableArea::scrollToPosition(const DoublePoint& scrollPositio
n, ScrollOffsetClamping clamp, ScrollBehavior scrollBehavior, ScrollType scrollT
ype) | 601 void PaintLayerScrollableArea::scrollToPosition(const DoublePoint& scrollPositio
n, ScrollOffsetClamping clamp, ScrollBehavior scrollBehavior, ScrollType scrollT
ype) |
| 602 { | 602 { |
| 603 cancelProgrammaticScrollAnimation(); | 603 cancelProgrammaticScrollAnimation(); |
| 604 | 604 |
| 605 DoublePoint newScrollPosition = clamp == ScrollOffsetClamped ? clampScrollPo
sition(scrollPosition) : scrollPosition; | 605 DoublePoint newScrollPosition = clamp == ScrollOffsetClamped ? clampScrollPo
sition(scrollPosition) : scrollPosition; |
| 606 if (newScrollPosition != scrollPositionDouble()) | 606 if (newScrollPosition != scrollPositionDouble()) |
| 607 ScrollableArea::setScrollPosition(newScrollPosition, scrollType, scrollB
ehavior); | 607 ScrollableArea::setScrollPosition(newScrollPosition, scrollType, scrollB
ehavior); |
| 608 } | 608 } |
| 609 | 609 |
| 610 bool PaintLayerScrollableArea::updateAfterLayout(SubtreeLayoutScope* delayedLayo
utScope) | 610 void PaintLayerScrollableArea::updateAfterLayout() |
| 611 { | 611 { |
| 612 ASSERT(box().hasOverflowClip()); | 612 ASSERT(box().hasOverflowClip()); |
| 613 | 613 |
| 614 bool didMarkForDelayedLayout = false; | |
| 615 | |
| 616 if (needsScrollbarReconstruction()) { | 614 if (needsScrollbarReconstruction()) { |
| 617 m_scrollbarManager.setCanDetachScrollbars(false); | 615 m_scrollbarManager.setCanDetachScrollbars(false); |
| 618 setHasHorizontalScrollbar(false); | 616 setHasHorizontalScrollbar(false); |
| 619 setHasVerticalScrollbar(false); | 617 setHasVerticalScrollbar(false); |
| 620 } | 618 } |
| 621 | 619 |
| 622 m_scrollbarManager.setCanDetachScrollbars(true); | 620 m_scrollbarManager.setCanDetachScrollbars(true); |
| 623 | 621 |
| 624 DoubleSize originalScrollOffset = adjustedScrollOffset(); | 622 DoubleSize originalScrollOffset = adjustedScrollOffset(); |
| 625 computeScrollDimensions(); | 623 computeScrollDimensions(); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 layer()->updateSelfPaintingLayer(); | 671 layer()->updateSelfPaintingLayer(); |
| 674 | 672 |
| 675 // Force an update since we know the scrollbars have changed things. | 673 // Force an update since we know the scrollbars have changed things. |
| 676 if (box().document().hasAnnotatedRegions()) | 674 if (box().document().hasAnnotatedRegions()) |
| 677 box().document().setAnnotatedRegionsDirty(true); | 675 box().document().setAnnotatedRegionsDirty(true); |
| 678 | 676 |
| 679 // Our proprietary overflow: overlay value doesn't trigger a layout. | 677 // Our proprietary overflow: overlay value doesn't trigger a layout. |
| 680 if ((horizontalScrollBarChanged && box().style()->overflowX() != OOVERLA
Y) || (verticalScrollBarChanged && box().style()->overflowY() != OOVERLAY)) { | 678 if ((horizontalScrollBarChanged && box().style()->overflowX() != OOVERLA
Y) || (verticalScrollBarChanged && box().style()->overflowY() != OOVERLAY)) { |
| 681 if (!m_inOverflowRelayout) { | 679 if (!m_inOverflowRelayout) { |
| 682 m_inOverflowRelayout = true; | 680 m_inOverflowRelayout = true; |
| 683 if (delayedLayoutScope) { | 681 SubtreeLayoutScope layoutScope(box()); |
| 684 delayedLayoutScope->setNeedsLayout(&box(), LayoutInvalidatio
nReason::ScrollbarChanged); | 682 layoutScope.setNeedsLayout(&box(), LayoutInvalidationReason::Scr
ollbarChanged); |
| 685 didMarkForDelayedLayout = true; | 683 if (box().isLayoutBlock()) { |
| 684 LayoutBlock& block = toLayoutBlock(box()); |
| 685 block.scrollbarsChanged(horizontalScrollBarChanged, vertical
ScrollBarChanged); |
| 686 block.layoutBlock(true); |
| 686 } else { | 687 } else { |
| 687 SubtreeLayoutScope layoutScope(box()); | 688 box().layout(); |
| 688 layoutScope.setNeedsLayout(&box(), LayoutInvalidationReason:
:ScrollbarChanged); | |
| 689 if (box().isLayoutBlock()) { | |
| 690 LayoutBlock& block = toLayoutBlock(box()); | |
| 691 block.scrollbarsChanged(horizontalScrollBarChanged, vert
icalScrollBarChanged); | |
| 692 block.layoutBlock(true); | |
| 693 } else { | |
| 694 box().layout(); | |
| 695 } | |
| 696 } | 689 } |
| 697 LayoutObject* parent = box().parent(); | 690 LayoutObject* parent = box().parent(); |
| 698 if (parent && parent->isFlexibleBox()) | 691 if (parent && parent->isFlexibleBox()) |
| 699 toLayoutFlexibleBox(parent)->clearCachedMainSizeForChild(box
()); | 692 toLayoutFlexibleBox(parent)->clearCachedMainSizeForChild(box
()); |
| 700 m_inOverflowRelayout = false; | 693 m_inOverflowRelayout = false; |
| 701 } | 694 } |
| 702 } | 695 } |
| 703 } | 696 } |
| 704 | 697 |
| 705 { | 698 { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 722 setHasHorizontalScrollbar(false); | 715 setHasHorizontalScrollbar(false); |
| 723 if (!scrollSize(VerticalScrollbar)) | 716 if (!scrollSize(VerticalScrollbar)) |
| 724 setHasVerticalScrollbar(false); | 717 setHasVerticalScrollbar(false); |
| 725 } | 718 } |
| 726 | 719 |
| 727 bool hasOverflow = hasScrollableHorizontalOverflow() || hasScrollableVertica
lOverflow(); | 720 bool hasOverflow = hasScrollableHorizontalOverflow() || hasScrollableVertica
lOverflow(); |
| 728 updateScrollableAreaSet(hasOverflow); | 721 updateScrollableAreaSet(hasOverflow); |
| 729 | 722 |
| 730 DisableCompositingQueryAsserts disabler; | 723 DisableCompositingQueryAsserts disabler; |
| 731 positionOverflowControls(); | 724 positionOverflowControls(); |
| 732 | |
| 733 return didMarkForDelayedLayout; | |
| 734 } | 725 } |
| 735 | 726 |
| 736 ScrollBehavior PaintLayerScrollableArea::scrollBehaviorStyle() const | 727 ScrollBehavior PaintLayerScrollableArea::scrollBehaviorStyle() const |
| 737 { | 728 { |
| 738 return box().style()->getScrollBehavior(); | 729 return box().style()->getScrollBehavior(); |
| 739 } | 730 } |
| 740 | 731 |
| 741 bool PaintLayerScrollableArea::hasHorizontalOverflow() const | 732 bool PaintLayerScrollableArea::hasHorizontalOverflow() const |
| 742 { | 733 { |
| 743 return pixelSnappedScrollWidth() > box().pixelSnappedClientWidth(); | 734 return pixelSnappedScrollWidth() > box().pixelSnappedClientWidth(); |
| (...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1553 } | 1544 } |
| 1554 | 1545 |
| 1555 DEFINE_TRACE(PaintLayerScrollableArea::ScrollbarManager) | 1546 DEFINE_TRACE(PaintLayerScrollableArea::ScrollbarManager) |
| 1556 { | 1547 { |
| 1557 visitor->trace(m_scrollableArea); | 1548 visitor->trace(m_scrollableArea); |
| 1558 visitor->trace(m_hBar); | 1549 visitor->trace(m_hBar); |
| 1559 visitor->trace(m_vBar); | 1550 visitor->trace(m_vBar); |
| 1560 } | 1551 } |
| 1561 | 1552 |
| 1562 } // namespace blink | 1553 } // namespace blink |
| OLD | NEW |