- Revision
- 165086
- Author
- [email protected]
- Date
- 2014-03-04 17:24:05 -0800 (Tue, 04 Mar 2014)
Log Message
Source/WebCore: Get position:fixed working slightly better on iOS
https://bugs.webkit.org/show_bug.cgi?id=129714
Reviewed by Benjamin Poulain.
Send the scroll position as a FloatPoint, rather than an IntPoint.
* WebCore.exp.in:
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
* page/scrolling/ScrollingTree.h:
Source/WebKit2: Get position:fixed working slightly better on iOS WK2
https://bugs.webkit.org/show_bug.cgi?id=129714
Reviewed by Benjamin Poulain.
Start telling the RemoteScrollingCoordinatorProxy about scroll position changes
again, so it can update fixed and sticky layers.
Send the scroll position as a FloatPoint, rather than an IntPoint.
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::scrollPositionChangedViaDelegatedScrolling):
(WebKit::RemoteScrollingCoordinatorProxy::scrollPositionChanged):
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:inStableState:]):
Tell the RemoteScrollingCoordinatorProxy about the scroll update.
Only update the customFixedPositionRect if we've finished scrolling or zooming.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::updateVisibleContentRects): Return a bool indicating
whether the visible rects changed.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (165085 => 165086)
--- trunk/Source/WebCore/ChangeLog 2014-03-05 01:03:55 UTC (rev 165085)
+++ trunk/Source/WebCore/ChangeLog 2014-03-05 01:24:05 UTC (rev 165086)
@@ -1,3 +1,17 @@
+2014-03-04 Simon Fraser <[email protected]>
+
+ Get position:fixed working slightly better on iOS
+ https://bugs.webkit.org/show_bug.cgi?id=129714
+
+ Reviewed by Benjamin Poulain.
+
+ Send the scroll position as a FloatPoint, rather than an IntPoint.
+
+ * WebCore.exp.in:
+ * page/scrolling/ScrollingTree.cpp:
+ (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
+ * page/scrolling/ScrollingTree.h:
+
2014-03-04 Alex Christensen <[email protected]>
Fixed Windows build without MEDIA_CONTROLS_SCRIPT enabled.
Modified: trunk/Source/WebCore/WebCore.exp.in (165085 => 165086)
--- trunk/Source/WebCore/WebCore.exp.in 2014-03-05 01:03:55 UTC (rev 165085)
+++ trunk/Source/WebCore/WebCore.exp.in 2014-03-05 01:24:05 UTC (rev 165086)
@@ -2705,7 +2705,7 @@
__ZN7WebCore13ScrollingTree32isPointInNonFastScrollableRegionENS_8IntPointE
__ZN7WebCore13ScrollingTree35shouldHandleWheelEventSynchronouslyERKNS_18PlatformWheelEventE
__ZN7WebCore13ScrollingTree37setScrollingPerformanceLoggingEnabledEb
-__ZN7WebCore13ScrollingTree42scrollPositionChangedViaDelegatedScrollingEyRKNS_8IntPointE
+__ZN7WebCore13ScrollingTree42scrollPositionChangedViaDelegatedScrollingEyRKNS_10FloatPointE
__ZN7WebCore13ScrollingTreeC2Ev
__ZN7WebCore13ScrollingTreeD1Ev
__ZN7WebCore13ScrollingTreeD2Ev
Modified: trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp (165085 => 165086)
--- trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp 2014-03-05 01:03:55 UTC (rev 165085)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp 2014-03-05 01:24:05 UTC (rev 165086)
@@ -98,7 +98,7 @@
m_rootNode->handleWheelEvent(wheelEvent);
}
-void ScrollingTree::scrollPositionChangedViaDelegatedScrolling(ScrollingNodeID nodeID, const IntPoint& scrollPosition)
+void ScrollingTree::scrollPositionChangedViaDelegatedScrolling(ScrollingNodeID nodeID, const FloatPoint& scrollPosition)
{
ScrollingTreeNode* node = nodeForID(nodeID);
if (!node)
Modified: trunk/Source/WebCore/page/scrolling/ScrollingTree.h (165085 => 165086)
--- trunk/Source/WebCore/page/scrolling/ScrollingTree.h 2014-03-05 01:03:55 UTC (rev 165085)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTree.h 2014-03-05 01:24:05 UTC (rev 165086)
@@ -63,7 +63,7 @@
virtual EventResult tryToHandleWheelEvent(const PlatformWheelEvent&) = 0;
bool shouldHandleWheelEventSynchronously(const PlatformWheelEvent&);
- virtual void scrollPositionChangedViaDelegatedScrolling(ScrollingNodeID, const IntPoint&);
+ virtual void scrollPositionChangedViaDelegatedScrolling(ScrollingNodeID, const FloatPoint&);
void setMainFrameIsRubberBanding(bool);
bool isRubberBandInProgress();
Modified: trunk/Source/WebKit2/ChangeLog (165085 => 165086)
--- trunk/Source/WebKit2/ChangeLog 2014-03-05 01:03:55 UTC (rev 165085)
+++ trunk/Source/WebKit2/ChangeLog 2014-03-05 01:24:05 UTC (rev 165086)
@@ -1,3 +1,28 @@
+2014-03-04 Simon Fraser <[email protected]>
+
+ Get position:fixed working slightly better on iOS WK2
+ https://bugs.webkit.org/show_bug.cgi?id=129714
+
+ Reviewed by Benjamin Poulain.
+
+ Start telling the RemoteScrollingCoordinatorProxy about scroll position changes
+ again, so it can update fixed and sticky layers.
+
+ Send the scroll position as a FloatPoint, rather than an IntPoint.
+
+ * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
+ (WebKit::RemoteScrollingCoordinatorProxy::scrollPositionChangedViaDelegatedScrolling):
+ (WebKit::RemoteScrollingCoordinatorProxy::scrollPositionChanged):
+ * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/ios/WKContentView.mm:
+ (-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:inStableState:]):
+ Tell the RemoteScrollingCoordinatorProxy about the scroll update.
+ Only update the customFixedPositionRect if we've finished scrolling or zooming.
+ * UIProcess/ios/WebPageProxyIOS.mm:
+ (WebKit::WebPageProxy::updateVisibleContentRects): Return a bool indicating
+ whether the visible rects changed.
+
2014-03-04 Conrad Shultz <[email protected]>
WKPage's pageExtendedBackgroundColor API exposed through WKView/WKWebView should support NSColor
Modified: trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp (165085 => 165086)
--- trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp 2014-03-05 01:03:55 UTC (rev 165085)
+++ trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp 2014-03-05 01:24:05 UTC (rev 165086)
@@ -138,7 +138,7 @@
return m_scrollingTree->isPointInNonFastScrollableRegion(p);
}
-void RemoteScrollingCoordinatorProxy::scrollPositionChangedViaDelegatedScrolling(ScrollingNodeID nodeID, const IntPoint& offset)
+void RemoteScrollingCoordinatorProxy::scrollPositionChangedViaDelegatedScrolling(ScrollingNodeID nodeID, const FloatPoint& offset)
{
m_scrollingTree->scrollPositionChangedViaDelegatedScrolling(nodeID, offset);
}
@@ -146,6 +146,11 @@
// This comes from the scrolling tree.
void RemoteScrollingCoordinatorProxy::scrollPositionChanged(WebCore::ScrollingNodeID scrolledNodeID, const WebCore::FloatPoint& newScrollPosition)
{
+ // Scroll updates for the main frame are sent via WebPageProxy::updateVisibleContentRects()
+ // so don't send them here.
+ if (scrolledNodeID == rootScrollingNodeID())
+ return;
+
m_webPageProxy.send(Messages::RemoteScrollingCoordinator::ScrollPositionChangedForNode(scrolledNodeID, newScrollPosition));
}
Modified: trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h (165085 => 165086)
--- trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h 2014-03-05 01:03:55 UTC (rev 165085)
+++ trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h 2014-03-05 01:24:05 UTC (rev 165086)
@@ -57,7 +57,7 @@
bool isPointInNonFastScrollableRegion(const WebCore::IntPoint&) const;
// Called externally when native views move around.
- void scrollPositionChangedViaDelegatedScrolling(WebCore::ScrollingNodeID, const WebCore::IntPoint&);
+ void scrollPositionChangedViaDelegatedScrolling(WebCore::ScrollingNodeID, const WebCore::FloatPoint&);
// FIXME: expose the tree and pass this to that?
bool handleWheelEvent(const WebCore::PlatformWheelEvent&);
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (165085 => 165086)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2014-03-05 01:03:55 UTC (rev 165085)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2014-03-05 01:24:05 UTC (rev 165086)
@@ -458,7 +458,7 @@
const WebCore::FloatRect& exposedContentRect() const { return m_lastVisibleContentRectUpdate.exposedRect(); }
const WebCore::FloatRect& unobscuredContentRect() const { return m_lastVisibleContentRectUpdate.unobscuredRect(); }
- void updateVisibleContentRects(const VisibleContentRectUpdateInfo&);
+ bool updateVisibleContentRects(const VisibleContentRectUpdateInfo&);
void setViewportConfigurationMinimumLayoutSize(const WebCore::IntSize&);
void didCommitLayerTree(const WebKit::RemoteLayerTreeTransaction&);
Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm (165085 => 165086)
--- trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm 2014-03-05 01:03:55 UTC (rev 165085)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm 2014-03-05 01:24:05 UTC (rev 165086)
@@ -171,11 +171,17 @@
// visual noise. We filter those useless updates.
scale = _page->displayedContentScale();
}
+
_page->updateVisibleContentRects(VisibleContentRectUpdateInfo(visibleRect, unobscuredRect, scale));
+ RemoteScrollingCoordinatorProxy* scrollingCoordinator = _page->scrollingCoordinatorProxy();
+ scrollingCoordinator->scrollPositionChangedViaDelegatedScrolling(scrollingCoordinator->rootScrollingNodeID(), unobscuredRect.origin);
+
if (auto drawingArea = _page->drawingArea()) {
- FloatRect fixedPosRect = [self fixedPositionRectFromExposedRect:unobscuredRect scale:scale];
- drawingArea->setCustomFixedPositionRect(fixedPosRect);
+ if (isStableState) {
+ FloatRect fixedPosRect = [self fixedPositionRectFromExposedRect:unobscuredRect scale:scale];
+ drawingArea->setCustomFixedPositionRect(fixedPosRect);
+ }
drawingArea->updateDebugIndicator();
}
}
Modified: trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm (165085 => 165086)
--- trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm 2014-03-05 01:03:55 UTC (rev 165085)
+++ trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm 2014-03-05 01:24:05 UTC (rev 165086)
@@ -234,12 +234,14 @@
callback->performCallbackWithReturnValue(beforeText, markedText, selectedText, afterText, location, length);
}
-void WebPageProxy::updateVisibleContentRects(const VisibleContentRectUpdateInfo& visibleContentRectUpdateInfo)
+bool WebPageProxy::updateVisibleContentRects(const VisibleContentRectUpdateInfo& visibleContentRectUpdateInfo)
{
if (visibleContentRectUpdateInfo == m_lastVisibleContentRectUpdate)
- return;
+ return false;
+
m_lastVisibleContentRectUpdate = visibleContentRectUpdateInfo;
m_process->send(Messages::ViewUpdateDispatcher::VisibleContentRectUpdate(m_pageID, visibleContentRectUpdateInfo), 0);
+ return true;
}
void WebPageProxy::setViewportConfigurationMinimumLayoutSize(const WebCore::IntSize& size)