[RLS] Remove unused code in view_painter, ax_object, graphics_layer, and print_context
Now that Root Layer Scrolling (RLS) is enabled by default, we can remove
these unused codepaths.
Bug: 823365
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I212505daa58d1e723cc51c4c764c08822d01da33
Reviewed-on: https://chromium-review.googlesource.com/1065119
Reviewed-by: Steve Kobes <skobes@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#559871}
diff --git a/third_party/blink/renderer/core/page/print_context.cc b/third_party/blink/renderer/core/page/print_context.cc
index 5e9c8843..3cf14cb 100644
--- a/third_party/blink/renderer/core/page/print_context.cc
+++ b/third_party/blink/renderer/core/page/print_context.cc
@@ -126,13 +126,11 @@
int page_logical_left = inline_direction_end > inline_direction_start
? inline_direction_start
: inline_direction_start - page_logical_width;
- if (RuntimeEnabledFeatures::RootLayerScrollingEnabled()) {
- ScrollableArea* scrollable_area =
- GetFrame()->View()->LayoutViewportScrollableArea();
- IntSize frame_scroll = scrollable_area->ScrollOffsetInt();
- page_logical_left -= frame_scroll.Width();
- page_logical_top -= frame_scroll.Height();
- }
+
+ auto* scrollable_area = GetFrame()->View()->LayoutViewportScrollableArea();
+ IntSize frame_scroll = scrollable_area->ScrollOffsetInt();
+ page_logical_left -= frame_scroll.Width();
+ page_logical_top -= frame_scroll.Height();
IntRect page_rect(page_logical_left, page_logical_top, page_logical_width,
page_logical_height);
if (!is_horizontal)
diff --git a/third_party/blink/renderer/core/paint/view_painter.cc b/third_party/blink/renderer/core/paint/view_painter.cc
index 6701f52..6a2380a 100644
--- a/third_party/blink/renderer/core/paint/view_painter.cc
+++ b/third_party/blink/renderer/core/paint/view_painter.cc
@@ -34,14 +34,7 @@
DCHECK(!layout_view_.GetFrameView()->ShouldThrottleRendering());
- if (RuntimeEnabledFeatures::RootLayerScrollingEnabled()) {
- BlockPainter(layout_view_).Paint(paint_info, paint_offset);
- return;
- }
-
- layout_view_.PaintObject(paint_info, paint_offset);
- BlockPainter(layout_view_)
- .PaintOverflowControlsIfNeeded(paint_info, paint_offset);
+ BlockPainter(layout_view_).Paint(paint_info, paint_offset);
}
void ViewPainter::PaintBoxDecorationBackground(const PaintInfo& paint_info) {
@@ -67,12 +60,9 @@
IntRect background_rect(
PixelSnappedIntRect(layout_view_.OverflowClipRect(LayoutPoint())));
- // When printing with root layer scrolling, we will paint the entire
- // unclipped scrolling content area.
- if (!RuntimeEnabledFeatures::RootLayerScrollingEnabled() ||
- paint_info.IsPrinting()) {
+ // When printing, paint the entire unclipped scrolling content area.
+ if (paint_info.IsPrinting())
background_rect.Unite(layout_view_.DocumentRect());
- }
const DisplayItemClient* display_item_client = &layout_view_;
diff --git a/third_party/blink/renderer/modules/accessibility/ax_object.cc b/third_party/blink/renderer/modules/accessibility/ax_object.cc
index 1e34e1e..8550311 100644
--- a/third_party/blink/renderer/modules/accessibility/ax_object.cc
+++ b/third_party/blink/renderer/modules/accessibility/ax_object.cc
@@ -2359,21 +2359,8 @@
// If the container has a scroll offset, subtract that out because we want our
// bounds to be relative to the *unscrolled* position of the container object.
- ScrollableArea* scrollable_area = container->GetScrollableAreaIfScrollable();
-
- // Without RLS, LayoutView (i.e. "WebArea") is scrolled by the FrameView and
- // those scrolls aren't accounted for at all in the layout tree. The
- // scrollable_area returned above returns the FrameView in that case though
- // so we avoid making the adjustment below. Once RLS ships, the LayoutView
- // scroll will be accounted for by the layout tree so this condition can be
- // removed.
- bool is_self_scrolling = !container->IsWebArea() ||
- RuntimeEnabledFeatures::RootLayerScrollingEnabled();
-
- if (scrollable_area && is_self_scrolling) {
- ScrollOffset scroll_offset = scrollable_area->GetScrollOffset();
- out_bounds_in_container.Move(scroll_offset);
- }
+ if (auto* scrollable_area = container->GetScrollableAreaIfScrollable())
+ out_bounds_in_container.Move(scrollable_area->GetScrollOffset());
// Compute the transform between the container's coordinate space and this
// object.
diff --git a/third_party/blink/renderer/platform/graphics/graphics_layer.cc b/third_party/blink/renderer/platform/graphics/graphics_layer.cc
index 5879a9b..d5d8f74 100644
--- a/third_party/blink/renderer/platform/graphics/graphics_layer.cc
+++ b/third_party/blink/renderer/platform/graphics/graphics_layer.cc
@@ -675,16 +675,9 @@
}
static FloatPoint ScrollPosition(const GraphicsLayer& layer) {
- const auto* scrollable_area = layer.GetScrollableArea();
- if (!RuntimeEnabledFeatures::RootLayerScrollingEnabled()) {
- // The LayoutView layer's scrollable area is on the "Frame Scrolling
- // Layer" ancestor.
- if (layer.DebugName() == "LayoutView #document")
- scrollable_area = layer.Parent()->Parent()->GetScrollableArea();
- else if (layer.DebugName() == "Frame Scrolling Layer")
- scrollable_area = nullptr;
- }
- return scrollable_area ? scrollable_area->ScrollPosition() : FloatPoint();
+ if (const auto* scrollable_area = layer.GetScrollableArea())
+ return scrollable_area->ScrollPosition();
+ return FloatPoint();
}
void AddLayer(const GraphicsLayer& layer,