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

document.open(): Test non-fully active documents #12770

Merged
merged 8 commits into from
Sep 4, 2018

Conversation

TimothyGu
Copy link
Member

@TimothyGu TimothyGu commented Aug 30, 2018

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

@TimothyGu
Copy link
Member Author

Oops the branch should be "timothygu/document-open-activity" as it's a new branch and not one of the existing tests… sorry @annevk!

Copy link
Member

@domenic domenic left a 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.

@domenic
Copy link
Member

domenic commented Aug 31, 2018

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.

@TimothyGu
Copy link
Member Author

Also need (as a separate PR if you like) tests that event listeners don't get erased in these cases.

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.

@TimothyGu
Copy link
Member Author

@domenic Added some tests for event listeners as well. PTAL.

Copy link
Member

@domenic domenic left a 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.

domenic pushed a commit to whatwg/html that referenced this pull request Sep 4, 2018
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
@TimothyGu TimothyGu merged commit 61bc4ec into master Sep 4, 2018
@TimothyGu TimothyGu deleted the annevk/document-open-activity branch September 4, 2018 20:20
mustaqahmed pushed a commit to mustaqahmed/html that referenced this pull request Feb 15, 2019
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
mustaqahmed pushed a commit to mustaqahmed/html that referenced this pull request Feb 15, 2019
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants