Chromium Code Reviews| 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 void PaintLayerScrollableArea::updateAfterLayout() | 615 bool PaintLayerScrollableArea::updateAfterLayout(SubtreeLayoutScope* delayedLayo utScope) |
| 616 { | 616 { |
| 617 ASSERT(box().hasOverflowClip()); | 617 ASSERT(box().hasOverflowClip()); |
| 618 | 618 |
| 619 bool didMarkForLayout = false; | |
| 620 | |
| 619 if (needsScrollbarReconstruction()) { | 621 if (needsScrollbarReconstruction()) { |
| 620 m_scrollbarManager.setCanDetachScrollbars(false); | 622 m_scrollbarManager.setCanDetachScrollbars(false); |
| 621 setHasHorizontalScrollbar(false); | 623 setHasHorizontalScrollbar(false); |
| 622 setHasVerticalScrollbar(false); | 624 setHasVerticalScrollbar(false); |
| 623 } | 625 } |
| 624 | 626 |
| 625 m_scrollbarManager.setCanDetachScrollbars(true); | 627 m_scrollbarManager.setCanDetachScrollbars(true); |
| 626 | 628 |
| 627 DoubleSize originalScrollOffset = adjustedScrollOffset(); | 629 DoubleSize originalScrollOffset = adjustedScrollOffset(); |
| 628 computeScrollDimensions(); | 630 computeScrollDimensions(); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 676 layer()->updateSelfPaintingLayer(); | 678 layer()->updateSelfPaintingLayer(); |
| 677 | 679 |
| 678 // Force an update since we know the scrollbars have changed things. | 680 // Force an update since we know the scrollbars have changed things. |
| 679 if (box().document().hasAnnotatedRegions()) | 681 if (box().document().hasAnnotatedRegions()) |
| 680 box().document().setAnnotatedRegionsDirty(true); | 682 box().document().setAnnotatedRegionsDirty(true); |
| 681 | 683 |
| 682 // Our proprietary overflow: overlay value doesn't trigger a layout. | 684 // Our proprietary overflow: overlay value doesn't trigger a layout. |
| 683 if ((horizontalScrollBarChanged && box().style()->overflowX() != OOVERLA Y) || (verticalScrollBarChanged && box().style()->overflowY() != OOVERLAY)) { | 685 if ((horizontalScrollBarChanged && box().style()->overflowX() != OOVERLA Y) || (verticalScrollBarChanged && box().style()->overflowY() != OOVERLAY)) { |
| 684 if (!m_inOverflowRelayout) { | 686 if (!m_inOverflowRelayout) { |
| 685 m_inOverflowRelayout = true; | 687 m_inOverflowRelayout = true; |
| 686 SubtreeLayoutScope layoutScope(box()); | 688 if (delayedLayoutScope) { |
| 687 layoutScope.setNeedsLayout(&box(), LayoutInvalidationReason::Scr ollbarChanged); | 689 delayedLayoutScope->setNeedsLayout(&box(), LayoutInvalidatio nReason::ScrollbarChanged); |
| 688 if (box().isLayoutBlock()) { | |
| 689 LayoutBlock& block = toLayoutBlock(box()); | |
| 690 block.scrollbarsChanged(horizontalScrollBarChanged, vertical ScrollBarChanged); | |
| 691 block.layoutBlock(true); | |
| 692 } else { | 690 } else { |
| 693 box().layout(); | 691 SubtreeLayoutScope layoutScope(box()); |
| 692 layoutScope.setNeedsLayout(&box(), LayoutInvalidationReason: :ScrollbarChanged); | |
| 693 if (box().isLayoutBlock()) { | |
| 694 LayoutBlock& block = toLayoutBlock(box()); | |
| 695 block.scrollbarsChanged(horizontalScrollBarChanged, vert icalScrollBarChanged); | |
| 696 block.layoutBlock(true); | |
| 697 } else { | |
| 698 box().layout(); | |
| 699 } | |
| 694 } | 700 } |
| 695 LayoutObject* parent = box().parent(); | 701 LayoutObject* parent = box().parent(); |
| 696 if (parent && parent->isFlexibleBox()) | 702 if (parent && parent->isFlexibleBox()) |
| 697 toLayoutFlexibleBox(parent)->clearCachedMainSizeForChild(box ()); | 703 toLayoutFlexibleBox(parent)->clearCachedMainSizeForChild(box ()); |
| 704 didMarkForLayout = true; | |
|
szager1
2016/02/25 21:08:08
Should this go inside the "if (delayedLayoutScope)
| |
| 698 m_inOverflowRelayout = false; | 705 m_inOverflowRelayout = false; |
| 699 } | 706 } |
| 700 } | 707 } |
| 701 } | 708 } |
| 702 | 709 |
| 703 { | 710 { |
| 704 // Hits in compositing/overflow/automatically-opt-into-composited-scroll ing-after-style-change.html. | 711 // Hits in compositing/overflow/automatically-opt-into-composited-scroll ing-after-style-change.html. |
| 705 DisableCompositingQueryAsserts disabler; | 712 DisableCompositingQueryAsserts disabler; |
| 706 | 713 |
| 707 // Set up the range (and page step/line step). | 714 // Set up the range (and page step/line step). |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 720 setHasHorizontalScrollbar(false); | 727 setHasHorizontalScrollbar(false); |
| 721 if (!scrollSize(VerticalScrollbar)) | 728 if (!scrollSize(VerticalScrollbar)) |
| 722 setHasVerticalScrollbar(false); | 729 setHasVerticalScrollbar(false); |
| 723 } | 730 } |
| 724 | 731 |
| 725 bool hasOverflow = hasScrollableHorizontalOverflow() || hasScrollableVertica lOverflow(); | 732 bool hasOverflow = hasScrollableHorizontalOverflow() || hasScrollableVertica lOverflow(); |
| 726 updateScrollableAreaSet(hasOverflow); | 733 updateScrollableAreaSet(hasOverflow); |
| 727 | 734 |
| 728 DisableCompositingQueryAsserts disabler; | 735 DisableCompositingQueryAsserts disabler; |
| 729 positionOverflowControls(); | 736 positionOverflowControls(); |
| 737 | |
| 738 return didMarkForLayout; | |
| 730 } | 739 } |
| 731 | 740 |
| 732 ScrollBehavior PaintLayerScrollableArea::scrollBehaviorStyle() const | 741 ScrollBehavior PaintLayerScrollableArea::scrollBehaviorStyle() const |
| 733 { | 742 { |
| 734 return box().style()->scrollBehavior(); | 743 return box().style()->scrollBehavior(); |
| 735 } | 744 } |
| 736 | 745 |
| 737 bool PaintLayerScrollableArea::hasHorizontalOverflow() const | 746 bool PaintLayerScrollableArea::hasHorizontalOverflow() const |
| 738 { | 747 { |
| 739 return pixelSnappedScrollWidth() > box().pixelSnappedClientWidth(); | 748 return pixelSnappedScrollWidth() > box().pixelSnappedClientWidth(); |
| (...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1549 } | 1558 } |
| 1550 | 1559 |
| 1551 DEFINE_TRACE(PaintLayerScrollableArea::ScrollbarManager) | 1560 DEFINE_TRACE(PaintLayerScrollableArea::ScrollbarManager) |
| 1552 { | 1561 { |
| 1553 visitor->trace(m_scrollableArea); | 1562 visitor->trace(m_scrollableArea); |
| 1554 visitor->trace(m_hBar); | 1563 visitor->trace(m_hBar); |
| 1555 visitor->trace(m_vBar); | 1564 visitor->trace(m_vBar); |
| 1556 } | 1565 } |
| 1557 | 1566 |
| 1558 } // namespace blink | 1567 } // namespace blink |
| OLD | NEW |