Diff
Modified: trunk/Source/WebCore/ChangeLog (156923 => 156924)
--- trunk/Source/WebCore/ChangeLog 2013-10-04 23:01:50 UTC (rev 156923)
+++ trunk/Source/WebCore/ChangeLog 2013-10-04 23:25:55 UTC (rev 156924)
@@ -1,3 +1,32 @@
+2013-10-04 Sam Weinig <[email protected]>
+
+ Unify rubberband control
+ https://bugs.webkit.org/show_bug.cgi?id=122341
+
+ Reviewed by Tim Horton.
+
+ - Consolidates the two ways we were passing state about whether
+ to rubber-band on a particular edge down to one.
+
+ * WebCore.exp.in:
+ * page/Page.cpp:
+ * page/Page.h:
+ * page/scrolling/ScrollingCoordinator.h:
+ (WebCore::ScrollingCoordinator::isRubberBandInProgress):
+ * page/scrolling/ScrollingTree.cpp:
+ (WebCore::ScrollingTree::ScrollingTree):
+ (WebCore::ScrollingTree::setCanRubberBandState):
+ (WebCore::ScrollingTree::rubberBandsAtLeft):
+ (WebCore::ScrollingTree::rubberBandsAtRight):
+ (WebCore::ScrollingTree::rubberBandsAtBottom):
+ (WebCore::ScrollingTree::rubberBandsAtTop):
+ (WebCore::ScrollingTree::willWheelEventStartSwipeGesture):
+ * page/scrolling/ScrollingTree.h:
+ * page/scrolling/mac/ScrollingCoordinatorMac.h:
+ * page/scrolling/mac/ScrollingCoordinatorMac.mm:
+ * page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
+ (WebCore::ScrollingTreeScrollingNodeMac::shouldRubberBandInDirection):
+
2013-10-04 Andreas Kling <[email protected]>
CTTE: SubframeLoader backpointer to Frame should be a reference.
Modified: trunk/Source/WebCore/WebCore.exp.in (156923 => 156924)
--- trunk/Source/WebCore/WebCore.exp.in 2013-10-04 23:01:50 UTC (rev 156923)
+++ trunk/Source/WebCore/WebCore.exp.in 2013-10-04 23:25:55 UTC (rev 156924)
@@ -868,7 +868,6 @@
__ZN7WebCore4Page19addFooterWithHeightEi
__ZN7WebCore4Page19addHeaderWithHeightEi
__ZN7WebCore4Page19addLayoutMilestonesEj
-__ZN7WebCore4Page19setRubberBandsAtTopEb
__ZN7WebCore4Page19visitedStateChangedEPNS_9PageGroupEy
__ZN7WebCore4Page20setDeviceScaleFactorEf
__ZN7WebCore4Page20unmarkAllTextMatchesEv
@@ -876,7 +875,6 @@
__ZN7WebCore4Page22allVisitedStateChangedEPNS_9PageGroupE
__ZN7WebCore4Page22nonFastScrollableRectsEPKNS_5FrameE
__ZN7WebCore4Page22removeLayoutMilestonesEj
-__ZN7WebCore4Page22setRubberBandsAtBottomEb
__ZN7WebCore4Page23clearUndoRedoOperationsEv
__ZN7WebCore4Page24findStringMatchingRangesERKN3WTF6StringEjiPNS1_6VectorINS1_6RefPtrINS_5RangeEEELm0ENS1_15CrashOnOverflowEEERi
__ZN7WebCore4Page24resumeScriptedAnimationsEv
@@ -2739,17 +2737,13 @@
#endif
#if ENABLE(THREADED_SCROLLING)
-__ZN7WebCore13ScrollingTree37setScrollingPerformanceLoggingEnabledEb
+__ZN7WebCore13ScrollingTree21setCanRubberBandStateEbbbb
__ZN7WebCore13ScrollingTree21tryToHandleWheelEventERKNS_18PlatformWheelEventE
-__ZN7WebCore13ScrollingTree22updateBackForwardStateEbb
+__ZN7WebCore13ScrollingTree37setScrollingPerformanceLoggingEnabledEb
__ZN7WebCore13ScrollingTreeD1Ev
__ZN7WebCore15ScrollingThread15dispatchBarrierERKN3WTF8FunctionIFvvEEE
__ZN7WebCore15ScrollingThread8dispatchERKN3WTF8FunctionIFvvEEE
__ZN7WebCore20ScrollingCoordinator44setForceMainThreadScrollLayerPositionUpdatesEb
-__ZNK7WebCore23ScrollingCoordinatorMac19rubberBandsAtBottomEv
-__ZNK7WebCore23ScrollingCoordinatorMac16rubberBandsAtTopEv
-__ZN7WebCore23ScrollingCoordinatorMac22setRubberBandsAtBottomEb
-__ZN7WebCore23ScrollingCoordinatorMac19setRubberBandsAtTopEb
__ZN7WebCore4Page20scrollingCoordinatorEv
#endif
Modified: trunk/Source/WebCore/page/Page.cpp (156923 => 156924)
--- trunk/Source/WebCore/page/Page.cpp 2013-10-04 23:01:50 UTC (rev 156923)
+++ trunk/Source/WebCore/page/Page.cpp 2013-10-04 23:25:55 UTC (rev 156924)
@@ -837,34 +837,6 @@
}
}
-bool Page::rubberBandsAtBottom()
-{
- if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
- return scrollingCoordinator->rubberBandsAtBottom();
-
- return false;
-}
-
-void Page::setRubberBandsAtBottom(bool rubberBandsAtBottom)
-{
- if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
- scrollingCoordinator->setRubberBandsAtBottom(rubberBandsAtBottom);
-}
-
-bool Page::rubberBandsAtTop()
-{
- if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
- return scrollingCoordinator->rubberBandsAtTop();
-
- return false;
-}
-
-void Page::setRubberBandsAtTop(bool rubberBandsAtTop)
-{
- if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
- scrollingCoordinator->setRubberBandsAtTop(rubberBandsAtTop);
-}
-
void Page::setPagination(const Pagination& pagination)
{
if (m_pagination == pagination)
Modified: trunk/Source/WebCore/page/Page.h (156923 => 156924)
--- trunk/Source/WebCore/page/Page.h 2013-10-04 23:01:50 UTC (rev 156923)
+++ trunk/Source/WebCore/page/Page.h 2013-10-04 23:25:55 UTC (rev 156924)
@@ -284,11 +284,6 @@
void setShouldSuppressScrollbarAnimations(bool suppressAnimations);
void lockAllOverlayScrollbarsToHidden(bool lockOverlayScrollbars);
- bool rubberBandsAtBottom();
- void setRubberBandsAtBottom(bool);
- bool rubberBandsAtTop();
- void setRubberBandsAtTop(bool);
-
// Page and FrameView both store a Pagination value. Page::pagination() is set only by API,
// and FrameView::pagination() is set only by CSS. Page::pagination() will affect all
// FrameViews in the page cache, but FrameView::pagination() only affects the current
Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h (156923 => 156924)
--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h 2013-10-04 23:01:50 UTC (rev 156923)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h 2013-10-04 23:25:55 UTC (rev 156924)
@@ -124,10 +124,6 @@
virtual void syncChildPositions(const LayoutRect&) { }
virtual String scrollingStateTreeAsText() const;
virtual bool isRubberBandInProgress() const { return false; }
- virtual bool rubberBandsAtBottom() const { return false; }
- virtual void setRubberBandsAtBottom(bool) { }
- virtual bool rubberBandsAtTop() const { return false; }
- virtual void setRubberBandsAtTop(bool) { }
virtual void setScrollPinningBehavior(ScrollPinningBehavior) { }
// Generated a unique id for scroll layers.
Modified: trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp (156923 => 156924)
--- trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp 2013-10-04 23:01:50 UTC (rev 156923)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp 2013-10-04 23:25:55 UTC (rev 156924)
@@ -49,12 +49,12 @@
ScrollingTree::ScrollingTree(ScrollingCoordinator* scrollingCoordinator)
: m_scrollingCoordinator(scrollingCoordinator)
, m_hasWheelEventHandlers(false)
- , m_canGoBack(false)
- , m_canGoForward(false)
+ , m_rubberBandsAtLeft(true)
+ , m_rubberBandsAtRight(true)
+ , m_rubberBandsAtTop(true)
+ , m_rubberBandsAtBottom(true)
, m_mainFramePinnedToTheLeft(false)
, m_mainFramePinnedToTheRight(false)
- , m_rubberBandsAtBottom(true)
- , m_rubberBandsAtTop(true)
, m_mainFramePinnedToTheTop(false)
, m_mainFramePinnedToTheBottom(false)
, m_mainFrameIsRubberBanding(false)
@@ -93,14 +93,6 @@
return DidHandleEvent;
}
-void ScrollingTree::updateBackForwardState(bool canGoBack, bool canGoForward)
-{
- MutexLocker locker(m_swipeStateMutex);
-
- m_canGoBack = canGoBack;
- m_canGoForward = canGoForward;
-}
-
void ScrollingTree::handleWheelEvent(const PlatformWheelEvent& wheelEvent)
{
ASSERT(ScrollingThread::isCurrentThread());
@@ -272,46 +264,49 @@
}
#endif
-bool ScrollingTree::canGoBack()
+bool ScrollingTree::isRubberBandInProgress()
{
- MutexLocker lock(m_swipeStateMutex);
+ MutexLocker lock(m_mutex);
- return m_canGoBack;
+ return m_mainFrameIsRubberBanding;
}
-bool ScrollingTree::canGoForward()
+void ScrollingTree::setMainFrameIsRubberBanding(bool isRubberBanding)
{
- MutexLocker lock(m_swipeStateMutex);
+ MutexLocker locker(m_mutex);
- return m_canGoForward;
+ m_mainFrameIsRubberBanding = isRubberBanding;
}
-bool ScrollingTree::isRubberBandInProgress()
+void ScrollingTree::setCanRubberBandState(bool canRubberBandsAtLeft, bool canRubberBandsAtRight, bool canRubberBandsAtTop, bool canRubberBandsAtBottom)
{
- MutexLocker lock(m_mutex);
+ MutexLocker locker(m_swipeStateMutex);
- return m_mainFrameIsRubberBanding;
+ m_rubberBandsAtLeft = canRubberBandsAtLeft;
+ m_rubberBandsAtRight = canRubberBandsAtRight;
+ m_rubberBandsAtTop = canRubberBandsAtTop;
+ m_rubberBandsAtBottom = canRubberBandsAtBottom;
}
-void ScrollingTree::setMainFrameIsRubberBanding(bool isRubberBanding)
+bool ScrollingTree::rubberBandsAtLeft()
{
- MutexLocker locker(m_mutex);
+ MutexLocker lock(m_swipeStateMutex);
- m_mainFrameIsRubberBanding = isRubberBanding;
+ return m_rubberBandsAtLeft;
}
-bool ScrollingTree::rubberBandsAtBottom()
+bool ScrollingTree::rubberBandsAtRight()
{
MutexLocker lock(m_swipeStateMutex);
- return m_rubberBandsAtBottom;
+ return m_rubberBandsAtRight;
}
-void ScrollingTree::setRubberBandsAtBottom(bool rubberBandsAtBottom)
+bool ScrollingTree::rubberBandsAtBottom()
{
- MutexLocker locker(m_swipeStateMutex);
+ MutexLocker lock(m_swipeStateMutex);
- m_rubberBandsAtBottom = rubberBandsAtBottom;
+ return m_rubberBandsAtBottom;
}
bool ScrollingTree::rubberBandsAtTop()
@@ -320,13 +315,6 @@
return m_rubberBandsAtTop;
}
-
-void ScrollingTree::setRubberBandsAtTop(bool rubberBandsAtTop)
-{
- MutexLocker locker(m_swipeStateMutex);
-
- m_rubberBandsAtTop = rubberBandsAtTop;
-}
void ScrollingTree::setScrollPinningBehavior(ScrollPinningBehavior pinning)
{
@@ -349,9 +337,9 @@
MutexLocker lock(m_swipeStateMutex);
- if (wheelEvent.deltaX() > 0 && m_mainFramePinnedToTheLeft && m_canGoBack)
+ if (wheelEvent.deltaX() > 0 && m_mainFramePinnedToTheLeft && !m_rubberBandsAtLeft)
return true;
- if (wheelEvent.deltaX() < 0 && m_mainFramePinnedToTheRight && m_canGoForward)
+ if (wheelEvent.deltaX() < 0 && m_mainFramePinnedToTheRight && !m_rubberBandsAtRight)
return true;
if (wheelEvent.deltaY() > 0 && m_mainFramePinnedToTheTop && !m_rubberBandsAtTop)
return true;
Modified: trunk/Source/WebCore/page/scrolling/ScrollingTree.h (156923 => 156924)
--- trunk/Source/WebCore/page/scrolling/ScrollingTree.h 2013-10-04 23:01:50 UTC (rev 156923)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTree.h 2013-10-04 23:25:55 UTC (rev 156924)
@@ -73,9 +73,6 @@
EventResult tryToHandleWheelEvent(const PlatformWheelEvent&);
bool hasWheelEventHandlers() const { return m_hasWheelEventHandlers; }
- // Can be called from any thread. Will update the back forward state of the page, used for rubber-banding.
- void updateBackForwardState(bool canGoBack, bool canGoForward);
-
// Must be called from the scrolling thread. Handles the wheel event.
void handleWheelEvent(const PlatformWheelEvent&);
@@ -94,13 +91,13 @@
void handleWheelEventPhase(PlatformWheelEventPhase);
#endif
- bool canGoBack();
- bool canGoForward();
+ // Can be called from any thread. Will update what edges allow rubber-banding.
+ void setCanRubberBandState(bool canRubberBandsAtLeft, bool canRubberBandsAtRight, bool canRubberBandsAtTop, bool canRubberBandsAtBottom);
- bool rubberBandsAtBottom();
- void setRubberBandsAtBottom(bool);
+ bool rubberBandsAtLeft();
+ bool rubberBandsAtRight();
bool rubberBandsAtTop();
- void setRubberBandsAtTop(bool);
+ bool rubberBandsAtBottom();
void setScrollPinningBehavior(ScrollPinningBehavior);
ScrollPinningBehavior scrollPinningBehavior();
@@ -130,12 +127,12 @@
bool m_hasWheelEventHandlers;
Mutex m_swipeStateMutex;
- bool m_canGoBack;
- bool m_canGoForward;
+ bool m_rubberBandsAtLeft;
+ bool m_rubberBandsAtRight;
+ bool m_rubberBandsAtTop;
+ bool m_rubberBandsAtBottom;
bool m_mainFramePinnedToTheLeft;
bool m_mainFramePinnedToTheRight;
- bool m_rubberBandsAtBottom;
- bool m_rubberBandsAtTop;
bool m_mainFramePinnedToTheTop;
bool m_mainFramePinnedToTheBottom;
bool m_mainFrameIsRubberBanding;
Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h (156923 => 156924)
--- trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h 2013-10-04 23:01:50 UTC (rev 156923)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h 2013-10-04 23:25:55 UTC (rev 156924)
@@ -73,10 +73,6 @@
virtual String scrollingStateTreeAsText() const OVERRIDE;
virtual bool isRubberBandInProgress() const OVERRIDE;
- virtual bool rubberBandsAtBottom() const OVERRIDE;
- virtual void setRubberBandsAtBottom(bool) OVERRIDE;
- virtual bool rubberBandsAtTop() const OVERRIDE;
- virtual void setRubberBandsAtTop(bool) OVERRIDE;
virtual void setScrollPinningBehavior(ScrollPinningBehavior) OVERRIDE;
Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm (156923 => 156924)
--- trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm 2013-10-04 23:01:50 UTC (rev 156923)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm 2013-10-04 23:25:55 UTC (rev 156924)
@@ -92,26 +92,6 @@
return scrollingTree()->isRubberBandInProgress();
}
-bool ScrollingCoordinatorMac::rubberBandsAtBottom() const
-{
- return scrollingTree()->rubberBandsAtBottom();
-}
-
-void ScrollingCoordinatorMac::setRubberBandsAtBottom(bool rubberBandsAtBottom)
-{
- scrollingTree()->setRubberBandsAtBottom(rubberBandsAtBottom);
-}
-
-bool ScrollingCoordinatorMac::rubberBandsAtTop() const
-{
- return scrollingTree()->rubberBandsAtTop();
-}
-
-void ScrollingCoordinatorMac::setRubberBandsAtTop(bool rubberBandsAtTop)
-{
- scrollingTree()->setRubberBandsAtTop(rubberBandsAtTop);
-}
-
void ScrollingCoordinatorMac::setScrollPinningBehavior(ScrollPinningBehavior pinning)
{
scrollingTree()->setScrollPinningBehavior(pinning);
Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm (156923 => 156924)
--- trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm 2013-10-04 23:01:50 UTC (rev 156923)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm 2013-10-04 23:25:55 UTC (rev 156924)
@@ -222,15 +222,9 @@
return hasEnabledVerticalScrollbar();
}
-bool ScrollingTreeScrollingNodeMac::shouldRubberBandInDirection(ScrollDirection direction)
+bool ScrollingTreeScrollingNodeMac::shouldRubberBandInDirection(ScrollDirection)
{
- if (direction == ScrollLeft)
- return !scrollingTree()->canGoBack();
- if (direction == ScrollRight)
- return !scrollingTree()->canGoForward();
-
- ASSERT_NOT_REACHED();
- return false;
+ return true;
}
IntPoint ScrollingTreeScrollingNodeMac::absoluteScrollPosition()
Modified: trunk/Source/WebKit2/ChangeLog (156923 => 156924)
--- trunk/Source/WebKit2/ChangeLog 2013-10-04 23:01:50 UTC (rev 156923)
+++ trunk/Source/WebKit2/ChangeLog 2013-10-04 23:25:55 UTC (rev 156924)
@@ -1,3 +1,48 @@
+2013-10-04 Sam Weinig <[email protected]>
+
+ Unify rubber-band control
+ https://bugs.webkit.org/show_bug.cgi?id=122341
+
+ Reviewed by Tim Horton.
+
+ - Consolidates the two ways we were passing state about whether
+ to rubber-band on a particular edge down to one.
+ - Adds SPI to control whether you can rubber band on the left
+ or right edge.
+ - Add a linked-on-or-after check to control whether we use the
+ legacy implicit rubber band control based on back/forward.
+
+ * UIProcess/API/C/WKPage.cpp:
+ (WKPageRubberBandsAtLeft):
+ (WKPageSetRubberBandsAtLeft):
+ (WKPageRubberBandsAtRight):
+ (WKPageSetRubberBandsAtRight):
+ (WKPageRubberBandsAtBottom):
+ (WKPageSetRubberBandsAtBottom):
+ * UIProcess/API/C/WKPage.h:
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::WebPageProxy):
+ (WebKit::WebPageProxy::sendWheelEvent):
+ (WebKit::WebPageProxy::rubberBandsAtLeft):
+ (WebKit::WebPageProxy::setRubberBandsAtLeft):
+ (WebKit::WebPageProxy::rubberBandsAtRight):
+ (WebKit::WebPageProxy::setRubberBandsAtRight):
+ (WebKit::WebPageProxy::rubberBandsAtTop):
+ (WebKit::WebPageProxy::setRubberBandsAtTop):
+ (WebKit::WebPageProxy::rubberBandsAtBottom):
+ (WebKit::WebPageProxy::setRubberBandsAtBottom):
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/mac/WebPageProxyMac.mm:
+ (WebKit::shouldUseLegacyImplicitRubberBandControl):
+ (WebKit::WebPageProxy::platformInitialize):
+ * WebProcess/WebPage/EventDispatcher.cpp:
+ (WebKit::EventDispatcher::wheelEvent):
+ * WebProcess/WebPage/EventDispatcher.h:
+ * WebProcess/WebPage/EventDispatcher.messages.in:
+ * WebProcess/WebPage/WebPage.cpp:
+ * WebProcess/WebPage/WebPage.h:
+ * WebProcess/WebPage/WebPage.messages.in:
+
2013-10-04 Lorenzo Tilve <[email protected]>
[GTK] Enable text edition UndoOperations support in WebKit2
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp (156923 => 156924)
--- trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp 2013-10-04 23:01:50 UTC (rev 156923)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp 2013-10-04 23:25:55 UTC (rev 156924)
@@ -454,17 +454,26 @@
return toImpl(pageRef)->isPinnedToBottomSide();
}
+bool WKPageRubberBandsAtLeft(WKPageRef pageRef)
+{
+ return toImpl(pageRef)->rubberBandsAtLeft();
+}
-bool WKPageRubberBandsAtBottom(WKPageRef pageRef)
+void WKPageSetRubberBandsAtLeft(WKPageRef pageRef, bool rubberBandsAtLeft)
{
- return toImpl(pageRef)->rubberBandsAtBottom();
+ toImpl(pageRef)->setRubberBandsAtLeft(rubberBandsAtLeft);
}
-void WKPageSetRubberBandsAtBottom(WKPageRef pageRef, bool rubberBandsAtBottom)
+bool WKPageRubberBandsAtRight(WKPageRef pageRef)
{
- toImpl(pageRef)->setRubberBandsAtBottom(rubberBandsAtBottom);
+ return toImpl(pageRef)->rubberBandsAtRight();
}
+void WKPageSetRubberBandsAtRight(WKPageRef pageRef, bool rubberBandsAtRight)
+{
+ toImpl(pageRef)->setRubberBandsAtRight(rubberBandsAtRight);
+}
+
bool WKPageRubberBandsAtTop(WKPageRef pageRef)
{
return toImpl(pageRef)->rubberBandsAtTop();
@@ -475,6 +484,16 @@
toImpl(pageRef)->setRubberBandsAtTop(rubberBandsAtTop);
}
+bool WKPageRubberBandsAtBottom(WKPageRef pageRef)
+{
+ return toImpl(pageRef)->rubberBandsAtBottom();
+}
+
+void WKPageSetRubberBandsAtBottom(WKPageRef pageRef, bool rubberBandsAtBottom)
+{
+ toImpl(pageRef)->setRubberBandsAtBottom(rubberBandsAtBottom);
+}
+
void WKPageSetPaginationMode(WKPageRef pageRef, WKPaginationMode paginationMode)
{
Pagination::Mode mode;
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPage.h (156923 => 156924)
--- trunk/Source/WebKit2/UIProcess/API/C/WKPage.h 2013-10-04 23:01:50 UTC (rev 156923)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPage.h 2013-10-04 23:25:55 UTC (rev 156924)
@@ -470,10 +470,14 @@
WK_EXPORT bool WKPageIsPinnedToTopSide(WKPageRef page);
WK_EXPORT bool WKPageIsPinnedToBottomSide(WKPageRef page);
+WK_EXPORT bool WKPageRubberBandsAtLeft(WKPageRef);
+WK_EXPORT void WKPageSetRubberBandsAtLeft(WKPageRef, bool rubberBandsAtLeft);
+WK_EXPORT bool WKPageRubberBandsAtRight(WKPageRef);
+WK_EXPORT void WKPageSetRubberBandsAtRight(WKPageRef, bool rubberBandsAtRight);
+WK_EXPORT bool WKPageRubberBandsAtTop(WKPageRef);
+WK_EXPORT void WKPageSetRubberBandsAtTop(WKPageRef, bool rubberBandsAtTop);
WK_EXPORT bool WKPageRubberBandsAtBottom(WKPageRef);
WK_EXPORT void WKPageSetRubberBandsAtBottom(WKPageRef, bool rubberBandsAtBottom);
-WK_EXPORT bool WKPageRubberBandsAtTop(WKPageRef);
-WK_EXPORT void WKPageSetRubberBandsAtTop(WKPageRef, bool rubberBandsAtTop);
WK_EXPORT bool WKPageCanDelete(WKPageRef page);
WK_EXPORT bool WKPageHasSelectedRange(WKPageRef page);
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (156923 => 156924)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2013-10-04 23:01:50 UTC (rev 156923)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2013-10-04 23:25:55 UTC (rev 156924)
@@ -295,8 +295,11 @@
, m_mainFrameIsPinnedToRightSide(false)
, m_mainFrameIsPinnedToTopSide(false)
, m_mainFrameIsPinnedToBottomSide(false)
- , m_rubberBandsAtBottom(false)
- , m_rubberBandsAtTop(false)
+ , m_useLegacyImplicitRubberBandControl(false)
+ , m_rubberBandsAtLeft(true)
+ , m_rubberBandsAtRight(true)
+ , m_rubberBandsAtTop(true)
+ , m_rubberBandsAtBottom(true)
, m_mainFrameInViewSourceMode(false)
, m_pageCount(0)
, m_renderTreeSize(0)
@@ -316,6 +319,8 @@
#endif
, m_scrollPinningBehavior(DoNotPin)
{
+ platformInitialize();
+
#if ENABLE(PAGE_VISIBILITY_API)
if (!m_isVisible)
m_visibilityState = PageVisibilityStateHidden;
@@ -337,10 +342,6 @@
#if ENABLE(VIBRATION)
m_vibration = WebVibrationProxy::create(this);
#endif
-#if ENABLE(THREADED_SCROLLING)
- m_rubberBandsAtBottom = true;
- m_rubberBandsAtTop = true;
-#endif
m_process->addMessageReceiver(Messages::WebPageProxy::messageReceiverName(), m_pageID, this);
@@ -1395,7 +1396,15 @@
return;
}
- m_process->send(Messages::EventDispatcher::WheelEvent(m_pageID, event, canGoBack(), canGoForward()), 0);
+ m_process->send(
+ Messages::EventDispatcher::WheelEvent(
+ m_pageID,
+ event,
+ m_useLegacyImplicitRubberBandControl ? !canGoBack() : rubberBandsAtLeft(),
+ m_useLegacyImplicitRubberBandControl ? !canGoForward() : rubberBandsAtRight(),
+ rubberBandsAtTop(),
+ rubberBandsAtBottom()
+ ), 0);
}
void WebPageProxy::handleKeyboardEvent(const NativeWebKeyboardEvent& event)
@@ -1828,30 +1837,44 @@
m_process->send(Messages::WebPage::SetSuppressScrollbarAnimations(suppressAnimations), m_pageID);
}
-void WebPageProxy::setRubberBandsAtBottom(bool rubberBandsAtBottom)
+bool WebPageProxy::rubberBandsAtLeft() const
{
- if (rubberBandsAtBottom == m_rubberBandsAtBottom)
- return;
+ return m_rubberBandsAtLeft;
+}
- m_rubberBandsAtBottom = rubberBandsAtBottom;
+void WebPageProxy::setRubberBandsAtLeft(bool rubberBandsAtLeft)
+{
+ m_rubberBandsAtLeft = rubberBandsAtLeft;
+}
- if (!isValid())
- return;
+bool WebPageProxy::rubberBandsAtRight() const
+{
+ return m_rubberBandsAtRight;
+}
- m_process->send(Messages::WebPage::SetRubberBandsAtBottom(rubberBandsAtBottom), m_pageID);
+void WebPageProxy::setRubberBandsAtRight(bool rubberBandsAtRight)
+{
+ m_rubberBandsAtRight = rubberBandsAtRight;
}
+bool WebPageProxy::rubberBandsAtTop() const
+{
+ return m_rubberBandsAtTop;
+}
+
void WebPageProxy::setRubberBandsAtTop(bool rubberBandsAtTop)
{
- if (rubberBandsAtTop == m_rubberBandsAtTop)
- return;
-
m_rubberBandsAtTop = rubberBandsAtTop;
+}
- if (!isValid())
- return;
+bool WebPageProxy::rubberBandsAtBottom() const
+{
+ return m_rubberBandsAtBottom;
+}
- m_process->send(Messages::WebPage::SetRubberBandsAtTop(rubberBandsAtTop), m_pageID);
+void WebPageProxy::setRubberBandsAtBottom(bool rubberBandsAtBottom)
+{
+ m_rubberBandsAtBottom = rubberBandsAtBottom;
}
void WebPageProxy::setPaginationMode(WebCore::Pagination::Mode mode)
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (156923 => 156924)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2013-10-04 23:01:50 UTC (rev 156923)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2013-10-04 23:25:55 UTC (rev 156924)
@@ -493,10 +493,14 @@
bool isPinnedToTopSide() const { return m_mainFrameIsPinnedToTopSide; }
bool isPinnedToBottomSide() const { return m_mainFrameIsPinnedToBottomSide; }
- bool rubberBandsAtBottom() const { return m_rubberBandsAtBottom; }
+ bool rubberBandsAtLeft() const;
+ void setRubberBandsAtLeft(bool);
+ bool rubberBandsAtRight() const;
+ void setRubberBandsAtRight(bool);
+ bool rubberBandsAtTop() const;
+ void setRubberBandsAtTop(bool);
+ bool rubberBandsAtBottom() const;
void setRubberBandsAtBottom(bool);
- bool rubberBandsAtTop() const { return m_rubberBandsAtTop; }
- void setRubberBandsAtTop(bool);
void setPaginationMode(WebCore::Pagination::Mode);
WebCore::Pagination::Mode paginationMode() const { return m_paginationMode; }
@@ -761,6 +765,7 @@
private:
WebPageProxy(PageClient*, PassRefPtr<WebProcessProxy>, WebPageGroup*, uint64_t pageID);
+ void platformInitialize();
void resetStateAfterProcessExited();
@@ -1214,8 +1219,11 @@
bool m_mainFrameIsPinnedToTopSide;
bool m_mainFrameIsPinnedToBottomSide;
+ bool m_useLegacyImplicitRubberBandControl;
+ bool m_rubberBandsAtLeft;
+ bool m_rubberBandsAtRight;
+ bool m_rubberBandsAtTop;
bool m_rubberBandsAtBottom;
- bool m_rubberBandsAtTop;
bool m_mainFrameInViewSourceMode;
Modified: trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm (156923 => 156924)
--- trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm 2013-10-04 23:01:50 UTC (rev 156923)
+++ trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm 2013-10-04 23:25:55 UTC (rev 156924)
@@ -46,6 +46,7 @@
#import <WebCore/TextAlternativeWithRange.h>
#import <WebKitSystemInterface.h>
#import <wtf/text/StringConcatenate.h>
+#import <mach-o/dyld.h>
@interface NSApplication (Details)
- (void)speakString:(NSString *)string;
@@ -57,6 +58,17 @@
namespace WebKit {
+static bool shouldUseLegacyImplicitRubberBandControl()
+{
+ static bool linkedAgainstExecutableExpectingImplicitRubberBandControl = NSVersionOfLinkTimeLibrary("WebKit2") < 0x021A0200 /* 538.2.0 */;
+ return linkedAgainstExecutableExpectingImplicitRubberBandControl;
+}
+
+void WebPageProxy::platformInitialize()
+{
+ m_useLegacyImplicitRubberBandControl = shouldUseLegacyImplicitRubberBandControl();
+}
+
#if defined(__ppc__) || defined(__ppc64__)
#define PROCESSOR "PPC"
#elif defined(__i386__) || defined(__x86_64__)
Modified: trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp (156923 => 156924)
--- trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp 2013-10-04 23:01:50 UTC (rev 156923)
+++ trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp 2013-10-04 23:25:55 UTC (rev 156924)
@@ -84,7 +84,7 @@
connection->addWorkQueueMessageReceiver(Messages::EventDispatcher::messageReceiverName(), m_queue.get(), this);
}
-void EventDispatcher::wheelEvent(uint64_t pageID, const WebWheelEvent& wheelEvent, bool canGoBack, bool canGoForward)
+void EventDispatcher::wheelEvent(uint64_t pageID, const WebWheelEvent& wheelEvent, bool canRubberBandsAtLeft, bool canRubberBandsAtRight, bool canRubberBandsAtTop, bool canRubberBandsAtBottom)
{
#if ENABLE(THREADED_SCROLLING)
MutexLocker locker(m_scrollingTreesMutex);
@@ -96,7 +96,7 @@
// scrolling tree can be notified.
// We only need to do this at the beginning of the gesture.
if (platformWheelEvent.phase() == PlatformWheelEventPhaseBegan)
- ScrollingThread::dispatch(bind(&ScrollingTree::updateBackForwardState, scrollingTree, canGoBack, canGoForward));
+ ScrollingThread::dispatch(bind(&ScrollingTree::setCanRubberBandState, scrollingTree, canRubberBandsAtLeft, canRubberBandsAtRight, canRubberBandsAtTop, canRubberBandsAtBottom));
ScrollingTree::EventResult result = scrollingTree->tryToHandleWheelEvent(platformWheelEvent);
if (result == ScrollingTree::DidHandleEvent || result == ScrollingTree::DidNotHandleEvent) {
@@ -104,9 +104,6 @@
return;
}
}
-#else
- UNUSED_PARAM(canGoBack);
- UNUSED_PARAM(canGoForward);
#endif
RunLoop::main()->dispatch(bind(&EventDispatcher::dispatchWheelEvent, this, pageID, wheelEvent));
Modified: trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h (156923 => 156924)
--- trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h 2013-10-04 23:01:50 UTC (rev 156923)
+++ trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h 2013-10-04 23:25:55 UTC (rev 156924)
@@ -65,7 +65,7 @@
virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&) OVERRIDE;
// Message handlers
- void wheelEvent(uint64_t pageID, const WebWheelEvent&, bool canGoBack, bool canGoForward);
+ void wheelEvent(uint64_t pageID, const WebWheelEvent&, bool canRubberBandsAtLeft, bool canRubberBandsAtRight, bool canRubberBandsAtTop, bool canRubberBandsAtBottom);
#if ENABLE(GESTURE_EVENTS)
void gestureEvent(uint64_t pageID, const WebGestureEvent&);
#endif
Modified: trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.messages.in (156923 => 156924)
--- trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.messages.in 2013-10-04 23:01:50 UTC (rev 156923)
+++ trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.messages.in 2013-10-04 23:25:55 UTC (rev 156924)
@@ -21,7 +21,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
messages -> EventDispatcher {
- WheelEvent(uint64_t pageID, WebKit::WebWheelEvent event, bool canGoBack, bool canGoForward)
+ WheelEvent(uint64_t pageID, WebKit::WebWheelEvent event, bool canRubberBandsAtLeft, bool canRubberBandsAtRight, bool canRubberBandsAtTop, bool canRubberBandsAtBottom)
#if ENABLE(GESTURE_EVENTS)
GestureEvent(uint64_t pageID, WebKit::WebGestureEvent event)
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (156923 => 156924)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2013-10-04 23:01:50 UTC (rev 156923)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2013-10-04 23:25:55 UTC (rev 156924)
@@ -1281,16 +1281,6 @@
m_page->setShouldSuppressScrollbarAnimations(suppressAnimations);
}
-void WebPage::setRubberBandsAtBottom(bool rubberBandsAtBottom)
-{
- m_page->setRubberBandsAtBottom(rubberBandsAtBottom);
-}
-
-void WebPage::setRubberBandsAtTop(bool rubberBandsAtTop)
-{
- m_page->setRubberBandsAtTop(rubberBandsAtTop);
-}
-
void WebPage::setPaginationMode(uint32_t mode)
{
Pagination pagination = m_page->pagination();
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (156923 => 156924)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2013-10-04 23:01:50 UTC (rev 156923)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2013-10-04 23:25:55 UTC (rev 156924)
@@ -312,9 +312,6 @@
void setSuppressScrollbarAnimations(bool);
- void setRubberBandsAtBottom(bool);
- void setRubberBandsAtTop(bool);
-
void setPaginationMode(uint32_t /* WebCore::Pagination::Mode */);
void setPaginationBehavesLikeColumns(bool);
void setPageLength(double);
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (156923 => 156924)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in 2013-10-04 23:01:50 UTC (rev 156923)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in 2013-10-04 23:25:55 UTC (rev 156924)
@@ -136,9 +136,6 @@
ListenForLayoutMilestones(uint32_t milestones)
SetSuppressScrollbarAnimations(bool suppressAnimations)
- SetRubberBandsAtBottom(bool rubberBandsAtBottom)
- SetRubberBandsAtTop(bool rubberBandsAtTop)
-
SetPaginationMode(uint32_t mode)
SetPaginationBehavesLikeColumns(bool behavesLikeColumns)
SetPageLength(double pageLength)