Skip to content

Commit e051892

Browse files
committed
[css-values] Per WG resolution, define that empty urls must resolve to an invalid resource (not re-request the stylesheet or host page).
1 parent cc473b6 commit e051892

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

css-values/Overview.bs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,19 @@ Resource Locators: the <<url>> type</h3>
539539
(If written as a normal function containing a string, ordinary string escaping rules apply;
540540
only newlines and the character used to quote the string need to be escaped.)
541541

542+
If the value of the ''url()'' is the empty string
543+
(like ''url("")'' or ''url()''),
544+
the url must resolve to an invalid resource
545+
(similar to what the url ''about:invalid'' does).
546+
547+
Note: This matches the behavior of empty urls for embedded resources elsewhere in the web platform,
548+
and avoids excess traffic re-requesting the stylesheet or host document
549+
due to editting mistakes leaving the ''url()'' value empty,
550+
which are almost certain to be invalid resources for whatever the ''url()'' shows up in.
551+
Linking on the web platform <em>does</em> allow empty urls,
552+
so if/when CSS gains some functionality to control hyperlinks,
553+
this restriction can be relaxed in those contexts.
554+
542555
<h4 id="relative-urls">
543556
Relative URLs</h4>
544557

0 commit comments

Comments
 (0)