Skip to content

Commit 20a4250

Browse files
committed
introduce various terms dbaron suggested for serializing identifiers and strings; fix typos
1 parent 4d69ac6 commit 20a4250

2 files changed

Lines changed: 134 additions & 76 deletions

File tree

cssom/Overview.html

Lines changed: 77 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
<div class=head>
2626
<h1 id=cssom>CSSOM</h1>
2727

28-
<h2 class="no-num no-toc" id="">Editor's Draft 17 February 2010</h2>
28+
<h2 class="no-num no-toc" id="">Editor's Draft 18 February 2010</h2>
2929

3030
<dl>
3131
<dt>This Version:
3232

3333
<dd><a
34-
href="http://www.w3.org/TR/2010/ED-cssom-20100217/">http://www.w3.org/TR/2010/ED-cssom-20100217/</a>
34+
href="http://www.w3.org/TR/2010/ED-cssom-20100218/">http://www.w3.org/TR/2010/ED-cssom-20100218/</a>
3535

3636
<dt>Latest Version:
3737

@@ -226,8 +226,8 @@ <h2 class="no-num no-toc" id=toc>Table of Contents</h2>
226226
</ul>
227227
</ul>
228228

229-
<li><a href="#dom-access-to-css-declaraton-blocks"><span class=secno>8.
230-
</span>DOM Access to CSS Declaraton Blocks</a>
229+
<li><a href="#dom-access-to-css-declaration-blocks"><span class=secno>8.
230+
</span>DOM Access to CSS Declaration Blocks</a>
231231
<ul class=toc>
232232
<li><a href="#the-elementcssinlinestyle-interface"><span
233233
class=secno>8.1. </span>The <code>ElementCSSInlineStyle</code>
@@ -3322,31 +3322,8 @@ <h4 id=serializing-css-values><span class=secno>7.4.2. </span>Serializing
33223322
<dt>&lt;identifier>
33233323

33243324
<dd>
3325-
<p>All characters that match any of the conditions in the list below are
3326-
to be represented as a literal "<code>\</code>" (U+005C), followed by
3327-
the Unicode code point as two hexadecimal digits in the range 0-9 a-f
3328-
(U+0030 to U+0039 and U+0061 to U+0066), followed by a space (U+0020).
3329-
All other characters are to be represented literally.</p>
3330-
3331-
<p class=note>Since this is only for characters lower than U+0080 the
3332-
representation as two digits does not cause problems.</p>
3333-
3334-
<ul>
3335-
<li>The character is the first character and is in the range 0-9 (U+0030
3336-
to U+0039).
3337-
3338-
<li>The character is the second character and is in the range 0-9
3339-
(U+0030 to U+0039) and the first character is a "<code>-</code>"
3340-
(U+002D).
3341-
3342-
<li>The character is the second character and is "<code>-</code>"
3343-
(U+002D) and the first character is "<code>-</code>" too.
3344-
3345-
<li>The character has a code point lower than U+0080 and is not in the
3346-
ranges 0-9 (U+0030 to U+0039), A-Z (U+0041 to U+005A), or a-z (U+0061
3347-
to U+007A) and is not "<code>-</code>" (U+002D) or "<code>_</code>"
3348-
(U+005F).
3349-
</ul>
3325+
<p>The identifier <a href="#escape-an-identifier" title="escape an
3326+
identifier">escaped</a>.
33503327

33513328
<dt>&lt;integer>
33523329

@@ -3392,10 +3369,9 @@ <h4 id=serializing-css-values><span class=secno>7.4.2. </span>Serializing
33923369
<dt>&lt;string>
33933370

33943371
<dd>
3395-
<p>A literal '<code>"</code>' (U+0022), followed by the string value with
3396-
'<code>"</code>' (U+0022) characters preceded by a literal
3397-
"<code>\</code>" (U+005C), followed by a literal '<code>"</code>'
3398-
(U+0022).
3372+
<p>A literal '<code>"</code>' (U+0022), followed by the <a
3373+
href="#escape-a-string" title="escape a string">escaped</a> string
3374+
value, followed by a literal '<code>"</code>' (U+0022).
33993375

34003376
<dt>&lt;time>
34013377

@@ -3406,11 +3382,71 @@ <h4 id=serializing-css-values><span class=secno>7.4.2. </span>Serializing
34063382
<dt>&lt;uri>
34073383

34083384
<dd>
3409-
<p>The literal string '<code title="">url("</code>', followed by the
3410-
<span>absolute URL</span> with '<code>"</code>' (U+0022) characters
3411-
preceded by a literal "<code>\</code>" (U+005C), followed by the literal
3412-
string '<code>)"</code>'.
3385+
<p>The literal string '<code title="">url("</code>', followed by the <a
3386+
href="#escape-a-string" title="escape a string">escaped</a>
3387+
<span>absolute URL</span>, followed by the literal string
3388+
'<code>")</code>'.
34133389
</dl>
3390+
3391+
<p>To <dfn id=escape-a-character>escape a character</dfn> means to create a
3392+
string of "<code>\</code>" (U+005C), followed by the character.
3393+
3394+
<p>To <dfn id=escape-a-character-as-code-point>escape a character as code
3395+
point</dfn> means to create a string of "<code>\</code>" (U+005C),
3396+
followed by the Unicode code point as the smallest possible number of
3397+
hexadecimal digits in the range 0-9 a-f (U+0030 to U+0039 and U+0061 to
3398+
U+0066) to represent the code point in base 16, followed by a space
3399+
(U+0020).
3400+
3401+
<p>To <dfn id=escape-an-identifier>escape an identifier</dfn> means to
3402+
create a string represented by the concatenation of, for each character of
3403+
the identifier:
3404+
3405+
<ul>
3406+
<li>If the character is in the range U+0000 to U+001F, the character <a
3407+
href="#escape-a-character-as-code-point" title="escape a character as
3408+
code point">escaped as code point</a>.
3409+
3410+
<li>If the character is the first character and is in the range 0-9
3411+
(U+0030 to U+0039), the character <a
3412+
href="#escape-a-character-as-code-point" title="escape a character as
3413+
code point">escaped as code point</a>.
3414+
3415+
<li>If the character is the second character and is in the range 0-9
3416+
(U+0030 to U+0039) and the first character is a "<code>-</code>"
3417+
(U+002D), the character <a href="#escape-a-character-as-code-point"
3418+
title="escape a character as code point">escaped as code point</a>.
3419+
3420+
<li>If the character is the second character and is "<code>-</code>"
3421+
(U+002D) and the first character is "<code>-</code>" too, the <a
3422+
href="#escape-a-character" title="escape a character">escaped</a>
3423+
character.
3424+
3425+
<li>If the character is not handled by one of the above rules and is
3426+
greater than or equal to U+0080, is "<code>-</code>" (U+002D) or
3427+
"<code>_</code>" (U+005F), or is in one of the ranges 0-9 (U+0030 to
3428+
U+0039), A-Z (U+0041 to U+005A), or a-z (U+0061 to U+007A), the character
3429+
itself.
3430+
3431+
<li>Otherwise, the <a href="#escape-a-character" title="escape a
3432+
character">escaped</a> character.
3433+
</ul>
3434+
3435+
<p>To <dfn id=escape-a-string>escape a string</dfn> means to create a
3436+
string represented by the concatenation of, for each character of the
3437+
given string:
3438+
3439+
<ul>
3440+
<li>If the character is in the range U+0000 to U+001F, the character <a
3441+
href="#escape-a-character-as-code-point" title="escape a character as
3442+
code point">escaped as code point</a>.
3443+
3444+
<li>If the character is '<code>"</code>' (U+0022), "<code>'</code>"
3445+
(U+0027), or '<code>\</code>' (U+005C), the <a href="#escape-a-character"
3446+
title="escape a character">escaped</a> character.
3447+
3448+
<li>Otherwise, the character itself.
3449+
</ul>
34143450
<!--
34153451
<ol>
34163452
<li><p>Relative lengths (<code>em</code>, <code>ex</code>, <code>px</code>,
@@ -3556,7 +3592,7 @@ <h4 id=serializing-css-values><span class=secno>7.4.2. </span>Serializing
35563592
<h5 id=examples0><span class=secno>7.4.2.1. </span>Examples</h5>
35573593

35583594
<p>Here are some examples of before and after results on specified values.
3559-
The before column could be what the author wrote in a stylesheet, while
3595+
The before column could be what the author wrote in a style sheet, while
35603596
the after column shows what querying the DOM would return.
35613597

35623598
<div class=example>
@@ -3625,8 +3661,8 @@ <h5 id=examples0><span class=secno>7.4.2.1. </span>Examples</h5>
36253661
</table>
36263662
</div>
36273663

3628-
<h2 id=dom-access-to-css-declaraton-blocks><span class=secno>8. </span>DOM
3629-
Access to CSS Declaraton Blocks</h2>
3664+
<h2 id=dom-access-to-css-declaration-blocks><span class=secno>8. </span>DOM
3665+
Access to CSS Declaration Blocks</h2>
36303666

36313667
<h3 id=the-elementcssinlinestyle-interface><span class=secno>8.1.
36323668
</span>The <code><a
@@ -3670,7 +3706,7 @@ <h2 id=resolved-values><span class=secno>9. </span>Resolved Values</h2>
36703706

36713707
<p><code><a href="#viewcss-getcomputedstyle">getComputedStyle()</a></code>
36723708
was historically defined to return the "computed value" of an element or
3673-
psuedo-element. However, the concept of "computed value" changed between
3709+
pseudo-element. However, the concept of "computed value" changed between
36743710
revisions of CSS while the implementation of <code><a
36753711
href="#viewcss-getcomputedstyle">getComputedStyle()</a></code> had to
36763712
remain the same for compatibility with deployed scripts. To address this

cssom/Overview.src.html

Lines changed: 57 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2530,30 +2530,8 @@ <h4>Serializing CSS Values</h4>
25302530
the literal string "<code>hz</code>".</dd>
25312531

25322532
<dt>&lt;identifier></dt>
2533-
<dd>
2534-
<p>All characters that match any of the conditions in the list below
2535-
are to be represented as a literal "<code>\</code>" (U+005C), followed
2536-
by the Unicode code point as two hexadecimal digits in the range 0-9 a-f
2537-
(U+0030 to U+0039 and U+0061 to U+0066), followed by a space (U+0020).
2538-
All other characters are to be represented literally.</p>
2539-
2540-
<p class="note">Since this is only for characters lower than U+0080 the
2541-
representation as two digits does not cause problems.</p>
2542-
2543-
<ul>
2544-
<li>The character is the first character and is in the range 0-9
2545-
(U+0030 to U+0039).</li>
2546-
<li>The character is the second character and is in the range 0-9
2547-
(U+0030 to U+0039) and the first character is a "<code>-</code>"
2548-
(U+002D).</li>
2549-
<li>The character is the second character and is "<code>-</code>"
2550-
(U+002D) and the first character is "<code>-</code>" too.</li>
2551-
<li>The character has a code point lower than U+0080 and is not in the
2552-
ranges 0-9 (U+0030 to U+0039), A-Z (U+0041 to U+005A), or a-z (U+0061
2553-
to U+007A) and is not "<code>-</code>" (U+002D) or "<code>_</code>"
2554-
(U+005F).</li>
2555-
</ul>
2556-
</dd>
2533+
<dd><p>The identifier
2534+
<span title="escape an identifier">escaped</span>.</p></dd>
25572535

25582536
<dt>&lt;integer></dt>
25592537
<dd><p>A base-ten integer using digits 0-9 (U+0030 to U+0039) in the
@@ -2589,21 +2567,65 @@ <h4>Serializing CSS Values</h4>
25892567
&lt;number> followed by the literal string "<code>dpcm</code>".</dd>
25902568

25912569
<dt>&lt;string></dt>
2592-
<dd><p>A literal '<code>"</code>' (U+0022), followed by the string value
2593-
with '<code>"</code>' (U+0022) characters preceded by a literal
2594-
"<code>\</code>" (U+005C), followed by a literal '<code>"</code>'
2595-
(U+0022).</p></dd>
2596-
2570+
<dd><p>A literal '<code>"</code>' (U+0022), followed by the
2571+
<span title="escape a string">escaped</span> string value, followed by a
2572+
literal '<code>"</code>' (U+0022).</p></dd>
2573+
25972574
<dt>&lt;time></dt>
25982575
<dd><p>The time in seconds serialized as per &lt;number> followed by
25992576
the literal string "<code>s</code>".</dd>
26002577

26012578
<dt>&lt;uri></dt>
26022579
<dd><p>The literal string '<code title="">url("</code>', followed by the
2603-
<span>absolute URL</span> with '<code>"</code>' (U+0022) characters
2604-
preceded by a literal "<code>\</code>" (U+005C), followed by the literal
2605-
string '<code>)"</code>'.</p></dd>
2580+
<span title="escape a string">escaped</span> <span>absolute URL</span>,
2581+
followed by the literal string '<code>")</code>'.</p></dd>
26062582
</dl>
2583+
2584+
<p>To <dfn>escape a character</dfn> means to create a string of
2585+
"<code>\</code>" (U+005C), followed by the character.</p>
2586+
2587+
<p>To <dfn>escape a character as code point</dfn> means to create a string
2588+
of "<code>\</code>" (U+005C), followed by the Unicode code point as the
2589+
smallest possible number of hexadecimal digits in the range 0-9 a-f
2590+
(U+0030 to U+0039 and U+0061 to U+0066) to represent the code point in
2591+
base 16, followed by a space (U+0020).</p>
2592+
2593+
<p>To <dfn>escape an identifier</dfn> means to create a string represented
2594+
by the concatenation of, for each character of the identifier:</p>
2595+
2596+
<ul>
2597+
<li>If the character is in the range U+0000 to U+001F, the character
2598+
<span title="escape a character as code point">escaped as code point</span>.</li>
2599+
<li>If the character is the first character and is in the range 0-9
2600+
(U+0030 to U+0039), the character
2601+
<span title="escape a character as code point">escaped as code point</span>.</li>
2602+
<li>If the character is the second character and is in the range 0-9
2603+
(U+0030 to U+0039) and the first character is a "<code>-</code>"
2604+
(U+002D), the character
2605+
<span title="escape a character as code point">escaped as code point</span>.</li>
2606+
<li>If the character is the second character and is "<code>-</code>"
2607+
(U+002D) and the first character is "<code>-</code>" too, the
2608+
<span title="escape a character">escaped</span> character.</li>
2609+
<li>If the character is not handled by one of the above rules and is
2610+
greater than or equal to U+0080, is "<code>-</code>" (U+002D) or
2611+
"<code>_</code>" (U+005F), or is in one of the ranges 0-9 (U+0030 to
2612+
U+0039), A-Z (U+0041 to U+005A), or a-z (U+0061 to U+007A), the character
2613+
itself.</li>
2614+
<li>Otherwise, the <span title="escape a character">escaped</span>
2615+
character.</li>
2616+
</ul>
2617+
2618+
<p>To <dfn>escape a string</dfn> means to create a string represented by
2619+
the concatenation of, for each character of the given string:</p>
2620+
2621+
<ul>
2622+
<li>If the character is in the range U+0000 to U+001F, the character
2623+
<span title="escape a character as code point">escaped as code point</span>.</li>
2624+
<li>If the character is '<code>"</code>' (U+0022), "<code>'</code>"
2625+
(U+0027), or '<code>\</code>' (U+005C), the
2626+
<span title="escape a character">escaped</span> character.</li>
2627+
<li>Otherwise, the character itself.</li>
2628+
</ul>
26072629

26082630
<!--
26092631
<ol>
@@ -2750,7 +2772,7 @@ <h4>Serializing CSS Values</h4>
27502772
<h5>Examples</h5>
27512773

27522774
<p>Here are some examples of before and after results on specified values.
2753-
The before column could be what the author wrote in a stylesheet, while
2775+
The before column could be what the author wrote in a style sheet, while
27542776
the after column shows what querying the DOM would return.</p>
27552777

27562778
<div class="example">
@@ -2775,7 +2797,7 @@ <h5>Examples</h5>
27752797

27762798

27772799

2778-
<h2>DOM Access to CSS Declaraton Blocks</h2>
2800+
<h2>DOM Access to CSS Declaration Blocks</h2>
27792801

27802802
<h3>The <code>ElementCSSInlineStyle</code> Interface</h3>
27812803

@@ -2823,7 +2845,7 @@ <h3>The <code title="">ViewCSS</code> Interface</h3>
28232845
<h2>Resolved Values</h2>
28242846

28252847
<p><code>getComputedStyle()</code> was historically defined to return the
2826-
"computed value" of an element or psuedo-element. However, the concept of
2848+
"computed value" of an element or pseudo-element. However, the concept of
28272849
"computed value" changed between revisions of CSS while the implementation
28282850
of <code>getComputedStyle()</code> had to remain the same for
28292851
compatibility with deployed scripts. To address this issue this

0 commit comments

Comments
 (0)