Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(711)

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Issue 2857583007: [RLS] Don't add to ScrollableAreaSet if the size is zero (Closed)
Patch Set: address review comments Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
index 1e3aafb6e03cae74c2bad5c6cde268110f629527..82e90b542915c7667638a45f3ce6928d54bbd2b5 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
@@ -911,8 +911,7 @@ void PaintLayerScrollableArea::UpdateAfterLayout() {
ClampScrollOffsetAfterOverflowChange();
if (!scrollbars_are_frozen) {
- UpdateScrollableAreaSet(HasScrollableHorizontalOverflow() ||
- HasScrollableVerticalOverflow());
+ UpdateScrollableAreaSet();
}
DisableCompositingQueryAsserts disabler;
@@ -1014,14 +1013,6 @@ bool PaintLayerScrollableArea::HasVerticalOverflow() const {
return PixelSnappedScrollHeight() > PixelSnappedClientSize().Height();
}
-bool PaintLayerScrollableArea::HasScrollableHorizontalOverflow() const {
- return HasHorizontalOverflow() && Box().ScrollsOverflowX();
-}
-
-bool PaintLayerScrollableArea::HasScrollableVerticalOverflow() const {
- return HasVerticalOverflow() && Box().ScrollsOverflowY();
-}
-
// This function returns true if the given box requires overflow scrollbars (as
// opposed to the 'viewport' scrollbars managed by the PaintLayerCompositor).
// FIXME: we should use the same scrolling machinery for both the viewport and
@@ -1037,8 +1028,7 @@ void PaintLayerScrollableArea::UpdateAfterStyleChange(
const ComputedStyle* old_style) {
// Don't do this on first style recalc, before layout has ever happened.
if (!OverflowRect().Size().IsZero()) {
- UpdateScrollableAreaSet(HasScrollableHorizontalOverflow() ||
- HasScrollableVerticalOverflow());
+ UpdateScrollableAreaSet();
}
// Whenever background changes on the scrollable element, the scroll bar
@@ -1829,7 +1819,7 @@ LayoutRect PaintLayerScrollableArea::ScrollIntoView(
return intersect;
}
-void PaintLayerScrollableArea::UpdateScrollableAreaSet(bool has_overflow) {
+void PaintLayerScrollableArea::UpdateScrollableAreaSet() {
LocalFrame* frame = Box().GetFrame();
if (!frame)
return;
@@ -1838,6 +1828,10 @@ void PaintLayerScrollableArea::UpdateScrollableAreaSet(bool has_overflow) {
if (!frame_view)
return;
+ bool has_overflow = !Box().Size().IsZero() &&
+ ((HasHorizontalOverflow() && Box().ScrollsOverflowX()) ||
+ (HasVerticalOverflow() && Box().ScrollsOverflowY()));
+
bool is_visible_to_hit_test = Box().Style()->VisibleToHitTesting();
bool did_scroll_overflow = scrolls_overflow_;
if (Box().IsLayoutView()) {
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698