Skip to content

Commit 4a7fe41

Browse files
committed
simplify CSS pixel nonsense
1 parent f0ee88d commit 4a7fe41

2 files changed

Lines changed: 33 additions & 44 deletions

File tree

cssom-view/Overview.html

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ <h2 class="no-num no-toc" id=toc>Table of Contents</h2>
108108
</span>Dependencies</a>
109109

110110
<li><a href="#terminology"><span class=secno>2.2 </span>Terminology</a>
111+
112+
<li><a href="#css-pixels"><span class=secno>2.3 </span>CSS pixels</a>
111113
</ul>
112114

113115
<li><a href="#dom-features"><span class=secno>3 </span>DOM Features</a>
@@ -234,10 +236,9 @@ <h3 id=terminology><span class=secno>2.2 </span>Terminology</h3>
234236
child of the root <a href="#html-element">HTML element</a>
235237
<code>html</code>.
236238

237-
<p>The terms <dfn id=css-pixel>CSS pixel</dfn>, <dfn
238-
id=content-edge>content edge</dfn>, <dfn id=padding-edge>padding
239-
edge</dfn>, <dfn id=border-edge>border edge</dfn>, and <dfn
240-
id=canvas>canvas</dfn> are defined by CSS 2.1. [<cite><a
239+
<p>The terms <dfn id=content-edge>content edge</dfn>, <dfn
240+
id=padding-edge>padding edge</dfn>, <dfn id=border-edge>border edge</dfn>,
241+
and <dfn id=canvas>canvas</dfn> are defined by CSS 2.1. [<cite><a
241242
href="#ref-css21">CSS21</a></cite>]
242243

243244
<p>The terms <dfn id=viewport>viewport</dfn>, <dfn
@@ -256,6 +257,18 @@ <h3 id=terminology><span class=secno>2.2 </span>Terminology</h3>
256257
area on the <a href="#canvas">canvas</a> that is rendered upon, excluding
257258
content on negative axis.
258259

260+
<h3 id=css-pixels><span class=secno>2.3 </span>CSS pixels</h3>
261+
262+
<p>All coordinates and dimensions for the APIs defined in this
263+
specification are in CSS pixels. [<cite><a
264+
href="#ref-css21">CSS21</a></cite>]
265+
266+
<p class=note>This does not apply to e.g. <code
267+
title=dom-media-matchmedium><a
268+
href="#dom-media-matchmedium">matchMedium()</a></code> as the units are
269+
explicitly given there and defined by the Media Queries specification.
270+
[<cite><a href="#ref-mq">MQ</a></cite>]
271+
259272
<h2 id=dom-features><span class=secno>3 </span>DOM Features</h2>
260273

261274
<p>This specification defines the <a
@@ -371,10 +384,6 @@ <h2 id=the-screenview-interface><span class=secno>5 </span>The <code
371384
readonly attribute <a href="#screen">Screen</a> <a href="#dom-screenview-screen" title=dom-screenview-screen>screen</a>;
372385
};</pre>
373386

374-
<p>All coordinates and dimensions on the <a
375-
href="#screenview">ScreenView</a> interface are expressed in <a
376-
href="#css-pixel" title="CSS pixel">CSS pixels</a>.
377-
378387
<p>The <dfn id=dom-screenview-innerwidth><code>innerWidth</code></dfn>
379388
attribute, on getting, <em class=ct>must</em> return the <a
380389
href="#viewport">viewport</a> width.
@@ -487,13 +496,13 @@ <h2 id=the-screenview-interface><span class=secno>5 </span>The <code
487496

488497
<p>The <dfn id=dom-screenview-outerwidth><code>outerWidth</code></dfn>
489498
attribute, on getting, <em class=ct>must</em> return the width of the
490-
client window as number of CSS pixels. If there is no client window this
491-
attribute <em class=ct>must</em> return zero.
499+
client window. If there is no client window this attribute <em
500+
class=ct>must</em> return zero.
492501

493502
<p>The <dfn id=dom-screenview-outerheight><code>outerHeight</code></dfn>
494503
attribute, on getting, <em class=ct>must</em> return the height of the
495-
client window as number of CSS pixels. If there is no client window this
496-
attribute <em class=ct>must</em> return zero.
504+
client window. If there is no client window this attribute <em
505+
class=ct>must</em> return zero.
497506

498507
<p>The <dfn id=dom-screenview-screen
499508
title=dom-screenview-screen><code>screen</code></dfn> attribute, on
@@ -516,10 +525,6 @@ <h3 id=the-screen-interface><span class=secno>5.1 </span>The <code
516525
readonly attribute unsigned long <a href="#dom-screen-pixeldepth">pixelDepth</a>;
517526
};</pre>
518527

519-
<p>All coordinates and dimensions on the <a href="#screen">Screen</a>
520-
interface are expressed in <a href="#css-pixel" title="CSS pixel">CSS
521-
pixels</a>.
522-
523528
<p>The <dfn id=dom-screen-availwidth><code>availWidth</code></dfn>
524529
attribute, on getting, <em class=ct>must</em> return the available width
525530
of the rendering surface of the output device.
@@ -912,9 +917,6 @@ <h2 id=extensions-to-the-htmlelement-interface><span class=secno>8
912917
readonly attribute long <a href="#dom-htmlelement-offsetheight">offsetHeight</a>;
913918
};</pre>
914919

915-
<p>All coordinates and dimensions on this object are expressed in <a
916-
href="#css-pixel" title="CSS pixel">CSS pixels</a>.
917-
918920
<h3 id=offset-attributes><span class=secno>8.1 </span>The <code
919921
title="">offsetParent</code>, <code title="">offsetTop</code>, <code
920922
title="">offsetLeft</code>, <code title="">offsetWidth</code>, and <code
@@ -1159,9 +1161,6 @@ <h2 id=extensions-to-the-mouseevent-interface><span class=secno>10
11591161
<p class=XXX>The object IDL fragment redefines some members. Can we resolve
11601162
this somehow?
11611163

1162-
<p>All coordinates and dimensions for this object are expressed in <a
1163-
href="#css-pixel" title="CSS pixel">CSS pixels</a>.
1164-
11651164
<p>The <dfn id=dom-mouseevent-screenx
11661165
title=dom-mouseevent-screenx><code>screenX</code></dfn> attribute, on
11671166
getting, <em class=ct>must</em> return the x-coordinate of the position
@@ -1262,10 +1261,6 @@ <h3 id=the-clientrect-interface><span class=secno>11.2 </span>The <code
12621261
readonly attribute float <a href="#dom-clientrect-height" title=dom-clientrect-height>height</a>;
12631262
};</pre>
12641263

1265-
<p>All coordinates and dimensions on the <code><a
1266-
href="#clientrect">ClientRect</a></code> interface are expressed in <a
1267-
href="#css-pixel" title="CSS pixel">CSS pixels</a>.
1268-
12691264
<p>The <dfn id=dom-clientrect-top
12701265
title=dom-clientrect-top><code>top</code></dfn> attribute, on getting, <em
12711266
class=ct>must</em> return the y-coordinate, relative to the <a

cssom-view/Overview.src.html

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ <h3 id="terminology">Terminology</h3>
134134
<code>body</code> <span>HTML element</span> child of the root
135135
<span>HTML element</span> <code>html</code>.</p>
136136

137-
<p>The terms <dfn id="css-pixel">CSS pixel</dfn>,
137+
<p>The terms
138138
<dfn id="content-edge">content edge</dfn>,
139139
<dfn id="padding-edge">padding edge</dfn>,
140140
<dfn id="border-edge">border edge</dfn>, and
@@ -157,6 +157,15 @@ <h3 id="terminology">Terminology</h3>
157157
<span>canvas</span> that is rendered upon, excluding content on negative
158158
axis.</p>
159159

160+
<h3>CSS pixels</h3>
161+
162+
<p>All coordinates and dimensions for the APIs defined in this
163+
specification are in CSS pixels. [<cite><span>CSS21</span></cite>]</p>
164+
165+
<p class="note">This does not apply to e.g.
166+
<code title="dom-media-matchmedium">matchMedium()</code> as the units are
167+
explicitly given there and defined by the Media Queries specification.
168+
[<cite><span>MQ</span></cite>]</p>
160169

161170

162171
<h2 id="dom-features">DOM Features</h2>
@@ -270,9 +279,6 @@ <h2 id="the-screenview-interface">The <code title="">ScreenView</code> Interface
270279
readonly attribute <span>Screen</span> <span title="dom-screenview-screen">screen</span>;
271280
};</pre>
272281

273-
<p>All coordinates and dimensions on the <span>ScreenView</span> interface
274-
are expressed in <span title="CSS pixel">CSS pixels</span>.</p>
275-
276282
<p>The <dfn id="dom-screenview-innerwidth"><code>innerWidth</code></dfn>
277283
attribute, on getting, <em class="ct">must</em> return the
278284
<span>viewport</span> width.</p>
@@ -374,12 +380,12 @@ <h2 id="the-screenview-interface">The <code title="">ScreenView</code> Interface
374380

375381
<p>The <dfn id="dom-screenview-outerwidth"><code>outerWidth</code></dfn>
376382
attribute, on getting, <em class="ct">must</em> return the width of the
377-
client window as number of CSS pixels. If there is no client window this
383+
client window. If there is no client window this
378384
attribute <em class="ct">must</em> return zero.</p>
379385

380386
<p>The <dfn id="dom-screenview-outerheight"><code>outerHeight</code></dfn>
381387
attribute, on getting, <em class="ct">must</em> return the height of the
382-
client window as number of CSS pixels. If there is no client window
388+
client window. If there is no client window
383389
this attribute <em class="ct">must</em> return zero.</p>
384390

385391
<p>The
@@ -403,9 +409,6 @@ <h3 id="the-screen-interface">The <code title="">Screen</code> Interface</h3>
403409
readonly attribute unsigned long <span>pixelDepth</span>;
404410
};</pre>
405411

406-
<p>All coordinates and dimensions on the <span>Screen</span> interface are
407-
expressed in <span title="CSS pixel">CSS pixels</span>.</p>
408-
409412
<p>The <dfn id="dom-screen-availwidth"><code>availWidth</code></dfn>
410413
attribute, on getting, <em class="ct">must</em> return the available width
411414
of the rendering surface of the output device.</p>
@@ -759,9 +762,6 @@ <h2 id="extensions-to-the-htmlelement-interface">Extensions to the <code title="
759762
readonly attribute long <span>offsetHeight</span>;
760763
};</pre>
761764

762-
<p>All coordinates and dimensions on this object are expressed in
763-
<span title="CSS pixel">CSS pixels</span>.</p>
764-
765765

766766
<h3 id="offset-attributes">The <code title="">offsetParent</code>,
767767
<code title="">offsetTop</code>, <code title="">offsetLeft</code>,
@@ -991,9 +991,6 @@ <h2 id="extensions-to-the-mouseevent-interface">Extensions to the <code title=""
991991
<p class="XXX">The object IDL fragment redefines some members. Can we
992992
resolve this somehow?</p>
993993

994-
<p>All coordinates and dimensions for this object are expressed in
995-
<span title="CSS pixel">CSS pixels</span>.</p>
996-
997994
<p>The
998995
<dfn id="dom-mouseevent-screenx" title="dom-mouseevent-screenx"><code>screenX</code></dfn>
999996
attribute, on getting, <em class="ct">must</em> return the x-coordinate of
@@ -1094,9 +1091,6 @@ <h3 id="the-clientrect-interface">The <code title="">ClientRect</code> Interface
10941091
readonly attribute float <span title="dom-clientrect-height">height</span>;
10951092
};</pre>
10961093

1097-
<p>All coordinates and dimensions on the <code>ClientRect</code> interface
1098-
are expressed in <span title="CSS pixel">CSS pixels</span>.</p>
1099-
11001094
<p>The
11011095
<dfn id="dom-clientrect-top" title="dom-clientrect-top"><code>top</code></dfn>
11021096
attribute, on getting, <em class="ct">must</em> return the y-coordinate,

0 commit comments

Comments
 (0)