-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
document.open(): Test non-fully active documents #12770
Conversation
Oops the branch should be "timothygu/document-open-activity" as it's a new branch and not one of the existing tests… sorry @annevk! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some clarity improvements and one request for another test.
html/webappapis/dynamic-markup-insertion/opening-the-input-stream/active.window.js
Outdated
Show resolved
Hide resolved
html/webappapis/dynamic-markup-insertion/opening-the-input-stream/active.window.js
Outdated
Show resolved
Hide resolved
html/webappapis/dynamic-markup-insertion/opening-the-input-stream/active.window.js
Outdated
Show resolved
Hide resolved
html/webappapis/dynamic-markup-insertion/opening-the-input-stream/active.window.js
Outdated
Show resolved
Hide resolved
html/webappapis/dynamic-markup-insertion/opening-the-input-stream/active.window.js
Outdated
Show resolved
Hide resolved
html/webappapis/dynamic-markup-insertion/opening-the-input-stream/active.window.js
Outdated
Show resolved
Hide resolved
Also need (as a separate PR if you like) tests that event listeners don't get erased in these cases. And ideally tests that aborting doesn't happen, although I know aborting is still WIP. |
This doesn't seem to work on browsers that should have already implemented the check. In Chrome (and presumably Safari), event listeners get erased in any case the Document is created alongside a Window object – including when the Document is inactive or does not have its browsing context. We don't seem to have a name for that yet. |
@domenic Added some tests for event listeners as well. PTAL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. You should be able to remove the initUIEvent("focus"), and doing so is probably a good idea.
There is no longer anything fundamental that prevents document.open() from being useful on non-active documents. This also aligns with Chrome, Edge, and Safari. In fact, some developers already utilize this property as a streaming HTML parser to desirable effect (see #2827). Additionally, use a more appropriate guard for erasing event listeners and handlers on the Window object, as revealed by the tests. Fixes #2827. Tests: web-platform-tests/wpt#12636 Tests: web-platform-tests/wpt#12770
There is no longer anything fundamental that prevents document.open() from being useful on non-active documents. This also aligns with Chrome, Edge, and Safari. In fact, some developers already utilize this property as a streaming HTML parser to desirable effect (see whatwg#2827). Additionally, use a more appropriate guard for erasing event listeners and handlers on the Window object, as revealed by the tests. Fixes whatwg#2827. Tests: web-platform-tests/wpt#12636 Tests: web-platform-tests/wpt#12770
There is no longer anything fundamental that prevents document.open() from being useful on non-active documents. This also aligns with Chrome, Edge, and Safari. In fact, some developers already utilize this property as a streaming HTML parser to desirable effect (see whatwg#2827). Additionally, use a more appropriate guard for erasing event listeners and handlers on the Window object, as revealed by the tests. Fixes whatwg#2827. Tests: web-platform-tests/wpt#12636 Tests: web-platform-tests/wpt#12770
Also fix a missing file in the related
url.js
test.For whatwg/html#3977.
All six tests pass in Chrome and Safari.
The "active but not fully active" and "non-active with associated Window; navigated away" cases fail in Edge with a "Permission denied" error, but all others pass.
All but the first one fail in Firefox, which implements the active document bailout