Title: [93056] trunk/Source/WebKit/chromium
- Revision
- 93056
- Author
- [email protected]
- Date
- 2011-08-15 12:59:08 -0700 (Mon, 15 Aug 2011)
Log Message
[chromium] Implement shouldRubberBandInDirection
https://bugs.webkit.org/show_bug.cgi?id=66206
Reviewed by Adam Barth.
History swiping can only start after an unhandled mouse wheel event
came back from the renderer, because mouse wheel _javascript_ handlers
take precedence over history swiping. This means that rubberbanding
must not consume wheel events if they could trigger history, else
history swiping won't be triggered for pages without wheel handlers
either.
This is based on the implementation in
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
* src/ChromeClientImpl.cpp:
(WebKit::ChromeClientImpl::shouldRubberBandInDirection):
* src/ChromeClientImpl.h:
Modified Paths
Diff
Modified: trunk/Source/WebKit/chromium/ChangeLog (93055 => 93056)
--- trunk/Source/WebKit/chromium/ChangeLog 2011-08-15 19:52:19 UTC (rev 93055)
+++ trunk/Source/WebKit/chromium/ChangeLog 2011-08-15 19:59:08 UTC (rev 93056)
@@ -1,3 +1,24 @@
+2011-08-15 Nico Weber <[email protected]>
+
+ [chromium] Implement shouldRubberBandInDirection
+ https://bugs.webkit.org/show_bug.cgi?id=66206
+
+ Reviewed by Adam Barth.
+
+ History swiping can only start after an unhandled mouse wheel event
+ came back from the renderer, because mouse wheel _javascript_ handlers
+ take precedence over history swiping. This means that rubberbanding
+ must not consume wheel events if they could trigger history, else
+ history swiping won't be triggered for pages without wheel handlers
+ either.
+
+ This is based on the implementation in
+ Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
+
+ * src/ChromeClientImpl.cpp:
+ (WebKit::ChromeClientImpl::shouldRubberBandInDirection):
+ * src/ChromeClientImpl.h:
+
2011-08-10 Aaron Boodman <[email protected]>
Pass additional details to client in didCreateIsolatedContext
Modified: trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp (93055 => 93056)
--- trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp 2011-08-15 19:52:19 UTC (rev 93055)
+++ trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp 2011-08-15 19:59:08 UTC (rev 93056)
@@ -969,6 +969,22 @@
return false;
}
+bool ChromeClientImpl::shouldRubberBandInDirection(WebCore::ScrollDirection direction) const
+{
+ ASSERT(direction != WebCore::ScrollUp && direction != WebCore::ScrollDown);
+
+ if (!m_webView->client())
+ return false;
+
+ if (direction == WebCore::ScrollLeft)
+ return !m_webView->client()->historyBackListCount();
+ if (direction == WebCore::ScrollRight)
+ return !m_webView->client()->historyForwardListCount();
+
+ ASSERT_NOT_REACHED();
+ return true;
+}
+
void ChromeClientImpl::numWheelEventHandlersChanged(unsigned numberOfWheelHandlers)
{
if (m_webView->client())
Modified: trunk/Source/WebKit/chromium/src/ChromeClientImpl.h (93055 => 93056)
--- trunk/Source/WebKit/chromium/src/ChromeClientImpl.h 2011-08-15 19:52:19 UTC (rev 93055)
+++ trunk/Source/WebKit/chromium/src/ChromeClientImpl.h 2011-08-15 19:59:08 UTC (rev 93056)
@@ -198,7 +198,7 @@
virtual bool shouldRunModalDialogDuringPageDismissal(const DialogType&, const String& dialogMessage, WebCore::FrameLoader::PageDismissalType) const;
- virtual bool shouldRubberBandInDirection(WebCore::ScrollDirection) const { return true; }
+ virtual bool shouldRubberBandInDirection(WebCore::ScrollDirection) const;
virtual void numWheelEventHandlersChanged(unsigned);
private:
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes