Handle cases when there's no viewport. Also make clientWidth/Height not use viewport dimensions in iframes. https://www.w3.org/Bugs/Public/show_bug.cgi?id=16380&list_id=10990 https://www.w3.org/Bugs/Public/show_bug.cgi?id=22063

Thu, 16 May 2013 14:57:50 +0200

author
Simon Pieters <simonp@opera.com>
date
Thu, 16 May 2013 14:57:50 +0200
changeset 8183
a3aa467d947d
parent 8182
1a7898ce25cf
child 8184
1c2099a22fdd

Handle cases when there's no viewport. Also make clientWidth/Height not use viewport dimensions in iframes. https://www.w3.org/Bugs/Public/show_bug.cgi?id=16380&list_id=10990 https://www.w3.org/Bugs/Public/show_bug.cgi?id=22063

cssom-view/Overview.html file | annotate | diff | comparison | revisions
cssom-view/cssom-view-source file | annotate | diff | comparison | revisions
cssom-view/idl/Document.idl file | annotate | diff | comparison | revisions
cssom-view/idl/Element.idl file | annotate | diff | comparison | revisions
cssom-view/idl/Window.idl file | annotate | diff | comparison | revisions
     1.1 --- a/cssom-view/Overview.html	Wed May 15 15:31:58 2013 -0700
     1.2 +++ b/cssom-view/Overview.html	Thu May 16 14:57:50 2013 +0200
     1.3 @@ -13,7 +13,7 @@
     1.4  
     1.5     <h1 id="cssom-view-module">CSSOM View Module</h1>
     1.6  
     1.7 -   <h2 class="no-num no-toc" id="w3c-doctype">Editor's Draft 15 May 2013</h2>
     1.8 +   <h2 class="no-num no-toc" id="w3c-doctype">Editor's Draft 16 May 2013</h2>
     1.9  
    1.10     <dl>
    1.11  
    1.12 @@ -69,7 +69,7 @@
    1.13     can be found in the <a href="http://www.w3.org/TR/">W3C technical reports
    1.14     index at http://www.w3.org/TR/.</a></em>
    1.15  
    1.16 -<p>This is the 15 May 2013 Editor's Draft of CSSOM View. Please send
    1.17 +<p>This is the 16 May 2013 Editor's Draft of CSSOM View. Please send
    1.18  comments to
    1.19  <a href="mailto:www-style@w3.org?subject=%5Bcssom-view%5D%20">www-style@w3.org</a>
    1.20  (<a href="http://lists.w3.org/Archives/Public/www-style/">archived</a>)
    1.21 @@ -115,10 +115,7 @@
    1.22    <ol class="toc">
    1.23     <li><a href="#the-getclientrects-and-getboundingclientrect-methods"><span class="secno">6.1 </span>The <code title="">getClientRects()</code> and
    1.24    <code title="">getBoundingClientRect()</code> methods</a></li>
    1.25 -   <li><a href="#element-scrolling-members"><span class="secno">6.2 </span><code title="">Element</code> Scrolling Members</a></li>
    1.26 -   <li><a href="#client-attributes"><span class="secno">6.3 </span>The <code title="">clientTop</code>,
    1.27 -  <code title="">clientLeft</code>, <code title="">clientWidth</code>, and
    1.28 -  <code title="">clientHeight</code> attributes</a></ol></li>
    1.29 +   <li><a href="#element-scrolling-members"><span class="secno">6.2 </span><code title="">Element</code> Scrolling Members</a></ol></li>
    1.30   <li><a href="#extensions-to-the-htmlelement-interface"><span class="secno">7 </span>Extensions to the <code title="">HTMLElement</code> Interface</a></li>
    1.31   <li><a href="#extensions-to-the-range-interface"><span class="secno">8 </span>Extensions to the <code title="">Range</code> Interface</a></li>
    1.32   <li><a href="#extensions-to-the-mouseevent-interface"><span class="secno">9 </span>Extensions to the <code title="">MouseEvent</code> Interface</a></li>
    1.33 @@ -274,15 +271,15 @@
    1.34  <dt class="attribute" id="widl-Window-innerWidth">
    1.35  <dfn id="widl-Window-innerWidth"><code>innerWidth</code></dfn> of type <span class="idlAttrType"><a>double</a></span>, readonly</dt>
    1.36  <dd>
    1.37 -<p>The <code><a href="#widl-Window-innerWidth">innerWidth</a></code> attribute must return the <a href="#viewport">viewport</a> width including the size of a rendered scroll bar (if any).</p>    <div class="example">     <p>The following snippet shows how to obtain the width of the viewport:</p>     <pre><code>var viewportWidth = innerWidth</code></pre>    </div></dd>
    1.38 +<p>The <code><a href="#widl-Window-innerWidth">innerWidth</a></code> attribute must return the <a href="#viewport">viewport</a> width including the size of a rendered scroll bar (if any), or zero if there is no   <a href="#viewport">viewport</a>.</p>    <div class="example">     <p>The following snippet shows how to obtain the width of the viewport:</p>     <pre><code>var viewportWidth = innerWidth</code></pre>    </div></dd>
    1.39  <dt class="attribute" id="widl-Window-innerHeight">
    1.40  <dfn id="widl-Window-innerHeight"><code>innerHeight</code></dfn> of type <span class="idlAttrType"><a>double</a></span>, readonly</dt>
    1.41  <dd>
    1.42 -<p>The <code><a href="#widl-Window-innerHeight">innerHeight</a></code> attribute must return the <a href="#viewport">viewport</a> height including the size of a rendered scroll bar (if any).</dd>
    1.43 +<p>The <code><a href="#widl-Window-innerHeight">innerHeight</a></code> attribute must return the <a href="#viewport">viewport</a> height including the size of a rendered scroll bar (if any), or zero if there is no   <a href="#viewport">viewport</a>.</dd>
    1.44  <dt class="attribute" id="widl-Window-scrollX">
    1.45  <dfn id="widl-Window-scrollX"><code>scrollX</code></dfn> of type <span class="idlAttrType"><a>double</a></span>, readonly</dt>
    1.46  <dd>
    1.47 -<p>The <code><a href="#widl-Window-scrollX">scrollX</a></code> attribute attribute must return the x-coordinate, relative to the <a href="#initial-containing-block">initial containing block</a> origin, of the left of the <a href="#viewport">viewport</a>.</dd>
    1.48 +<p>The <code><a href="#widl-Window-scrollX">scrollX</a></code> attribute attribute must return the x-coordinate, relative to the <a href="#initial-containing-block">initial containing block</a> origin, of the left of the   <a href="#viewport">viewport</a>, or zero if there is no <a href="#viewport">viewport</a>.</dd>
    1.49  <dt class="attribute" id="widl-Window-pageXOffset">
    1.50  <dfn id="widl-Window-pageXOffset"><code>pageXOffset</code></dfn> of type <span class="idlAttrType"><a>double</a></span>, readonly</dt>
    1.51  <dd>
    1.52 @@ -290,7 +287,7 @@
    1.53  <dt class="attribute" id="widl-Window-scrollY">
    1.54  <dfn id="widl-Window-scrollY"><code>scrollY</code></dfn> of type <span class="idlAttrType"><a>double</a></span>, readonly</dt>
    1.55  <dd>
    1.56 -<p>The <code><a href="#widl-Window-scrollY">scrollY</a></code> attribute attribute must return the y-coordinate, relative to the <a href="#initial-containing-block">initial containing block</a> origin, of the top of the <a href="#viewport">viewport</a>.</dd>
    1.57 +<p>The <code><a href="#widl-Window-scrollY">scrollY</a></code> attribute attribute must return the y-coordinate, relative to the <a href="#initial-containing-block">initial containing block</a> origin, of the top of the    <a href="#viewport">viewport</a>, or zero if there is no <a href="#viewport">viewport</a>.</dd>
    1.58  <dt class="attribute" id="widl-Window-pageYOffset">
    1.59  <dfn id="widl-Window-pageYOffset"><code>pageYOffset</code></dfn> of type <span class="idlAttrType"><a>double</a></span>, readonly</dt>
    1.60  <dd>
    1.61 @@ -320,7 +317,7 @@
    1.62  <dt class="method" id="widl-Window-scroll-void-double-x-double-y">
    1.63  <dfn id="widl-Window-scroll"><code>scroll</code></dfn> (<span class="idlParam"><span class="idlParamType"><a>double</a></span> <a class="idlParamName" href="#widl-MouseEvent-x">x</a></span>, <span class="idlParam"><span class="idlParamType"><a>double</a></span> <a class="idlParamName" href="#widl-MouseEvent-y">y</a></span>), returns <span class="idlMethType"><a>void</a></span></dt>
    1.64  <dd>
    1.65 -<p>When the <code><a href="#widl-Window-scroll">scroll</a></code> operation is invoked these steps must be run:</p>    <ol>     <li>      <dl>       <dt>If <a href="#document-content">document content</a> can have overflow to the right       <dd><p>Let <var title="">x</var> be max(0, min(<var title="">x</var>,       <a href="#content">content</a> width - <a href="#content-edge">content edge</a>       width)).</dd>       <dt>If <a href="#document-content">document content</a> can have overflow to the left       (under right-to-left conditions)       <dd><p>Let <var title="">x</var> be min(0, max(<var title="">x</var>,       <a href="#content-edge">content edge</a> width - <a href="#content">content</a>       width)).</dd>      </dl>     </li>     <li><p>Let <var title="">y</var> be max(0, min(<var title="">y</var>,     <a href="#document-content">document content</a> height - <a href="#viewport">viewport</a>     height excluding the size of a rendered scroll bar (if any))).</li>     <li><p>Align the x-coordinate <var title="">x</var> of the     <a href="#document-content">document content</a> with the left of the <a href="#viewport">viewport</a>     and align the y-coordinate <var title="">y</var> of the <a href="#document-content">document     content</a> with the top of the <a href="#viewport">viewport</a>.</li>     <li><p>If the aligning caused content to move <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#queue-a-task">queue a task</a> to     <a class="external" href="http://dom.spec.whatwg.org/#concept-event-fire" title="concept-event-fire">fire an event</a>     named <code title="event-scroll">scroll</code> that bubbles at the     <code class="external"><a href="http://dom.spec.whatwg.org/#document">Document</a></code> object, unless a     <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#concept-task" title="concept-task">task</a> to fire that event at the <code class="external"><a href="http://dom.spec.whatwg.org/#document">Document</a></code> object     was already <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#queue-a-task" title="queue a task">queued</a>.</li>    </ol></dd>
    1.66 +<p>When the <code><a href="#widl-Window-scroll">scroll</a></code> operation is invoked these steps must be run:</p>    <ol>     <li>     <li><p>If there is no <a href="#viewport">viewport</a>, abort these steps.      <dl>       <dt>If <a href="#document-content">document content</a> can have overflow to the right       <dd><p>Let <var title="">x</var> be max(0, min(<var title="">x</var>,       <a href="#content">content</a> width - <a href="#content-edge">content edge</a>       width)).</dd>       <dt>If <a href="#document-content">document content</a> can have overflow to the left       (under right-to-left conditions)       <dd><p>Let <var title="">x</var> be min(0, max(<var title="">x</var>,       <a href="#content-edge">content edge</a> width - <a href="#content">content</a>       width)).</dd>      </dl>     </li>     <li><p>Let <var title="">y</var> be max(0, min(<var title="">y</var>,     <a href="#document-content">document content</a> height - <a href="#viewport">viewport</a>     height excluding the size of a rendered scroll bar (if any))).</li>     <li><p>Align the x-coordinate <var title="">x</var> of the     <a href="#document-content">document content</a> with the left of the <a href="#viewport">viewport</a>     and align the y-coordinate <var title="">y</var> of the <a href="#document-content">document     content</a> with the top of the <a href="#viewport">viewport</a>.</li>     <li><p>If the aligning caused content to move <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#queue-a-task">queue a task</a> to     <a class="external" href="http://dom.spec.whatwg.org/#concept-event-fire" title="concept-event-fire">fire an event</a>     named <code title="event-scroll">scroll</code> that bubbles at the     <code class="external"><a href="http://dom.spec.whatwg.org/#document">Document</a></code> object, unless a     <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#concept-task" title="concept-task">task</a> to fire that event at the <code class="external"><a href="http://dom.spec.whatwg.org/#document">Document</a></code> object     was already <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#queue-a-task" title="queue a task">queued</a>.</li>    </ol></dd>
    1.67  <dt class="method" id="widl-Window-scrollTo-void-double-x-double-y">
    1.68  <dfn id="widl-Window-scrollTo"><code>scrollTo</code></dfn> (<span class="idlParam"><span class="idlParamType"><a>double</a></span> <a class="idlParamName" href="#widl-MouseEvent-x">x</a></span>, <span class="idlParam"><span class="idlParamType"><a>double</a></span> <a class="idlParamName" href="#widl-MouseEvent-y">y</a></span>), returns <span class="idlMethType"><a>void</a></span></dt>
    1.69  <dd>
    1.70 @@ -424,11 +421,11 @@
    1.71  <dt class="method" id="widl-Document-elementFromPoint-Element-double-x-double-y">
    1.72  <dfn id="widl-Document-elementFromPoint"><code>elementFromPoint</code></dfn> (<span class="idlParam"><span class="idlParamType"><a>double</a></span> <a class="idlParamName" href="#widl-MouseEvent-x">x</a></span>, <span class="idlParam"><span class="idlParamType"><a>double</a></span> <a class="idlParamName" href="#widl-MouseEvent-y">y</a></span>), returns <span class="idlMethType"><a>Element</a>?</span></dt>
    1.73  <dd>
    1.74 -<p>The <code><a href="#widl-Document-elementFromPoint">elementFromPoint</a></code> operation must return the element at coordinates <var><a href="#widl-MouseEvent-x">x</a></var>,<var><a href="#widl-MouseEvent-y">y</a></var> in the <a href="#viewport">viewport</a>. The element to be returned is determined    through hit testing. If either argument is negative, <var title="">x</var> is greater than the <a href="#viewport">viewport</a> width excluding the size of a rendered scroll    bar (if any), or <var title="">y</var> is greater than the <a href="#viewport">viewport</a> height excluding the size of a rendered scroll bar (if any), the method must    return null. If there is no element at the given position the method must return the root element, if any, or null otherwise.</dd>
    1.75 +<p>The <code><a href="#widl-Document-elementFromPoint">elementFromPoint</a></code> operation must return the element at coordinates <var><a href="#widl-MouseEvent-x">x</a></var>,<var><a href="#widl-MouseEvent-y">y</a></var> in the <a href="#viewport">viewport</a>. The element to be returned is determined    through hit testing. If either argument is negative, <var title="">x</var> is greater than the <a href="#viewport">viewport</a> width excluding the size of a rendered scroll    bar (if any), or <var title="">y</var> is greater than the <a href="#viewport">viewport</a> height excluding the size of a rendered scroll bar (if any), the method must    return null. If there is no element at the given position the method must return the root element, if any, or null otherwise. If there is no    <a href="#viewport">viewport</a> associated with the document, the method must return null.</dd>
    1.76  <dt class="method" id="widl-Document-caretPositionFromPoint-CaretPosition-double-x-double-y">
    1.77  <dfn id="widl-Document-caretPositionFromPoint"><code>caretPositionFromPoint</code></dfn> (<span class="idlParam"><span class="idlParamType"><a>double</a></span> <a class="idlParamName" href="#widl-MouseEvent-x">x</a></span>, <span class="idlParam"><span class="idlParamType"><a>double</a></span> <a class="idlParamName" href="#widl-MouseEvent-y">y</a></span>), returns <span class="idlMethType"><a>CaretPosition</a>?</span></dt>
    1.78  <dd>
    1.79 -<p>The <code><a href="#widl-Document-caretPositionFromPoint">caretPositionFromPoint</a></code> operation must return the result of running these steps:</p>    <ol>     <li><p>If either argument is negative, <var title="">x</var> is greater     than the <a href="#viewport">viewport</a> width excluding the size of a rendered     scroll bar (if any), <var title="">y</var> is greather than the     <a href="#viewport">viewport</a> height excluding the size of a rendered scroll bar     (if any) return null.</li>     <li><p>If at the coordinates <var title="">x</var>,<var title="">y</var>     in the <a href="#viewport">viewport</a> no text insertion point indicator would have     been inserted return null.</li>     <li>      <p>If at the coordinates <var title="">x</var>,<var title="">y</var>      in the <a href="#viewport">viewport</a> a text insertion point indicator would have      been inserted in a text entry widget which is also a replaced element      return a <a href="#caret-position">caret position</a> with its properties set as      follows:</p>      <dl>       <dt><a href="#caret-node">caret node</a></dt>       <dd><p>The node corresponding to the text entry widget.</dd>       <dt><a href="#caret-offset">caret offset</a></dt>       <dd><p>The amount of 16-bit units to the left of where the       text insertion point indicator would have inserted.</dd>       <dt><a href="#caret-range">caret range</a></dt>       <dd><p>null</dd>      </dl>     </li>     <li>      <p>Otherwise, return a <a href="#caret-position">caret position</a> where the      <a href="#caret-range">caret range</a> is a collapsed      <code class="external"><a href="http://dom.spec.whatwg.org/#range">Range</a></code> object for the position      where the text insertion point indicator would have been inserted and      the other properties are set as follows:</p>      <dl>       <dt><a href="#caret-node">caret node</a></dt>       <dd><p>The <code class="external" title="dom-Range-startContainer"><a href="http://dom.spec.whatwg.org/#dom-range-startcontainer">startContainer</a></code>       of the <a href="#caret-range">caret range</a>.</dd>       <dt><a href="#caret-offset">caret offset</a></dt>       <dd><p>The <code class="external" title="dom-Range-startOffset"><a href="http://dom.spec.whatwg.org/#dom-range-startoffset">startOffset</a></code> of       the <a href="#caret-range">caret range</a>.</p>      </dl>     </li>    </ol>    <p class="note">The specifics of hit testing are out of scope of this    specification and therefore the exact details of    <code title="widl-Document-elementFromPoint">elementFromPoint()</code> and    <code title="widl-Document-caretPositionFromPoint">caretPositionFromPoint()</code>    are therefore too. Hit testing will hopefully be defined in a future    revision of CSS or HTML.</dd>
    1.80 +<p>The <code><a href="#widl-Document-caretPositionFromPoint">caretPositionFromPoint</a></code> operation must return the result of running these steps:</p>    <ol>     <li><p>If there is no <a href="#viewport">viewport</a> associated with the document, return null.     <li><p>If either argument is negative, <var title="">x</var> is greater     than the <a href="#viewport">viewport</a> width excluding the size of a rendered     scroll bar (if any), <var title="">y</var> is greather than the     <a href="#viewport">viewport</a> height excluding the size of a rendered scroll bar     (if any) return null.</li>     <li><p>If at the coordinates <var title="">x</var>,<var title="">y</var>     in the <a href="#viewport">viewport</a> no text insertion point indicator would have     been inserted return null.</li>     <li>      <p>If at the coordinates <var title="">x</var>,<var title="">y</var>      in the <a href="#viewport">viewport</a> a text insertion point indicator would have      been inserted in a text entry widget which is also a replaced element      return a <a href="#caret-position">caret position</a> with its properties set as      follows:</p>      <dl>       <dt><a href="#caret-node">caret node</a></dt>       <dd><p>The node corresponding to the text entry widget.</dd>       <dt><a href="#caret-offset">caret offset</a></dt>       <dd><p>The amount of 16-bit units to the left of where the       text insertion point indicator would have inserted.</dd>       <dt><a href="#caret-range">caret range</a></dt>       <dd><p>null</dd>      </dl>     </li>     <li>      <p>Otherwise, return a <a href="#caret-position">caret position</a> where the      <a href="#caret-range">caret range</a> is a collapsed      <code class="external"><a href="http://dom.spec.whatwg.org/#range">Range</a></code> object for the position      where the text insertion point indicator would have been inserted and      the other properties are set as follows:</p>      <dl>       <dt><a href="#caret-node">caret node</a></dt>       <dd><p>The <code class="external" title="dom-Range-startContainer"><a href="http://dom.spec.whatwg.org/#dom-range-startcontainer">startContainer</a></code>       of the <a href="#caret-range">caret range</a>.</dd>       <dt><a href="#caret-offset">caret offset</a></dt>       <dd><p>The <code class="external" title="dom-Range-startOffset"><a href="http://dom.spec.whatwg.org/#dom-range-startoffset">startOffset</a></code> of       the <a href="#caret-range">caret range</a>.</p>      </dl>     </li>    </ol>    <p class="note">The specifics of hit testing are out of scope of this    specification and therefore the exact details of    <code title="widl-Document-elementFromPoint">elementFromPoint()</code> and    <code title="widl-Document-caretPositionFromPoint">caretPositionFromPoint()</code>    are therefore too. Hit testing will hopefully be defined in a future    revision of CSS or HTML.</dd>
    1.81  </dl>
    1.82  
    1.83  
    1.84 @@ -495,19 +492,19 @@
    1.85  <dt class="attribute" id="widl-Element-clientTop">
    1.86  <dfn id="widl-Element-clientTop"><code>clientTop</code></dfn> of type <span class="idlAttrType"><a>double</a></span>, readonly</dt>
    1.87  <dd>
    1.88 -<p>The <code><a href="#widl-Element-clientTop">clientTop</a></code> attribute returns the computed value of the    '<code>border-top-width</code>' property plus the width of any scrollbar    rendered between the top <a href="#padding-edge">padding edge</a> and the top    <a href="#border-edge">border edge</a>.</dd>
    1.89 +<p>The <code><a href="#widl-Element-clientTop">clientTop</a></code> attribute must run these steps:    <ol>     <li><p>If the element has no associated <a href="#css-layout-box">CSS layout box</a> or if the <a href="#css-layout-box">CSS layout box</a> is inline, return zero.     <li><p>Return the computed value of the '<code>border-top-width</code>' property plus the height of any scrollbar rendered between the top <a href="#padding-edge">padding     edge</a> and the top <a href="#border-edge">border edge</a>.    </ol></dd>
    1.90  <dt class="attribute" id="widl-Element-clientLeft">
    1.91  <dfn id="widl-Element-clientLeft"><code>clientLeft</code></dfn> of type <span class="idlAttrType"><a>double</a></span>, readonly</dt>
    1.92  <dd>
    1.93 -<p>The <code><a href="#widl-Element-clientLeft">clientLeft</a></code> attribute returns the computed value of the    '<code>border-left-width</code>' property plus the width of any scrollbar    rendered between the left <a href="#padding-edge">padding edge</a> and the left    <a href="#border-edge">border edge</a>.</dd>
    1.94 +<p>The <code><a href="#widl-Element-clientLeft">clientLeft</a></code> attribute must run these steps:    <ol>     <li><p>If the element has no associated <a href="#css-layout-box">CSS layout box</a> or if the <a href="#css-layout-box">CSS layout box</a> is inline, return zero.     <li><p>Return the computed value of the '<code>border-left-width</code>' property plus the width of any scrollbar rendered between the left <a href="#padding-edge">padding     edge</a> and the left <a href="#border-edge">border edge</a>.    </ol></dd>
    1.95  <dt class="attribute" id="widl-Element-clientWidth">
    1.96  <dfn id="widl-Element-clientWidth"><code>clientWidth</code></dfn> of type <span class="idlAttrType"><a>double</a></span>, readonly</dt>
    1.97  <dd>
    1.98 -<p>The <code><a href="#widl-Element-clientWidth">clientWidth</a></code> attribute returns the    <a href="#viewport">viewport</a> width excluding the size of a rendered scroll bar    (if any) if the element is the root element and the    width of the <a href="#padding-edge">padding edge</a> (excluding the width of any    rendered scrollbar between the <a href="#padding-edge">padding edge</a> and the    <a href="#border-edge">border edge</a>) otherwise.</dd>
    1.99 +<p>The <code><a href="#widl-Element-clientWidth">clientWidth</a></code> attribute must run these steps:    <ol>     <li><p>If the element has no associated <a href="#css-layout-box">CSS layout box</a> or if the <a href="#css-layout-box">CSS layout box</a> is inline, return zero.     <li><p>If the element is the root element and the element's document's <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#browsing-context">browsing context</a> is a     <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#top-level-browsing-context">top-level browsing context</a>, return the <a href="#viewport">viewport</a> width excluding the size of a rendered scroll bar (if     any).     <li><p>Return the width of the <a href="#padding-edge">padding edge</a> excluding the width of any rendered scrollbar between the <a href="#padding-edge">padding edge</a> and the     <a href="#border-edge">border edge</a>.    </ol></dd>
   1.100  <dt class="attribute" id="widl-Element-clientHeight">
   1.101  <dfn id="widl-Element-clientHeight"><code>clientHeight</code></dfn> of type <span class="idlAttrType"><a>double</a></span>, readonly</dt>
   1.102  <dd>
   1.103 -<p>The <code><a href="#widl-Element-clientHeight">clientHeight</a></code> attribute returns the    <a href="#viewport">viewport</a> height excluding the size of a rendered scroll bar    (if any) if the element is the root element and the    height of the <a href="#padding-edge">padding edge</a> (excluding the height of any    rendered scrollbar between the <a href="#padding-edge">padding edge</a> and the    <a href="#border-edge">border edge</a>) otherwise.</dd>
   1.104 +<p>The <code><a href="#widl-Element-clientHeight">clientHeight</a></code> attribute must run these steps:    <ol>     <li><p>If the element has no associated <a href="#css-layout-box">CSS layout box</a> or if the <a href="#css-layout-box">CSS layout box</a> is inline, return zero.     <li><p>If the element is the root element and the element's document's <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#browsing-context">browsing context</a> is a     <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#top-level-browsing-context">top-level browsing context</a>, return the <a href="#viewport">viewport</a> height excluding the size of a rendered scroll bar (if any).     <li><p>Return the height of the <a href="#padding-edge">padding edge</a> excluding the height of any rendered scrollbar between the <a href="#padding-edge">padding edge</a> and the     <a href="#border-edge">border edge</a>.    </ol></dd>
   1.105  </dl>
   1.106  <dl class="methods">
   1.107  <dt class="method" id="widl-Element-getClientRects-ClientRectList">
   1.108 @@ -622,19 +619,6 @@
   1.109    </ol>
   1.110  
   1.111  
   1.112 -  <h3 id="client-attributes"><span class="secno">6.3 </span>The <code title="">clientTop</code>,
   1.113 -  <code title="">clientLeft</code>, <code title="">clientWidth</code>, and
   1.114 -  <code title="">clientHeight</code> attributes</h3>
   1.115 -
   1.116 -  <p>The <code title="widl-lElement-clientTop">clientTop</code>,
   1.117 -  <code title="widl-Element-clientLeft">clientLeft</code>,
   1.118 -  <code title="widl-Element-clientWidth">clientWidth</code>, and
   1.119 -  <code title="widl-Element-clientHeight">clientHeight</code>
   1.120 -  attributes must return zero if the element does not
   1.121 -  have any associated <a href="#css-layout-box">CSS layout box</a> or if the <a href="#css-layout-box">CSS layout box</a> is inline.
   1.122 -  Otherwise, these attributes must behave as defined in
   1.123 -  the remainder of this section.</p>
   1.124 -
   1.125    <h2 id="extensions-to-the-htmlelement-interface"><span class="secno">7 </span>Extensions to the <code title="">HTMLElement</code> Interface</h2>
   1.126  
   1.127    
     2.1 --- a/cssom-view/cssom-view-source	Wed May 15 15:31:58 2013 -0700
     2.2 +++ b/cssom-view/cssom-view-source	Thu May 16 14:57:50 2013 +0200
     2.3 @@ -339,19 +339,6 @@
     2.4    </ol>
     2.5  
     2.6  
     2.7 -  <h3 id="client-attributes">The <code title>clientTop</code>,
     2.8 -  <code title>clientLeft</code>, <code title>clientWidth</code>, and
     2.9 -  <code title>clientHeight</code> attributes</h3>
    2.10 -
    2.11 -  <p>The <code title=widl-lElement-clientTop>clientTop</code>,
    2.12 -  <code title=widl-Element-clientLeft>clientLeft</code>,
    2.13 -  <code title=widl-Element-clientWidth>clientWidth</code>, and
    2.14 -  <code title=widl-Element-clientHeight>clientHeight</code>
    2.15 -  attributes must return zero if the element does not
    2.16 -  have any associated <span>CSS layout box</span> or if the <span>CSS layout box</span> is inline.
    2.17 -  Otherwise, these attributes must behave as defined in
    2.18 -  the remainder of this section.</p>
    2.19 -
    2.20    <h2 id="extensions-to-the-htmlelement-interface">Extensions to the <code title>HTMLElement</code> Interface</h2>
    2.21  
    2.22    <!--{@idl(HTMLElement)}-->
     3.1 --- a/cssom-view/idl/Document.idl	Wed May 15 15:31:58 2013 -0700
     3.2 +++ b/cssom-view/idl/Document.idl	Thu May 16 14:57:50 2013 +0200
     3.3 @@ -5,13 +5,15 @@
     3.4     "<p>The {@name} {@type} must return the element at coordinates <var>x</var>,<var>y</var> in the <span>viewport</span>. The element to be returned is determined\
     3.5      through hit testing. If either argument is negative, <var title>x</var> is greater than the <span>viewport</span> width excluding the size of a rendered scroll\
     3.6      bar (if any), or <var title>y</var> is greater than the <span>viewport</span> height excluding the size of a rendered scroll bar (if any), the method must\
     3.7 -    return null. If there is no element at the given position the method must return the root element, if any, or null otherwise.</p>"
     3.8 +    return null. If there is no element at the given position the method must return the root element, if any, or null otherwise. If there is no\
     3.9 +    <span>viewport</span> associated with the document, the method must return null.</p>"
    3.10    ]
    3.11    Element? elementFromPoint(double x, double y);
    3.12  
    3.13    [Documentation=
    3.14     "<p>The {@name} {@type} must return the result of running these steps:</p>\
    3.15      <ol>\
    3.16 +     <li><p>If there is no <span>viewport</span> associated with the document, return null.\
    3.17       <li><p>If either argument is negative, <var title>x</var> is greater\
    3.18       than the <span>viewport</span> width excluding the size of a rendered\
    3.19       scroll bar (if any), <var title>y</var> is greather than the\
     4.1 --- a/cssom-view/idl/Element.idl	Wed May 15 15:31:58 2013 -0700
     4.2 +++ b/cssom-view/idl/Element.idl	Thu May 16 14:57:50 2013 +0200
     4.3 @@ -187,38 +187,47 @@
     4.4    readonly attribute double scrollHeight;
     4.5  
     4.6    [Documentation=
     4.7 -   "<p>The {@name} {@type} returns the computed value of the\
     4.8 -    '<code>border-top-width</code>' property plus the width of any scrollbar\
     4.9 -    rendered between the top <span>padding edge</span> and the top\
    4.10 -    <span>border edge</span>.</p>"
    4.11 +   "<p>The {@name} {@type} must run these steps:\
    4.12 +    <ol>\
    4.13 +     <li><p>If the element has no associated <span>CSS layout box</span> or if the <span>CSS layout box</span> is inline, return zero.\
    4.14 +     <li><p>Return the computed value of the '<code>border-top-width</code>' property plus the height of any scrollbar rendered between the top <span>padding\
    4.15 +     edge</span> and the top <span>border edge</span>.\
    4.16 +    </ol>"
    4.17    ]
    4.18    readonly attribute double clientTop;
    4.19  
    4.20    [Documentation=
    4.21 -   "<p>The {@name} {@type} returns the computed value of the\
    4.22 -    '<code>border-left-width</code>' property plus the width of any scrollbar\
    4.23 -    rendered between the left <span>padding edge</span> and the left\
    4.24 -    <span>border edge</span>.</p>"
    4.25 +   "<p>The {@name} {@type} must run these steps:\
    4.26 +    <ol>\
    4.27 +     <li><p>If the element has no associated <span>CSS layout box</span> or if the <span>CSS layout box</span> is inline, return zero.\
    4.28 +     <li><p>Return the computed value of the '<code>border-left-width</code>' property plus the width of any scrollbar rendered between the left <span>padding\
    4.29 +     edge</span> and the left <span>border edge</span>.\
    4.30 +    </ol>"
    4.31    ]
    4.32    readonly attribute double clientLeft;
    4.33  
    4.34    [Documentation=
    4.35 -   "<p>The {@name} {@type} returns the\
    4.36 -    <span>viewport</span> width excluding the size of a rendered scroll bar\
    4.37 -    (if any) if the element is the root element and the\
    4.38 -    width of the <span>padding edge</span> (excluding the width of any\
    4.39 -    rendered scrollbar between the <span>padding edge</span> and the\
    4.40 -    <span>border edge</span>) otherwise.</p>"
    4.41 +   "<p>The {@name} {@type} must run these steps:\
    4.42 +    <ol>\
    4.43 +     <li><p>If the element has no associated <span>CSS layout box</span> or if the <span>CSS layout box</span> is inline, return zero.\
    4.44 +     <li><p>If the element is the root element and the element's document's <span data-anolis-spec=html>browsing context</span> is a\
    4.45 +     <span data-anolis-spec=html>top-level browsing context</span>, return the <span>viewport</span> width excluding the size of a rendered scroll bar (if\
    4.46 +     any).\
    4.47 +     <li><p>Return the width of the <span>padding edge</span> excluding the width of any rendered scrollbar between the <span>padding edge</span> and the\
    4.48 +     <span>border edge</span>.\
    4.49 +    </ol>"
    4.50    ]
    4.51    readonly attribute double clientWidth;
    4.52  
    4.53    [Documentation=
    4.54 -   "<p>The {@name} {@type} returns the\
    4.55 -    <span>viewport</span> height excluding the size of a rendered scroll bar\
    4.56 -    (if any) if the element is the root element and the\
    4.57 -    height of the <span>padding edge</span> (excluding the height of any\
    4.58 -    rendered scrollbar between the <span>padding edge</span> and the\
    4.59 -    <span>border edge</span>) otherwise.</p>"
    4.60 +   "<p>The {@name} {@type} must run these steps:\
    4.61 +    <ol>\
    4.62 +     <li><p>If the element has no associated <span>CSS layout box</span> or if the <span>CSS layout box</span> is inline, return zero.\
    4.63 +     <li><p>If the element is the root element and the element's document's <span data-anolis-spec=html>browsing context</span> is a\
    4.64 +     <span data-anolis-spec=html>top-level browsing context</span>, return the <span>viewport</span> height excluding the size of a rendered scroll bar (if any).\
    4.65 +     <li><p>Return the height of the <span>padding edge</span> excluding the height of any rendered scrollbar between the <span>padding edge</span> and the\
    4.66 +     <span>border edge</span>.\
    4.67 +    </ol>"
    4.68    ]
    4.69    readonly attribute double clientHeight;
    4.70  
     5.1 --- a/cssom-view/idl/Window.idl	Wed May 15 15:31:58 2013 -0700
     5.2 +++ b/cssom-view/idl/Window.idl	Thu May 16 14:57:50 2013 +0200
     5.3 @@ -26,7 +26,8 @@
     5.4  
     5.5    // viewport
     5.6    [Documentation=
     5.7 -   "<p>The {@name} {@type} must return the <span>viewport</span> width including the size of a rendered scroll bar (if any).</p>\
     5.8 +   "<p>The {@name} {@type} must return the <span>viewport</span> width including the size of a rendered scroll bar (if any), or zero if there is no\
     5.9 +   <span>viewport</span>.</p>\
    5.10      <div class='example'>\
    5.11       <p>The following snippet shows how to obtain the width of the viewport:</p>\
    5.12       <pre><code>var viewportWidth = innerWidth</code></pre>\
    5.13 @@ -35,13 +36,15 @@
    5.14    readonly attribute double innerWidth;
    5.15  
    5.16    [Documentation=
    5.17 -   "<p>The {@name} {@type} must return the <span>viewport</span> height including the size of a rendered scroll bar (if any).</p>"
    5.18 +   "<p>The {@name} {@type} must return the <span>viewport</span> height including the size of a rendered scroll bar (if any), or zero if there is no\
    5.19 +   <span>viewport</span>.</p>"
    5.20    ]
    5.21    readonly attribute double innerHeight;
    5.22  
    5.23    // viewport scrolling
    5.24    [Documentation=
    5.25 -   "<p>The {@name} {@type} attribute must return the x-coordinate, relative to the <span>initial containing block</span> origin, of the left of the <span>viewport</span>.</p>"
    5.26 +   "<p>The {@name} {@type} attribute must return the x-coordinate, relative to the <span>initial containing block</span> origin, of the left of the\
    5.27 +   <span>viewport</span>, or zero if there is no <span>viewport</span>.</p>"
    5.28    ]
    5.29    readonly attribute double scrollX;
    5.30  
    5.31 @@ -51,7 +54,8 @@
    5.32    readonly attribute double pageXOffset;
    5.33  
    5.34    [Documentation=
    5.35 -   "<p>The {@name} {@type} attribute must return the y-coordinate, relative to the <span>initial containing block</span> origin, of the top of the <span>viewport</span>.</p>"
    5.36 +   "<p>The {@name} {@type} attribute must return the y-coordinate, relative to the <span>initial containing block</span> origin, of the top of the\
    5.37 +    <span>viewport</span>, or zero if there is no <span>viewport</span>.</p>"
    5.38    ]
    5.39    readonly attribute double scrollY;
    5.40  
    5.41 @@ -64,6 +68,7 @@
    5.42     "<p>When the {@name} {@type} is invoked these steps must be run:</p>\
    5.43      <ol>\
    5.44       <li>\
    5.45 +     <li><p>If there is no <span>viewport</span>, abort these steps.\
    5.46        <dl>\
    5.47         <dt>If <span>document content</span> can have overflow to the right\
    5.48         <dd><p>Let <var title>x</var> be max(0, min(<var title>x</var>,\

mercurial