REGRESSION (r167689): Hovering file name in a file input causes a crash
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 26 Apr 2014 04:41:42 +0000 (04:41 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 26 Apr 2014 04:41:42 +0000 (04:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=132214

Reviewed by Andreas Kling.

Source/WebCore:
The bug was caused by callDefaultEventHandlersInTheBubblingOrder unconditionally
accessing path.contextAt(0) even if the event path was empty.

Fixed the bug by exiting early when the event path is empty.

Test: fast/events/shadow-event-path-2.html

* dom/EventDispatcher.cpp:
(WebCore::callDefaultEventHandlersInTheBubblingOrder):

LayoutTests:
Add a regression test.

* fast/events/shadow-event-path-2-expected.txt: Added.
* fast/events/shadow-event-path-2.html: Added.
* fast/events/shadow-event-path.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@167840 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/events/shadow-event-path-2-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/shadow-event-path-2.html [new file with mode: 0644]
LayoutTests/fast/events/shadow-event-path.html
Source/WebCore/ChangeLog
Source/WebCore/dom/EventDispatcher.cpp

index f96b43d..9f0ba64 100644 (file)
@@ -1,3 +1,16 @@
+2014-04-25  Ryosuke Niwa  <rniwa@webkit.org>
+
+        REGRESSION (r167689): Hovering file name in a file input causes a crash
+        https://bugs.webkit.org/show_bug.cgi?id=132214
+
+        Reviewed by Andreas Kling.
+
+        Add a regression test.
+
+        * fast/events/shadow-event-path-2-expected.txt: Added.
+        * fast/events/shadow-event-path-2.html: Added.
+        * fast/events/shadow-event-path.html:
+
 2014-04-25  Oliver Hunt  <oliver@apple.com>
 
         Need earlier cell test
diff --git a/LayoutTests/fast/events/shadow-event-path-2-expected.txt b/LayoutTests/fast/events/shadow-event-path-2-expected.txt
new file mode 100644 (file)
index 0000000..922c128
--- /dev/null
@@ -0,0 +1,1246 @@
+This test records target and relatedTarget at each element while dispatching a mouse click event at an input element.
+
+
+Content:<div id="detailsContainer"><input id="target" type="file"></div>
+
+mouseover@html
+    target:html
+    relatedTarget:null
+
+mouseover@document
+    target:html
+    relatedTarget:null
+
+mouseover@window
+    target:html
+    relatedTarget:null
+
+mouseenter@html
+    target:html
+    relatedTarget:null
+
+mousemove@html
+    target:html
+    relatedTarget:null
+
+mousemove@document
+    target:html
+    relatedTarget:null
+
+mousemove@window
+    target:html
+    relatedTarget:null
+
+mouseout@html
+    target:html
+    relatedTarget:input#target
+
+mouseout@document
+    target:html
+    relatedTarget:input#target
+
+mouseout@window
+    target:html
+    relatedTarget:input#target
+
+mouseover@input#target
+    target:input#target
+    relatedTarget:html
+
+mouseover@div#detailsContainer
+    target:input#target
+    relatedTarget:html
+
+mouseover@body
+    target:input#target
+    relatedTarget:html
+
+mouseover@html
+    target:input#target
+    relatedTarget:html
+
+mouseover@document
+    target:input#target
+    relatedTarget:html
+
+mouseover@window
+    target:input#target
+    relatedTarget:html
+
+mouseenter@input#target
+    target:input#target
+    relatedTarget:html
+
+mouseenter@div#detailsContainer
+    target:div#detailsContainer
+    relatedTarget:html
+
+mouseenter@body
+    target:body
+    relatedTarget:html
+
+mousemove@input#target
+    target:input#target
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:input#target
+    relatedTarget:null
+
+mousemove@body
+    target:input#target
+    relatedTarget:null
+
+mousemove@html
+    target:input#target
+    relatedTarget:null
+
+mousemove@document
+    target:input#target
+    relatedTarget:null
+
+mousemove@window
+    target:input#target
+    relatedTarget:null
+
+mousemove@input#target
+    target:input#target
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:input#target
+    relatedTarget:null
+
+mousemove@body
+    target:input#target
+    relatedTarget:null
+
+mousemove@html
+    target:input#target
+    relatedTarget:null
+
+mousemove@document
+    target:input#target
+    relatedTarget:null
+
+mousemove@window
+    target:input#target
+    relatedTarget:null
+
+mousemove@input#target
+    target:input#target
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:input#target
+    relatedTarget:null
+
+mousemove@body
+    target:input#target
+    relatedTarget:null
+
+mousemove@html
+    target:input#target
+    relatedTarget:null
+
+mousemove@document
+    target:input#target
+    relatedTarget:null
+
+mousemove@window
+    target:input#target
+    relatedTarget:null
+
+mousemove@input#target
+    target:input#target
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:input#target
+    relatedTarget:null
+
+mousemove@body
+    target:input#target
+    relatedTarget:null
+
+mousemove@html
+    target:input#target
+    relatedTarget:null
+
+mousemove@document
+    target:input#target
+    relatedTarget:null
+
+mousemove@window
+    target:input#target
+    relatedTarget:null
+
+mousemove@input#target
+    target:input#target
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:input#target
+    relatedTarget:null
+
+mousemove@body
+    target:input#target
+    relatedTarget:null
+
+mousemove@html
+    target:input#target
+    relatedTarget:null
+
+mousemove@document
+    target:input#target
+    relatedTarget:null
+
+mousemove@window
+    target:input#target
+    relatedTarget:null
+
+mousemove@input#target
+    target:input#target
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:input#target
+    relatedTarget:null
+
+mousemove@body
+    target:input#target
+    relatedTarget:null
+
+mousemove@html
+    target:input#target
+    relatedTarget:null
+
+mousemove@document
+    target:input#target
+    relatedTarget:null
+
+mousemove@window
+    target:input#target
+    relatedTarget:null
+
+mousemove@input#target
+    target:input#target
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:input#target
+    relatedTarget:null
+
+mousemove@body
+    target:input#target
+    relatedTarget:null
+
+mousemove@html
+    target:input#target
+    relatedTarget:null
+
+mousemove@document
+    target:input#target
+    relatedTarget:null
+
+mousemove@window
+    target:input#target
+    relatedTarget:null
+
+mousemove@input#target
+    target:input#target
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:input#target
+    relatedTarget:null
+
+mousemove@body
+    target:input#target
+    relatedTarget:null
+
+mousemove@html
+    target:input#target
+    relatedTarget:null
+
+mousemove@document
+    target:input#target
+    relatedTarget:null
+
+mousemove@window
+    target:input#target
+    relatedTarget:null
+
+mousemove@input#target
+    target:input#target
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:input#target
+    relatedTarget:null
+
+mousemove@body
+    target:input#target
+    relatedTarget:null
+
+mousemove@html
+    target:input#target
+    relatedTarget:null
+
+mousemove@document
+    target:input#target
+    relatedTarget:null
+
+mousemove@window
+    target:input#target
+    relatedTarget:null
+
+mousemove@input#target
+    target:input#target
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:input#target
+    relatedTarget:null
+
+mousemove@body
+    target:input#target
+    relatedTarget:null
+
+mousemove@html
+    target:input#target
+    relatedTarget:null
+
+mousemove@document
+    target:input#target
+    relatedTarget:null
+
+mousemove@window
+    target:input#target
+    relatedTarget:null
+
+mousemove@input#target
+    target:input#target
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:input#target
+    relatedTarget:null
+
+mousemove@body
+    target:input#target
+    relatedTarget:null
+
+mousemove@html
+    target:input#target
+    relatedTarget:null
+
+mousemove@document
+    target:input#target
+    relatedTarget:null
+
+mousemove@window
+    target:input#target
+    relatedTarget:null
+
+mousemove@input#target
+    target:input#target
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:input#target
+    relatedTarget:null
+
+mousemove@body
+    target:input#target
+    relatedTarget:null
+
+mousemove@html
+    target:input#target
+    relatedTarget:null
+
+mousemove@document
+    target:input#target
+    relatedTarget:null
+
+mousemove@window
+    target:input#target
+    relatedTarget:null
+
+mousemove@input#target
+    target:input#target
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:input#target
+    relatedTarget:null
+
+mousemove@body
+    target:input#target
+    relatedTarget:null
+
+mousemove@html
+    target:input#target
+    relatedTarget:null
+
+mousemove@document
+    target:input#target
+    relatedTarget:null
+
+mousemove@window
+    target:input#target
+    relatedTarget:null
+
+mousemove@input#target
+    target:input#target
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:input#target
+    relatedTarget:null
+
+mousemove@body
+    target:input#target
+    relatedTarget:null
+
+mousemove@html
+    target:input#target
+    relatedTarget:null
+
+mousemove@document
+    target:input#target
+    relatedTarget:null
+
+mousemove@window
+    target:input#target
+    relatedTarget:null
+
+mousemove@input#target
+    target:input#target
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:input#target
+    relatedTarget:null
+
+mousemove@body
+    target:input#target
+    relatedTarget:null
+
+mousemove@html
+    target:input#target
+    relatedTarget:null
+
+mousemove@document
+    target:input#target
+    relatedTarget:null
+
+mousemove@window
+    target:input#target
+    relatedTarget:null
+
+mousemove@input#target
+    target:input#target
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:input#target
+    relatedTarget:null
+
+mousemove@body
+    target:input#target
+    relatedTarget:null
+
+mousemove@html
+    target:input#target
+    relatedTarget:null
+
+mousemove@document
+    target:input#target
+    relatedTarget:null
+
+mousemove@window
+    target:input#target
+    relatedTarget:null
+
+mousemove@input#target
+    target:input#target
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:input#target
+    relatedTarget:null
+
+mousemove@body
+    target:input#target
+    relatedTarget:null
+
+mousemove@html
+    target:input#target
+    relatedTarget:null
+
+mousemove@document
+    target:input#target
+    relatedTarget:null
+
+mousemove@window
+    target:input#target
+    relatedTarget:null
+
+mousemove@input#target
+    target:input#target
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:input#target
+    relatedTarget:null
+
+mousemove@body
+    target:input#target
+    relatedTarget:null
+
+mousemove@html
+    target:input#target
+    relatedTarget:null
+
+mousemove@document
+    target:input#target
+    relatedTarget:null
+
+mousemove@window
+    target:input#target
+    relatedTarget:null
+
+mousemove@input#target
+    target:input#target
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:input#target
+    relatedTarget:null
+
+mousemove@body
+    target:input#target
+    relatedTarget:null
+
+mousemove@html
+    target:input#target
+    relatedTarget:null
+
+mousemove@document
+    target:input#target
+    relatedTarget:null
+
+mousemove@window
+    target:input#target
+    relatedTarget:null
+
+mousemove@input#target
+    target:input#target
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:input#target
+    relatedTarget:null
+
+mousemove@body
+    target:input#target
+    relatedTarget:null
+
+mousemove@html
+    target:input#target
+    relatedTarget:null
+
+mousemove@document
+    target:input#target
+    relatedTarget:null
+
+mousemove@window
+    target:input#target
+    relatedTarget:null
+
+mousemove@input#target
+    target:input#target
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:input#target
+    relatedTarget:null
+
+mousemove@body
+    target:input#target
+    relatedTarget:null
+
+mousemove@html
+    target:input#target
+    relatedTarget:null
+
+mousemove@document
+    target:input#target
+    relatedTarget:null
+
+mousemove@window
+    target:input#target
+    relatedTarget:null
+
+mousemove@input#target
+    target:input#target
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:input#target
+    relatedTarget:null
+
+mousemove@body
+    target:input#target
+    relatedTarget:null
+
+mousemove@html
+    target:input#target
+    relatedTarget:null
+
+mousemove@document
+    target:input#target
+    relatedTarget:null
+
+mousemove@window
+    target:input#target
+    relatedTarget:null
+
+mousemove@input#target
+    target:input#target
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:input#target
+    relatedTarget:null
+
+mousemove@body
+    target:input#target
+    relatedTarget:null
+
+mousemove@html
+    target:input#target
+    relatedTarget:null
+
+mousemove@document
+    target:input#target
+    relatedTarget:null
+
+mousemove@window
+    target:input#target
+    relatedTarget:null
+
+mousemove@input#target
+    target:input#target
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:input#target
+    relatedTarget:null
+
+mousemove@body
+    target:input#target
+    relatedTarget:null
+
+mousemove@html
+    target:input#target
+    relatedTarget:null
+
+mousemove@document
+    target:input#target
+    relatedTarget:null
+
+mousemove@window
+    target:input#target
+    relatedTarget:null
+
+mouseout@input#target
+    target:input#target
+    relatedTarget:div#detailsContainer
+
+mouseout@div#detailsContainer
+    target:input#target
+    relatedTarget:div#detailsContainer
+
+mouseout@body
+    target:input#target
+    relatedTarget:div#detailsContainer
+
+mouseout@html
+    target:input#target
+    relatedTarget:div#detailsContainer
+
+mouseout@document
+    target:input#target
+    relatedTarget:div#detailsContainer
+
+mouseout@window
+    target:input#target
+    relatedTarget:div#detailsContainer
+
+mouseleave@input#target
+    target:input#target
+    relatedTarget:div#detailsContainer
+
+mouseover@div#detailsContainer
+    target:div#detailsContainer
+    relatedTarget:input#target
+
+mouseover@body
+    target:div#detailsContainer
+    relatedTarget:input#target
+
+mouseover@html
+    target:div#detailsContainer
+    relatedTarget:input#target
+
+mouseover@document
+    target:div#detailsContainer
+    relatedTarget:input#target
+
+mouseover@window
+    target:div#detailsContainer
+    relatedTarget:input#target
+
+mousemove@div#detailsContainer
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@body
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@html
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@document
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@window
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@body
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@html
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@document
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@window
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@body
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@html
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@document
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@window
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@body
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@html
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@document
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@window
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@body
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@html
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@document
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@window
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@body
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@html
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@document
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@window
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@body
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@html
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@document
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@window
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@body
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@html
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@document
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@window
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@body
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@html
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@document
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@window
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@body
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@html
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@document
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@window
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@body
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@html
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@document
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@window
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@body
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@html
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@document
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@window
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@body
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@html
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@document
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@window
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@body
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@html
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@document
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@window
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@body
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@html
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@document
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@window
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@body
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@html
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@document
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@window
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@body
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@html
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@document
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@window
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@body
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@html
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@document
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@window
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@body
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@html
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@document
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@window
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@body
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@html
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@document
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@window
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@body
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@html
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@document
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@window
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@body
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@html
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@document
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@window
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@body
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@html
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@document
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@window
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@body
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@html
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@document
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@window
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@body
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@html
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@document
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@window
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@body
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@html
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@document
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@window
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@div#detailsContainer
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@body
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@html
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@document
+    target:div#detailsContainer
+    relatedTarget:null
+
+mousemove@window
+    target:div#detailsContainer
+    relatedTarget:null
+
+
diff --git a/LayoutTests/fast/events/shadow-event-path-2.html b/LayoutTests/fast/events/shadow-event-path-2.html
new file mode 100644 (file)
index 0000000..35e5067
--- /dev/null
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<body>
+<p>This test records target and relatedTarget at each element while dispatching a mouse click event at an input element.</p>
+<div id="detailsContainer"><input id="target" type="file"></div>
+<pre id="log"></pre>
+<script src="resources/shadow-event-path-shared.js"></script>
+<script>
+
+var detailsContainer = document.getElementById('detailsContainer');
+log('Content:' + detailsContainer.outerHTML + '\n');
+
+if (window.testRunner && !window.eventSender)
+    log('This test requires eventSender.');
+else if (window.eventSender) {
+    var target = document.getElementById('target');
+    for (var x = -10; x <= 500; x += 10)
+        eventSender.mouseMoveTo(target.offsetLeft + x, target.offsetTop + target.offsetHeight / 2);
+}
+
+</script>
+</body>
+</html>
index 4847457..d9ce0b2 100644 (file)
@@ -4,60 +4,20 @@
 <p>This test records target and relatedTarget at each element while dispatching a mouse click event at an input element.</p>
 <div id="detailsContainer"><details><summary><div id="divInsideSummary"><input id="target" type="text" size="10"></summary></div></detials></div>
 <pre id="log"></pre>
+<script src="resources/shadow-event-path-shared.js"></script>
 <script>
 
-if (window.testRunner)
-    testRunner.dumpAsText();
+var detailsContainer = document.getElementById('detailsContainer');
+log('Content:' + detailsContainer.outerHTML + '\n');
 
-function targetIdentifier(target) {
-    if (target === undefined || target === null)
-        return target;
-    if (target === window)
-        return 'window';
-    if (target === document)
-        return 'document';
-    return target.localName + (target.id ? '#' + target.id : '');
-}
-
-function attachListeners(eventname) {
-    var targets = Array.prototype.slice.call(document.querySelectorAll('*'));
-    targets.push(window);
-    targets.push(document);
-    targets.forEach(function (target) {
-        target.addEventListener(eventname, function (event) {
-            log.textContent += eventname + '@' + targetIdentifier(target) + '\n'
-                + '    target:' + targetIdentifier(event.target) + '\n'
-                + '    relatedTarget:' + targetIdentifier(event.relatedTarget) + '\n\n';
-        });
-    });
-}
-
-var log = document.getElementById('log');
-log.textContent = 'Content:' + detailsContainer.outerHTML + '\n\n';
-var target = document.getElementById('target');
-
-attachListeners('mousemove');
-attachListeners('mousedown');
-attachListeners('mouseover');
-attachListeners('mouseout');
-attachListeners('mouseenter');
-attachListeners('mouseleave');
-attachListeners('mouseup');
-attachListeners('click');
-
-function runTest() {
-    testRunner.waitUntilDone();
+if (window.testRunner && !window.eventSender)
+    log('This test requires eventSender.');
+else if (window.eventSender) {
+    var target = document.getElementById('target');
     eventSender.mouseMoveTo(target.offsetLeft + target.offsetWidth / 2, target.offsetTop + target.offsetHeight / 2);
     eventSender.mouseMoveTo(target.offsetLeft + target.offsetWidth + 100, target.offsetTop + target.offsetHeight / 2);
     eventSender.mouseDown();
     eventSender.mouseUp();
-    testRunner.notifyDone();
-}
-
-if (window.testRunner && !window.eventSender)
-    log.textContent += 'This test requires eventSender.';
-else if (window.eventSender) {
-    window.onload = runTest;
 }
 
 </script>
index e58093e..83fe533 100644 (file)
@@ -1,3 +1,20 @@
+2014-04-25  Ryosuke Niwa  <rniwa@webkit.org>
+
+        REGRESSION (r167689): Hovering file name in a file input causes a crash
+        https://bugs.webkit.org/show_bug.cgi?id=132214
+
+        Reviewed by Andreas Kling.
+
+        The bug was caused by callDefaultEventHandlersInTheBubblingOrder unconditionally
+        accessing path.contextAt(0) even if the event path was empty.
+
+        Fixed the bug by exiting early when the event path is empty.
+
+        Test: fast/events/shadow-event-path-2.html
+
+        * dom/EventDispatcher.cpp:
+        (WebCore::callDefaultEventHandlersInTheBubblingOrder):
+
 2014-04-25  Tim Horton  <timothy_horton@apple.com>
 
         REGRESSION (r167828): http/tests/media/hls/video-controls-live-stream.html fails
index f87d435..2749928 100644 (file)
@@ -262,6 +262,9 @@ void EventDispatcher::dispatchSimulatedClick(Element* element, Event* underlying
 
 static void callDefaultEventHandlersInTheBubblingOrder(Event& event, const EventPath& path)
 {
+    if (path.isEmpty())
+        return;
+
     // Non-bubbling events call only one default event handler, the one for the target.
     path.contextAt(0).node()->defaultEventHandler(&event);
     ASSERT(!event.defaultPrevented());