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 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 | 688 |
689 // Force an update since we know the scrollbars have changed things. | 689 // Force an update since we know the scrollbars have changed things. |
690 if (box().document().hasAnnotatedRegions()) | 690 if (box().document().hasAnnotatedRegions()) |
691 box().document().setAnnotatedRegionsDirty(true); | 691 box().document().setAnnotatedRegionsDirty(true); |
692 | 692 |
693 if (box().style()->overflowX() == OAUTO || box().style()->overflowY() ==
OAUTO) { | 693 if (box().style()->overflowX() == OAUTO || box().style()->overflowY() ==
OAUTO) { |
694 if (!m_inOverflowRelayout) { | 694 if (!m_inOverflowRelayout) { |
695 // Our proprietary overflow: overlay value doesn't trigger a lay
out. | 695 // Our proprietary overflow: overlay value doesn't trigger a lay
out. |
696 m_inOverflowRelayout = true; | 696 m_inOverflowRelayout = true; |
697 SubtreeLayoutScope layoutScope(box()); | 697 SubtreeLayoutScope layoutScope(box()); |
698 layoutScope.setNeedsLayout(&box()); | 698 layoutScope.setNeedsLayout(&box(), LayoutInvalidationReason::Scr
ollbarChanged); |
699 if (box().isLayoutBlock()) { | 699 if (box().isLayoutBlock()) { |
700 LayoutBlock& block = toLayoutBlock(box()); | 700 LayoutBlock& block = toLayoutBlock(box()); |
701 block.scrollbarsChanged(autoHorizontalScrollBarChanged, auto
VerticalScrollBarChanged); | 701 block.scrollbarsChanged(autoHorizontalScrollBarChanged, auto
VerticalScrollBarChanged); |
702 block.layoutBlock(true); | 702 block.layoutBlock(true); |
703 } else { | 703 } else { |
704 box().layout(); | 704 box().layout(); |
705 } | 705 } |
706 m_inOverflowRelayout = false; | 706 m_inOverflowRelayout = false; |
707 } | 707 } |
708 } | 708 } |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 if (Scrollbar* verticalScrollbar = this->verticalScrollbar()) { | 834 if (Scrollbar* verticalScrollbar = this->verticalScrollbar()) { |
835 int clientHeight = box().pixelSnappedClientHeight(); | 835 int clientHeight = box().pixelSnappedClientHeight(); |
836 verticalScrollbar->setProportion(clientHeight, overflowRect().height()); | 836 verticalScrollbar->setProportion(clientHeight, overflowRect().height()); |
837 } | 837 } |
838 | 838 |
839 bool hasHorizontalOverflow = this->hasHorizontalOverflow(); | 839 bool hasHorizontalOverflow = this->hasHorizontalOverflow(); |
840 bool hasVerticalOverflow = this->hasVerticalOverflow(); | 840 bool hasVerticalOverflow = this->hasVerticalOverflow(); |
841 bool autoHorizontalScrollBarChanged = box().hasAutoHorizontalScrollbar() &&
(hasHorizontalScrollbar() != hasHorizontalOverflow); | 841 bool autoHorizontalScrollBarChanged = box().hasAutoHorizontalScrollbar() &&
(hasHorizontalScrollbar() != hasHorizontalOverflow); |
842 bool autoVerticalScrollBarChanged = box().hasAutoVerticalScrollbar() && (has
VerticalScrollbar() != hasVerticalOverflow); | 842 bool autoVerticalScrollBarChanged = box().hasAutoVerticalScrollbar() && (has
VerticalScrollbar() != hasVerticalOverflow); |
843 if (autoHorizontalScrollBarChanged || autoVerticalScrollBarChanged) | 843 if (autoHorizontalScrollBarChanged || autoVerticalScrollBarChanged) |
844 box().setNeedsLayoutAndFullPaintInvalidation(); | 844 box().setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationReason::U
nknown); |
845 } | 845 } |
846 | 846 |
847 DoubleSize DeprecatedPaintLayerScrollableArea::clampScrollOffset(const DoubleSiz
e& scrollOffset) const | 847 DoubleSize DeprecatedPaintLayerScrollableArea::clampScrollOffset(const DoubleSiz
e& scrollOffset) const |
848 { | 848 { |
849 int maxX = scrollWidth() - box().pixelSnappedClientWidth(); | 849 int maxX = scrollWidth() - box().pixelSnappedClientWidth(); |
850 int maxY = scrollHeight() - box().pixelSnappedClientHeight(); | 850 int maxY = scrollHeight() - box().pixelSnappedClientHeight(); |
851 | 851 |
852 double x = std::max(std::min(scrollOffset.width(), static_cast<double>(maxX)
), 0.0); | 852 double x = std::max(std::min(scrollOffset.width(), static_cast<double>(maxX)
), 0.0); |
853 double y = std::max(std::min(scrollOffset.height(), static_cast<double>(maxY
)), 0.0); | 853 double y = std::max(std::min(scrollOffset.height(), static_cast<double>(maxY
)), 0.0); |
854 return DoubleSize(x, y); | 854 return DoubleSize(x, y); |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1386 void DeprecatedPaintLayerScrollableArea::setTopmostScrollChild(DeprecatedPaintLa
yer* scrollChild) | 1386 void DeprecatedPaintLayerScrollableArea::setTopmostScrollChild(DeprecatedPaintLa
yer* scrollChild) |
1387 { | 1387 { |
1388 // We only want to track the topmost scroll child for scrollable areas with | 1388 // We only want to track the topmost scroll child for scrollable areas with |
1389 // overlay scrollbars. | 1389 // overlay scrollbars. |
1390 if (!hasOverlayScrollbars()) | 1390 if (!hasOverlayScrollbars()) |
1391 return; | 1391 return; |
1392 m_nextTopmostScrollChild = scrollChild; | 1392 m_nextTopmostScrollChild = scrollChild; |
1393 } | 1393 } |
1394 | 1394 |
1395 } // namespace blink | 1395 } // namespace blink |
OLD | NEW |