Description
"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:
<body background="image.png">
Here the background
attribute sets background-image
:
When a body element has a background attribute set to a non-empty value [...] the user agent is expected to treat the attribute as a presentational hint setting the element's 'background-image' property to the return value.
https://html.spec.whatwg.org/multipage/rendering.html#the-page:attr-background
As another example, inline styles:
<div style="background-image: url('image.png')">
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.