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