[webkit-changes] [140183] trunk/Source/WebKit/chromium

2013-01-18 Thread rjkroege
Title: [140183] trunk/Source/WebKit/chromium








Revision 140183
Author rjkro...@chromium.org
Date 2013-01-18 11:06:50 -0800 (Fri, 18 Jan 2013)


Log Message
[chromium] Use new-style gesture scrolling events for fling and
for plugin scrolling: https://bugs.webkit.org/show_bug.cgi?id=106589

Reviewed by James Robinson.

https://bugs.webkit.org/show_bug.cgi?id=103952 modified touchscreen
scrolling to not use synthetic mouse wheel events. Update the fling facility
in WebViewImpl to use these events for touchscreen-initiated flings. Also
modify the WebPluginContainerImpl to scroll in response to touchscreen
scroll gestures if the plugin does not itself implement gesture events.

* src/WebPluginContainerImpl.cpp:
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::WebViewImpl):
(WebKit::WebViewImpl::scrollBy): Handle fling callback conditionally based
on initiating device. Touchpad flings generate wheels. Touchscreen flings
use gesture events.
(WebKit::WebViewImpl::handleGestureEvent):
(WebKit::WebViewImpl::transferActiveWheelFlingAnimation):
* src/WebViewImpl.h:

Modified Paths

trunk/Source/WebKit/chromium/ChangeLog
trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp
trunk/Source/WebKit/chromium/src/WebViewImpl.cpp
trunk/Source/WebKit/chromium/src/WebViewImpl.h




Diff

Modified: trunk/Source/WebKit/chromium/ChangeLog (140182 => 140183)

--- trunk/Source/WebKit/chromium/ChangeLog	2013-01-18 18:59:19 UTC (rev 140182)
+++ trunk/Source/WebKit/chromium/ChangeLog	2013-01-18 19:06:50 UTC (rev 140183)
@@ -1,3 +1,26 @@
+2013-01-18  Robert Kroeger  
+
+[chromium] Use new-style gesture scrolling events for fling and
+for plugin scrolling: https://bugs.webkit.org/show_bug.cgi?id=106589
+
+Reviewed by James Robinson.
+
+https://bugs.webkit.org/show_bug.cgi?id=103952 modified touchscreen
+scrolling to not use synthetic mouse wheel events. Update the fling facility
+in WebViewImpl to use these events for touchscreen-initiated flings. Also
+modify the WebPluginContainerImpl to scroll in response to touchscreen
+scroll gestures if the plugin does not itself implement gesture events. 
+
+* src/WebPluginContainerImpl.cpp:
+* src/WebViewImpl.cpp:
+(WebKit::WebViewImpl::WebViewImpl):
+(WebKit::WebViewImpl::scrollBy): Handle fling callback conditionally based
+on initiating device. Touchpad flings generate wheels. Touchscreen flings
+use gesture events.
+(WebKit::WebViewImpl::handleGestureEvent):
+(WebKit::WebViewImpl::transferActiveWheelFlingAnimation):
+* src/WebViewImpl.h:
+
 2013-01-18  Seokju Kwon  
 
 Add explicit keyword to constructors in platform-specific InspectorClient


Modified: trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp (140182 => 140183)

--- trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp	2013-01-18 18:59:19 UTC (rev 140182)
+++ trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp	2013-01-18 19:06:50 UTC (rev 140183)
@@ -776,14 +776,33 @@
 }
 }
 
+static inline bool gestureScrollHelper(ScrollbarGroup* scrollbarGroup, ScrollDirection positiveDirection, ScrollDirection negativeDirection, float delta)
+{
+if (!delta)
+return false;
+float absDelta = delta > 0 ? delta : -delta;
+return scrollbarGroup->scroll(delta < 0 ? negativeDirection : positiveDirection, ScrollByPrecisePixel, absDelta);
+}
+
 void WebPluginContainerImpl::handleGestureEvent(GestureEvent* event)
 {
 WebGestureEventBuilder webEvent(this, m_element->renderer(), *event);
 if (webEvent.type == WebInputEvent::Undefined)
 return;
 WebCursorInfo cursorInfo;
-if (m_webPlugin->handleInputEvent(webEvent, cursorInfo))
+if (m_webPlugin->handleInputEvent(webEvent, cursorInfo)) {
 event->setDefaultHandled();
+return;
+}
+
+if (webEvent.type == WebInputEvent::GestureScrollUpdate) {
+if (!m_scrollbarGroup)
+return;
+if (gestureScrollHelper(m_scrollbarGroup.get(), ScrollLeft, ScrollRight, webEvent.data.scrollUpdate.deltaX))
+event->setDefaultHandled();
+if (gestureScrollHelper(m_scrollbarGroup.get(), ScrollUp, ScrollDown, webEvent.data.scrollUpdate.deltaY))
+event->setDefaultHandled();
+}
 // FIXME: Can a plugin change the cursor from a touch-event callback?
 }
 


Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (140182 => 140183)

--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2013-01-18 18:59:19 UTC (rev 140182)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2013-01-18 19:06:50 UTC (rev 140183)
@@ -449,6 +449,7 @@
 , m_navigatorContentUtilsClient(NavigatorContentUtilsClientImpl::create(this))
 #endif
 , m_flingModifier(0)
+, m_flingSourceDevice(false)
 , m_validationMessage(ValidationMessageClientImpl::create(*client))
 , m_suppressInvalidations(false)
 , m_showFPSCounter(false)
@@ -658,22 +659

[webkit-changes] [139898] branches/chromium/1364

2013-01-16 Thread rjkroege
Title: [139898] branches/chromium/1364








Revision 139898
Author rjkro...@chromium.org
Date 2013-01-16 11:07:23 -0800 (Wed, 16 Jan 2013)


Log Message
Merge 138808
> Existence of window.Touch can break websites mobile device detection
> https://bugs.webkit.org/show_bug.cgi?id=106071
> 
> Source/WebCore:
> 
> Patch by Rick Byers  on 2013-01-04
> Reviewed by Ojan Vafai.
> 
> Revert http://trac.webkit.org/changeset/135562 for now while I work
> on a slightly safer version.
> 
> * page/DOMWindow.idl:
> 
> LayoutTests:
> 
> Revert http://trac.webkit.org/changeset/135562 for now while I work
> on a slightly safer version.
> 
> Patch by Rick Byers  on 2013-01-04
> Reviewed by Ojan Vafai.
> 
> * fast/events/touch/document-create-touch-list-expected.txt:
> * fast/events/touch/script-tests/document-create-touch-list.js:
> * platform/efl/fast/js/global-constructors-expected.txt:
> * platform/qt-5.0/fast/js/global-constructors-expected.txt:
> * platform/qt/fast/js/global-constructors-expected.txt:

TBR=rby...@chromium.org
Review URL: https://codereview.chromium.org/11970016

Modified Paths

branches/chromium/1364/LayoutTests/fast/events/touch/document-create-touch-list-expected.txt
branches/chromium/1364/LayoutTests/fast/events/touch/script-tests/document-create-touch-list.js
branches/chromium/1364/LayoutTests/platform/efl/fast/js/global-constructors-expected.txt
branches/chromium/1364/LayoutTests/platform/qt/fast/js/global-constructors-expected.txt
branches/chromium/1364/LayoutTests/platform/qt-5.0/fast/js/global-constructors-expected.txt
branches/chromium/1364/Source/WebCore/page/DOMWindow.idl




Diff

Modified: branches/chromium/1364/LayoutTests/fast/events/touch/document-create-touch-list-expected.txt (139897 => 139898)

--- branches/chromium/1364/LayoutTests/fast/events/touch/document-create-touch-list-expected.txt	2013-01-16 19:04:23 UTC (rev 139897)
+++ branches/chromium/1364/LayoutTests/fast/events/touch/document-create-touch-list-expected.txt	2013-01-16 19:07:23 UTC (rev 139898)
@@ -9,10 +9,7 @@
 PASS touchList.item(0) is null
 PASS touchList.item(1) is null
 PASS touchList.item() threw exception TypeError: Not enough arguments.
-PASS ts instanceof TouchEvent is true
-PASS ts.touches instanceof TouchList is true
 PASS ts.touches.length is 2
-PASS ts.touches[0] instanceof Touch is true
 PASS ts.touches[0].identifier is 12341
 PASS ts.touches[0].clientX is 60
 PASS ts.touches[1].screenY is 120


Modified: branches/chromium/1364/LayoutTests/fast/events/touch/script-tests/document-create-touch-list.js (139897 => 139898)

--- branches/chromium/1364/LayoutTests/fast/events/touch/script-tests/document-create-touch-list.js	2013-01-16 19:04:23 UTC (rev 139897)
+++ branches/chromium/1364/LayoutTests/fast/events/touch/script-tests/document-create-touch-list.js	2013-01-16 19:07:23 UTC (rev 139898)
@@ -21,10 +21,7 @@
 
 document.body.addEventListener("touchstart", function handleTouchStart(ev) {
 ts = ev;
-shouldBeTrue("ts instanceof TouchEvent");
-shouldBeTrue("ts.touches instanceof TouchList");
 shouldBe("ts.touches.length", "2");
-shouldBeTrue("ts.touches[0] instanceof Touch");
 shouldBe("ts.touches[0].identifier", "12341");
 shouldBe("ts.touches[0].clientX", "60");
 shouldBe("ts.touches[1].screenY", "120");


Modified: branches/chromium/1364/LayoutTests/platform/efl/fast/js/global-constructors-expected.txt (139897 => 139898)

--- branches/chromium/1364/LayoutTests/platform/efl/fast/js/global-constructors-expected.txt	2013-01-16 19:04:23 UTC (rev 139897)
+++ branches/chromium/1364/LayoutTests/platform/efl/fast/js/global-constructors-expected.txt	2013-01-16 19:07:23 UTC (rev 139898)
@@ -318,9 +318,7 @@
 PASS TextTrackCueList.toString() is '[object TextTrackCueListConstructor]'
 PASS TextTrackList.toString() is '[object TextTrackListConstructor]'
 PASS TimeRanges.toString() is '[object TimeRangesConstructor]'
-PASS Touch.toString() is '[object TouchConstructor]'
 PASS TouchEvent.toString() is '[object TouchEventConstructor]'
-PASS TouchList.toString() is '[object TouchListConstructor]'
 PASS TrackEvent.toString() is '[object TrackEventConstructor]'
 PASS UIEvent.toString() is '[object UIEventConstructor]'
 PASS URL.toString() is '[object URLConstructor]'


Modified: branches/chromium/1364/LayoutTests/platform/qt/fast/js/global-constructors-expected.txt (139897 => 139898)

--- branches/chromium/1364/LayoutTests/platform/qt/fast/js/global-constructors-expected.txt	2013-01-16 19:04:23 UTC (rev 139897)
+++ branches/chromium/1364/LayoutTests/platform/qt/fast/js/global-constructors-expected.txt	2013-01-16 19:07:23 UTC (rev 139898)
@@ -295,9 +295,7 @@
 PASS TextEvent.toString() is '[object TextEventConstructor]'
 PASS TextMetrics.toString() is '[object TextMetricsConstructor]'
 PASS TimeRanges.toString() is '[object TimeRangesConstructor]'
-PASS Touch.toString() is '[object TouchConstructor]'
 PASS TouchEvent.toString() is '[object TouchEventConstructor]'

[webkit-changes] [139447] branches/chromium/1364

2013-01-11 Thread rjkroege
Title: [139447] branches/chromium/1364








Revision 139447
Author rjkro...@chromium.org
Date 2013-01-11 08:34:52 -0800 (Fri, 11 Jan 2013)


Log Message
Merge 139339
> Manually revert http://trac.webkit.org/changeset/136012
> https://bugs.webkit.org/show_bug.cgi?id=106580
> 
> Reviewed by Dimitri Glazkov.
> 
> Source/WebCore:
> 
> 136012 broke touch-scrolling of an overflow div in an iframe. Revert manually
> to work around conflicts.
> 
> * page/EventHandler.cpp:
> (WebCore::EventHandler::handleWheelEvent):
> 
> LayoutTests:
> 
> * fast/events/touch/gesture/touch-gesture-scroll-remove-node-expected.txt: Removed.
> * fast/events/touch/gesture/touch-gesture-scroll-remove-node.html: Removed.
> 

TBR=rjkro...@chromium.org

Modified Paths

branches/chromium/1364/Source/WebCore/page/EventHandler.cpp


Removed Paths

branches/chromium/1364/LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-remove-node-expected.txt
branches/chromium/1364/LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-remove-node.html




Diff

Deleted: branches/chromium/1364/LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-remove-node-expected.txt (139446 => 139447)

--- branches/chromium/1364/LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-remove-node-expected.txt	2013-01-11 15:55:02 UTC (rev 139446)
+++ branches/chromium/1364/LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-remove-node-expected.txt	2013-01-11 16:34:52 UTC (rev 139447)
@@ -1,29 +0,0 @@
-This tests gesture event scrolling of a div where the element the scrolling starts on is removed from an onscroll event handler.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-begin scroll
-scroll up
-PASS scroller.scrollTop is 96
-PASS scroller.scrollLeft is 0
-PASS wheelCount is 1
-PASS scrollCount is 1
-PASS typeof cache[2] is typeof undefined
-scroll down
-PASS scroller.scrollTop is 0
-PASS scroller.scrollLeft is 0
-PASS wheelCount is 2
-PASS scrollCount is 2
-1
-2
-3
-4
-5
-6
-7
-8
-9
-10
-11
-


Deleted: branches/chromium/1364/LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-remove-node.html (139446 => 139447)

--- branches/chromium/1364/LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-remove-node.html	2013-01-11 15:55:02 UTC (rev 139446)
+++ branches/chromium/1364/LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-remove-node.html	2013-01-11 16:34:52 UTC (rev 139447)
@@ -1,197 +0,0 @@
-
-
-
-
-  #spacing {
-width: 200px;
-height: 120px;
-  }
-  #scroller {
-border: 1px solid #777;
-box-sizing: content-box;
-height: 300px;
-margin: 20px;
-overflow-x: hidden;
-overflow-y: auto;
-width: 100px
-  }
-  .spacer {
-box-sizing: border-box;
-display: block;
-overflow: hidden;
-visibility: hidden;
-  }
-  .list-item {
-line-height: 30px;
-text-align: center;
-  }
-
-
-
-  
-
-
- -
-
-