-
Notifications
You must be signed in to change notification settings - Fork 719
[css-images] [css-values] Fetch algorithms require a style sheet, which may not exist #12065
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
Comments
cc @fantasai, @tabatkins, @noamr, @annevk |
We should pass either a |
Just wanted to point out another issue with the style sheet assumption here: https://www.w3.org/TR/css-values-4/#fetch-a-style-resource
If we don't have a style sheet, we still have to set an initiator type here. Otherwise, a WPT has a test which relies on this behavior. |
This was the original purpose of this line, to avoid exposing what resources external no-cors CSS downloads. |
…s-4] [css-shapes-2] Clean up fetching This fixes a few cases around fetching external URLs for style resources: - The base URL is the sheet's base URL if exists, otherwise the sheet's location, otherwise the document base URL. - The algorithm can take either a rule or declaration block, and derive the correct stylesheet and base URL from that. Updated the calling sites to take that onto account. - Removed redundant URL parsing in "@import". Closes w3c#12065 Closes w3c#12068 Closes w3c#12086 Closes w3c#12147
…s-4] [css-shapes-2] Clean up fetching (#12261) * [css-vlaues-4] [css-cascade-4] [css-color-5] [css-fonts-4] [css-images-4] [css-shapes-2] Clean up fetching This fixes a few cases around fetching external URLs for style resources: - The base URL is the sheet's base URL if exists, otherwise the sheet's location, otherwise the document base URL. - The algorithm can take either a rule or declaration block, and derive the correct stylesheet and base URL from that. Updated the calling sites to take that onto account. - Removed redundant URL parsing in "@import". Closes #12065 Closes #12068 Closes #12086 Closes #12147 * Extract the computed absolute URL to a separate algo * A few fixes * nit
"fetch a style resource" and thus "fetch an external image for a stylesheet" require a non-null
CSSStyleSheet
. However, there may not be such a sheet. Specifically, presentational hints and style attributes.For example:
Here the
background
attribute setsbackground-image
:As another example, inline styles:
As far as I'm aware, neither of these have a
CSSStyleSheet
object associated with them. Seems like we should probably fall back to using the Document's base URL in these cases.The text was updated successfully, but these errors were encountered: