[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da
jnd at chromium.org
jnd at chromium.org
Wed Dec 22 17:59:38 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit b4759c912a3129a0679440d0803be9a1e328a357
Author: jnd at chromium.org <jnd at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sat Dec 4 12:15:36 2010 +0000
2010-12-04 Johnny Ding <jnd at chromium.org>
Reviewed by Alexey Proskuryakov.
The JavaScript created (untrusted) event inside a user-initiated
(trusted) event should not cache the UserGesture status.
https://bugs.webkit.org/show_bug.cgi?id=50508
* fast/events/popup-blocked-from-untrusted-mouse-click-expected.txt: Added.
* fast/events/popup-blocked-from-untrusted-mouse-click.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73327 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 6a16746..917f683 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2010-12-04 Johnny Ding <jnd at chromium.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ The JavaScript created (untrusted) event inside a user-initiated
+ (trusted) event should not cache the UserGesture status.
+
+ https://bugs.webkit.org/show_bug.cgi?id=50508
+
+ * fast/events/popup-blocked-from-untrusted-mouse-click-expected.txt: Added.
+ * fast/events/popup-blocked-from-untrusted-mouse-click.html: Added.
+
2010-12-03 Martin Robinson <mrobinson at igalia.com>
Add a platform-specific baseline for GTK+ after r73128. This test
diff --git a/LayoutTests/fast/events/popup-blocked-from-untrusted-mouse-click-expected.txt b/LayoutTests/fast/events/popup-blocked-from-untrusted-mouse-click-expected.txt
new file mode 100644
index 0000000..6bec8a5
--- /dev/null
+++ b/LayoutTests/fast/events/popup-blocked-from-untrusted-mouse-click-expected.txt
@@ -0,0 +1,4 @@
+
+open a new window
+The JavaScript created (untrusted) event inside a user-initiated (trusted) event should not cache the UserGesture status. This test is for bug https://bugs.webkit.org/show_bug.cgi?id=50508.
+PASSED
diff --git a/LayoutTests/fast/events/popup-blocked-from-untrusted-mouse-click.html b/LayoutTests/fast/events/popup-blocked-from-untrusted-mouse-click.html
new file mode 100644
index 0000000..876ec7a
--- /dev/null
+++ b/LayoutTests/fast/events/popup-blocked-from-untrusted-mouse-click.html
@@ -0,0 +1,83 @@
+<html>
+<head>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.setCanOpenWindows();
+ layoutTestController.setCloseRemainingWindowsWhenComplete(true);
+ layoutTestController.waitUntilDone();
+}
+
+var TEST_STARTED = 0;
+var TEST_WITH_ENABLING_POPUP_BLOCKER = 1;
+var TEST_WITH_DISABLING_POPUP_BLOCKER = 2;
+var TEST_COMPLETED = 3;
+
+function nextTestStage() {
+ window.testStage++;
+ if (TEST_WITH_ENABLING_POPUP_BLOCKER == window.testStage) {
+ window.popupBlockerIsEnabled = true;
+ doClick();
+ } else if (TEST_WITH_DISABLING_POPUP_BLOCKER == window.testStage) {
+ window.popupBlockerIsEnabled = false;
+ doClick();
+ } else {
+ document.getElementById("console").innerHTML = "PASSED";
+ layoutTestController.notifyDone();
+ }
+}
+
+function dispatchEvent(obj, evt) {
+ return function() {
+ return obj.dispatchEvent(evt);
+ }
+}
+
+function simulateClick() {
+ var evt = document.createEvent("MouseEvents");
+ evt.initMouseEvent("click", true, true, window,
+ 0, 0, 0, 0, 0, false, false, false, false, 0, null);
+ var cb = document.getElementById("anchor");
+ setTimeout(dispatchEvent(cb, evt), 100);
+}
+
+function openWindow(evt) {
+ window.open("data:text/html\, try to open new window", "_blank");
+ // If we enabled the popup blocker, the new window should be blocked.
+ // The windowCount should still be 1.
+ var expectedWindowCount = 1;
+ // If we disabled the popup blocker, the new window should be created.
+ // The windowCount should be 2.
+ if (!window.popupBlockerIsEnabled)
+ expectedWindowCount = 2;
+ // Encounter a failure, quit test.
+ if (layoutTestController.windowCount() != expectedWindowCount) {
+ layoutTestController.notifyDone();
+ return;
+ }
+ // Go to next test stage.
+ window.setTimeout(nextTestStage, 0);
+}
+
+function doClick() {
+ layoutTestController.setPopupBlockingEnabled(window.popupBlockerIsEnabled);
+ // Send a mouse-click event to click the button.
+ eventSender.mouseMoveTo(0, 0);
+ eventSender.mouseMoveTo(20, 20);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+}
+
+function test() {
+ if (!window.layoutTestController)
+ return;
+ window.testStage = TEST_STARTED;
+ nextTestStage();
+}
+
+</script>
+<body onload="window.setTimeout(test, 0);">
+<input type="button" onclick="simulateClick();" value="click me" id="btn"><br>
+<a onclick="openWindow(event)" id="anchor"> open a new window </a><br>
+The JavaScript created (untrusted) event inside a user-initiated (trusted) event should not cache the UserGesture status. This test is for bug https://bugs.webkit.org/show_bug.cgi?id=50508.
+<div id="console">FAILED</div>
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list