Skip to content

Commit 901a71d

Browse files
author
Simon Pieters
committed
[cssom-view] Add document.elementsFromPoint(). https://www.w3.org/Bugs/Public/show_bug.cgi?id=19753
1 parent e1c8cba commit 901a71d

2 files changed

Lines changed: 28 additions & 2 deletions

File tree

cssom-view/Overview.html

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
<h1>CSSOM View Module</h1>
2727

28-
<h2 class="no-num no-toc" id="w3c-doctype">Editor's Draft 20 June 2013</h2>
28+
<h2 class="no-num no-toc" id="w3c-doctype">Editor's Draft 24 June 2013</h2>
2929

3030
<dl>
3131

@@ -92,7 +92,7 @@ <h2 class="no-num no-toc" id="sotd">Status of This Document</h2>
9292
can be found in the <a href="http://www.w3.org/TR/">W3C technical reports
9393
index at http://www.w3.org/TR/.</a></em>
9494

95-
<p>This is the 20 June 2013 Editor's Draft of CSSOM View. Please send
95+
<p>This is the 24 June 2013 Editor's Draft of CSSOM View. Please send
9696
comments to
9797
<a href="mailto:www-style@w3.org?subject=%5Bcssom-view%5D%20">www-style@w3.org</a>
9898
(<a href="http://lists.w3.org/Archives/Public/www-style/">archived</a>)
@@ -717,6 +717,7 @@ <h2 id="extensions-to-the-document-interface"><span class="secno">6 </span>Exten
717717

718718
<pre class="idl">partial interface <a class="external" data-anolis-spec="dom" href="http://dom.spec.whatwg.org/#document">Document</a> {
719719
<a class="external" data-anolis-spec="dom" href="http://dom.spec.whatwg.org/#element">Element</a>? <a href="#dom-document-elementfrompoint" title="dom-Document-elementFromPoint">elementFromPoint</a>(double x, double y);
720+
sequence&lt;<a class="external" data-anolis-spec="dom" href="http://dom.spec.whatwg.org/#element">Element</a>&gt; <a href="#dom-document-elementsfrompoint" title="dom-Document-elementsFromPoint">elementsFromPoint</a>(double x, double y);
720721
<a href="#caretposition">CaretPosition</a>? <a href="#dom-document-caretpositionfrompoint" title="dom-Document-caretPositionFromPoint">caretPositionFromPoint</a>(double x, double y);
721722
};</pre>
722723

@@ -727,6 +728,16 @@ <h2 id="extensions-to-the-document-interface"><span class="secno">6 </span>Exten
727728
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
728729
<a href="#viewport">viewport</a> associated with the document, the method must return null.</p>
729730

731+
<p class="note">The <code title="dom-Document-elementFromPoint"><a href="#dom-document-elementfrompoint">elementFromPoint()</a></code> method does not necessarily return the top-most painted element. For
732+
instnace, an element can be excluded from being a target for hit testing by using the 'pointer-events' CSS property.
733+
734+
<p class="atrisk">The <dfn id="dom-document-elementsfrompoint" title="dom-Document-elementsFromPoint"><code>elementsFromPoint(<var>x</var>, <var>y</var>)</code></dfn> method must return a sequence of
735+
elements at coordinates <var>x</var>,<var>y</var> in the <a href="#viewport">viewport</a>. The sequence to be returned is sorted by paint order, with the first element as
736+
the topmost in the order. If either argument is negative, <var>x</var> is greater than the <a href="#viewport">viewport</a> width excluding the size of a rendered scroll
737+
bar (if any), or <var>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 an
738+
empty sequence. If there is no element at the given position the method must return a sequence containing the root element, if any, or an empty sequence
739+
otherwise. If there is no <a href="#viewport">viewport</a> associated with the document, the method must return an empty sequence.
740+
730741
<p>The <dfn id="dom-document-caretpositionfrompoint" title="dom-Document-caretPositionFromPoint"><code>caretPositionFromPoint(<var>x</var>, <var>y</var>)</code></dfn> method must return the
731742
result of running these steps:</p>
732743
<ol>
@@ -1549,10 +1560,12 @@ <h2 class="no-num" id="acknowledgments">Acknowledgments</h2>
15491560

15501561
<p>The editors would like to thank
15511562

1563+
Alan Stearns,
15521564
Alexey Feldgendler,
15531565
Björn Höhrmann,
15541566
Dan Bates,
15551567
David Vest,
1568+
Elliott Sprehn,
15561569
Garrett Smith,
15571570
Hallvord R. M. Steen,
15581571
Leif Arne Storset,

cssom-view/Overview.src.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,7 @@ <h2>Extensions to the <code title>Document</code> Interface</h2>
679679

680680
<pre class=idl>partial interface <span data-anolis-spec=dom>Document</span> {
681681
<span data-anolis-spec=dom>Element</span>? <span title=dom-Document-elementFromPoint>elementFromPoint</span>(double x, double y);
682+
sequence&lt;<span data-anolis-spec=dom>Element</span>> <span title=dom-Document-elementsFromPoint>elementsFromPoint</span>(double x, double y);
682683
<span>CaretPosition</span>? <span title=dom-Document-caretPositionFromPoint>caretPositionFromPoint</span>(double x, double y);
683684
};</pre>
684685

@@ -689,6 +690,16 @@ <h2>Extensions to the <code title>Document</code> Interface</h2>
689690
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
690691
<span>viewport</span> associated with the document, the method must return null.</p>
691692

693+
<p class=note>The <code title=dom-Document-elementFromPoint>elementFromPoint()</code> method does not necessarily return the top-most painted element. For
694+
instnace, an element can be excluded from being a target for hit testing by using the 'pointer-events' CSS property.
695+
696+
<p class=atrisk>The <dfn title=dom-Document-elementsFromPoint><code>elementsFromPoint(<var>x</var>, <var>y</var>)</code></dfn> method must return a sequence of
697+
elements at coordinates <var>x</var>,<var>y</var> in the <span>viewport</span>. The sequence to be returned is sorted by paint order, with the first element as
698+
the topmost in the order. If either argument is negative, <var>x</var> is greater than the <span>viewport</span> width excluding the size of a rendered scroll
699+
bar (if any), or <var>y</var> is greater than the <span>viewport</span> height excluding the size of a rendered scroll bar (if any), the method must return an
700+
empty sequence. If there is no element at the given position the method must return a sequence containing the root element, if any, or an empty sequence
701+
otherwise. If there is no <span>viewport</span> associated with the document, the method must return an empty sequence.
702+
692703
<p>The <dfn title=dom-Document-caretPositionFromPoint><code>caretPositionFromPoint(<var>x</var>, <var>y</var>)</code></dfn> method must return the
693704
result of running these steps:</p>
694705
<ol>
@@ -1491,10 +1502,12 @@ <h2 class="no-num">Acknowledgments</h2>
14911502

14921503
<p>The editors would like to thank
14931504

1505+
Alan Stearns,
14941506
Alexey Feldgendler,
14951507
Bj&ouml;rn H&ouml;hrmann,
14961508
Dan Bates,
14971509
David Vest,
1510+
Elliott Sprehn,
14981511
Garrett Smith,
14991512
Hallvord R. M. Steen,
15001513
Leif Arne Storset,

0 commit comments

Comments
 (0)