Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Issue 2755773002: Make Window#open arguments optional to match the spec

Created:
3 years, 9 months ago by lunalu1
Modified:
3 years, 8 months ago
Reviewers:
foolip
CC:
chromium-reviews, blink-reviews, blink-reviews-frames_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Make Window#open arguments optional to match the spec BUG=701557

Patch Set 1 #

Patch Set 2 : Update window.open function length for layout tests" #

Total comments: 8

Patch Set 3 : Codereivew: remove unnecessary TODO #

Patch Set 4 : Codereview: add wpt test for window.open #

Patch Set 5 : Update wpt tests window-open.html #

Total comments: 1

Patch Set 6 : Updated layout tests for window.open #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+20 lines, -4 lines) Patch
A third_party/WebKit/LayoutTests/external/wpt/html/browsers/the-window-object/window-open.html View 1 2 3 4 5 1 chunk +17 lines, -0 lines 1 comment Download
M third_party/WebKit/LayoutTests/fast/js/function-length.html View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/fast/js/function-length-expected.txt View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/Window.idl View 1 2 1 chunk +1 line, -2 lines 0 comments Download

Messages

Total messages: 37 (25 generated)
lunalu1
PTAL
3 years, 9 months ago (2017-03-16 15:25:45 UTC) #7
foolip
https://codereview.chromium.org/2755773002/diff/20001/third_party/WebKit/Source/core/frame/Window.idl File third_party/WebKit/Source/core/frame/Window.idl (right): https://codereview.chromium.org/2755773002/diff/20001/third_party/WebKit/Source/core/frame/Window.idl#newcode65 third_party/WebKit/Source/core/frame/Window.idl:65: // TODO(lunalu): Replace Window by WindowProxy. There's already a ...
3 years, 9 months ago (2017-03-21 08:09:34 UTC) #11
lunalu1
Please see comments replied inline. https://codereview.chromium.org/2755773002/diff/20001/third_party/WebKit/Source/core/frame/Window.idl File third_party/WebKit/Source/core/frame/Window.idl (right): https://codereview.chromium.org/2755773002/diff/20001/third_party/WebKit/Source/core/frame/Window.idl#newcode65 third_party/WebKit/Source/core/frame/Window.idl:65: // TODO(lunalu): Replace Window ...
3 years, 9 months ago (2017-03-21 19:49:45 UTC) #12
foolip
https://codereview.chromium.org/2755773002/diff/20001/third_party/WebKit/Source/core/frame/Window.idl File third_party/WebKit/Source/core/frame/Window.idl (right): https://codereview.chromium.org/2755773002/diff/20001/third_party/WebKit/Source/core/frame/Window.idl#newcode66 third_party/WebKit/Source/core/frame/Window.idl:66: [Custom] Window? open(optional DOMString url = "about:blank", optional DOMString ...
3 years, 9 months ago (2017-03-22 05:31:20 UTC) #17
lunalu1
Please see comments inline. https://codereview.chromium.org/2755773002/diff/20001/third_party/WebKit/Source/core/frame/Window.idl File third_party/WebKit/Source/core/frame/Window.idl (right): https://codereview.chromium.org/2755773002/diff/20001/third_party/WebKit/Source/core/frame/Window.idl#newcode66 third_party/WebKit/Source/core/frame/Window.idl:66: [Custom] Window? open(optional DOMString url ...
3 years, 9 months ago (2017-03-24 19:37:31 UTC) #18
lunalu1
wpt tests added in: https://github.com/w3c/web-platform-tests/pull/5229
3 years, 9 months ago (2017-03-27 15:30:52 UTC) #19
foolip
https://codereview.chromium.org/2755773002/diff/20001/third_party/WebKit/Source/core/frame/Window.idl File third_party/WebKit/Source/core/frame/Window.idl (right): https://codereview.chromium.org/2755773002/diff/20001/third_party/WebKit/Source/core/frame/Window.idl#newcode66 third_party/WebKit/Source/core/frame/Window.idl:66: [Custom] Window? open(optional DOMString url = "about:blank", optional DOMString ...
3 years, 8 months ago (2017-03-30 05:04:50 UTC) #20
foolip
Can you do the wpt changes as part of this CL?
3 years, 8 months ago (2017-03-30 05:05:48 UTC) #21
lunalu1
I added the wpt tests for window.open. PTAL
3 years, 8 months ago (2017-03-30 18:28:32 UTC) #23
foolip
https://codereview.chromium.org/2755773002/diff/80001/third_party/WebKit/LayoutTests/external/wpt/html/browsers/the-window-object/window-open.html File third_party/WebKit/LayoutTests/external/wpt/html/browsers/the-window-object/window-open.html (right): https://codereview.chromium.org/2755773002/diff/80001/third_party/WebKit/LayoutTests/external/wpt/html/browsers/the-window-object/window-open.html#newcode8 third_party/WebKit/LayoutTests/external/wpt/html/browsers/the-window-object/window-open.html:8: assert_equals(window.open().location.href, 'about:blank'); Can you also test null and undefined ...
3 years, 8 months ago (2017-04-04 03:50:49 UTC) #31
lunalu1
I updated the layout tests. Please take a second look.
3 years, 8 months ago (2017-04-04 18:08:40 UTC) #33
foolip
3 years, 8 months ago (2017-04-05 04:33:56 UTC) #37
https://codereview.chromium.org/2755773002/diff/100001/third_party/WebKit/Lay...
File
third_party/WebKit/LayoutTests/external/wpt/html/browsers/the-window-object/window-open.html
(right):

https://codereview.chromium.org/2755773002/diff/100001/third_party/WebKit/Lay...
third_party/WebKit/LayoutTests/external/wpt/html/browsers/the-window-object/window-open.html:10:
assert_equals(window.open('null').location.href, 'about:blank');
Here I meant to test using the literal null, not a string, because I suspect
that will reveal a bug in our custom bindings.

However, it also seems like these tests can't be synchronous, because it seems
like location.href is always 'about:blank' initially and then the window is
navigated to the new url asynchronously. That's the "Otherwise, navigate" at
step 8 of https://html.spec.whatwg.org/multipage/browsers.html#dom-open

So, for the first two of these, I think you'll have to do something like this:

async_test(t => {
  const win = window.open();
  assert_equals(win.location.href, 'about:blank');
  win.onload = t.step_func_done(() => {
    assert_equals(win.location.href, 'about:blank');
  });
});

And for the null case, the inner assert should probably be
assert_true(win.location.href.endsWith('null'));

What I hope to find out is which browsers will fail the window.open(null) case.
It could be that we should change the spec if everyone treats it as
'about:blank' rather than stringifying it to 'null'.

Powered by Google App Engine
This is Rietveld 408576698