Title: [152541] trunk
- Revision
- 152541
- Author
- [email protected]
- Date
- 2013-07-10 12:30:59 -0700 (Wed, 10 Jul 2013)
Log Message
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.
* platform/mac-wk2/plugins/snapshotting/plugin-receives-click-event-expected.txt: Added.
* plugins/snapshotting/plugin-receives-click-event.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (152540 => 152541)
--- trunk/LayoutTests/ChangeLog 2013-07-10 18:42:39 UTC (rev 152540)
+++ trunk/LayoutTests/ChangeLog 2013-07-10 19:30:59 UTC (rev 152541)
@@ -1,3 +1,14 @@
+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-10 Mario Sanchez Prada <[email protected]>
AX: Allow requesting the full plain text for an object with textUnderElement()
Added: trunk/LayoutTests/platform/mac-wk2/plugins/snapshotting/plugin-receives-click-event-expected.txt (0 => 152541)
--- trunk/LayoutTests/platform/mac-wk2/plugins/snapshotting/plugin-receives-click-event-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac-wk2/plugins/snapshotting/plugin-receives-click-event-expected.txt 2013-07-10 19:30:59 UTC (rev 152541)
@@ -0,0 +1,2 @@
+
+PASS, plugin did receive mouse click event.
Added: trunk/LayoutTests/plugins/snapshotting/plugin-receives-click-event.html (0 => 152541)
--- trunk/LayoutTests/plugins/snapshotting/plugin-receives-click-event.html (rev 0)
+++ trunk/LayoutTests/plugins/snapshotting/plugin-receives-click-event.html 2013-07-10 19:30:59 UTC (rev 152541)
@@ -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: trunk/Source/WebCore/ChangeLog (152540 => 152541)
--- trunk/Source/WebCore/ChangeLog 2013-07-10 18:42:39 UTC (rev 152540)
+++ trunk/Source/WebCore/ChangeLog 2013-07-10 19:30:59 UTC (rev 152541)
@@ -1,3 +1,24 @@
+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 Nick Diego Yamane <[email protected]>
Fix a bug in MediaStreamDescriptor::removeVideoComponent
Modified: trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp (152540 => 152541)
--- trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp 2013-07-10 18:42:39 UTC (rev 152540)
+++ trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp 2013-07-10 19:30:59 UTC (rev 152541)
@@ -531,9 +531,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