8000 some cleanup for the first sections of Layout APIs · w3c/csswg-drafts@8724023 · GitHub
Skip to content

Commit 8724023

Browse files
committed
some cleanup for the first sections of Layout APIs
1 parent 7ec7c76 commit 8724023

2 files changed

Lines changed: 234 additions & 286 deletions

File tree

cssom/Overview.html

E36F
Lines changed: 119 additions & 156 deletions
57CD
Original file line numberDiff line numberDiff line change
@@ -267,15 +267,15 @@ <h2 class="no-num no-toc" id=toc>Table of Contents</h2>
267267
<li><a href="#the-windowlayout"><span class=secno>4.1. </span>The
268268
<code>WindowLayout</code> Interface</a>
269269
<ul class=toc>
270-
<li><a href="#the-screen"><span class=secno>4.1.1. </span>The
271-
<code>Screen</code> Interface</a>
270+
<li><a href="#the-screen"><span class=secno>4.1.1. </span>The <code
271+
title="">Screen</code> Interface</a>
272272
</ul>
273273

274274
<li><a href="#the-documentlayout"><span class=secno>4.2. </span>The
275-
<code>DocumentLayout</code> Interface</a>
275+
<code title="">DocumentLayout</code> Interface</a>
276276

277-
<li><a href="#the-elementlayout"><span class=secno>4.3. </span>The
278-
<code>ElementLayout</code> Interface</a>
277+
<li><a href="#the-elementlayout"><span class=secno>4.3. </span>The <code
278+
title="">ElementLayout</code> Interface</a>
279279
<ul class=toc>
280280
<li><a href="#the-getclientrects"><span class=secno>4.3.1. </span>The
281281
<code>getClientRects()</code> and <code>getBoundingClientRect</code>
@@ -2453,182 +2453,145 @@ <h4 id=the-csspercentagelengthvalue><span class=secno>3.7.5. </span>The
24532453
<h2 id=layout><span class=secno>4. </span>Layout APIs</h2>
24542454
<!-- Also need EventLayout -->
24552455

2456-
<p><em>This section and its subsections apply to visual user agents
2457-
only.</em>
2456+
<p><em>This section applies to visual user agents only.</em>
2457+
2458+
<p>The APIs provided in this section provide authors with a way to inspect
2459+
a rendered document as well as its environment. Examples include getting
2460+
the element rendered at a certain position or obtaining the width or
2461+
height of the output screen.
24582462

24592463
<h3 id=the-windowlayout><span class=secno>4.1. </span>The <code><a
24602464
href="#windowlayout">WindowLayout</a></code> Interface</h3>
24612465

2462-
<p>The <code><a href="#windowlayout">WindowLayout</a></code> interface <em
2463-
class=ct>must</em> be implemented on objects implementing the
2464-
<code>Window</code> interface. [Window]
2465-
24662466
<p>The term <dfn id=browsing>browsing context</dfn> is used as defined by
2467-
the Window Object 1.0 specification. [Window]
2468-
2469-
<p>Some of the terminology used in this section and its subsection is that
2470-
of Media Queries. [MQ]
2467+
the Window Object 1.0 specification. Some of the other terminology comes
2468+
from the Media Queries specification. [Window] [MQ]
24712469

2472-
<p>This interface represents rendering information about the current
2473-
browsing context.
2470+
<p>The <code><a href="#windowlayout">WindowLayout</a></code> interface <em
2471+
class=ct>must</em> be implemented on objects implementing the
2472+
<code>Window</code> interface. It represents rendering information about
2473+
the current browsing context. [Window]
24742474

24752475
<pre class=idl>interface <dfn id=windowlayout>WindowLayout</dfn> {
2476-
readonly attribute float <a href="#windowlayout-innerwidth" title=windowlayout-innerwidth>innerWidth</a>;
2477-
readonly attribute float <a href="#windowlayout-innerheight" title=windowlayout-innerheight>innerHeight</a>;
2478-
readonly attribute float <a href="#windowlayout-outerheight" title=windowlayout-outerheight>outerWidth</a>;
2479-
readonly attribute float <a href="#windowlayout-outerheight" title=windowlayout-outerheight>outerHeight</a>;
2480-
readonly attribute float <a href="#windowlayout-pagexoffset" title=windowlayout-pagexoffset>pageXOffset</a>;
2481-
readonly attribute float <a href="#windowlayout-pageyoffset" title=windowlayout-pageyoffset>pageYOffset</a>;
2482-
readonly attribute float <a href="#windowlayout-screenx" title=windowlayout-screenx>screenX</a>;
2483-
readonly attribute float <a href="#windowlayout-screeny" title=windowlayout-screeny>screenY</a>;
2484-
readonly attribute <a href="#screen">Screen</a> <a href="#windowlayout-screen" title=windowlayout-screen>screen</a>;
2476+
readonly attribute float <a href="#windowlayout-innerwidth" title=windowlayout-innerwidth>innerWidth</a>;
2477+
readonly attribute float <a href="#windowlayout-innerheight" title=windowlayout-innerheight>innerHeight</a>;
2478+
readonly attribute float <a href="#windowlayout-outerheight" title=windowlayout-outerheight>outerWidth</a>;
2479+
readonly attribute float <a href="#windowlayout-outerheight" title=windowlayout-outerheight>outerHeight</a>;
2480+
readonly attribute float <a href="#windowlayout-pagexoffset" title=windowlayout-pagexoffset>pageXOffset</a>;
2481+
readonly attribute float <a href="#windowlayout-pageyoffset" title=windowlayout-pageyoffset>pageYOffset</a>;
2482+
readonly attribute float <a href="#windowlayout-screenx" title=windowlayout-screenx>screenX</a>;
2483+
readonly attribute float <a href="#windowlayout-screeny" title=windowlayout-screeny>screenY</a>;
2484+
readonly attribute <a href="#screen">Screen</a> <a href="#windowlayout-screen" title=windowlayout-screen>screen</a>;
24852485
};</pre>
24862486
<!-- XXX float? -->
24872487

2488-
<dl>
2489-
<dt><dfn id=windowlayout-innerwidth
2490-
title=windowlayout-innerwidth><code>innerWidth</code> of type
2491-
<code>float</code>, readonly</dfn>
2492-
2493-
<dd>
2494-
<p>This attribute <em class=ct>must</em> be the viewport width in pixels.</p>
2495-
2496-
<p class=note>This is including, if rendered, the vertical scrollbar.</p>
2497-
2498-
<dt><dfn id=windowlayout-innerheight
2499-
title=windowlayout-innerheight><code>innerHeight</code> of type
2500-
<code>float</code>, readonly</dfn>
2501-
2502-
<dd>
2503-
<p>This attribute <em class=ct>must</em> be the viewport height in
2504-
pixels.</p>
2505-
2506-
<p class=note>This is including, if rendered, the horizontal scrollbar.</p>
2507-
2508-
<dt><dfn id=windowlayout-outerwidth
2509-
title=windowlayout-outerwidth><code>outerWidth</code> of type
2510-
<code>float</code>, readonly</dfn>
2511-
2512-
<dd>In web browsers, this attribute <em class=ct>must</em> be the width of
2513-
the browser window in pixels. Otherwise, this <em class=ct>must</em> be
2514-
<code>0</code>.
2515-
2516-
<dt><dfn id=windowlayout-outerheight
2517-
title=windowlayout-outerheight><code>outerHeight</code> of type
2518-
<code>float</code>, readonly</dfn>
2519-
2520-
<dd>In web browsers, this attribute <em class=ct>must</em> be the height
2521-
of the browser window in pixels. Otherwise, this <em class=ct>must</em>
2522-
be <code>0</code>.
2523-
2524-
<dt><dfn id=windowlayout-pagexoffset
2525-
title=windowlayout-pagexoffset><code>pageXOffset</code> of type
2526-
<code>float</code>, readonly</dfn>
2527-
2528-
<dd>This attribute <em class=ct>must</em> be the number of pixels the user
2529-
has scrolled to the right.
2530-
2531-
<dt><dfn id=windowlayout-pageyoffset
2532-
title=windowlayout-pageyoffset><code>pageYOffset</code> of type
2533-
<code>float</code>, readonly</dfn>
2534-
2535-
<dd>This attribute <em class=ct>must</em> be the number of pixels the user
2536-
has scrolled to the bottom.
2537-
2538-
<dt><dfn id=windowlayout-screenx
2539-
title=windowlayout-screenx><code>screenX</code> of type
2540-
<code>float</code>, readonly</dfn>
2541-
2542-
<dd>In web browsers, this attribute <em class=ct>must</em> be the amount
2543-
of of pixels to the left of the browser window offsetted against the
2544-
screen of the output device. Otherwise, this <em class=ct>must</em> be
2545-
<code>0</code>.
2546-
2547-
<dt><dfn id=windowlayout-screeny
2548-
title=windowlayout-screeny><code>screenY</code> of type
2549-
<code>float</code>, readonly</dfn>
2550-
2551-
<dd>In web browsers, this attribute <em class=ct>must</em> be the amount
2552-
of of pixels to the top of the browser window offsetted against the
2553-
screen of the output device. Otherwise, this <em class=ct>must</em> be
2554-
<code>0</code>.
2555-
2556-
<dt><dfn id=windowlayout-screen
2557-
title=windowlayout-screen><code>screen</code> of type <code>float</code>,
2558-
readonly</dfn>
2559-
2560-
<dd>This attribute <em class=ct>must</em> hold a <code><a
2561-
href="#screen">Screen</a></code> object.
2562-
</dl>
2488+
<p>The <dfn id=windowlayout-innerwidth
2489+
title=windowlayout-innerwidth><code>innerWidth</code></dfn> attribute, on
2490+
getting, <em class=ct>must</em> return the viewport width in CSS pixels as
2491+
number of CSS pixels. <span class=note>This is including, if rendered, the
2492+
vertical scrollbar.</span>
2493+
2494+
<p>The <dfn id=windowlayout-innerheight
2495+
title=windowlayout-innerheight><code>innerHeight</code></dfn> attribute,
2496+
on getting, <em class=ct>must</em> return the viewport height in CSS
2497+
pixels as number of CSS pixels. <span class=note>This is including, if
2498+
rendered, the horizontal scrollbar.</span>
2499+
2500+
<p>The <dfn id=windowlayout-outerwidth
2501+
title=windowlayout-outerwidth><code>outerWidth</code></dfn> attribute, on
2502+
getting, <em class=ct>must</em> return the width of the browser window in
2503+
CSS pixels as number of CSS pixels. If there is no browser window this
2504+
attribute <em class=ct>must</em> return zero.
2505+
2506+
<p>The <dfn id=windowlayout-outerheight
2507+
title=windowlayout-outerheight><code>outerHeight</code></dfn> attribute,
2508+
on getting, <em class=ct>must</em> return the height of the browser window
2509+
in CSS pixels as number of CSS pixels. If there is no browser windows this
2510+
attribute <em class=ct>must</em> return zero.
2511+
2512+
<p>The <dfn id=windowlayout-pagexoffset
2513+
title=windowlayout-pagexoffset><code>pageXOffset</code></dfn> attribute,
2514+
on getting, <em class=ct>must</em> return the number of CSS pixels the
2515+
user has scrolled towards the right.</p>
2516+
<!-- xxx more detailed? -->
2517+
2518+
<p>The <dfn id=windowlayout-pageyoffset
2519+
title=windowlayout-pageyoffset><code>pageYOffset</code></dfn> attribute,
2520+
on getting, <em class=ct>must</em> return the number of CSS pixels the
2521+
user has scrolled towards the bottom.
2522+
2523+
<p>The <dfn id=windowlayout-screenx
2524+
title=windowlayout-screenx><code>screenX</code> 7F6F </dfn> attribute, on
2525+
getting, <em class=ct>must</em> return the amount of CSS pixels between
2526+
the left of the browser window and the left of the screen of the output
2527+
device. If there is no browser window this attribute <em
2528+
class=ct>must</em> return zero.
2529+
2530+
<p>The <dfn id=windowlayout-screeny
2531+
title=windowlayout-screeny><code>screenY</code></dfn> attribute, on
2532+
getting, <em class=ct>must</em> return the amount of CSS pixels between
2533+
the top of the browser window and the top of the screen of the output
2534+
device. If there is no browser window this attribute <em
2535+
class=ct>must</em> return zero.
2536+
2537+
<p>The <dfn id=windowlayout-screen
2538+
title=windowlayout-screen><code>screen</code></dfn> attribute, on getting,
2539+
<em class=ct>must</em> return a <code><a href="#screen">Screen</a></code>
2540+
object.
25632541

25642542
<p>If the user agent supports multiple views and the current view does not
25652543
have a notion of an output device the above attributes with the exception
25662544
of <code title=windowlayout-screen><a
2567-
href="#windowlayout-screen">screen</a></code> <em class=ct>must</em> be
2568-
<code>0</code>. [DOM2View]
2545+
href="#windowlayout-screen">screen</a></code> <em class=ct>should</em>
2546+
return zero. [DOM2View]
25692547

2570-
<h4 id=the-screen><span class=secno>4.1.1. </span>The <code><a
2571-
href="#screen">Screen</a></code> Interface</h4>
2548+
<h4 id=the-screen><span class=secno>4.1.1. </span>The <code
2549+
title="">Screen</code> Interface</h4>
25722550

2573-
<p>This interface represents information about the screen of the output
2574-
device.
2551+
<p>As its name suggests, the <code><a href="#screen">Screen</a></code>
2552+
interface represents information about the screen of the output device.
25752553

25762554
<pre class=idl>interface <dfn id=screen>Screen</dfn> {
2577-
readonly attribute float <a href="#screen-availwidth" title=screen-availwidth>availWidth</a>;
2578-
readonly attribute float <a href="#screen-height" title=screen-height>availHeight</a>;
2579-
readonly attribute float <a href="#screen-width" title=screen-width>width</a>;
2580-
readonly attribute float <a href="#screen-height" title=screen-height>height</a>;
2581-
readonly attribute float <a href="#screen-colordepth" title=screen-colordepth>colorDepth</a>;
2582-
readonly attribute float <a href="#screen-pixeldepth" title=screen-pixeldepth>pixelDepth</a>;
2555+
readonly attribute float <a href="#screen-availwidth" title=screen-availwidth>availWidth</a>;
2556+
readonly attribute float <a href="#screen-height" title=screen-height>availHeight</a>;
2557+
readonly attribute float <a href="#screen-width" title=screen-width>width</a>;
2558+
readonly attribute float <a href="#screen-height" title=screen-height>height</a>;
2559+
readonly attribute float <a href="#screen-colordepth" title=screen-colordepth>colorDepth</a>;
2560+
readonly attribute float <a href="#screen-pixeldepth" title=screen-pixeldepth>pixelDepth</a>;
25832561
};</pre>
2584-
<!-- XXX float? -->
2585-
2586-
<dl class=members>
2587-
<dt><dfn id=screen-availwidth
2588-
title=screen-availwidth><code>availWidth</code> of type
2589-
<code>float</code>, readonly</dfn>
2590-
2591-
<dd>This attribute <em class=ct>must</em> be the available width for
2592-
rendering surface of the output device in pixels.
25932562

2594-
<dt><dfn id=screen-availheight
2595-
title=screen-availheight><code>availHeight</code> of type
2596-
<code>float</code>, readonly</dfn>
2563+
<p>The <dfn id=screen-availwidth
2564+
title=screen-availwidth><code>availWidth</code></dfn> attribute, on
2565+
getting, <em class=ct>must</em> return the available width for rendering
2566+
surface of the output device in CSS pixels as number of CSS pixels.
25972567

2598-
<dd>This attribute <em class=ct>must</em> be the available height for
2599-
rendering surface of the output device in pixels.
2568+
<p>The <dfn id=screen-availheight
2569+
title=screen-availheight><code>availHeight</code></dfn> attribute, on
2570+
getting, <em class=ct>must</em> return the available height for rendering
2571+
surface of the output device in CSS pixels as number of CSS pixels.
26002572

2601-
<dt><dfn id=screen-width title=screen-width><code>width</code> of type
2602-
<code>float</code>, readonly</dfn>
2573+
<p>The <dfn id=screen-width title=screen-width><code>width</code></dfn>
2574+
attribute, on getting, <em class=ct>must</em> return the width of the
2575+
output device in CSS pixels as number of CSS pixels.
26032576

2604-
<dd>This attribute <em class=ct>must</em> be the width of the output
2605-
device in pixels.
2577+
<p>The <dfn id=screen-height title=screen-height><code>height</code></dfn>
2578+
attribute, on getting, <em class=ct>must</em> return the height of the
2579+
output device in CSS pixels as number of CSS pixels.
26062580

2607-
<dt><dfn id=screen-height title=screen-height><code>height</code> of type
2608-
<code>float</code>, readonly</dfn>
2609-
2610-
<dd>This attribute <em class=ct>must</em> be the height of the output
2611-
device in pixels.
2612-
2613-
<dt><dfn id=screen-colordepth
2614-
title=screen-colordepth><code>colorDepth</code> of type
2615-
<code>float</code>, readonly</dfn>
2616-
2617-
<dt><dfn id=screen-pixeldepth
2618-
title=screen-pixeldepth><code>pixelDepth</code> of type
2619-
<code>float</code>, readonly</dfn></dt>
2620-
<!-- pixelDepth is not supported by Internet Explorer 7 -->
2621-
2622-
<dd>These attributes <em class=ct>must</em> be the number of bits per
2623-
color from the output device.
2624-
</dl>
2581+
<p>The <dfn id=screen-colordepth
2582+
title=screen-colordepth><code>colorDepth</code></dfn> and <dfn
2583+
id=screen-pixeldepth title=screen-pixeldepth><code>pixelDepth</code></dfn>
2584+
attributes <em class=ct>must</em> both return the lowest number of bits
2585+
from the color components of the output device. If the device is not a
2586+
color device these attributes <em class=ct>must</em> return zero.</p>
2587+
<!-- pixelDepth is not supported by Internet Explorer 7 -->
26252588

26262589
<p>If the user agent supports multiple views and the current view does not
26272590
have a notion of an output device the above attributes <em
2628-
class=ct>must</em> be <code>0</code>. [DOM2View]
2591+
class=ct>should</em> return zero. [DOM2View]
26292592

2630-
<h3 id=the-documentlayout><span class=secno>4.2. </span>The <code><a
2631-
href="#documentlayout">DocumentLayout</a></code> Interface</h3>
2593+
<h3 id=the-documentlayout><span class=secno>4.2. </span>The <code
2594+
title="">DocumentLayout</code> Interface</h3>
26322595

26332596
<p>Objects implementing the <code>Document</code> interface <em
26342597
class=ct>must</em> also implement the <code><a
@@ -2646,8 +2609,8 @@ <h3 id=the-documentlayout><span class=secno>4.2. </span>The <code><a
26462609
If either argument is negative or if there is no element under the given
26472610
position the method <em class=ct>must</em> return <code>null</code>.
26482611

2649-
<h3 id=the-elementlayout><span class=secno>4.3. </span>The <code><a
2650-
href="#elementlayout">ElementLayout</a></code> Interface</h3>
2612+
<h3 id=the-elementlayout><span class=secno>4.3. </span>The <code
2613+
title="">ElementLayout</code> Interface</h3>
26512614

26522615
<p>Objects implementing the <code>Element</code> interface <em
26532616
class=ct>must</em> also implement the <code><a
@@ -2663,8 +2626,8 @@ <h3 id=the-elementlayout><span class=secno>4.3. </span>The <code><a
26632626
readonly attribute float <a href="#elementlayout-offsetwidth">offsetWidth</a>;
26642627
readonly attribute float <a href="#elementlayout-offsetheight">offsetHeight</a>;
26652628

2666-
attribute float <a href="#elementlayout-scrolltop">scrollTop</a>; // scroll on setting
2667-
attribute float <a href="#elementlayout-scrollleft">scrollLeft</a>; // scroll on setting
2629+
attribute float <a href="#elementlayout-scrolltop">scrollTop</a>; // scroll on setting
2630+
attribute float <a href="#elementlayout-scrollleft">scrollLeft</a>; // scroll on setting
26682631
readonly attribute float <span>scrollWidth</span>;
26692632
readonly attribute float <span>scrollHeight</span>;
26702633

0 commit comments

Comments
 (0)