@@ -962,11 +962,23 @@ Fragment URLs</h5>
962
962
This reference must always be treated as same-document
963
963
(rather than cross-document).
964
964
965
- Note: This means that stylesheets inside a [=shadow tree=]
966
- will resolve these URLs only to elements inside the shadow,
967
- elements in the light DOM
968
- will resolve these URLs only to elements in the light DOM,
969
- etc.
965
+ Note: This means that such fragments will resolve
966
+ against the contents of the current document
967
+ (and in consideration of shadow DOM, only within the stylesheet's associated [=node tree=] ),
968
+ regardless of what base URL relative URLs outside of CSS resolve against.
969
+
970
+ <div class="example">
971
+ In the following example,
972
+ <code> #anchor</code> will resolve against <code> http://example.com/</code>
973
+ whereas <code> #image</code> will resolve against the elements in the HTML document itself:
974
+
975
+ <xmp highlight=html>
976
+ <!DOCTYPE html>
977
+ <base href="http://example.com/">
978
+ ...
979
+ <a href="#anchor" style="background-image: url(#image)">link</a>
980
+ </xmp>
981
+ </div>
970
982
971
983
When <a href="https://www.w3.org/TR/cssom-1/#serializing-css-values">serializing</a>
972
984
a ''url()'' with the <a>local url flag</a> set,
@@ -4961,6 +4973,9 @@ Recent Changes</h3>
4961
4973
Substantial changes since <a href="https://www.w3.org/TR/2021/WD-css-values-4-20211216/">16 December 2021 WD</a> :
4962
4974
4963
4975
<ul>
4976
+ <li> Changed resolution of a ''url()'' with the [=local url flag=]
4977
+ to reference the current [=node tree=] (regardless of document base URL modifications).
4978
+ (<a href="https://github.com/w3c/csswg-drafts/issues/3320">Issue 3320</a> )
4964
4979
<li> Switched censoring of ''NaN'' that escapes a [=math function=] from infinity to zero.
4965
4980
(<a href="https://github.com/w3c/csswg-drafts/issues/7067">Issue 7067</a> )
4966
4981
<li> Added [[#linked-properties]] to allow this property pattern to be easily referenced.
0 commit comments