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

Should stylesheets be obtained in documents without a browsing context? #1495

Closed
jdm opened this issue Jul 4, 2016 · 9 comments · Fixed by #1516
Closed

Should stylesheets be obtained in documents without a browsing context? #1495

jdm opened this issue Jul 4, 2016 · 9 comments · Fixed by #1516
Assignees
Labels
clarification Standard could be clearer compat Standard is not web compatible or proprietary feature needs standardizing

Comments

@jdm
Copy link
Member

jdm commented Jul 4, 2016

https://html.spec.whatwg.org/multipage/semantics.html#link-type-stylesheet:concept-link-obtain lists a bunch of conditions for obtaining a stylesheet based on whether the link element is in a document or not. What about documents without browsing contexts?

@domenic
Copy link
Member

domenic commented Jul 4, 2016

I mean, per spec, they should not be; I think that's pretty clear. Do you have evidence browsers do things differently?

@jdm
Copy link
Member Author

jdm commented Jul 4, 2016

Where does the spec say they shouldn't?

@domenic
Copy link
Member

domenic commented Jul 4, 2016

Ah, I see, sorry I misread :(. I guess per spec they should be fetched. Again, is that not what browsers do?

@jdm
Copy link
Member Author

jdm commented Jul 4, 2016

None of Gecko, Blink, or Webkit fetch the CSS file when executing var d = (new DOMParser()).parseFromString('<link rel="stylesheet" href="foo.css"></link>', 'text/html');

@domenic
Copy link
Member

domenic commented Jul 4, 2016

I see! Sounds like a spec bug then. We should definitely add a requirement that it be in a browsing context, then.

@annevk annevk added clarification Standard could be clearer compat Standard is not web compatible or proprietary feature needs standardizing labels Jul 4, 2016
@annevk
Copy link
Member

annevk commented Jul 4, 2016

@igrigorik presumably this applies equally for the various preloading types?

@zcorpan
Copy link
Member

zcorpan commented Jul 4, 2016

On a related note, for style element, the spec has a comment near "update a style block" saying

  <!-- note that a browsing context isn't needed:
       http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2739 -->

@zcorpan
Copy link
Member

zcorpan commented Jul 4, 2016

Quick test for link confirm it isn't fetched
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4299

bors-servo pushed a commit to servo/servo that referenced this issue Jul 5, 2016
Don't load stylesheets in documents without browsing contexts

Per whatwg/html#1495, this fixes the most commonly reported panic in nightlies by making us match what other browsers do.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12047 (github issue number if applicable).
- [X] There are tests for these changes OR

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12241)
<!-- Reviewable:end -->
@domenic
Copy link
Member

domenic commented Jul 6, 2016

Going to wait on working on this until #1483 is merged, to avoid conflicts.

domenic added a commit that referenced this issue Jul 7, 2016
This fixes #1495 by changing the "appropriate times to obtain the
resource" to require that the <link rel="stylesheet"> element be in a
document that has a browsing context.
domenic added a commit that referenced this issue Jul 7, 2016
This fixes #1495 by changing the "appropriate times to obtain the
resource" to require that the <link rel="stylesheet"> element be in a
document that has a browsing context.
@domenic domenic self-assigned this Jul 14, 2016
annevk pushed a commit that referenced this issue Jul 19, 2016
This fixes #1495 by changing the "appropriate times to obtain the
resource" to require that the <link rel="stylesheet"> element be in a
document that has a browsing context.
alice pushed a commit to alice/html that referenced this issue Jan 8, 2019
This fixes whatwg#1495 by changing the "appropriate times to obtain the
resource" to require that the <link rel="stylesheet"> element be in a
document that has a browsing context.
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 1, 2019
…wsing contexts (from jdm:multiple-stylesheets); r=notriddle

Per whatwg/html#1495, this fixes the most commonly reported panic in nightlies by making us match what other browsers do.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12047 (github issue number if applicable).
- [X] There are tests for these changes OR

Source-Repo: https://github.com/servo/servo
Source-Revision: 61491447e21655a1eca01a85797b25a254525d98

UltraBlame original commit: 3d72d0ed4143696590799c52cc0f51697fc8f2f0
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 1, 2019
…wsing contexts (from jdm:multiple-stylesheets); r=notriddle

Per whatwg/html#1495, this fixes the most commonly reported panic in nightlies by making us match what other browsers do.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12047 (github issue number if applicable).
- [X] There are tests for these changes OR

Source-Repo: https://github.com/servo/servo
Source-Revision: 61491447e21655a1eca01a85797b25a254525d98

UltraBlame original commit: 3d72d0ed4143696590799c52cc0f51697fc8f2f0
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 1, 2019
…wsing contexts (from jdm:multiple-stylesheets); r=notriddle

Per whatwg/html#1495, this fixes the most commonly reported panic in nightlies by making us match what other browsers do.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12047 (github issue number if applicable).
- [X] There are tests for these changes OR

Source-Repo: https://github.com/servo/servo
Source-Revision: 61491447e21655a1eca01a85797b25a254525d98

UltraBlame original commit: 3d72d0ed4143696590799c52cc0f51697fc8f2f0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification Standard could be clearer compat Standard is not web compatible or proprietary feature needs standardizing
Development

Successfully merging a pull request may close this issue.

4 participants