Title: [204630] trunk
Revision
204630
Author
[email protected]
Date
2016-08-19 08:36:55 -0700 (Fri, 19 Aug 2016)

Log Message

WebKit should unset event propagation flags after dispatch
https://bugs.webkit.org/show_bug.cgi?id=160853

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline several W3C tests now that more checks are passing.

* web-platform-tests/dom/events/Event-dispatch-multiple-stopPropagation-expected.txt:
* web-platform-tests/dom/events/Event-initEvent-expected.txt:
* web-platform-tests/dom/events/Event-propagation-expected.txt:

Source/WebCore:

WebKit should unset event propagation flags after dispatch to reflect
the latest DOM specification:
- https://github.com/whatwg/dom/commit/806d4aab584f6fc38c21f8e088b51b8ba3e27e20

No new tests, rebaselined existing tests.

* dom/Event.h:
(WebCore::Event::resetPropagationFlags):
* dom/EventDispatcher.cpp:
(WebCore::EventDispatcher::dispatchEvent):
* dom/EventTarget.cpp:
(WebCore::EventTarget::dispatchEvent):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (204629 => 204630)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2016-08-19 07:26:22 UTC (rev 204629)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2016-08-19 15:36:55 UTC (rev 204630)
@@ -1,3 +1,16 @@
+2016-08-19  Chris Dumez  <[email protected]>
+
+        WebKit should unset event propagation flags after dispatch
+        https://bugs.webkit.org/show_bug.cgi?id=160853
+
+        Reviewed by Ryosuke Niwa.
+
+        Rebaseline several W3C tests now that more checks are passing.
+
+        * web-platform-tests/dom/events/Event-dispatch-multiple-stopPropagation-expected.txt:
+        * web-platform-tests/dom/events/Event-initEvent-expected.txt:
+        * web-platform-tests/dom/events/Event-propagation-expected.txt:
+
 2016-08-18  Chris Dumez  <[email protected]>
 
         Move prefix / namespaceURI / localName attributes from Node to Attr / Element

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-multiple-stopPropagation-expected.txt (204629 => 204630)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-multiple-stopPropagation-expected.txt	2016-08-19 07:26:22 UTC (rev 204629)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-dispatch-multiple-stopPropagation-expected.txt	2016-08-19 15:36:55 UTC (rev 204630)
@@ -1,3 +1,3 @@
 
-FAIL  Multiple dispatchEvent() and stopPropagation()  assert_array_equals: lengths differ, expected 1 got 0
+PASS  Multiple dispatchEvent() and stopPropagation()  
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-propagation-expected.txt (204629 => 204630)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-propagation-expected.txt	2016-08-19 07:26:22 UTC (rev 204629)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-propagation-expected.txt	2016-08-19 15:36:55 UTC (rev 204630)
@@ -1,7 +1,7 @@
 
 PASS Newly-created Event 
-FAIL After stopPropagation() assert_equals: Propagation flag after first dispatch expected true but got false
+PASS After stopPropagation() 
 PASS Reinitialized after stopPropagation() 
-FAIL After stopImmediatePropagation() assert_equals: Propagation flag after first dispatch expected true but got false
+PASS After stopImmediatePropagation() 
 PASS Reinitialized after stopImmediatePropagation() 
 

Modified: trunk/Source/WebCore/ChangeLog (204629 => 204630)


--- trunk/Source/WebCore/ChangeLog	2016-08-19 07:26:22 UTC (rev 204629)
+++ trunk/Source/WebCore/ChangeLog	2016-08-19 15:36:55 UTC (rev 204630)
@@ -1,3 +1,23 @@
+2016-08-19  Chris Dumez  <[email protected]>
+
+        WebKit should unset event propagation flags after dispatch
+        https://bugs.webkit.org/show_bug.cgi?id=160853
+
+        Reviewed by Ryosuke Niwa.
+
+        WebKit should unset event propagation flags after dispatch to reflect
+        the latest DOM specification:
+        - https://github.com/whatwg/dom/commit/806d4aab584f6fc38c21f8e088b51b8ba3e27e20
+
+        No new tests, rebaselined existing tests.
+
+        * dom/Event.h:
+        (WebCore::Event::resetPropagationFlags):
+        * dom/EventDispatcher.cpp:
+        (WebCore::EventDispatcher::dispatchEvent):
+        * dom/EventTarget.cpp:
+        (WebCore::EventTarget::dispatchEvent):
+
 2016-08-18  Daniel Bates  <[email protected]>
 
         Ld warns of non-existent PrivateFrameworks directory when building WebKit with the public iOS 9.3 SDK

Modified: trunk/Source/WebCore/dom/Event.h (204629 => 204630)


--- trunk/Source/WebCore/dom/Event.h	2016-08-19 07:26:22 UTC (rev 204629)
+++ trunk/Source/WebCore/dom/Event.h	2016-08-19 15:36:55 UTC (rev 204630)
@@ -166,6 +166,8 @@
     bool propagationStopped() const { return m_propagationStopped || m_immediatePropagationStopped; }
     bool immediatePropagationStopped() const { return m_immediatePropagationStopped; }
 
+    void resetPropagationFlags();
+
     bool defaultPrevented() const { return m_defaultPrevented; }
     void preventDefault()
     {
@@ -227,6 +229,12 @@
     RefPtr<Event> m_underlyingEvent;
 };
 
+inline void Event::resetPropagationFlags()
+{
+    m_propagationStopped = false;
+    m_immediatePropagationStopped = false;
+}
+
 } // namespace WebCore
 
 #define SPECIALIZE_TYPE_TRAITS_EVENT(ToValueTypeName) \

Modified: trunk/Source/WebCore/dom/EventDispatcher.cpp (204629 => 204630)


--- trunk/Source/WebCore/dom/EventDispatcher.cpp	2016-08-19 07:26:22 UTC (rev 204629)
+++ trunk/Source/WebCore/dom/EventDispatcher.cpp	2016-08-19 15:36:55 UTC (rev 204630)
@@ -186,7 +186,8 @@
 
     event.setTarget(EventPath::eventTargetRespectingTargetRules(*node));
     event.setCurrentTarget(nullptr);
-    event.setEventPhase(0);
+    event.resetPropagationFlags();
+    event.setEventPhase(Event::NONE);
 
     if (clickHandlingState.stateful)
         downcast<HTMLInputElement>(*node).didDispatchClickEvent(event, clickHandlingState);

Modified: trunk/Source/WebCore/dom/EventTarget.cpp (204629 => 204630)


--- trunk/Source/WebCore/dom/EventTarget.cpp	2016-08-19 07:26:22 UTC (rev 204629)
+++ trunk/Source/WebCore/dom/EventTarget.cpp	2016-08-19 15:36:55 UTC (rev 204630)
@@ -162,7 +162,8 @@
     event.setCurrentTarget(this);
     event.setEventPhase(Event::AT_TARGET);
     bool defaultPrevented = fireEventListeners(event);
-    event.setEventPhase(0);
+    event.resetPropagationFlags();
+    event.setEventPhase(Event::NONE);
     return defaultPrevented;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to