Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return value of window.open when popup is blocked #1851

Closed
zcorpan opened this issue Oct 3, 2016 · 1 comment · Fixed by #1854
Closed

Return value of window.open when popup is blocked #1851

zcorpan opened this issue Oct 3, 2016 · 1 comment · Fixed by #1854
Assignees

Comments

@zcorpan
Copy link
Member

zcorpan commented Oct 3, 2016

See
#1845
#1848

What should the return value be when the popup is blocked?

http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4541

The IDL only allows null or WindowProxy.

WebKit/Chromium return undefined.
Gecko/Edge 13 return null.

I suggest we align the spec with Gecko/Edge, since the spec says to return null in the noopener case and it fits with the IDL.

cc @bzbarsky

@bzbarsky
Copy link
Contributor

bzbarsky commented Oct 4, 2016

Yes, returning null makes sense to me.

@annevk annevk self-assigned this Oct 4, 2016
annevk added a commit that referenced this issue Oct 4, 2016
zcorpan pushed a commit that referenced this issue Oct 4, 2016
kisg pushed a commit to paul99/webkit-mips that referenced this issue Oct 4, 2016
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:
- whatwg/html#1854
- whatwg/html#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: http://svn.webkit.org/repository/webkit/trunk@206777 268f45cc-cd09-0410-ab3c-d52691b4dbfc
alice pushed a commit to alice/html that referenced this issue Jan 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants