RESOLVED WONTFIX Bug 97171
Support the replace attribute of window.open
https://bugs.webkit.org/show_bug.cgi?id=97171
Summary Support the replace attribute of window.open
KyungTae Kim
Reported 2012-09-19 22:38:53 PDT
According to a spec of window.open() below, if the 'replace' attribute is false, the current window must be exist in the window's session history. http://www.w3.org/TR/2009/WD-html5-20090423/browsers.html#dom-open When test with the attached html file, I can back to the page after redirected on the IE and the the Firefox, but not on the Webkit browser. Is the last parameter of the below function ignored on Webkit? window.open("http://www.google.com", "_self", "", false);
Attachments
test case (201 bytes, text/html)
2012-09-19 22:39 PDT, KyungTae Kim
no flags
Patch (15.80 KB, patch)
2012-09-24 03:42 PDT, KyungTae Kim
no flags
Patch (11.80 KB, patch)
2012-11-01 02:37 PDT, KyungTae Kim
abarth: review-
webkit-ews: commit-queue-
KyungTae Kim
Comment 1 2012-09-19 22:39:26 PDT
Created attachment 164841 [details] test case
KyungTae Kim
Comment 2 2012-09-24 03:42:47 PDT
Build Bot
Comment 3 2012-09-24 04:30:46 PDT
Comment on attachment 165346 [details] Patch Attachment 165346 [details] did not pass mac-ews (mac): Output: http://queues.webkit.org/results/13994604 New failing tests: fast/history/window-open-replace-true.html fast/history/window-open-replace-false.html fast/history/gesture-before-onload-form-submit.html
WebKit Review Bot
Comment 4 2012-09-24 08:58:58 PDT
Comment on attachment 165346 [details] Patch Attachment 165346 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/13985751 New failing tests: fast/history/window-open-replace-false.html fast/history/gesture-before-onload-form-submit.html
WebKit Review Bot
Comment 5 2012-09-24 10:00:14 PDT
Comment on attachment 165346 [details] Patch Attachment 165346 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/13993687 New failing tests: fast/history/window-open-replace-false.html fast/history/gesture-before-onload-form-submit.html
KyungTae Kim
Comment 6 2012-11-01 01:13:33 PDT
The standard says "the replace attribute, if true, means that whatever page is currently open in that window will be removed from the window's session history". http://www.w3.org/TR/2009/WD-html5-20090423/browsers.html#dom-open Then, if the replace attribute is false, what is proper operation? Not remove the current opened page, or following "by the user gesture" rules?
KyungTae Kim
Comment 7 2012-11-01 02:37:25 PDT
Early Warning System Bot
Comment 8 2012-11-01 02:46:36 PDT
Early Warning System Bot
Comment 9 2012-11-01 02:47:57 PDT
Build Bot
Comment 10 2012-11-01 03:09:25 PDT
Build Bot
Comment 11 2012-11-01 03:12:04 PDT
EFL EWS Bot
Comment 12 2012-11-01 04:01:14 PDT
EFL EWS Bot
Comment 13 2012-11-01 04:20:10 PDT
WebKit Review Bot
Comment 14 2012-11-01 04:45:33 PDT
Comment on attachment 171800 [details] Patch Attachment 171800 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/14670460 New failing tests: fast/history/window-open-replace-false.html
WebKit Review Bot
Comment 15 2012-11-01 05:41:29 PDT
Comment on attachment 171800 [details] Patch Attachment 171800 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/14693489 New failing tests: fast/history/window-open-replace-false.html
Adam Barth
Comment 16 2012-11-01 08:01:50 PDT
Comment on attachment 171800 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=171800&action=review Looks like you have compile and test failures. > Source/WebCore/page/DOMWindow.cpp:1933 > + bool lockHistory = false, lockBackForwardList = false; > + if (locking == LockHistoryAndBackForwardList) > + lockHistory = lockBackForwardList = true; This is pretty far out of style. Please take a look at http://www.webkit.org/coding/coding-style.html
Ian 'Hixie' Hickson
Comment 17 2012-11-01 14:42:12 PDT
(In reply to comment #6) > The standard says "the replace attribute, if true, means that whatever page is currently open in that window will be removed from the window's session history". > http://www.w3.org/TR/2009/WD-html5-20090423/browsers.html#dom-open First, that's a REALLY OLD version of the spec, quite obsolete. The up to date link is: http://whatwg.org/html#dom-open The behaviour of the "replace" argument is just "If the replace is true or if the browsing context was just created as part of the rules for choosing a browsing context given a browsing context name, then replacement must be enabled". (The text quoted in comment 6 isn't normative and doesn't define what "replace" does, it's just descriptive. Please ignore it for when implementing the spec. See the introduction to the spec for information on how to read the spec to avoid interpreting non-normative statements as normative ones; the basic idea is that if it doesn't say "must", it's not normative.) The meaning of "replacement enabled" is defined here: http://whatwg.org/html#replacement-enabled If "replace" isn't specified, then replacement isn't enabled and so the text above doesn't take effect. HTH.
Chris Dumez
Comment 18 2016-07-14 11:53:18 PDT
Only IE/Edge implements this. It looks like it is about to get removed from the specification: https://github.com/whatwg/html/pull/1556
Note You need to log in before you can comment on or make changes to this bug.