Chromium Code Reviews| 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 adffb22d30e612c6b4f40fb2974165c5907178f7..12f2e12b23ee2a8b682feb3c359b156cf580960b 100644 |
| --- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
| +++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp |
| @@ -666,18 +666,13 @@ bool PaintLayerScrollableArea::UserInputScrollable( |
| return true; |
| if (Box().IsLayoutView()) { |
|
szager1
2017/05/22 18:29:35
General observation: we should probably work towar
skobes
2017/05/22 19:15:10
Agreed. Scrollability is a big mess right now wit
|
| - 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; |
| - } |
| - } |
| + ScrollbarMode h_mode; |
| + ScrollbarMode v_mode; |
| + ToLayoutView(Box()).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) |
| @@ -1291,21 +1286,17 @@ void PaintLayerScrollableArea::ComputeScrollbarExistence( |
| // values, due to which we are destroying the scrollbars that were already |
| // present. |
| 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 (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; |
| - } |
| - } |
| + ScrollbarMode h_mode; |
| + ScrollbarMode v_mode; |
| + ToLayoutView(Box()).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; |
| } |
| } |
| @@ -1780,7 +1771,7 @@ void PaintLayerScrollableArea::UpdateScrollableAreaSet(bool has_overflow) { |
| if (Box().IsLayoutView()) { |
| ScrollbarMode h_mode; |
| ScrollbarMode v_mode; |
| - frame_view->CalculateScrollbarModes(h_mode, v_mode); |
| + ToLayoutView(Box()).CalculateScrollbarModes(h_mode, v_mode); |
| if (h_mode == kScrollbarAlwaysOff && v_mode == kScrollbarAlwaysOff) |
| has_overflow = false; |
| } |