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

Initializing/inheriting feature policy for unattached (?) documents #176

Open
ehsan-karamad opened this issue Jun 8, 2018 · 2 comments
Open
Labels
feature question Questions and issues around specific policy-controlled features

Comments

@ehsan-karamad
Copy link
Contributor

When a document is not associated with a frame, does it still need to have a "container" policy? The only example for such documents I can think of are those returned by DOMParser.parseFromString().

For example, document-stream-insertion (soon to be document-write) is used to block calls to document.write. If the document creates a document from parsing string, should it be able to use the API?

@annevk
Copy link
Member

annevk commented Jun 9, 2018

Both document.open() and document.write[ln]() will return early in cases where the document doesn't have a browsing context (_frame in Blink), because they can't be the active document in such cases.

(There's many ways to get such documents btw, new Document(), xhr.responseXML, etc.)

@ehsan-karamad
Copy link
Contributor Author

Thanks for responding and sorry for the delay. I did test this locally on Chrome and FireFox:

let doc = (new DOMParser()).parseFromString("<body></body>", "text/html");
doc.write("foo");

to find out that apparently blink does not actually follow the specs here. As you mentioned above, according to step 3 in the specs document.write is expected to return early if the document is not an "active" document (which is what you suggested above). I will file a bug for chrome.

@pabrai pabrai added the feature question Questions and issues around specific policy-controlled features label May 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature question Questions and issues around specific policy-controlled features
Projects
None yet
Development

No branches or pull requests

3 participants