Skip to content

Commit e02ce7e

Browse files
committed
abstract out URL escaping
1 parent e24d27d commit e02ce7e

2 files changed

Lines changed: 26 additions & 25 deletions

File tree

cssom/Overview.html

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1934,12 +1934,9 @@ <h4 id=the-cssrule-interface><span class=secno>7.2.2. </span>The <code
19341934

19351935
<ol>
19361936
<li>The literal string "<code>@import</code>", followed by a space
1937-
(U+0020), followed by the literal string '<code><a
1938-
href="#url">url("</a></code>', followed by the <a
1939-
href="#escape-a-string" title="escape a string">escaped</a> value of
1940-
the <code title=dom-CSSImportRule-href><a
1941-
href="#dom-cssimportrule-href">href</a></code> attribute, followed by
1942-
'<code>")</code>'.
1937+
(U+0020), followed by the <a href="#escape-a-url" title="escape a
1938+
URL">URL escaped</a> value of the <code title=dom-CSSImportRule-href><a
1939+
href="#dom-cssimportrule-href">href</a></code> attribute.
19431940

19441941
<li>If the associated <code><a href="#medialist">MediaList</a></code>
19451942
object is not empty, a space (U+0020), followed by the value of the
@@ -1971,11 +1968,10 @@ <h4 id=the-cssrule-interface><span class=secno>7.2.2. </span>The <code
19711968
title=dom-CSSNamespaceRule-prefix><a
19721969
href="#dom-cssnamespacerule-prefix">prefix</a></code> attribute (if
19731970
any), followed by a space (U+0020) if there is a prefix, followed by the
1974-
literal string '<code><a href="#url">url("</a></code>' followed by the
1975-
<a href="#escape-a-string" title="escape a string">string escaped</a>
1976-
value of the <code title=dom-CSSNamespaceRule-namespaceURI><a
1971+
<a href="#escape-a-url" title="escape a URL">URL escaped</a> value of
1972+
the <code title=dom-CSSNamespaceRule-namespaceURI><a
19771973
href="#dom-cssnamespacerule-namespaceuri">namespaceURI</a></code>
1978-
attribute, followed by the literal string '<code>");</code>'.
1974+
attribute, followed the character "<code>;</code>" (U+003B).
19791975
</dl>
19801976

19811977
<p>The <dfn id=dom-cssrule-parentrule
@@ -3429,10 +3425,8 @@ <h4 id=serializing-css-values><span class=secno>7.4.2. </span>Serializing
34293425
<dt>&lt;uri>
34303426

34313427
<dd>
3432-
<p>The literal string '<code title="">url("</code>', followed by the <a
3433-
href="#escape-a-string" title="escape a string">escaped</a>
3434-
<span>absolute URL</span>, followed by the literal string
3435-
'<code>")</code>'.
3428+
<p>The <span>absolute URL</span> <a href="#escape-a-url" title="escape a
3429+
URL">escaped</a>.
34363430
</dl>
34373431

34383432
<p>To <dfn id=escape-a-character>escape a character</dfn> means to create a
@@ -3496,7 +3490,12 @@ <h4 id=serializing-css-values><span class=secno>7.4.2. </span>Serializing
34963490
</ul>
34973491

34983492
<p class=note>"<code>'</code>" (U+0027) is not escaped because strings are
3499-
always serialized with '<code>"</code>' (U+0022).</p>
3493+
always serialized with '<code>"</code>' (U+0022).
3494+
3495+
<p>To <dfn id=escape-a-url>escape a URL</dfn> means to create a string
3496+
represented by '<code><a href="#url">url("</a></code>', followed by the <a
3497+
href="#escape-a-string" title="escape a string">escaped</a> value of the
3498+
given string, followed by <code>")</code>.</p>
35003499
<!--
35013500
<ol>
35023501
<li><p>Relative lengths (<code>em</code>, <code>ex</code>, <code>px</code>,

cssom/Overview.src.html

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,10 +1548,9 @@ <h4>The <code title="">CSSRule</code> Interface</h4>
15481548
<p>The result of concatenating these strings:</p>
15491549
<ol>
15501550
<li>The literal string "<code>@import</code>", followed by a space
1551-
(U+0020), followed by the literal string '<code>url("</code>', followed
1552-
by the <span title="escape a string">escaped</span> value of the
1553-
<code title="dom-CSSImportRule-href">href</code> attribute, followed by
1554-
'<code>")</code>'.</li>
1551+
(U+0020), followed by the <span title="escape a URL">URL escaped</span>
1552+
value of the <code title="dom-CSSImportRule-href">href</code>
1553+
attribute.</li>
15551554
<li>If the associated <code>MediaList</code> object is not empty, a
15561555
space (U+0020), followed by the value of the
15571556
<code title="dom-MediaList-mediaText">mediaText</code> attribute of the
@@ -1575,10 +1574,9 @@ <h4>The <code title="">CSSRule</code> Interface</h4>
15751574
<span title="escape an identifier">identifier escaped</span> value of the
15761575
<code title="dom-CSSNamespaceRule-prefix">prefix</code> attribute (if
15771576
any), followed by a space (U+0020) if there is a prefix, followed by the
1578-
literal string '<code>url("</code>' followed by the
1579-
<span title="escape a string">string escaped</span> value of the
1577+
<span title="escape a URL">URL escaped</span> value of the
15801578
<code title="dom-CSSNamespaceRule-namespaceURI">namespaceURI</code>
1581-
attribute, followed by the literal string '<code>");</code>'.</p></dd>
1579+
attribute, followed the character "<code>;</code>" (U+003B).</p></dd>
15821580
</dl>
15831581

15841582

@@ -2110,9 +2108,8 @@ <h4>Serializing CSS Values</h4>
21102108
the literal string "<code>s</code>".</dd>
21112109

21122110
<dt>&lt;uri></dt>
2113-
<dd><p>The literal string '<code title="">url("</code>', followed by the
2114-
<span title="escape a string">escaped</span> <span>absolute URL</span>,
2115-
followed by the literal string '<code>")</code>'.</p></dd>
2111+
<dd><p>The <span>absolute URL</span>
2112+
<span title="escape a URL">escaped</span>.</p></dd>
21162113
</dl>
21172114

21182115
<p>To <dfn>escape a character</dfn> means to create a string of
@@ -2163,6 +2160,11 @@ <h4>Serializing CSS Values</h4>
21632160
<p class="note">"<code>'</code>" (U+0027) is not escaped because strings
21642161
are always serialized with '<code>"</code>' (U+0022).</p>
21652162

2163+
<p>To <dfn>escape a URL</dfn> means to create a string represented by
2164+
'<code>url("</code>', followed by the
2165+
<span title="escape a string">escaped</span> value of the given string,
2166+
followed by <code>")</code>.</p>
2167+
21662168
<!--
21672169
<ol>
21682170
<li><p>Relative lengths (<code>em</code>, <code>ex</code>, <code>px</code>,

0 commit comments

Comments
 (0)