WebKit Bugzilla
Attachment 372212 Details for
Bug 198895
: Implement ScrollableArea::scrollOffset()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198895-20190615195734.patch (text/plain), 29.55 KB, created by
Simon Fraser (smfr)
on 2019-06-15 19:57:35 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Simon Fraser (smfr)
Created:
2019-06-15 19:57:35 PDT
Size:
29.55 KB
patch
obsolete
>Subversion Revision: 246343 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index f51216e97256723696e79470688add08117f47ff..af84a73cea5c09eafbbb0f17878cd7954a5e51e5 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,65 @@ >+2019-06-15 Simon Fraser <simon.fraser@apple.com> >+ >+ Implement ScrollableArea::scrollOffset() >+ https://bugs.webkit.org/show_bug.cgi?id=198895 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Remove from ScrollableArea the following: >+ virtual int scrollSize(ScrollbarOrientation) const = 0; >+ virtual int scrollOffset(ScrollbarOrientation) const = 0; >+ and instead implement ScrollOffset scrollOffset() const. >+ >+ Also make scrollPosition() pure virtual, avoiding the reverse dependency where >+ this base class implementation got values from scrollbars. >+ >+ scrollSize(ScrollbarOrientation) was only used by ScrollAnimatorIOS and we can >+ do the same computation via min/max scroll positions. >+ >+ RenderListBox and PopupMenuWin need implementations of scrollPosition(). >+ >+ Remove some PLATFORM(IOS_FAMILY) #ifdefs from ScrollableArea for code that compiles >+ on all platforms. >+ >+ * page/FrameView.h: >+ * platform/ScrollView.cpp: >+ (WebCore::ScrollView::overhangAmount const): >+ (WebCore::ScrollView::scrollSize const): Deleted. >+ (WebCore::ScrollView::scrollOffset const): Deleted. >+ * platform/ScrollView.h: >+ * platform/ScrollableArea.cpp: >+ (WebCore::ScrollableArea::isPinnedVerticallyInDirection const): >+ (WebCore::ScrollableArea::scrollOffset const): >+ (WebCore::ScrollableArea::scrollPosition const): Deleted. >+ * platform/ScrollableArea.h: >+ (WebCore::offsetForOrientation): >+ (WebCore::ScrollableArea::isHorizontalScrollerPinnedToMinimumPosition const): >+ (WebCore::ScrollableArea::isHorizontalScrollerPinnedToMaximumPosition const): >+ (WebCore::ScrollableArea::isVerticalScrollerPinnedToMinimumPosition const): >+ (WebCore::ScrollableArea::isVerticalScrollerPinnedToMaximumPosition const): >+ (WebCore::ScrollableArea::tiledBacking const): Deleted. >+ * platform/Scrollbar.cpp: >+ (WebCore::Scrollbar::Scrollbar): >+ (WebCore::Scrollbar::offsetDidChange): >+ * platform/ios/ScrollAnimatorIOS.mm: >+ (WebCore::ScrollAnimatorIOS::handleTouchEvent): >+ * platform/win/PopupMenuWin.cpp: >+ (WebCore::PopupMenuWin::scrollPosition const): >+ (WebCore::PopupMenuWin::wndProc): >+ (WebCore::PopupMenuWin::scrollSize const): Deleted. >+ (WebCore::PopupMenuWin::scrollOffset const): Deleted. >+ * platform/win/PopupMenuWin.h: >+ (WebCore::PopupMenuWin::scrollOffset const): Deleted. >+ * rendering/RenderLayer.cpp: >+ (WebCore::RenderLayer::scrollSize const): Deleted. >+ (WebCore::RenderLayer::scrollOffset const): Deleted. >+ * rendering/RenderLayer.h: >+ * rendering/RenderListBox.cpp: >+ (WebCore::RenderListBox::scrollPosition const): >+ (WebCore::RenderListBox::scrollSize const): Deleted. >+ (WebCore::RenderListBox::scrollOffset const): Deleted. >+ * rendering/RenderListBox.h: >+ > 2019-06-11 Timothy Hatcher <timothy@apple.com> > > Flash when tapping compose button after switching to/from dark mode without restarting Mail. >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 8e461f9d3e61b9213966c978899bb351e16248fa..e91e3861e6213e8709af835e9ae8f6aacdb79dc7 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,22 @@ >+2019-06-15 Simon Fraser <simon.fraser@apple.com> >+ >+ Implement ScrollableArea::scrollOffset() >+ https://bugs.webkit.org/show_bug.cgi?id=198895 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UIProcess/win/WebPopupMenuProxyWin.cpp: >+ (WebKit::PopupMenuWin::scrollPosition const): >+ (WebKit::WebPopupMenuProxyWin::onKeyDown): Just use m_scrollOffset. >+ (WebKit::WebPopupMenuProxyWin::scrollSize const): Deleted. >+ * UIProcess/win/WebPopupMenuProxyWin.h: Remove the one-axis scrollOffset() >+ * WebProcess/Plugins/PDF/PDFPlugin.h: >+ * WebProcess/Plugins/PDF/PDFPlugin.mm: >+ (WebKit::PDFPlugin::scrollSize const): Deleted. >+ (WebKit::PDFPlugin::scrollOffset const): Deleted. >+ * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: >+ (WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect): >+ > 2019-06-11 Timothy Hatcher <timothy@apple.com> > > Flash when tapping compose button after switching to/from dark mode without restarting Mail. >diff --git a/Source/WebCore/page/FrameView.h b/Source/WebCore/page/FrameView.h >index 390301f375871c154306d83c3b98e57d3f473228..bf94012f2ff2a5a0b788ef31595038413dfd08da 100644 >--- a/Source/WebCore/page/FrameView.h >+++ b/Source/WebCore/page/FrameView.h >@@ -153,7 +153,7 @@ public: > WEBCORE_EXPORT GraphicsLayer* graphicsLayerForPlatformWidget(PlatformWidget); > WEBCORE_EXPORT void scheduleLayerFlushAllowingThrottling(); > >- WEBCORE_EXPORT TiledBacking* tiledBacking() const final; >+ WEBCORE_EXPORT TiledBacking* tiledBacking() const; > > ScrollingNodeID scrollingNodeID() const override; > ScrollableArea* scrollableAreaForScrollLayerID(uint64_t) const; >diff --git a/Source/WebCore/platform/ScrollView.cpp b/Source/WebCore/platform/ScrollView.cpp >index 61bb518bca1a95ea95bf978f89fd46114ecb5d40..b126a9c2b706a117346c57407851e385582cc968 100644 >--- a/Source/WebCore/platform/ScrollView.cpp >+++ b/Source/WebCore/platform/ScrollView.cpp >@@ -378,19 +378,6 @@ ScrollPosition ScrollView::documentScrollPositionRelativeToScrollableAreaOrigin( > return scrollPosition() - IntSize(0, headerHeight()); > } > >-int ScrollView::scrollSize(ScrollbarOrientation orientation) const >-{ >- // If no scrollbars are present, it does not indicate content is not be scrollable. >- if (!m_horizontalScrollbar && !m_verticalScrollbar && !prohibitsScrolling()) { >- IntSize scrollSize = m_contentsSize - visibleContentRect(LegacyIOSDocumentVisibleRect).size(); >- scrollSize.clampNegativeToZero(); >- return orientation == HorizontalScrollbar ? scrollSize.width() : scrollSize.height(); >- } >- >- Scrollbar* scrollbar = ((orientation == HorizontalScrollbar) ? m_horizontalScrollbar : m_verticalScrollbar).get(); >- return scrollbar ? (scrollbar->totalSize() - scrollbar->visibleSize()) : 0; >-} >- > void ScrollView::notifyPageThatContentAreaWillPaint() const > { > } >@@ -474,19 +461,6 @@ void ScrollView::completeUpdatesAfterScrollTo(const IntSize& scrollDelta) > updateCompositingLayersAfterScrolling(); > } > >-int ScrollView::scrollOffset(ScrollbarOrientation orientation) const >-{ >- ScrollOffset offset = scrollOffsetFromPosition(scrollPosition()); >- >- if (orientation == HorizontalScrollbar) >- return offset.x(); >- >- if (orientation == VerticalScrollbar) >- return offset.y(); >- >- return 0; >-} >- > void ScrollView::setScrollPosition(const ScrollPosition& scrollPosition) > { > LOG_WITH_STREAM(Scrolling, stream << "ScrollView::setScrollPosition " << scrollPosition); >@@ -528,7 +502,7 @@ IntSize ScrollView::overhangAmount() const > IntSize stretch; > > // FIXME: use maximumScrollOffset() >- ScrollOffset scrollOffset = scrollOffsetFromPosition(scrollPosition()); >+ ScrollOffset scrollOffset = this->scrollOffset(); > if (scrollOffset.y() < 0) > stretch.setHeight(scrollOffset.y()); > else if (totalContentsSize().height() && scrollOffset.y() > totalContentsSize().height() - visibleHeight()) >diff --git a/Source/WebCore/platform/ScrollView.h b/Source/WebCore/platform/ScrollView.h >index ff82c27644ca0e10dc548c88e1b5e7aeac18fd97..03eb5d170a7b7fdd15b238920493e58f595b5000 100644 >--- a/Source/WebCore/platform/ScrollView.h >+++ b/Source/WebCore/platform/ScrollView.h >@@ -69,8 +69,6 @@ public: > using Widget::weakPtrFactory; > > // ScrollableArea functions. >- int scrollSize(ScrollbarOrientation) const final; >- int scrollOffset(ScrollbarOrientation) const final; > WEBCORE_EXPORT void setScrollOffset(const ScrollOffset&) final; > bool isScrollCornerVisible() const final; > void scrollbarStyleChanged(ScrollbarStyle, bool forceUpdate) override; >diff --git a/Source/WebCore/platform/ScrollableArea.cpp b/Source/WebCore/platform/ScrollableArea.cpp >index a98e5dab6ef60dcab2f97719d5f0d8ece5ef131b..c8882ee23050971c946a55a97faa37bf09e51398 100644 >--- a/Source/WebCore/platform/ScrollableArea.cpp >+++ b/Source/WebCore/platform/ScrollableArea.cpp >@@ -572,7 +572,6 @@ void ScrollableArea::serviceScrollAnimations() > scrollAnimator->serviceScrollAnimations(); > } > >-#if PLATFORM(IOS_FAMILY) > bool ScrollableArea::isPinnedInBothDirections(const IntSize& scrollDelta) const > { > return isPinnedHorizontallyInDirection(scrollDelta.width()) && isPinnedVerticallyInDirection(scrollDelta.height()); >@@ -595,7 +594,6 @@ bool ScrollableArea::isPinnedVerticallyInDirection(int verticalScrollDelta) cons > return true; > return false; > } >-#endif // PLATFORM(IOS_FAMILY) > > int ScrollableArea::horizontalScrollbarIntrusion() const > { >@@ -612,12 +610,9 @@ IntSize ScrollableArea::scrollbarIntrusion() const > return { horizontalScrollbarIntrusion(), verticalScrollbarIntrusion() }; > } > >-ScrollPosition ScrollableArea::scrollPosition() const >+ScrollOffset ScrollableArea::scrollOffset() const > { >- // FIXME: This relationship seems to be inverted. Scrollbars should be 'view', not 'model', and should get their values from us. >- int x = horizontalScrollbar() ? horizontalScrollbar()->value() : 0; >- int y = verticalScrollbar() ? verticalScrollbar()->value() : 0; >- return IntPoint(x, y); >+ return scrollOffsetFromPosition(scrollPosition()); > } > > ScrollPosition ScrollableArea::minimumScrollPosition() const >diff --git a/Source/WebCore/platform/ScrollableArea.h b/Source/WebCore/platform/ScrollableArea.h >index fde607f38682e390b914e4861781fffa13ea28af..d7438c15cd51d6660c0f738ac2e97fabf5abdc23 100644 >--- a/Source/WebCore/platform/ScrollableArea.h >+++ b/Source/WebCore/platform/ScrollableArea.h >@@ -48,6 +48,18 @@ typedef IntPoint ScrollPosition; > // scrollOffset() is the value used by scrollbars (min is 0,0), and should never have negative components. > typedef IntPoint ScrollOffset; > >+ >+inline int offsetForOrientation(ScrollOffset offset, ScrollbarOrientation orientation) >+{ >+ switch (orientation) { >+ case HorizontalScrollbar: return offset.x(); >+ case VerticalScrollbar: return offset.y(); >+ } >+ ASSERT_NOT_REACHED(); >+ return 0; >+} >+ >+ > class ScrollableArea : public CanMakeWeakPtr<ScrollableArea> { > public: > WEBCORE_EXPORT bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1); >@@ -157,8 +169,6 @@ public: > ScrollAnimator* existingScrollAnimator() const { return m_scrollAnimator.get(); } > > virtual bool isActive() const = 0; >- virtual int scrollSize(ScrollbarOrientation) const = 0; >- virtual int scrollOffset(ScrollbarOrientation) const = 0; > WEBCORE_EXPORT virtual void invalidateScrollbar(Scrollbar&, const IntRect&); > virtual bool isScrollCornerVisible() const = 0; > virtual IntRect scrollCornerRect() const = 0; >@@ -196,7 +206,7 @@ public: > const IntPoint& scrollOrigin() const { return m_scrollOrigin; } > bool scrollOriginChanged() const { return m_scrollOriginChanged; } > >- virtual ScrollPosition scrollPosition() const; >+ virtual ScrollPosition scrollPosition() const = 0; > virtual ScrollPosition minimumScrollPosition() const; > virtual ScrollPosition maximumScrollPosition() const; > >@@ -205,6 +215,8 @@ public: > return position.constrainedBetween(minimumScrollPosition(), maximumScrollPosition()); > } > >+ WEBCORE_EXPORT ScrollOffset scrollOffset() const; >+ > ScrollOffset maximumScrollOffset() const; > > WEBCORE_EXPORT ScrollPosition scrollPositionFromOffset(ScrollOffset) const; >@@ -298,18 +310,14 @@ public: > virtual bool scheduleAnimation() { return false; } > void serviceScrollAnimations(); > >-#if PLATFORM(IOS_FAMILY) >- bool isHorizontalScrollerPinnedToMinimumPosition() const { return !horizontalScrollbar() || scrollOffset(HorizontalScrollbar) <= 0; } >- bool isHorizontalScrollerPinnedToMaximumPosition() const { return !horizontalScrollbar() || scrollOffset(HorizontalScrollbar) >= maximumScrollOffset().x(); } >- bool isVerticalScrollerPinnedToMinimumPosition() const { return !verticalScrollbar() || scrollOffset(VerticalScrollbar) <= 0; } >- bool isVerticalScrollerPinnedToMaximumPosition() const { return !verticalScrollbar() || scrollOffset(VerticalScrollbar) >= maximumScrollOffset().y(); } >+ bool isHorizontalScrollerPinnedToMinimumPosition() const { return !horizontalScrollbar() || scrollOffset().x() <= 0; } >+ bool isHorizontalScrollerPinnedToMaximumPosition() const { return !horizontalScrollbar() || scrollOffset().x() >= maximumScrollOffset().x(); } >+ bool isVerticalScrollerPinnedToMinimumPosition() const { return !verticalScrollbar() || scrollOffset().y() <= 0; } >+ bool isVerticalScrollerPinnedToMaximumPosition() const { return !verticalScrollbar() || scrollOffset().y() >= maximumScrollOffset().y(); } > > bool isPinnedInBothDirections(const IntSize&) const; > bool isPinnedHorizontallyInDirection(int horizontalScrollDelta) const; > bool isPinnedVerticallyInDirection(int verticalScrollDelta) const; >-#endif >- >- virtual TiledBacking* tiledBacking() const { return nullptr; } > > // True if scrolling happens by moving compositing layers. > virtual bool usesCompositedScrolling() const { return false; } >diff --git a/Source/WebCore/platform/Scrollbar.cpp b/Source/WebCore/platform/Scrollbar.cpp >index 25f8af16a185dec1dcf227f00951c688329c8fc8..39691550d9fa2e7395c55309b3e24e7732edfb7b 100644 >--- a/Source/WebCore/platform/Scrollbar.cpp >+++ b/Source/WebCore/platform/Scrollbar.cpp >@@ -69,7 +69,7 @@ Scrollbar::Scrollbar(ScrollableArea& scrollableArea, ScrollbarOrientation orient > int thickness = theme().scrollbarThickness(controlSize); > Widget::setFrameRect(IntRect(0, 0, thickness, thickness)); > >- m_currentPos = static_cast<float>(m_scrollableArea.scrollOffset(m_orientation)); >+ m_currentPos = static_cast<float>(offsetForOrientation(m_scrollableArea.scrollOffset(), m_orientation)); > } > > Scrollbar::~Scrollbar() >@@ -91,7 +91,7 @@ int Scrollbar::occupiedHeight() const > > void Scrollbar::offsetDidChange() > { >- float position = static_cast<float>(m_scrollableArea.scrollOffset(m_orientation)); >+ float position = static_cast<float>(offsetForOrientation(m_scrollableArea.scrollOffset(), m_orientation)); > if (position == m_currentPos) > return; > >diff --git a/Source/WebCore/platform/ios/ScrollAnimatorIOS.mm b/Source/WebCore/platform/ios/ScrollAnimatorIOS.mm >index 49574688b71042946f93b900bbd22985867abebe..01f0a9bb20a248b6998856470aee374a98cfa51c 100644 >--- a/Source/WebCore/platform/ios/ScrollAnimatorIOS.mm >+++ b/Source/WebCore/platform/ios/ScrollAnimatorIOS.mm >@@ -103,8 +103,9 @@ bool ScrollAnimatorIOS::handleTouchEvent(const PlatformTouchEvent& touchEvent) > determineScrollableAreaForTouchSequence(touchDelta); > > if (!m_committedToScrollAxis) { >- bool horizontallyScrollable = m_scrollableArea.scrollSize(HorizontalScrollbar); >- bool verticallyScrollable = m_scrollableArea.scrollSize(VerticalScrollbar); >+ auto scrollSize = m_scrollableArea.maximumScrollPosition() - m_scrollableArea.minimumScrollPosition(); >+ bool horizontallyScrollable = scrollSize.width(); >+ bool verticallyScrollable = scrollSize.height(); > > if (!horizontallyScrollable && !verticallyScrollable) > return false; >diff --git a/Source/WebCore/platform/win/PopupMenuWin.cpp b/Source/WebCore/platform/win/PopupMenuWin.cpp >index 522a3408eb4a4b223f67607fa1391dff0a9af766..7c7bfdfb18c5be67e170da9643b9c3dde5c32df4 100644 >--- a/Source/WebCore/platform/win/PopupMenuWin.cpp >+++ b/Source/WebCore/platform/win/PopupMenuWin.cpp >@@ -679,14 +679,9 @@ void PopupMenuWin::paint(const IntRect& damageRect, HDC hdc) > ::BitBlt(localDC, damageRect.x(), damageRect.y(), damageRect.width(), damageRect.height(), m_DC.get(), damageRect.x(), damageRect.y(), SRCCOPY); > } > >-int PopupMenuWin::scrollSize(ScrollbarOrientation orientation) const >+ScrollPosition PopupMenuWin::scrollPosition() const > { >- return ((orientation == VerticalScrollbar) && m_scrollbar) ? (m_scrollbar->totalSize() - m_scrollbar->visibleSize()) : 0; >-} >- >-int PopupMenuWin::scrollOffset(ScrollbarOrientation) const >-{ >- return m_scrollOffset; >+ return { 0, m_scrollOffset }; > } > > void PopupMenuWin::setScrollOffset(const IntPoint& offset) >@@ -892,9 +887,9 @@ LRESULT PopupMenuWin::wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa > focusLast(); > break; > case VK_PRIOR: >- if (focusedIndex() != scrollOffset()) { >+ if (focusedIndex() != m_scrollOffset) { > // Set the selection to the first visible item >- int firstVisibleItem = scrollOffset(); >+ int firstVisibleItem = m_scrollOffset; > up(focusedIndex() - firstVisibleItem); > } else { > // The first visible item is selected, so move the selection back one page >@@ -902,7 +897,7 @@ LRESULT PopupMenuWin::wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa > } > break; > case VK_NEXT: { >- int lastVisibleItem = scrollOffset() + visibleItems() - 1; >+ int lastVisibleItem = m_scrollOffset + visibleItems() - 1; > if (focusedIndex() != lastVisibleItem) { > // Set the selection to the last visible item > down(lastVisibleItem - focusedIndex()); >diff --git a/Source/WebCore/platform/win/PopupMenuWin.h b/Source/WebCore/platform/win/PopupMenuWin.h >index 363a0a3ab5d5a4c2442e6fa4f59bb400f31cbfec..3529b8f287937737d8f24316ecd6c29d4d7611ab 100644 >--- a/Source/WebCore/platform/win/PopupMenuWin.h >+++ b/Source/WebCore/platform/win/PopupMenuWin.h >@@ -77,8 +77,6 @@ private: > void setWasClicked(bool b = true) { m_wasClicked = b; } > bool wasClicked() const { return m_wasClicked; } > >- int scrollOffset() const { return m_scrollOffset; } >- > bool scrollToRevealSelection(); > > void incrementWheelDelta(int delta); >@@ -89,8 +87,7 @@ private: > void setScrollbarCapturingMouse(bool b) { m_scrollbarCapturingMouse = b; } > > // ScrollableArea >- int scrollSize(ScrollbarOrientation) const override; >- int scrollOffset(ScrollbarOrientation) const override; >+ ScrollPosition scrollPosition() const override; > void setScrollOffset(const IntPoint&) override; > void invalidateScrollbarRect(Scrollbar&, const IntRect&) override; > void invalidateScrollCornerRect(const IntRect&) override { } >diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp >index a6a30466ed174a68382c341c580d31333127ff0a..c308a7a453f02bc609fe666104e0c071190c7537 100644 >--- a/Source/WebCore/rendering/RenderLayer.cpp >+++ b/Source/WebCore/rendering/RenderLayer.cpp >@@ -2894,28 +2894,11 @@ void RenderLayer::resize(const PlatformMouseEvent& evt, const LayoutSize& oldOff > // FIXME (Radar 4118564): We should also autoscroll the window as necessary to keep the point under the cursor in view. > } > >-int RenderLayer::scrollSize(ScrollbarOrientation orientation) const >-{ >- Scrollbar* scrollbar = ((orientation == HorizontalScrollbar) ? m_hBar : m_vBar).get(); >- return scrollbar ? (scrollbar->totalSize() - scrollbar->visibleSize()) : 0; >-} >- > void RenderLayer::setScrollOffset(const ScrollOffset& offset) > { > scrollTo(scrollPositionFromOffset(offset)); > } > >-int RenderLayer::scrollOffset(ScrollbarOrientation orientation) const >-{ >- if (orientation == HorizontalScrollbar) >- return scrollOffset().x(); >- >- if (orientation == VerticalScrollbar) >- return scrollOffset().y(); >- >- return 0; >-} >- > ScrollingNodeID RenderLayer::scrollingNodeID() const > { > if (!isComposited()) >diff --git a/Source/WebCore/rendering/RenderLayer.h b/Source/WebCore/rendering/RenderLayer.h >index 5e07bc775f22be480fde242c58c78da46373a32d..8cc87588a0c9d4d0b5a4b4a08515266e659a70d2 100644 >--- a/Source/WebCore/rendering/RenderLayer.h >+++ b/Source/WebCore/rendering/RenderLayer.h >@@ -442,8 +442,6 @@ public: > void setPostLayoutScrollPosition(Optional<ScrollPosition>); > void applyPostLayoutScrollPositionIfNeeded(); > >- ScrollOffset scrollOffset() const { return scrollOffsetFromPosition(m_scrollPosition); } >- > void availableContentSizeChanged(AvailableSizeChangeReason) override; > > // "absoluteRect" is in scaled document coordinates. >@@ -1073,8 +1071,6 @@ private: > > bool shouldBeSelfPaintingLayer() const; > >- int scrollOffset(ScrollbarOrientation) const override; >- > // ScrollableArea interface > void invalidateScrollbarRect(Scrollbar&, const IntRect&) override; > void invalidateScrollCornerRect(const IntRect&) override; >@@ -1085,7 +1081,6 @@ private: > IntRect convertFromContainingViewToScrollbar(const Scrollbar&, const IntRect&) const override; > IntPoint convertFromScrollbarToContainingView(const Scrollbar&, const IntPoint&) const override; > IntPoint convertFromContainingViewToScrollbar(const Scrollbar&, const IntPoint&) const override; >- int scrollSize(ScrollbarOrientation) const override; > void setScrollOffset(const ScrollOffset&) override; > ScrollingNodeID scrollingNodeID() const override; > >diff --git a/Source/WebCore/rendering/RenderListBox.cpp b/Source/WebCore/rendering/RenderListBox.cpp >index 44c6d1f693c9777b302ccf78a3af46f9c0afa99e..4b4129ffbe9044c00febc40d5694cfc0772253d3 100644 >--- a/Source/WebCore/rendering/RenderListBox.cpp >+++ b/Source/WebCore/rendering/RenderListBox.cpp >@@ -645,14 +645,9 @@ void RenderListBox::valueChanged(unsigned listIndex) > selectElement().dispatchFormControlChangeEvent(); > } > >-int RenderListBox::scrollSize(ScrollbarOrientation orientation) const >+ScrollPosition RenderListBox::scrollPosition() const > { >- return ((orientation == VerticalScrollbar) && m_vBar) ? (m_vBar->totalSize() - m_vBar->visibleSize()) : 0; >-} >- >-int RenderListBox::scrollOffset(ScrollbarOrientation) const >-{ >- return m_indexOffset; >+ return { 0, m_indexOffset }; > } > > ScrollPosition RenderListBox::minimumScrollPosition() const >diff --git a/Source/WebCore/rendering/RenderListBox.h b/Source/WebCore/rendering/RenderListBox.h >index 3cd1697e2a48a53ea9d0a1320afc9a0e150a426b..65d9226b3a054e6978a029674ea9df44041e37bc 100644 >--- a/Source/WebCore/rendering/RenderListBox.h >+++ b/Source/WebCore/rendering/RenderListBox.h >@@ -112,11 +112,12 @@ private: > bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) override; > > // ScrollableArea interface. >- int scrollSize(ScrollbarOrientation) const override; >- int scrollOffset(ScrollbarOrientation) const override; > void setScrollOffset(const ScrollOffset&) override; >+ >+ ScrollPosition scrollPosition() const override; > ScrollPosition minimumScrollPosition() const override; > ScrollPosition maximumScrollPosition() const override; >+ > void invalidateScrollbarRect(Scrollbar&, const IntRect&) override; > bool isActive() const override; > bool isScrollCornerVisible() const override { return false; } // We don't support resize on list boxes yet. If we did these would have to change. >diff --git a/Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.cpp b/Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.cpp >index 980e0b7bb01227a323a6d45a957da8b93bd28b73..0a8d8c455a5e6c9876bb1ac0e11248e0d559d04d 100644 >--- a/Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.cpp >+++ b/Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.cpp >@@ -441,9 +441,9 @@ void WebPopupMenuProxyWin::invalidateItem(int index) > ::InvalidateRect(m_popup, &r, TRUE); > } > >-int WebPopupMenuProxyWin::scrollSize(ScrollbarOrientation orientation) const >+ScrollPosition WebPopupMenuProxyWin::scrollPosition() const > { >- return ((orientation == VerticalScrollbar) && m_scrollbar) ? (m_scrollbar->totalSize() - m_scrollbar->visibleSize()) : 0; >+ return { 0, m_scrollOffset }; > } > > void WebPopupMenuProxyWin::setScrollOffset(const IntPoint& offset) >@@ -554,9 +554,9 @@ LRESULT WebPopupMenuProxyWin::onKeyDown(HWND hWnd, UINT message, WPARAM wParam, > focusLast(); > break; > case VK_PRIOR: >- if (focusedIndex() != scrollOffset(VerticalScrollbar)) { >+ if (focusedIndex() != m_scrollOffset) { > // Set the selection to the first visible item >- int firstVisibleItem = scrollOffset(VerticalScrollbar); >+ int firstVisibleItem = m_scrollOffset; > up(focusedIndex() - firstVisibleItem); > } else { > // The first visible item is selected, so move the selection back one page >@@ -564,7 +564,7 @@ LRESULT WebPopupMenuProxyWin::onKeyDown(HWND hWnd, UINT message, WPARAM wParam, > } > break; > case VK_NEXT: { >- int lastVisibleItem = scrollOffset(VerticalScrollbar) + visibleItems() - 1; >+ int lastVisibleItem = m_scrollOffset + visibleItems() - 1; > if (focusedIndex() != lastVisibleItem) { > // Set the selection to the last visible item > down(lastVisibleItem - focusedIndex()); >@@ -921,7 +921,6 @@ void WebPopupMenuProxyWin::focusLast() > } > } > >- > void WebPopupMenuProxyWin::incrementWheelDelta(int delta) > { > m_wheelDelta += delta; >diff --git a/Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.h b/Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.h >index 4694c47bb79901b066849ccbcbb464c327a4c089..64739b3363f5be1bad3f87eef13cd510f271742b 100644 >--- a/Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.h >+++ b/Source/WebKit/UIProcess/win/WebPopupMenuProxyWin.h >@@ -58,9 +58,8 @@ private: > WebCore::Scrollbar* scrollbar() const { return m_scrollbar.get(); } > > // ScrollableArea >- int scrollSize(WebCore::ScrollbarOrientation) const override; >+ WebCore::ScrollPosition scrollPosition() const override; > void setScrollOffset(const WebCore::IntPoint&) override; >- int scrollOffset(WebCore::ScrollbarOrientation) const override { return m_scrollOffset; } > > void invalidateScrollbarRect(WebCore::Scrollbar&, const WebCore::IntRect&) override; > void invalidateScrollCornerRect(const WebCore::IntRect&) override { } >diff --git a/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h b/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h >index 6862e304fedb85b78634700b9d6b35a6c3c20cec..d41503b20a3be902a3a3e8a84f3c3d5aca019121 100644 >--- a/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h >+++ b/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h >@@ -202,10 +202,8 @@ private: > void invalidateScrollbarRect(WebCore::Scrollbar&, const WebCore::IntRect&) final; > void invalidateScrollCornerRect(const WebCore::IntRect&) final; > WebCore::IntPoint lastKnownMousePosition() const final { return m_lastMousePositionInPluginCoordinates; } >- int scrollSize(WebCore::ScrollbarOrientation) const final; > bool isActive() const final; > bool isScrollCornerVisible() const final { return false; } >- int scrollOffset(WebCore::ScrollbarOrientation) const final; > WebCore::ScrollPosition scrollPosition() const final; > WebCore::ScrollPosition minimumScrollPosition() const final; > WebCore::ScrollPosition maximumScrollPosition() const final; >diff --git a/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm b/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm >index 1588bd0e1c50798804ce1414ff033275f45c9bca..03a1f0465c0e65c2652254f0e42d0aec5520943f 100644 >--- a/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm >+++ b/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm >@@ -863,12 +863,6 @@ IntRect PDFPlugin::scrollableAreaBoundingBox(bool*) const > return pluginView()->frameRect(); > } > >-int PDFPlugin::scrollSize(ScrollbarOrientation orientation) const >-{ >- Scrollbar* scrollbar = ((orientation == HorizontalScrollbar) ? m_horizontalScrollbar : m_verticalScrollbar).get(); >- return scrollbar ? (scrollbar->totalSize() - scrollbar->visibleSize()) : 0; >-} >- > bool PDFPlugin::isActive() const > { > if (Frame* coreFrame = m_frame->coreFrame()) { >@@ -889,18 +883,6 @@ bool PDFPlugin::forceUpdateScrollbarsOnMainThreadForPerformanceTesting() const > return false; > } > >-int PDFPlugin::scrollOffset(ScrollbarOrientation orientation) const >-{ >- if (orientation == HorizontalScrollbar) >- return m_scrollOffset.width(); >- >- if (orientation == VerticalScrollbar) >- return m_scrollOffset.height(); >- >- ASSERT_NOT_REACHED(); >- return 0; >-} >- > ScrollPosition PDFPlugin::scrollPosition() const > { > return IntPoint(m_scrollOffset.width(), m_scrollOffset.height()); >diff --git a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm >index 4e4762c9d1b977e3f151d5d971b75bb198c88ad7..5e50e0ba1ef1246c6ae08f29d92a830e0db4f237 100644 >--- a/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm >+++ b/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm >@@ -253,10 +253,8 @@ void RemoteLayerTreeDrawingArea::updateScrolledExposedRect() > m_scrolledViewExposedRect = m_viewExposedRect; > > #if !PLATFORM(IOS_FAMILY) >- if (m_viewExposedRect) { >- ScrollOffset scrollOffset = frameView->scrollOffsetFromPosition(frameView->scrollPosition()); >- m_scrolledViewExposedRect.value().moveBy(scrollOffset); >- } >+ if (m_viewExposedRect) >+ m_scrolledViewExposedRect.value().moveBy(frameView->scrollOffset()); > #endif > > frameView->setViewExposedRect(m_scrolledViewExposedRect);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198895
:
372204
|
372206
| 372212