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 4e4ff7a468afeee5f77e1ac9d841b71245719009..f968c5190534813c5c63c544cba43f45a85d8b17 100644 |
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
@@ -645,6 +645,21 @@ bool PaintLayerScrollableArea::UserInputScrollable( |
if (Box().IsIntrinsicallyScrollable(orientation)) |
return true; |
+ if (Box().IsLayoutView()) { |
+ if (LocalFrame* frame = Box().GetFrame()) { |
+ if (FrameView* frame_view = frame->View()) { |
+ ScrollbarMode h_mode; |
+ ScrollbarMode v_mode; |
+ frame_view->CalculateScrollbarModes(h_mode, v_mode); |
+ if (orientation == kHorizontalScrollbar && |
+ h_mode == kScrollbarAlwaysOff) |
+ return false; |
+ if (orientation == kVerticalScrollbar && v_mode == kScrollbarAlwaysOff) |
+ return false; |
+ } |
+ } |
+ } |
+ |
EOverflow overflow_style = (orientation == kHorizontalScrollbar) |
? Box().Style()->OverflowX() |
: Box().Style()->OverflowY(); |
@@ -1255,8 +1270,12 @@ void PaintLayerScrollableArea::ComputeScrollbarExistence( |
frame_view->CalculateScrollbarModes(h_mode, v_mode); |
if (h_mode == kScrollbarAlwaysOn) |
needs_horizontal_scrollbar = true; |
+ else if (h_mode == kScrollbarAlwaysOff) |
+ needs_horizontal_scrollbar = false; |
if (v_mode == kScrollbarAlwaysOn) |
needs_vertical_scrollbar = true; |
+ else if (v_mode == kScrollbarAlwaysOff) |
+ needs_vertical_scrollbar = false; |
} |
} |
} |
@@ -1731,6 +1750,13 @@ void PaintLayerScrollableArea::UpdateScrollableAreaSet(bool has_overflow) { |
bool is_visible_to_hit_test = Box().Style()->VisibleToHitTesting(); |
bool did_scroll_overflow = scrolls_overflow_; |
+ if (Box().IsLayoutView()) { |
+ ScrollbarMode h_mode; |
+ ScrollbarMode v_mode; |
+ frame_view->CalculateScrollbarModes(h_mode, v_mode); |
+ if (h_mode == kScrollbarAlwaysOff && v_mode == kScrollbarAlwaysOff) |
+ has_overflow = false; |
+ } |
scrolls_overflow_ = has_overflow && is_visible_to_hit_test; |
if (did_scroll_overflow == ScrollsOverflow()) |
return; |