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 997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1008 if (NeedsRelayout() && !HadVerticalScrollbarBeforeRelayout()) | 1008 if (NeedsRelayout() && !HadVerticalScrollbarBeforeRelayout()) |
1009 client_width += VerticalScrollbarWidth(); | 1009 client_width += VerticalScrollbarWidth(); |
1010 return PixelSnappedScrollWidth() > client_width; | 1010 return PixelSnappedScrollWidth() > client_width; |
1011 } | 1011 } |
1012 | 1012 |
1013 bool PaintLayerScrollableArea::HasVerticalOverflow() const { | 1013 bool PaintLayerScrollableArea::HasVerticalOverflow() const { |
1014 return PixelSnappedScrollHeight() > PixelSnappedClientSize().Height(); | 1014 return PixelSnappedScrollHeight() > PixelSnappedClientSize().Height(); |
1015 } | 1015 } |
1016 | 1016 |
1017 bool PaintLayerScrollableArea::HasScrollableHorizontalOverflow() const { | 1017 bool PaintLayerScrollableArea::HasScrollableHorizontalOverflow() const { |
1018 if (Box().Size().IsZero()) | |
skobes
2017/07/15 00:44:31
Actually it would be simpler to put this logic ins
Srirama
2017/07/17 14:35:24
Done.
| |
1019 return false; | |
1020 | |
1018 return HasHorizontalOverflow() && Box().ScrollsOverflowX(); | 1021 return HasHorizontalOverflow() && Box().ScrollsOverflowX(); |
1019 } | 1022 } |
1020 | 1023 |
1021 bool PaintLayerScrollableArea::HasScrollableVerticalOverflow() const { | 1024 bool PaintLayerScrollableArea::HasScrollableVerticalOverflow() const { |
1025 if (Box().Size().IsZero()) | |
1026 return false; | |
1027 | |
1022 return HasVerticalOverflow() && Box().ScrollsOverflowY(); | 1028 return HasVerticalOverflow() && Box().ScrollsOverflowY(); |
1023 } | 1029 } |
1024 | 1030 |
1025 // This function returns true if the given box requires overflow scrollbars (as | 1031 // This function returns true if the given box requires overflow scrollbars (as |
1026 // opposed to the 'viewport' scrollbars managed by the PaintLayerCompositor). | 1032 // opposed to the 'viewport' scrollbars managed by the PaintLayerCompositor). |
1027 // FIXME: we should use the same scrolling machinery for both the viewport and | 1033 // FIXME: we should use the same scrolling machinery for both the viewport and |
1028 // overflow. Currently, we need to avoid producing scrollbars here if they'll be | 1034 // overflow. Currently, we need to avoid producing scrollbars here if they'll be |
1029 // handled externally in the RLC. | 1035 // handled externally in the RLC. |
1030 static bool CanHaveOverflowScrollbars(const LayoutBox& box) { | 1036 static bool CanHaveOverflowScrollbars(const LayoutBox& box) { |
1031 return (RuntimeEnabledFeatures::RootLayerScrollingEnabled() || | 1037 return (RuntimeEnabledFeatures::RootLayerScrollingEnabled() || |
(...skipping 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2260 | 2266 |
2261 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: | 2267 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: |
2262 ClampScrollableAreas() { | 2268 ClampScrollableAreas() { |
2263 for (auto& scrollable_area : *needs_clamp_) | 2269 for (auto& scrollable_area : *needs_clamp_) |
2264 scrollable_area->ClampScrollOffsetAfterOverflowChange(); | 2270 scrollable_area->ClampScrollOffsetAfterOverflowChange(); |
2265 delete needs_clamp_; | 2271 delete needs_clamp_; |
2266 needs_clamp_ = nullptr; | 2272 needs_clamp_ = nullptr; |
2267 } | 2273 } |
2268 | 2274 |
2269 } // namespace blink | 2275 } // namespace blink |
OLD | NEW |