OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights |
3 * reserved. | 3 * reserved. |
4 * | 4 * |
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
6 * | 6 * |
7 * Other contributors: | 7 * Other contributors: |
8 * Robert O'Callahan <roc+@cs.cmu.edu> | 8 * Robert O'Callahan <roc+@cs.cmu.edu> |
9 * David Baron <dbaron@fas.harvard.edu> | 9 * David Baron <dbaron@fas.harvard.edu> |
10 * Christian Biesinger <cbiesinger@gmail.com> | 10 * Christian Biesinger <cbiesinger@gmail.com> |
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 if (FrameView* frame_view = frame->View()) | 638 if (FrameView* frame_view = frame->View()) |
639 frame_view->RemoveAnimatingScrollableArea(this); | 639 frame_view->RemoveAnimatingScrollableArea(this); |
640 } | 640 } |
641 } | 641 } |
642 | 642 |
643 bool PaintLayerScrollableArea::UserInputScrollable( | 643 bool PaintLayerScrollableArea::UserInputScrollable( |
644 ScrollbarOrientation orientation) const { | 644 ScrollbarOrientation orientation) const { |
645 if (Box().IsIntrinsicallyScrollable(orientation)) | 645 if (Box().IsIntrinsicallyScrollable(orientation)) |
646 return true; | 646 return true; |
647 | 647 |
| 648 if (Box().IsLayoutView()) { |
| 649 if (LocalFrame* frame = Box().GetFrame()) { |
| 650 if (FrameView* frame_view = frame->View()) { |
| 651 ScrollbarMode h_mode; |
| 652 ScrollbarMode v_mode; |
| 653 frame_view->CalculateScrollbarModes(h_mode, v_mode); |
| 654 if (orientation == kHorizontalScrollbar && |
| 655 h_mode == kScrollbarAlwaysOff) |
| 656 return false; |
| 657 if (orientation == kVerticalScrollbar && v_mode == kScrollbarAlwaysOff) |
| 658 return false; |
| 659 } |
| 660 } |
| 661 } |
| 662 |
648 EOverflow overflow_style = (orientation == kHorizontalScrollbar) | 663 EOverflow overflow_style = (orientation == kHorizontalScrollbar) |
649 ? Box().Style()->OverflowX() | 664 ? Box().Style()->OverflowX() |
650 : Box().Style()->OverflowY(); | 665 : Box().Style()->OverflowY(); |
651 return (overflow_style == EOverflow::kScroll || | 666 return (overflow_style == EOverflow::kScroll || |
652 overflow_style == EOverflow::kAuto || | 667 overflow_style == EOverflow::kAuto || |
653 overflow_style == EOverflow::kOverlay); | 668 overflow_style == EOverflow::kOverlay); |
654 } | 669 } |
655 | 670 |
656 bool PaintLayerScrollableArea::ShouldPlaceVerticalScrollbarOnLeft() const { | 671 bool PaintLayerScrollableArea::ShouldPlaceVerticalScrollbarOnLeft() const { |
657 return Box().ShouldPlaceBlockDirectionScrollbarOnLogicalLeft(); | 672 return Box().ShouldPlaceBlockDirectionScrollbarOnLogicalLeft(); |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1248 // values, due to which we are destroying the scrollbars that were already | 1263 // values, due to which we are destroying the scrollbars that were already |
1249 // present. | 1264 // present. |
1250 if (Box().IsLayoutView()) { | 1265 if (Box().IsLayoutView()) { |
1251 if (LocalFrame* frame = Box().GetFrame()) { | 1266 if (LocalFrame* frame = Box().GetFrame()) { |
1252 if (FrameView* frame_view = frame->View()) { | 1267 if (FrameView* frame_view = frame->View()) { |
1253 ScrollbarMode h_mode; | 1268 ScrollbarMode h_mode; |
1254 ScrollbarMode v_mode; | 1269 ScrollbarMode v_mode; |
1255 frame_view->CalculateScrollbarModes(h_mode, v_mode); | 1270 frame_view->CalculateScrollbarModes(h_mode, v_mode); |
1256 if (h_mode == kScrollbarAlwaysOn) | 1271 if (h_mode == kScrollbarAlwaysOn) |
1257 needs_horizontal_scrollbar = true; | 1272 needs_horizontal_scrollbar = true; |
| 1273 else if (h_mode == kScrollbarAlwaysOff) |
| 1274 needs_horizontal_scrollbar = false; |
1258 if (v_mode == kScrollbarAlwaysOn) | 1275 if (v_mode == kScrollbarAlwaysOn) |
1259 needs_vertical_scrollbar = true; | 1276 needs_vertical_scrollbar = true; |
| 1277 else if (v_mode == kScrollbarAlwaysOff) |
| 1278 needs_vertical_scrollbar = false; |
1260 } | 1279 } |
1261 } | 1280 } |
1262 } | 1281 } |
1263 } | 1282 } |
1264 | 1283 |
1265 bool PaintLayerScrollableArea::SetHasHorizontalScrollbar(bool has_scrollbar) { | 1284 bool PaintLayerScrollableArea::SetHasHorizontalScrollbar(bool has_scrollbar) { |
1266 if (FreezeScrollbarsScope::ScrollbarsAreFrozen()) | 1285 if (FreezeScrollbarsScope::ScrollbarsAreFrozen()) |
1267 return false; | 1286 return false; |
1268 | 1287 |
1269 if (has_scrollbar == HasHorizontalScrollbar()) | 1288 if (has_scrollbar == HasHorizontalScrollbar()) |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1724 LocalFrame* frame = Box().GetFrame(); | 1743 LocalFrame* frame = Box().GetFrame(); |
1725 if (!frame) | 1744 if (!frame) |
1726 return; | 1745 return; |
1727 | 1746 |
1728 FrameView* frame_view = frame->View(); | 1747 FrameView* frame_view = frame->View(); |
1729 if (!frame_view) | 1748 if (!frame_view) |
1730 return; | 1749 return; |
1731 | 1750 |
1732 bool is_visible_to_hit_test = Box().Style()->VisibleToHitTesting(); | 1751 bool is_visible_to_hit_test = Box().Style()->VisibleToHitTesting(); |
1733 bool did_scroll_overflow = scrolls_overflow_; | 1752 bool did_scroll_overflow = scrolls_overflow_; |
| 1753 if (Box().IsLayoutView()) { |
| 1754 ScrollbarMode h_mode; |
| 1755 ScrollbarMode v_mode; |
| 1756 frame_view->CalculateScrollbarModes(h_mode, v_mode); |
| 1757 if (h_mode == kScrollbarAlwaysOff && v_mode == kScrollbarAlwaysOff) |
| 1758 has_overflow = false; |
| 1759 } |
1734 scrolls_overflow_ = has_overflow && is_visible_to_hit_test; | 1760 scrolls_overflow_ = has_overflow && is_visible_to_hit_test; |
1735 if (did_scroll_overflow == ScrollsOverflow()) | 1761 if (did_scroll_overflow == ScrollsOverflow()) |
1736 return; | 1762 return; |
1737 | 1763 |
1738 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { | 1764 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) { |
1739 // The scroll and scroll offset properties depend on |scrollsOverflow| (see: | 1765 // The scroll and scroll offset properties depend on |scrollsOverflow| (see: |
1740 // PaintPropertyTreeBuilder::updateScrollAndScrollTranslation). | 1766 // PaintPropertyTreeBuilder::updateScrollAndScrollTranslation). |
1741 Box().SetNeedsPaintPropertyUpdate(); | 1767 Box().SetNeedsPaintPropertyUpdate(); |
1742 } | 1768 } |
1743 | 1769 |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2137 | 2163 |
2138 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: | 2164 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: |
2139 ClampScrollableAreas() { | 2165 ClampScrollableAreas() { |
2140 for (auto& scrollable_area : *needs_clamp_) | 2166 for (auto& scrollable_area : *needs_clamp_) |
2141 scrollable_area->ClampScrollOffsetAfterOverflowChange(); | 2167 scrollable_area->ClampScrollOffsetAfterOverflowChange(); |
2142 delete needs_clamp_; | 2168 delete needs_clamp_; |
2143 needs_clamp_ = nullptr; | 2169 needs_clamp_ = nullptr; |
2144 } | 2170 } |
2145 | 2171 |
2146 } // namespace blink | 2172 } // namespace blink |
OLD | NEW |