Diff
Modified: trunk/LayoutTests/ChangeLog (206776 => 206777)
--- trunk/LayoutTests/ChangeLog 2016-10-04 18:51:44 UTC (rev 206776)
+++ trunk/LayoutTests/ChangeLog 2016-10-04 19:00:06 UTC (rev 206777)
@@ -1,3 +1,27 @@
+2016-10-04 Chris Dumez <[email protected]>
+
+ Return null when window.open() is popup blocked
+ https://bugs.webkit.org/show_bug.cgi?id=162897
+
+ Reviewed by Michael Catanzaro.
+
+ Rebaseline existing tests to reflect behavior change.
+
+ * fast/events/popup-blocked-from-fake-button-click-expected.txt:
+ * fast/events/popup-blocked-from-fake-button-click.html:
+ * fast/events/popup-blocked-from-fake-focus-expected.txt:
+ * fast/events/popup-blocked-from-fake-focus.html:
+ * fast/events/popup-blocked-from-fake-user-gesture-expected.txt:
+ * fast/events/popup-blocked-from-fake-user-gesture.html:
+ * fast/events/popup-blocked-from-untrusted-click-event-on-anchor-expected.txt:
+ * fast/events/popup-blocked-from-untrusted-click-event-on-anchor.html:
+ * fast/events/popup-blocking-timers3-expected.txt:
+ * fast/events/popup-blocking-timers3.html:
+ * fast/events/popup-blocking-timers4-expected.txt:
+ * fast/events/popup-blocking-timers4.html:
+ * fast/events/popup-blocking-timers6-expected.txt:
+ * fast/events/popup-blocking-timers6.html:
+
2016-10-04 Ryan Haddad <[email protected]>
Marking http/tests/cache/disk-cache/disk-cache-204-status-code.html as flaky on mac-wk2.
Modified: trunk/LayoutTests/fast/events/popup-blocked-from-fake-button-click-expected.txt (206776 => 206777)
--- trunk/LayoutTests/fast/events/popup-blocked-from-fake-button-click-expected.txt 2016-10-04 18:51:44 UTC (rev 206776)
+++ trunk/LayoutTests/fast/events/popup-blocked-from-fake-button-click-expected.txt 2016-10-04 19:00:06 UTC (rev 206777)
@@ -1,2 +1,2 @@
-PASS win is undefined.
+PASS win is null
Modified: trunk/LayoutTests/fast/events/popup-blocked-from-fake-button-click.html (206776 => 206777)
--- trunk/LayoutTests/fast/events/popup-blocked-from-fake-button-click.html 2016-10-04 18:51:44 UTC (rev 206776)
+++ trunk/LayoutTests/fast/events/popup-blocked-from-fake-button-click.html 2016-10-04 19:00:06 UTC (rev 206777)
@@ -9,7 +9,7 @@
var win;
function popup() {
win = window.open("about:blank", "blank");
- shouldBeUndefined("win");
+ shouldBeNull("win");
}
if (window.testRunner) {
Modified: trunk/LayoutTests/fast/events/popup-blocked-from-fake-focus-expected.txt (206776 => 206777)
--- trunk/LayoutTests/fast/events/popup-blocked-from-fake-focus-expected.txt 2016-10-04 18:51:44 UTC (rev 206776)
+++ trunk/LayoutTests/fast/events/popup-blocked-from-fake-focus-expected.txt 2016-10-04 19:00:06 UTC (rev 206777)
@@ -1,4 +1,4 @@
-PASS win is undefined.
-PASS win is undefined.
+PASS win is null
+PASS win is null
Modified: trunk/LayoutTests/fast/events/popup-blocked-from-fake-focus.html (206776 => 206777)
--- trunk/LayoutTests/fast/events/popup-blocked-from-fake-focus.html 2016-10-04 18:51:44 UTC (rev 206776)
+++ trunk/LayoutTests/fast/events/popup-blocked-from-fake-focus.html 2016-10-04 19:00:06 UTC (rev 206777)
@@ -10,7 +10,7 @@
var win;
function popup() {
win = window.open("about:blank", "blank");
- shouldBeUndefined("win");
+ shouldBeNull("win");
}
if (window.testRunner) {
Modified: trunk/LayoutTests/fast/events/popup-blocked-from-fake-user-gesture-expected.txt (206776 => 206777)
--- trunk/LayoutTests/fast/events/popup-blocked-from-fake-user-gesture-expected.txt 2016-10-04 18:51:44 UTC (rev 206776)
+++ trunk/LayoutTests/fast/events/popup-blocked-from-fake-user-gesture-expected.txt 2016-10-04 19:00:06 UTC (rev 206777)
@@ -1,4 +1,4 @@
Click Here
PASS win is non-null.
-PASS win is undefined.
+PASS win is null
Modified: trunk/LayoutTests/fast/events/popup-blocked-from-fake-user-gesture.html (206776 => 206777)
--- trunk/LayoutTests/fast/events/popup-blocked-from-fake-user-gesture.html 2016-10-04 18:51:44 UTC (rev 206776)
+++ trunk/LayoutTests/fast/events/popup-blocked-from-fake-user-gesture.html 2016-10-04 19:00:06 UTC (rev 206777)
@@ -20,7 +20,7 @@
{
window.event = stolenEvent;
win = window.open("about:blank", "blank");
- shouldBeUndefined("win");
+ shouldBeNull("win");
}
clickHandler = clickHandler1;
Modified: trunk/LayoutTests/fast/events/popup-blocked-from-untrusted-click-event-on-anchor-expected.txt (206776 => 206777)
--- trunk/LayoutTests/fast/events/popup-blocked-from-untrusted-click-event-on-anchor-expected.txt 2016-10-04 18:51:44 UTC (rev 206776)
+++ trunk/LayoutTests/fast/events/popup-blocked-from-untrusted-click-event-on-anchor-expected.txt 2016-10-04 19:00:06 UTC (rev 206777)
@@ -1,3 +1,3 @@
test
-PASS win is undefined.
+PASS win is null
Modified: trunk/LayoutTests/fast/events/popup-blocked-from-untrusted-click-event-on-anchor.html (206776 => 206777)
--- trunk/LayoutTests/fast/events/popup-blocked-from-untrusted-click-event-on-anchor.html 2016-10-04 18:51:44 UTC (rev 206776)
+++ trunk/LayoutTests/fast/events/popup-blocked-from-untrusted-click-event-on-anchor.html 2016-10-04 19:00:06 UTC (rev 206777)
@@ -9,7 +9,7 @@
var win;
function popup() {
win = window.open('about:blank','blank','height=200,width=200');
- shouldBeUndefined("win");
+ shouldBeNull("win");
}
if (window.testRunner) {
Modified: trunk/LayoutTests/fast/events/popup-blocking-timers3-expected.txt (206776 => 206777)
--- trunk/LayoutTests/fast/events/popup-blocking-timers3-expected.txt 2016-10-04 18:51:44 UTC (rev 206776)
+++ trunk/LayoutTests/fast/events/popup-blocking-timers3-expected.txt 2016-10-04 19:00:06 UTC (rev 206777)
@@ -2,5 +2,5 @@
Test calling window.open() in a 100 ms interval. A popup should only be allowed on the first execution of the interval.
PASS newWindow is non-null.
Test calling window.open() in a 100 ms interval. A popup should only be allowed on the first execution of the interval.
-PASS newWindow is undefined.
+PASS newWindow is null
Modified: trunk/LayoutTests/fast/events/popup-blocking-timers3.html (206776 => 206777)
--- trunk/LayoutTests/fast/events/popup-blocking-timers3.html 2016-10-04 18:51:44 UTC (rev 206776)
+++ trunk/LayoutTests/fast/events/popup-blocking-timers3.html 2016-10-04 19:00:06 UTC (rev 206777)
@@ -22,7 +22,7 @@
shouldBeNonNull("newWindow");
firstIntervalExecution = false;
} else {
- shouldBeUndefined("newWindow");
+ shouldBeNull("newWindow");
clearInterval(intervalId);
if (window.testRunner)
testRunner.notifyDone();
Modified: trunk/LayoutTests/fast/events/popup-blocking-timers4-expected.txt (206776 => 206777)
--- trunk/LayoutTests/fast/events/popup-blocking-timers4-expected.txt 2016-10-04 18:51:44 UTC (rev 206776)
+++ trunk/LayoutTests/fast/events/popup-blocking-timers4-expected.txt 2016-10-04 19:00:06 UTC (rev 206777)
@@ -1,4 +1,4 @@
Click Here
Test calling window.open() in a nested call to setTimeout(). A popup should not be allowed.
-PASS newWindow is undefined.
+PASS newWindow is null
Modified: trunk/LayoutTests/fast/events/popup-blocking-timers4.html (206776 => 206777)
--- trunk/LayoutTests/fast/events/popup-blocking-timers4.html 2016-10-04 18:51:44 UTC (rev 206776)
+++ trunk/LayoutTests/fast/events/popup-blocking-timers4.html 2016-10-04 19:00:06 UTC (rev 206777)
@@ -17,7 +17,7 @@
newWindow = window.open("about:blank");
self.focus();
debug("Test calling window.open() in a nested call to setTimeout(). A popup should not be allowed.")
- shouldBeUndefined("newWindow");
+ shouldBeNull("newWindow");
if (window.testRunner)
testRunner.notifyDone();
}, 0);
Modified: trunk/LayoutTests/fast/events/popup-blocking-timers6-expected.txt (206776 => 206777)
--- trunk/LayoutTests/fast/events/popup-blocking-timers6-expected.txt 2016-10-04 18:51:44 UTC (rev 206776)
+++ trunk/LayoutTests/fast/events/popup-blocking-timers6-expected.txt 2016-10-04 19:00:06 UTC (rev 206777)
@@ -1,4 +1,4 @@
Click Here
Test calling window.open() with a 1001 ms delay. A popup should not be allowed.
-PASS newWindow is undefined.
+PASS newWindow is null
Modified: trunk/LayoutTests/fast/events/popup-blocking-timers6.html (206776 => 206777)
--- trunk/LayoutTests/fast/events/popup-blocking-timers6.html 2016-10-04 18:51:44 UTC (rev 206776)
+++ trunk/LayoutTests/fast/events/popup-blocking-timers6.html 2016-10-04 19:00:06 UTC (rev 206777)
@@ -16,7 +16,7 @@
newWindow = window.open("about:blank");
self.focus();
debug("Test calling window.open() with a 1001 ms delay. A popup should not be allowed.")
- shouldBeUndefined("newWindow");
+ shouldBeNull("newWindow");
if (window.testRunner)
testRunner.notifyDone();
Modified: trunk/Source/WebCore/ChangeLog (206776 => 206777)
--- trunk/Source/WebCore/ChangeLog 2016-10-04 18:51:44 UTC (rev 206776)
+++ trunk/Source/WebCore/ChangeLog 2016-10-04 19:00:06 UTC (rev 206777)
@@ -1,5 +1,23 @@
2016-10-04 Chris Dumez <[email protected]>
+ Return null when window.open() is popup blocked
+ https://bugs.webkit.org/show_bug.cgi?id=162897
+
+ Reviewed by Michael Catanzaro.
+
+ The return value of window.open() when the popup is blocked should be null:
+ - https://github.com/whatwg/html/pull/1854
+ - https://github.com/whatwg/html/issues/1851
+
+ Firefox / Edge return null.
+
+ No new tests, rebaselined existing tests.
+
+ * bindings/js/JSDOMWindowCustom.cpp:
+ (WebCore::JSDOMWindow::open):
+
+2016-10-04 Chris Dumez <[email protected]>
+
[Web IDL] Add support for dictionary inheritance
https://bugs.webkit.org/show_bug.cgi?id=162907
Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp (206776 => 206777)
--- trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp 2016-10-04 18:51:44 UTC (rev 206776)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp 2016-10-04 19:00:06 UTC (rev 206777)
@@ -433,7 +433,7 @@
RefPtr<DOMWindow> openedWindow = wrapped().open(urlString, target, windowFeaturesString, activeDOMWindow(&state), firstDOMWindow(&state));
if (!openedWindow)
- return jsUndefined();
+ return jsNull();
return toJS(&state, openedWindow.get());
}