Commit 4d001793 authored by Chris Harrelson's avatar Chris Harrelson Committed by Commit Bot

[RLS] Remove references to RootLayerScrollingEnabled in various files

Bug:823365

Change-Id: I188e8521d0981c3da23f978caaffdc0009190691
Reviewed-on: https://chromium-review.googlesource.com/1070887
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#561316}
parent 32970019
...@@ -208,11 +208,6 @@ static bool PointInFrameContentIfVisible(Document& document, ...@@ -208,11 +208,6 @@ static bool PointInFrameContentIfVisible(Document& document,
return false; return false;
point_in_frame.Scale(frame->PageZoomFactor(), frame->PageZoomFactor()); point_in_frame.Scale(frame->PageZoomFactor(), frame->PageZoomFactor());
// For non RLS case, the point needs to be adjusted by the frame's scroll
// offset.
if (!RuntimeEnabledFeatures::RootLayerScrollingEnabled())
point_in_frame.Move(scrollable_area->GetScrollOffset());
return true; return true;
} }
......
...@@ -763,20 +763,17 @@ int TextFinder::SelectFindMatch(unsigned index, WebRect* selection_rect) { ...@@ -763,20 +763,17 @@ int TextFinder::SelectFindMatch(unsigned index, WebRect* selection_rect) {
ScrollAlignment::kAlignCenterIfNeeded, ScrollAlignment::kAlignCenterIfNeeded,
kUserScroll)); kUserScroll));
if (RuntimeEnabledFeatures::RootLayerScrollingEnabled()) { // Absolute coordinates are scroll-variant so the bounding box will change
// If RLS is on, absolute coordinates are scroll-variant so the // if the page is scrolled by ScrollRectToVisible above. Recompute the
// bounding box will change if the page is scrolled by // bounding box so we have the updated location for the zoom below.
// ScrollRectToVisible above. Recompute the bounding box so we have the // TODO(bokan): This should really use the return value from
// updated location for the zoom below. // ScrollRectToVisible which returns the updated position of the
// TODO(bokan): This should really use the return value from // scrolled rect. However, this was recently added and this is a fix
// ScrollRectToVisible which returns the updated position of the // that needs to be merged to a release branch.
// scrolled rect. However, this was recently added and this is a fix // https://crbug.com/823365.
// that needs to be merged to a release branch. active_match_bounding_box =
// https://crbug.com/823365. EnclosingIntRect(LayoutObject::AbsoluteBoundingBoxRectForRange(
active_match_bounding_box = EphemeralRange(active_match_.Get())));
EnclosingIntRect(LayoutObject::AbsoluteBoundingBoxRectForRange(
EphemeralRange(active_match_.Get())));
}
} }
// Zoom to the active match. // Zoom to the active match.
......
...@@ -2974,13 +2974,6 @@ WebSize WebViewImpl::ContentsPreferredMinimumSize() { ...@@ -2974,13 +2974,6 @@ WebSize WebViewImpl::ContentsPreferredMinimumSize() {
int width_scaled = document->GetLayoutView() int width_scaled = document->GetLayoutView()
->MinPreferredLogicalWidth() ->MinPreferredLogicalWidth()
.Round(); // Already accounts for zoom. .Round(); // Already accounts for zoom.
if (Scrollbar* scrollbar =
MainFrameImpl()->GetFrameView()->VerticalScrollbar()) {
DCHECK(!RuntimeEnabledFeatures::RootLayerScrollingEnabled());
// For RLS, this occurs in LayoutBlock::ComputeIntrinsicLogicalWidths.
if (!scrollbar->IsOverlayScrollbar())
width_scaled += scrollbar->ScrollbarThickness();
}
int height_scaled = int height_scaled =
document->documentElement()->GetLayoutBox()->ScrollHeight().Round(); document->documentElement()->GetLayoutBox()->ScrollHeight().Round();
return IntSize(width_scaled, height_scaled); return IntSize(width_scaled, height_scaled);
......
...@@ -731,21 +731,6 @@ void LocalFrame::SetPageAndTextZoomFactors(float page_zoom_factor, ...@@ -731,21 +731,6 @@ void LocalFrame::SetPageAndTextZoomFactors(float page_zoom_factor,
return; return;
} }
if (page_zoom_factor_ != page_zoom_factor &&
!RuntimeEnabledFeatures::RootLayerScrollingEnabled()) {
if (LocalFrameView* view = this->View()) {
// Update the scroll position when doing a full page zoom, so the content
// stays in relatively the same position.
ScrollableArea* scrollable_area = view->LayoutViewportScrollableArea();
ScrollOffset scroll_offset = scrollable_area->GetScrollOffset();
float percent_difference = (page_zoom_factor / page_zoom_factor_);
scrollable_area->SetScrollOffset(
ScrollOffset(scroll_offset.Width() * percent_difference,
scroll_offset.Height() * percent_difference),
kProgrammaticScroll);
}
}
page_zoom_factor_ = page_zoom_factor; page_zoom_factor_ = page_zoom_factor;
text_zoom_factor_ = text_zoom_factor; text_zoom_factor_ = text_zoom_factor;
......
...@@ -285,8 +285,7 @@ LayoutRect RootFrameViewport::ScrollIntoView( ...@@ -285,8 +285,7 @@ LayoutRect RootFrameViewport::ScrollIntoView(
LayoutRect scroll_snapport_rect(VisibleScrollSnapportRect()); LayoutRect scroll_snapport_rect(VisibleScrollSnapportRect());
LayoutRect rect_in_document = rect_in_absolute; LayoutRect rect_in_document = rect_in_absolute;
if (RuntimeEnabledFeatures::RootLayerScrollingEnabled()) rect_in_document.Move(LayoutSize(LayoutViewport().GetScrollOffset()));
rect_in_document.Move(LayoutSize(LayoutViewport().GetScrollOffset()));
ScrollOffset new_scroll_offset = ScrollOffset new_scroll_offset =
ClampScrollOffset(ScrollAlignment::GetScrollOffsetToExpose( ClampScrollOffset(ScrollAlignment::GetScrollOffsetToExpose(
...@@ -312,8 +311,7 @@ LayoutRect RootFrameViewport::ScrollIntoView( ...@@ -312,8 +311,7 @@ LayoutRect RootFrameViewport::ScrollIntoView(
// Return the newly moved rect to absolute coordinates. // Return the newly moved rect to absolute coordinates.
// TODO(szager): PaintLayerScrollableArea::ScrollIntoView clips the return // TODO(szager): PaintLayerScrollableArea::ScrollIntoView clips the return
// value to the visible content rect, but this does not. // value to the visible content rect, but this does not.
if (RuntimeEnabledFeatures::RootLayerScrollingEnabled()) rect_in_document.Move(-LayoutSize(LayoutViewport().GetScrollOffset()));
rect_in_document.Move(-LayoutSize(LayoutViewport().GetScrollOffset()));
return rect_in_document; return rect_in_document;
} }
......
...@@ -892,13 +892,6 @@ void Fullscreen::FullscreenElementChanged(Element* old_element, ...@@ -892,13 +892,6 @@ void Fullscreen::FullscreenElementChanged(Element* old_element,
frame->GetEventHandler().ScheduleHoverStateUpdate(); frame->GetEventHandler().ScheduleHoverStateUpdate();
frame->GetChromeClient().FullscreenElementChanged(old_element, new_element); frame->GetChromeClient().FullscreenElementChanged(old_element, new_element);
if (!RuntimeEnabledFeatures::RootLayerScrollingEnabled()) {
// Fullscreen status affects scroll paint properties through
// LocalFrameView::UserInputScrollable().
if (LocalFrameView* frame_view = frame->View())
frame_view->SetNeedsPaintPropertyUpdate();
}
// Descendant frames may have been inert because their owner iframes were // Descendant frames may have been inert because their owner iframes were
// outside of fullscreen element. SetIsInert recurses through subframes to // outside of fullscreen element. SetIsInert recurses through subframes to
// propagate the inert bit as needed. // propagate the inert bit as needed.
......
...@@ -223,33 +223,7 @@ void ScrollingCoordinator::UpdateAfterCompositingChangeIfNeeded( ...@@ -223,33 +223,7 @@ void ScrollingCoordinator::UpdateAfterCompositingChangeIfNeeded(
} }
frame_view->ClearFrameIsScrollableDidChange(); frame_view->ClearFrameIsScrollableDidChange();
if (frame_view && !RuntimeEnabledFeatures::RootLayerScrollingEnabled()) {
if (cc::Layer* scroll_layer =
GraphicsLayerToCcLayer(frame_view->LayerForScrolling())) {
UpdateUserInputScrollable(frame_view);
scroll_layer->SetBounds(
static_cast<gfx::Size>(frame_view->ContentsSize()));
}
}
UpdateUserInputScrollable(&page_->GetVisualViewport()); UpdateUserInputScrollable(&page_->GetVisualViewport());
if (!RuntimeEnabledFeatures::RootLayerScrollingEnabled()) {
const FrameTree& tree = frame_view->GetPage()->MainFrame()->Tree();
for (const Frame* child = tree.FirstChild(); child;
child = child->Tree().NextSibling()) {
if (!child->IsLocalFrame())
continue;
LocalFrameView* frame_view = ToLocalFrame(child)->View();
if (!frame_view || frame_view->ShouldThrottleRendering())
continue;
if (cc::Layer* scroll_layer =
GraphicsLayerToCcLayer(frame_view->LayerForScrolling())) {
scroll_layer->SetBounds(
static_cast<gfx::Size>(frame_view->ContentsSize()));
}
}
}
} }
static void ClearPositionConstraintExceptForLayer(GraphicsLayer* layer, static void ClearPositionConstraintExceptForLayer(GraphicsLayer* layer,
...@@ -563,8 +537,7 @@ bool ScrollingCoordinator::ScrollableAreaScrollLayerDidChange( ...@@ -563,8 +537,7 @@ bool ScrollingCoordinator::ScrollableAreaScrollLayerDidChange(
// Update the viewport layer registration if the outer viewport may have // Update the viewport layer registration if the outer viewport may have
// changed. // changed.
if (RuntimeEnabledFeatures::RootLayerScrollingEnabled() && if (IsForRootLayer(scrollable_area))
IsForRootLayer(scrollable_area))
page_->GetChromeClient().RegisterViewportLayers(); page_->GetChromeClient().RegisterViewportLayers();
CompositorAnimationTimeline* timeline; CompositorAnimationTimeline* timeline;
...@@ -794,9 +767,6 @@ void ScrollingCoordinator::Reset(LocalFrame* frame) { ...@@ -794,9 +767,6 @@ void ScrollingCoordinator::Reset(LocalFrame* frame) {
vertical_scrollbars_.clear(); vertical_scrollbars_.clear();
frame->View()->GetScrollingContext()->GetLayersWithTouchRects()->clear(); frame->View()->GetScrollingContext()->GetLayersWithTouchRects()->clear();
frame->View()->ClearFrameIsScrollableDidChange(); frame->View()->ClearFrameIsScrollableDidChange();
if (!RuntimeEnabledFeatures::RootLayerScrollingEnabled())
SetShouldUpdateScrollLayerPositionOnMainThread(frame, 0);
} }
// Note that in principle this could be called more often than // Note that in principle this could be called more often than
......
...@@ -123,16 +123,9 @@ void SetNeedsCompositingUpdateOnAncestors(Element* element) { ...@@ -123,16 +123,9 @@ void SetNeedsCompositingUpdateOnAncestors(Element* element) {
continue; continue;
LayoutView* layout_view = ToLocalFrame(frame)->View()->GetLayoutView(); LayoutView* layout_view = ToLocalFrame(frame)->View()->GetLayoutView();
if (RuntimeEnabledFeatures::RootLayerScrollingEnabled()) { PaintLayer* frame_root_layer = layout_view->Layer();
PaintLayer* frame_root_layer = layout_view->Layer(); DCHECK(frame_root_layer);
DCHECK(frame_root_layer); frame_root_layer->SetNeedsCompositingInputsUpdate();
frame_root_layer->SetNeedsCompositingInputsUpdate();
} else {
if (PaintLayerCompositor* plc = layout_view->Compositor()) {
plc->SetNeedsCompositingUpdate(
kCompositingUpdateAfterCompositingInputChange);
}
}
} }
} }
......
...@@ -416,12 +416,6 @@ LayoutRect NodeRectInRootFrame(const Node* node, bool ignore_border) { ...@@ -416,12 +416,6 @@ LayoutRect NodeRectInRootFrame(const Node* node, bool ignore_border) {
DCHECK(node->GetLayoutObject()); DCHECK(node->GetLayoutObject());
DCHECK(!node->GetDocument().View()->NeedsLayout()); DCHECK(!node->GetDocument().View()->NeedsLayout());
if (node->IsDocumentNode() &&
!RuntimeEnabledFeatures::RootLayerScrollingEnabled()) {
LocalFrameView* view = ToDocument(node)->GetFrame()->View();
return LayoutRect(view->ContentsToRootFrame(
view->LayoutViewportScrollableArea()->VisibleContentRect()));
}
LayoutRect rect = node->GetDocument().GetFrame()->View()->AbsoluteToRootFrame( LayoutRect rect = node->GetDocument().GetFrame()->View()->AbsoluteToRootFrame(
node->BoundingBox()); node->BoundingBox());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment