Return null when window.open() is popup blocked
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Oct 2016 19:00:06 +0000 (19:00 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Oct 2016 19:00:06 +0000 (19:00 +0000)
commit63191d18af67cb7d2b9e16b0deef5c3a4f66c28b
tree52ace59b62fa7d29fc27a78cd6bca4e962245042
parenta0729a178d15d381e8d5e0ae7bd0e6c6f37f9d62
Return null when window.open() is popup blocked
https://bugs.webkit.org/show_bug.cgi?id=162897

Reviewed by Michael Catanzaro.

Source/WebCore:

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):

LayoutTests:

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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@206777 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/events/popup-blocked-from-fake-button-click-expected.txt
LayoutTests/fast/events/popup-blocked-from-fake-button-click.html
LayoutTests/fast/events/popup-blocked-from-fake-focus-expected.txt
LayoutTests/fast/events/popup-blocked-from-fake-focus.html
LayoutTests/fast/events/popup-blocked-from-fake-user-gesture-expected.txt
LayoutTests/fast/events/popup-blocked-from-fake-user-gesture.html
LayoutTests/fast/events/popup-blocked-from-untrusted-click-event-on-anchor-expected.txt
LayoutTests/fast/events/popup-blocked-from-untrusted-click-event-on-anchor.html
LayoutTests/fast/events/popup-blocking-timers3-expected.txt
LayoutTests/fast/events/popup-blocking-timers3.html
LayoutTests/fast/events/popup-blocking-timers4-expected.txt
LayoutTests/fast/events/popup-blocking-timers4.html
LayoutTests/fast/events/popup-blocking-timers6-expected.txt
LayoutTests/fast/events/popup-blocking-timers6.html
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSDOMWindowCustom.cpp