Skip to content

Commit bf60a57

Browse files
committed
[css-values] Editorial cleanup of URL section.
1 parent c46c661 commit bf60a57

1 file changed

Lines changed: 28 additions & 13 deletions

File tree

css-values/Overview.bs

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,6 @@ Resource Locators: the <<url>> type</h3>
508508

509509
<pre class="prod"><dfn id="url-value">&lt;url></dfn> = url( <<string>> <<url-modifier>>* )</pre>
510510

511-
512511
<div class="example">
513512
Below is an example of a URL being used as a background image:
514513

@@ -518,15 +517,29 @@ Resource Locators: the <<url>> type</h3>
518517
In addition to the syntax defined above,
519518
a <<url>> can sometimes be written in other ways:
520519

521-
* For legacy reasons,
522-
a <<url>> can be written without quotation marks around the URL itself.
523-
This syntax is <a lt="consume a url token" spec=css-syntax-3>specially-parsed</a>,
524-
and produces a <<url-token>> rather than a <a>function</a> syntactically. [[!CSS3SYN]]
525-
* Some CSS contexts, such as ''@import'', allow a <<url>> to be represented by a <<string>> instead.
526-
This behaves identically to writing a ''url()'' function containing that string.
527-
528-
Because these alternate ways of writing a <<url>> are not <a>functional notations</a>,
529-
they cannot accept any <<url-modifier>>s.
520+
* A <<url>> can be written without quotation marks around the URL itself.
521+
(This syntax is <a lt="consume a url token" spec=css-syntax-3>specially-parsed</a>
522+
as a <<url-token>>. [[!CSS3SYN]])
523+
524+
<div class="example">
525+
For example, the following declarations are identical:
526+
<pre>
527+
background: url("http://www.example.com/pinkish.gif");
528+
background: url(http://www.example.com/pinkish.gif);
529+
</pre>
530+
</div>
531+
532+
* Some CSS contexts (such as ''@import'') allow a <<url>> to be represented by a bare <<string>>,
533+
without the ''url()'' wrapper.
534+
In such cases the string behaves identically to a ''url()'' function containing that string.
535+
536+
<div class="example">
537+
For example, the following statements are identical:
538+
<pre>
539+
@import url("base-theme.css");
540+
@import "base-theme.css";
541+
</pre>
542+
</div>
530543

531544
Note: The special parsing rules for the legacy quotation-mark&ndash;less <<url>> syntax
532545
means that parentheses, <a href="https://www.w3.org/TR/css-syntax/#whitespace">whitespace</a> characters,
@@ -537,8 +550,8 @@ Resource Locators: the <<url>> type</h3>
537550
it might also be possible to write these characters as URL-escapes
538551
(e.g. ''url(open%28parens)'' or ''url(close%29parens)'')
539552
as described in [[URL]].
540-
(If written as a normal function containing a string, ordinary string escaping rules apply;
541-
only newlines and the character used to quote the string need to be escaped.)
553+
Alternately, the URL can be quoted as a string,
554+
in which case only newlines and the character used to quote the string need to be escaped.
542555

543556
<h4 id="relative-urls">
544557
Relative URLs</h4>
@@ -640,11 +653,13 @@ URL Modifiers</h4>
640653

641654
The ''url()'' function supports specifying additional <dfn>&lt;url-modifier></dfn>s,
642655
which change the meaning or the interpretation of the URL somehow.
643-
A <<url-modifier>> is either an <<ident>> or a <a>function</a>.
656+
A <<url-modifier>> is either an <<ident>> or a <a>functional notation</a>.
644657

645658
This specification does not define any <<url-modifier>>s,
646659
but other specs may do so.
647660

661+
Note: A <<url>> that is either unquoted or not wrapped in ''url()'' notation
662+
cannot accept any <<url-modifier>>s.
648663

649664
<h2 id="numeric-types">
650665
Numeric Data Types</h2>

0 commit comments

Comments
 (0)