-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Need to specify <style> only works on browsing-context-having documents #4547
Comments
Fixes #2553. The spec actually does not cover this; see spec issue at whatwg/html#4547.
Fixes #2553. The spec actually does not cover this; see spec issue at whatwg/html#4547.
Fixes #2553. The spec actually does not cover this; see spec issue at whatwg/html#4547.
We went over this during the Web Components F2F and as I recalled we had pretty explicitly decided on the current model I looked into that and it turns out user agents do create style sheets today. They might not fetch subresources and they might not contribute to resolved styles, but |
I think the style sheet object is created by the style is never applied and it's never added to document's stylesheet or something like that. |
PR #1137 explicitly removed a clause that specified that the style block update algorithm should only work on "element[s] whose node document has a browsing context". Seems like this used to be explicit and was intentionally removed? I'm coming from discussion on chromium#437153, where the pre-1137 wording caused Chromium to have a misalignment with the spec (see demo here). |
Right, it was intentionally removed per @annevk's comments above, that However, the test case you found (with XHR |
We should probably also test Edit: per @hsivonen Firefox has a "data document" concept that's used for |
@annevk I haven't contributed to any web standards stuff before, but would be happy to attempt to add a Web Platform Test for the various test cases mentioned in issue! |
That sounds great and will help determine where browsers are at and with making changes, if any. |
Quick test case: https://jsbin.com/cozenirite/1/edit?html,css,console,output shows the computed style of the p is not changed, and (if you check the network panel) the
@import
is not fetched.A quick fix may be to add a check to step 3 of https://html.spec.whatwg.org/multipage/semantics.html#update-a-style-block that the node document has a browsing context.
We probably also want to update the conditions under which it runs (a paragraph before) to use BC-connected/BC-disconnected instead of just connected/disconnected.
The text was updated successfully, but these errors were encountered: