Commit e04ac9ce authored by Steve Kobes's avatar Steve Kobes Committed by Commit Bot

Delete LFV::ScrollContents and friends.

Bug: 823365
Change-Id: I847384bf51dfe78dcb772afde72d7d19c876b44b
Reviewed-on: https://chromium-review.googlesource.com/1073659Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Commit-Queue: Steve Kobes <skobes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#562021}
parent 2485621e
......@@ -1476,12 +1476,6 @@ void LocalFrameView::AdjustMediaTypeForPrinting(bool printing) {
StyleChangeReason::kStyleSheetChange));
}
bool LocalFrameView::ContentsInCompositedLayer() const {
auto* layout_view = this->GetLayoutView();
return layout_view &&
layout_view->GetCompositingState() == kPaintsIntoOwnBacking;
}
void LocalFrameView::AddBackgroundAttachmentFixedObject(LayoutObject* object) {
DCHECK(!background_attachment_fixed_objects_.Contains(object));
......@@ -1734,47 +1728,6 @@ bool LocalFrameView::InvalidateViewportConstrainedObjects() {
return fast_path_allowed;
}
bool LocalFrameView::ScrollContentsFastPath(const IntSize& scroll_delta) {
if (!ContentsInCompositedLayer())
return false;
InvalidateBackgroundAttachmentFixedDescendants(*GetLayoutView());
if (!viewport_constrained_objects_ ||
viewport_constrained_objects_->IsEmpty()) {
probe::didChangeViewport(frame_.Get());
return true;
}
if (!InvalidateViewportConstrainedObjects())
return false;
probe::didChangeViewport(frame_.Get());
return true;
}
void LocalFrameView::ScrollContentsSlowPath() {
TRACE_EVENT0("blink", "LocalFrameView::scrollContentsSlowPath");
// We need full invalidation during slow scrolling. For slimming paint, full
// invalidation of the LayoutView is not enough. We also need to invalidate
// all of the objects.
// FIXME: Find out what are enough to invalidate in slow path scrolling.
// crbug.com/451090#9.
auto* layout_view = GetLayoutView();
DCHECK(layout_view);
if (ContentsInCompositedLayer()) {
layout_view->Layer()->GetCompositedLayerMapping()->SetContentsNeedDisplay();
} else {
layout_view
->SetShouldDoFullPaintInvalidationIncludingNonCompositingDescendants();
}
if (ContentsInCompositedLayer()) {
IntRect update_rect = VisibleContentRect();
layout_view->InvalidatePaintRectangle(LayoutRect(update_rect));
}
}
void LocalFrameView::RestoreScrollbar() {
SetScrollbarsSuppressed(false);
}
......@@ -4463,30 +4416,6 @@ void LocalFrameView::NotifyFrameRectsChangedIfNeeded() {
}
}
void LocalFrameView::ScrollContentsIfNeeded() {
if (pending_scroll_delta_.IsZero())
return;
ScrollOffset scroll_delta = pending_scroll_delta_;
pending_scroll_delta_ = ScrollOffset();
// FIXME: Change scrollContents() to take DoubleSize. crbug.com/414283.
ScrollContents(FlooredIntSize(scroll_delta));
}
void LocalFrameView::ScrollContents(const IntSize& scroll_delta) {
ChromeClient* client = GetChromeClient();
if (!client)
return;
TRACE_EVENT0("blink", "LocalFrameView::scrollContents");
if (!ScrollContentsFastPath(-scroll_delta))
ScrollContentsSlowPath();
// This call will move children with native FrameViews (plugins) and
// invalidate them as well.
FrameRectsChanged();
}
FloatPoint LocalFrameView::ContentsToFrame(
const FloatPoint& point_in_content_space) const {
return point_in_content_space - GetScrollOffset();
......
......@@ -596,16 +596,11 @@ class CORE_EXPORT LocalFrameView final
return ToIntSize(VisibleContentRect().Location());
}
ScrollOffset GetScrollOffset() const override { return scroll_offset_; }
ScrollOffset PendingScrollDelta() const { return pending_scroll_delta_; }
IntSize MinimumScrollOffsetInt()
const override; // The minimum offset we can be scrolled to.
int ScrollX() const { return ScrollOffsetInt().Width(); }
int ScrollY() const { return ScrollOffsetInt().Height(); }
// Scroll the actual contents of the view (either blitting or invalidating as
// needed).
void ScrollContents(const IntSize& scroll_delta);
// This gives us a means of blocking updating our scrollbars until the first
// layout has occurred.
void SetScrollbarsSuppressed(bool suppressed) {
......@@ -918,15 +913,8 @@ class CORE_EXPORT LocalFrameView final
JankTracker& GetJankTracker() { return jank_tracker_; }
protected:
// Scroll the content via the compositor.
bool ScrollContentsFastPath(const IntSize& scroll_delta);
// Scroll the content by invalidating everything.
void ScrollContentsSlowPath();
ScrollBehavior ScrollBehaviorStyle() const override;
void ScrollContentsIfNeeded();
void NotifyFrameRectsChangedIfNeeded();
enum ComputeScrollbarExistenceOption { kFirstPass, kIncremental };
......@@ -1004,8 +992,6 @@ class CORE_EXPORT LocalFrameView final
void ClearLayoutSubtreeRootsAndMarkContainingBlocks();
bool ContentsInCompositedLayer() const;
void PerformPreLayoutTasks();
void PerformLayout(bool in_subtree_layout);
void ScheduleOrPerformPostLayoutTasks();
......@@ -1190,7 +1176,6 @@ class CORE_EXPORT LocalFrameView final
PluginSet plugins_;
HeapHashSet<Member<Scrollbar>> scrollbars_;
ScrollOffset pending_scroll_delta_;
ScrollOffset scroll_offset_;
// TODO(bokan): This is unneeded when root-layer-scrolls is turned on.
......
......@@ -494,7 +494,7 @@ bool LayoutView::MapToVisualRectInAncestorSpaceInternal(
MapCoordinatesFlags mode,
VisualRectFlags visual_rect_flags) const {
if (mode & kIsFixed)
transform_state.Move(OffsetForFixedPosition(true));
transform_state.Move(OffsetForFixedPosition());
// Apply our transform if we have one (because of full page zooming).
if (Layer() && Layer()->Transform()) {
......@@ -551,20 +551,10 @@ bool LayoutView::MapToVisualRectInAncestorSpaceInternal(
return false;
}
LayoutSize LayoutView::OffsetForFixedPosition(
bool include_pending_scroll) const {
LayoutSize LayoutView::OffsetForFixedPosition() const {
FloatSize adjustment;
if (frame_view_) {
adjustment += frame_view_->GetScrollOffset();
// FIXME: Paint invalidation should happen after scroll updates, so there
// should be no pending scroll delta.
// However, we still have paint invalidation during layout, so we can't
// DCHECK for now. crbug.com/434950.
// DCHECK(m_frameView->pendingScrollDelta().isZero());
// If we have a pending scroll, invalidate the previous scroll position.
if (include_pending_scroll && !frame_view_->PendingScrollDelta().IsZero())
adjustment -= frame_view_->PendingScrollDelta();
}
if (HasOverflowClip())
......
......@@ -136,7 +136,7 @@ class CORE_EXPORT LayoutView final : public LayoutBlockFlow {
const LayoutBoxModelObject* ancestor,
TransformState&,
VisualRectFlags = kDefaultVisualRectFlags) const override;
LayoutSize OffsetForFixedPosition(bool include_pending_scroll = false) const;
LayoutSize OffsetForFixedPosition() const;
void InvalidatePaintForViewAndCompositedLayers();
......
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