No-op document.open() calls should not have any side effects
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Sep 2018 22:55:56 +0000 (22:55 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Sep 2018 22:55:56 +0000 (22:55 +0000)
commitbc49348d3490bf679261d80a1eb0914eea757ed6
treee6ca6e756678229e60aba71552b4a2b3192a3f53
parentfe50c5ab5ddc830728a309e7eeb406af5964620e
No-op document.open() calls should not have any side effects
https://bugs.webkit.org/show_bug.cgi?id=189373
<rdar://problem/44282702>

Reviewed by Geoffrey Garen.

LayoutTests/imported/w3c:

Rebaseline WPT test now that it is passing.

* web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/bailout-side-effects-synchronous-script.window-expected.txt:

Source/WebCore:

Update document.open() implementation to match the specification [1] more closely.
In particular, URLs updates should happen much later, at step 11. They were happening
too early and would cause side effects when returning early.

[1] https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#document-open-steps

No new tests, rebaselined existing test.

* dom/Document.cpp:
(WebCore::Document::open):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236433 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/bailout-side-effects-synchronous-script.window-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp