Title: [152549] branches/safari-537-branch

Diff

Modified: branches/safari-537-branch/LayoutTests/ChangeLog (152548 => 152549)


--- branches/safari-537-branch/LayoutTests/ChangeLog	2013-07-10 21:15:56 UTC (rev 152548)
+++ branches/safari-537-branch/LayoutTests/ChangeLog	2013-07-10 21:34:47 UTC (rev 152549)
@@ -1,3 +1,18 @@
+2013-07-10  Lucas Forschler  <[email protected]>
+
+        Merge r152541
+
+    2013-07-09  Roger Fong  <[email protected]>
+
+            HTMLPluginElement's state should be Playing before firing mouse click event.
+            https://bugs.webkit.org/show_bug.cgi?id=118398.
+            <rdar://problem/14262126>
+
+            Reviewed by Dean Jackson.
+
+            * platform/mac-wk2/plugins/snapshotting/plugin-receives-click-event-expected.txt: Added.
+            * plugins/snapshotting/plugin-receives-click-event.html: Added.
+
 2013-07-09  Jeffrey Pfau  <[email protected]>
 
         Skip cache partitioning tests, as cache partitioning is not supported on Lion

Copied: branches/safari-537-branch/LayoutTests/platform/mac-wk2/plugins/snapshotting/plugin-receives-click-event-expected.txt (from rev 152541, trunk/LayoutTests/platform/mac-wk2/plugins/snapshotting/plugin-receives-click-event-expected.txt) (0 => 152549)


--- branches/safari-537-branch/LayoutTests/platform/mac-wk2/plugins/snapshotting/plugin-receives-click-event-expected.txt	                        (rev 0)
+++ branches/safari-537-branch/LayoutTests/platform/mac-wk2/plugins/snapshotting/plugin-receives-click-event-expected.txt	2013-07-10 21:34:47 UTC (rev 152549)
@@ -0,0 +1,2 @@
+
+PASS, plugin did receive mouse click event.

Copied: branches/safari-537-branch/LayoutTests/plugins/snapshotting/plugin-receives-click-event.html (from rev 152541, trunk/LayoutTests/plugins/snapshotting/plugin-receives-click-event.html) (0 => 152549)


--- branches/safari-537-branch/LayoutTests/plugins/snapshotting/plugin-receives-click-event.html	                        (rev 0)
+++ branches/safari-537-branch/LayoutTests/plugins/snapshotting/plugin-receives-click-event.html	2013-07-10 21:34:47 UTC (rev 152549)
@@ -0,0 +1,26 @@
+<embed id="plugin" src=""
+<div id="result">FAIL, plugin did not receive mouse click event.</div>
+<script>
+if (window.testRunner) {
+    window.internals.settings.setPlugInSnapshottingEnabled(true);
+    window.internals.settings.setMaximumPlugInSnapshotAttempts(0);
+	var embed = document.getElementById("plugin");
+	var div = document.getElementById("result");
+	embed.addEventListener("click", function() {
+		div.innerHTML = "PASS, plugin did receive mouse click event.";
+		testRunner.notifyDone();
+		});
+	testRunner.waitUntilDone();
+    setTimeout(function() {
+        var embed = document.querySelector("embed");
+        var rect = embed.getBoundingClientRect();
+        eventSender.mouseMoveTo(rect.left + 10, rect.top + 10);
+        eventSender.mouseDown();
+        eventSender.mouseUp();
+        setTimeout(function() {
+            testRunner.notifyDone();
+        }, 500);
+    }, 500);
+	testRunner.dumpAsText();
+}
+</script>

Modified: branches/safari-537-branch/Source/WebCore/ChangeLog (152548 => 152549)


--- branches/safari-537-branch/Source/WebCore/ChangeLog	2013-07-10 21:15:56 UTC (rev 152548)
+++ branches/safari-537-branch/Source/WebCore/ChangeLog	2013-07-10 21:34:47 UTC (rev 152549)
@@ -1,5 +1,30 @@
 2013-07-10  Lucas Forschler  <[email protected]>
 
+        Merge r152541
+
+    2013-07-09  Roger Fong  <[email protected]>
+
+            HTMLPluginElement's state should be Playing before firing mouse click event.
+            https://bugs.webkit.org/show_bug.cgi?id=118398.
+            <rdar://problem/14262126>
+
+            Reviewed by Dean Jackson.
+
+            Test: plugins/snapshotting/plugin-receives-click-event.html
+
+            * html/HTMLPlugInImageElement.cpp:
+            (WebCore::HTMLPlugInImageElement::simulatedMouseClickTimerFired):
+            The defaultEventHandler returns early if the state is not Playing.
+            This is because we only want the plugin to deal with user interaction normally if the
+            plugin is actually enabled (not being snapshotted).
+            When we click on the snapshotted plugin to start it, we mimic what would happen to the plugin
+            normally by dispatching another click event on top of where we just clicked.
+            However, we were sending the click event before setting the state to Playing which meant that our
+            simulated click was not being handled. 
+            We should be setting this state before sending the click, not after.
+
+2013-07-10  Lucas Forschler  <[email protected]>
+
         Merge r152426
 
     2013-07-05  Brent Fulgham  <[email protected]>

Modified: branches/safari-537-branch/Source/WebCore/html/HTMLPlugInImageElement.cpp (152548 => 152549)


--- branches/safari-537-branch/Source/WebCore/html/HTMLPlugInImageElement.cpp	2013-07-10 21:15:56 UTC (rev 152548)
+++ branches/safari-537-branch/Source/WebCore/html/HTMLPlugInImageElement.cpp	2013-07-10 21:34:47 UTC (rev 152549)
@@ -536,9 +536,9 @@
     ASSERT(displayState() == RestartingWithPendingMouseClick);
     ASSERT(m_pendingClickEventFromSnapshot);
 
+    setDisplayState(Playing);
     dispatchSimulatedClick(m_pendingClickEventFromSnapshot.get(), SendMouseOverUpDownEvents, DoNotShowPressedLook);
 
-    setDisplayState(Playing);
     m_pendingClickEventFromSnapshot = nullptr;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to