Commit 21f5dfe2 authored by Steve Kobes's avatar Steve Kobes Committed by Commit Bot

Delete LocalFrameView::ScrollbarManager and scroll_corner_.

This removes methods and paths in LocalFrameView that depend directly on
scrollbar existence.  Since RLS, LocalFrameView never has scrollbars.

Bug: 823365
Change-Id: I691480e4cad9239f12c50aa868c5d13571d45b2f
Reviewed-on: https://chromium-review.googlesource.com/1097540Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Commit-Queue: Steve Kobes <skobes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566618}
parent ad4785c6
......@@ -2043,7 +2043,6 @@ void Document::PropagateStyleToViewport() {
View()->RecalculateScrollbarOverlayColorTheme(
View()->DocumentBackgroundColor());
View()->RecalculateCustomScrollbarStyle();
if (PaintLayerScrollableArea* scrollable_area =
GetLayoutView()->GetScrollableArea()) {
if (scrollable_area->HorizontalScrollbar() &&
......
......@@ -3607,9 +3607,6 @@ void WebViewImpl::ApplyViewportDeltas(
}
elastic_overscroll_ += elastic_overscroll_delta;
if (MainFrameImpl() && MainFrameImpl()->GetFrameView())
MainFrameImpl()->GetFrameView()->DidUpdateElasticOverscroll();
}
void WebViewImpl::RecordWheelAndTouchScrollingCount(
......
......@@ -49,7 +49,6 @@
#include "third_party/blink/renderer/core/paint/object_paint_properties.h"
#include "third_party/blink/renderer/core/paint/paint_invalidation_capable_scrollable_area.h"
#include "third_party/blink/renderer/core/paint/paint_phase.h"
#include "third_party/blink/renderer/core/paint/scrollbar_manager.h"
#include "third_party/blink/renderer/platform/geometry/int_rect.h"
#include "third_party/blink/renderer/platform/geometry/layout_rect.h"
#include "third_party/blink/renderer/platform/graphics/color.h"
......@@ -57,7 +56,6 @@
#include "third_party/blink/renderer/platform/graphics/graphics_layer_client.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/scroll/scroll_types.h"
#include "third_party/blink/renderer/platform/scroll/scrollbar.h"
#include "third_party/blink/renderer/platform/scroll/smooth_scroll_sequencer.h"
#include "third_party/blink/renderer/platform/ukm_time_aggregator.h"
#include "third_party/blink/renderer/platform/wtf/allocator.h"
......@@ -154,8 +152,6 @@ class CORE_EXPORT LocalFrameView final
void SetCanHaveScrollbars(bool);
bool CanHaveScrollbars() const { return can_have_scrollbars_; }
Scrollbar* CreateScrollbar(ScrollbarOrientation) override;
void SnapAfterScrollbarDragging(ScrollbarOrientation) override;
void SetLayoutOverflowSize(const IntSize&);
......@@ -223,8 +219,6 @@ class CORE_EXPORT LocalFrameView final
void UpdateCountersAfterStyleChange();
void Dispose() override;
void DetachScrollbars();
void RecalculateCustomScrollbarStyle();
void InvalidateAllCustomScrollbarsOnActiveChanged();
// True if the LocalFrameView's base background color is completely opaque.
......@@ -244,7 +238,6 @@ class CORE_EXPORT LocalFrameView final
void SetInputEventsScaleForEmulation(float);
void DidChangeScrollOffset();
void DidUpdateElasticOverscroll();
void ViewportSizeChanged(bool width_changed, bool height_changed);
void MarkViewportConstrainedObjectsForLayout(bool width_changed,
......@@ -389,10 +382,6 @@ class CORE_EXPORT LocalFrameView final
FloatPoint ConvertToLayoutObject(const LayoutObject&,
const FloatPoint&) const;
bool IsFrameViewScrollCorner(LayoutScrollbarPart* scroll_corner) const {
return scroll_corner_ == scroll_corner;
}
enum ScrollingReasons {
kScrollable,
kNotScrollableNoOverflow,
......@@ -402,7 +391,6 @@ class CORE_EXPORT LocalFrameView final
ScrollingReasons GetScrollingReasons() const;
bool IsScrollable() const override;
bool IsProgrammaticallyScrollable() override;
IntPoint LastKnownMousePosition() const override;
bool ShouldSetCursor() const;
......@@ -473,7 +461,7 @@ class CORE_EXPORT LocalFrameView final
bool ShouldScrollOnMainThread() const override;
PaintLayer* Layer() const override;
int ScrollSize(ScrollbarOrientation) const override;
bool IsScrollCornerVisible() const override;
bool IsScrollCornerVisible() const override { return false; }
bool UpdateAfterCompositingChange() override;
bool UserInputScrollable(ScrollbarOrientation) const override {
return false;
......@@ -521,18 +509,7 @@ class CORE_EXPORT LocalFrameView final
void RemoveScrollbar(Scrollbar*);
void AddScrollbar(Scrollbar*);
// If the scroll view does not use a native widget, then it will have
// cross-platform Scrollbars. These functions can be used to obtain those
// scrollbars.
Scrollbar* HorizontalScrollbar() const override {
return scrollbar_manager_.HorizontalScrollbar();
}
Scrollbar* VerticalScrollbar() const override {
return scrollbar_manager_.VerticalScrollbar();
}
LayoutScrollbarPart* ScrollCorner() const override { return scroll_corner_; }
void PositionScrollbarLayers();
LayoutScrollbarPart* ScrollCorner() const override { return nullptr; }
// Functions for setting and retrieving the scrolling mode in each axis
// (horizontal/vertical). The mode has values of AlwaysOff, AlwaysOn, and
......@@ -639,10 +616,6 @@ class CORE_EXPORT LocalFrameView final
// Functions for converting to screen coordinates.
IntRect ContentsToScreen(const IntRect&) const;
// For platforms that need to hit test scrollbars from within the engine's
// event handlers (like Win32).
Scrollbar* ScrollbarAtFramePoint(const IntPoint&);
// Converts from/to local "frame" coordinates to the root "frame"
// coordinates. Note: with root-layer-scrolls, "frame" coordinates become
// equivalent to "absoltue" coordinates since the LayoutView (same size and
......@@ -702,9 +675,7 @@ class CORE_EXPORT LocalFrameView final
void Show() override;
void Hide() override;
bool IsPointInScrollbarCorner(const IntPoint&);
bool ScrollbarCornerPresent() const;
IntRect ScrollCornerRect() const override;
IntRect ScrollCornerRect() const override { return IntRect(); }
IntPoint ConvertFromContainingEmbeddedContentViewToScrollbar(
const Scrollbar&,
......@@ -820,8 +791,7 @@ class CORE_EXPORT LocalFrameView final
void CrossOriginStatusChanged();
// The visual viewport can supply scrollbars which affect the existence of
// our scrollbars (see: computeScrollbarExistence).
// The visual viewport can supply scrollbars.
void VisualViewportScrollbarsChanged();
LayoutUnit CaretWidth() const;
......@@ -876,44 +846,8 @@ class CORE_EXPORT LocalFrameView final
void NotifyFrameRectsChangedIfNeeded();
enum ComputeScrollbarExistenceOption { kFirstPass, kIncremental };
void ComputeScrollbarExistence(bool& new_has_horizontal_scrollbar,
bool& new_has_vertical_scrollbar,
const IntSize& doc_size,
ComputeScrollbarExistenceOption = kFirstPass);
void UpdateScrollbarGeometry();
class InUpdateScrollbarsScope {
STACK_ALLOCATED();
public:
explicit InUpdateScrollbarsScope(LocalFrameView* view)
: scope_(&view->in_update_scrollbars_, true) {}
private:
base::AutoReset<bool> scope_;
};
private:
explicit LocalFrameView(LocalFrame&, IntRect);
class ScrollbarManager : public blink::ScrollbarManager {
DISALLOW_NEW();
// Helper class to manage the life cycle of Scrollbar objects.
public:
ScrollbarManager(LocalFrameView& scroller)
: blink::ScrollbarManager(scroller) {}
void SetHasHorizontalScrollbar(bool has_scrollbar) override;
void SetHasVerticalScrollbar(bool has_scrollbar) override;
// TODO(ymalik): This should be hidden and all calls should go through
// setHas*Scrollbar functions above.
Scrollbar* CreateScrollbar(ScrollbarOrientation) override;
protected:
void DestroyScrollbar(ScrollbarOrientation) override;
};
void PaintInternal(GraphicsContext&,
const GlobalPaintFlags,
......@@ -924,8 +858,6 @@ class CORE_EXPORT LocalFrameView final
void UpdateScrollOffset(const ScrollOffset&, ScrollType) override;
void UpdateScrollbarEnabledState();
void DispatchEventsForPrintingOnAllFrames();
void SetupPrintContext();
......@@ -961,7 +893,6 @@ class CORE_EXPORT LocalFrameView final
DocumentLifecycle& Lifecycle() const;
void ContentsResized() override;
void ScrollbarExistenceMaybeChanged();
// Methods to do point conversion via layoutObjects, in order to take
// transforms into account.
......@@ -993,28 +924,17 @@ class CORE_EXPORT LocalFrameView final
void UpdateCompositedSelectionIfNeeded();
void SetNeedsCompositingUpdate(CompositingUpdateType);
// Returns true if the LocalFrameView's own scrollbars overlay its content
// when visible.
bool HasOverlayScrollbars() const;
// Returns true if the frame should use custom scrollbars. If true, sets
// customScrollbarElement to the element that supplies the scrollbar's style
// information.
bool ShouldUseCustomScrollbars(Element*& custom_scrollbar_element) const;
// Returns true if a scrollbar needs to go from native -> custom or vice
// versa, or if a custom scrollbar has a stale owner.
bool NeedsScrollbarReconstruction() const;
bool ShouldIgnoreOverflowHidden() const;
void UpdateScrollCorner();
AXObjectCache* ExistingAXObjectCache() const;
void SetLayoutSizeInternal(const IntSize&);
void AdjustScrollbarOpacity();
bool VisualViewportSuppliesScrollbars();
ScrollingCoordinator* GetScrollingCoordinator() const;
......@@ -1101,9 +1021,6 @@ class CORE_EXPORT LocalFrameView final
Member<Node> fragment_anchor_;
// layoutObject to hold our custom scroll corner.
LayoutScrollbarPart* scroll_corner_;
Member<ScrollableAreaSet> scrollable_areas_;
Member<ScrollableAreaSet> animating_scrollable_areas_;
std::unique_ptr<ResizerAreaSet> resizer_areas_;
......@@ -1141,7 +1058,6 @@ class CORE_EXPORT LocalFrameView final
bool scrollbars_suppressed_;
bool root_layer_did_scroll_;
bool in_update_scrollbars_;
std::unique_ptr<LayoutAnalyzer> analyzer_;
......@@ -1171,9 +1087,6 @@ class CORE_EXPORT LocalFrameView final
HeapLinkedHashSet<WeakMember<ScrollableArea>>;
AnchoringAdjustmentQueue anchoring_adjustment_queue_;
// ScrollbarManager holds the Scrollbar instances.
ScrollbarManager scrollbar_manager_;
bool suppress_adjust_view_size_;
bool allows_layout_invalidation_after_layout_clean_;
bool needs_intersection_observation_;
......
......@@ -669,12 +669,6 @@ WebInputEventResult MouseEventManager::HandleMousePressEvent(
frame_->GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets();
if (LocalFrameView* frame_view = frame_->View()) {
if (frame_view->IsPointInScrollbarCorner(
FlooredIntPoint(event.Event().PositionInRootFrame())))
return WebInputEventResult::kNotHandled;
}
bool single_click = event.Event().click_count <= 1;
mouse_down_may_start_drag_ =
......
......@@ -256,12 +256,6 @@ void LayoutEmbeddedContent::StyleDidChange(StyleDifference diff,
if (!embedded_content_view)
return;
// If the iframe has custom scrollbars, recalculate their style.
if (FrameView* frame_view = ChildFrameView()) {
if (frame_view->IsLocalFrameView())
ToLocalFrameView(frame_view)->RecalculateCustomScrollbarStyle();
}
if (Style()->Visibility() != EVisibility::kVisible) {
embedded_content_view->Hide();
} else {
......
......@@ -233,13 +233,6 @@ void LayoutScrollbarPart::SetNeedsPaintInvalidation() {
// This LayoutScrollbarPart is a scroll corner or a resizer.
DCHECK_EQ(part_, kNoPart);
if (LocalFrameView* frame_view = View()->GetFrameView()) {
if (frame_view->IsFrameViewScrollCorner(this)) {
frame_view->SetScrollCornerNeedsPaintInvalidation();
return;
}
}
scrollable_area_->SetScrollCornerNeedsPaintInvalidation();
}
......
......@@ -144,19 +144,6 @@ bool LayoutView::HitTestNoLifecycleUpdate(HitTestResult& result) {
} else {
hit_layer = Layer()->HitTest(result);
// LocalFrameView scrollbars are not the same as Layer scrollbars tested by
// Layer::hitTestOverflowControls, so we need to test LocalFrameView
// scrollbars separately here. Note that it's important we do this after the
// hit test above, because that may overwrite the entire HitTestResult when
// it finds a hit.
IntPoint frame_point = GetFrameView()->ContentsToFrame(
result.GetHitTestLocation().RoundedPoint());
if (Scrollbar* frame_scrollbar =
GetFrameView()->ScrollbarAtFramePoint(frame_point)) {
result.SetScrollbar(frame_scrollbar);
hit_layer = true;
}
// If hitTestResult include scrollbar, innerNode should be the parent of the
// scrollbar.
if (result.GetScrollbar()) {
......
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