Commit d12c2b3a authored by pdr's avatar pdr Committed by Commit bot

Do not pass scrollPosition to updateScrollbars at every callsite

More followup cleanup to the scroll position code. This is a minor
refactoring to push the scroll position double concent into
updateScrollbars since it does not need to be plumbed at every callsite.
scrollPositionDouble has some subtlety (see comment above it) which is
easy to mess up.

Review URL: https://codereview.chromium.org/1758413002

Cr-Commit-Position: refs/heads/master@{#380478}
parent a2e14e32
......@@ -398,7 +398,7 @@ void FrameView::setFrameRect(const IntRect& newRect)
Widget::setFrameRect(newRect);
updateScrollbars(scrollOffsetDouble());
updateScrollbars();
frameRectsChanged();
updateScrollableAreaSet();
......@@ -506,7 +506,7 @@ void FrameView::setContentsSize(const IntSize& size)
return;
m_contentsSize = size;
updateScrollbars(scrollOffsetDouble());
updateScrollbars();
ScrollableArea::contentsResized();
Page* page = frame().page();
......@@ -537,7 +537,7 @@ void FrameView::adjustViewSize()
// updating scrollbars twice by skipping the call here when the content
// size does not change.
if (!m_frame->document()->printing() && size == contentsSize())
updateScrollbars(scrollOffsetDouble());
updateScrollbars();
}
setContentsSize(size);
......@@ -1009,7 +1009,7 @@ void FrameView::layout()
}
if (needsScrollbarReconstruction() || scrollOriginChanged())
updateScrollbars(scrollOffsetDouble());
updateScrollbars();
LayoutSize oldSize = m_size;
......@@ -2257,7 +2257,7 @@ void FrameView::scrollbarStyleChanged()
return;
adjustScrollbarOpacity();
contentsResized();
updateScrollbars(scrollOffsetDouble());
updateScrollbars();
positionScrollbarLayers();
}
......@@ -3160,7 +3160,7 @@ void FrameView::setScrollbarModes(ScrollbarMode horizontalMode, ScrollbarMode ve
if (!needsUpdate)
return;
updateScrollbars(scrollOffsetDouble());
updateScrollbars();
if (!layerForScrolling())
return;
......@@ -3270,7 +3270,7 @@ void FrameView::setScrollOffset(const DoublePoint& offset, ScrollType scrollType
void FrameView::windowResizerRectChanged()
{
updateScrollbars(scrollOffsetDouble());
updateScrollbars();
}
bool FrameView::hasOverlayScrollbars() const
......@@ -3441,7 +3441,7 @@ bool FrameView::shouldIgnoreOverflowHidden() const
return m_frame->settings()->ignoreMainFrameOverflowHiddenQuirk() && m_frame->isMainFrame();
}
void FrameView::updateScrollbars(const DoubleSize& desiredOffset)
void FrameView::updateScrollbars()
{
if (m_frame->settings() && m_frame->settings()->rootLayerScrolls())
return;
......@@ -3450,7 +3450,7 @@ void FrameView::updateScrollbars(const DoubleSize& desiredOffset)
if (visualViewportSuppliesScrollbars()) {
setHasHorizontalScrollbar(false);
setHasVerticalScrollbar(false);
setScrollOffsetFromUpdateScrollbars(desiredOffset);
setScrollOffsetFromUpdateScrollbars(scrollOffsetDouble());
return;
}
......@@ -3482,7 +3482,7 @@ void FrameView::updateScrollbars(const DoubleSize& desiredOffset)
updateScrollCorner();
}
setScrollOffsetFromUpdateScrollbars(desiredOffset);
setScrollOffsetFromUpdateScrollbars(scrollOffsetDouble());
}
void FrameView::setScrollOffsetFromUpdateScrollbars(const DoubleSize& offset)
......
......@@ -619,7 +619,7 @@ protected:
IntRect adjustScrollbarRectForResizer(const IntRect&, Scrollbar&);
// Called to update the scrollbars to accurately reflect the state of the view.
void updateScrollbars(const DoubleSize& desiredOffset);
void updateScrollbars();
class InUpdateScrollbarsScope {
STACK_ALLOCATED();
......
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