Skip to content

Commit 4ef097f

Browse files
committed
caretRangeFromPoint per CSSWG resolution
1 parent 85c326d commit 4ef097f

2 files changed

Lines changed: 41 additions & 8 deletions

File tree

cssom-view/Overview.html

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828

2929
<h1 id=cssom-view-module>CSSOM View Module</h1>
3030

31-
<h2 class="no-num no-toc" id=w3c-doctype>Editor's Draft 9 April 2008</h2>
31+
<h2 class="no-num no-toc" id=w3c-doctype>Editor's Draft 24 April 2008</h2>
3232

3333
<dl>
3434
<dt>This Version:
3535

3636
<dd><a
37-
href="http://www.w3.org/TR/2008/ED-cssom-view-20080409/">http://www.w3.org/TR/2008/ED-cssom-view-20080409/</a>
37+
href="http://www.w3.org/TR/2008/ED-cssom-view-20080424/">http://www.w3.org/TR/2008/ED-cssom-view-20080424/</a>
3838

3939
<dt>Latest Version:
4040

@@ -549,7 +549,8 @@ <h2 id=the-documentview-interface><span class=secno>6. </span>The <code
549549

550550
<pre class=idl>interface <dfn id=documentview>DocumentView</dfn> {
551551
readonly attribute <a href="#abstractview">AbstractView</a> <a href="#documentview-defaultview">defaultView</a>;
552-
Element <a href="#documentview-elementfrompoint">elementFromPoint</a>(in unsigned long <var title="">x</var>, in unsigned long <var title="">y</var>);
552+
Element <a href="#documentview-elementfrompoint">elementFromPoint</a>(in float <var title="">x</var>, in float <var title="">y</var>);
553+
Range <a href="#documentview-caretrangefrompoint">caretRangeFromPoint</a>(in float <var title="">x</var>, in float <var title="">y</var>);
553554
};</pre>
554555

555556
<p>The <dfn id=documentview-defaultview><code>defaultView</code></dfn>
@@ -570,10 +571,27 @@ <h2 id=the-documentview-interface><span class=secno>6. </span>The <code
570571
than the <a href="#viewport">viewport</a> height, the method <em
571572
class=ct>must</em> return <code>null</code>. If there is no element at the
572573
given position the method <em class=ct>must</em> return the root element,
573-
if any, or <code>null</code> otherwise.
574+
if any, or <code>null</code> otherwise. [<cite><a
575+
href="#ref-dom2tr">DOM2TR</a></cite>]
576+
577+
<p>The <dfn id=documentview-caretrangefrompoint
578+
title=caretrangefrompoint><code>caretRangeFromPoint(<var title="">x</var>,
579+
<var title="">y</var>)</code></dfn> method, when invoked, <em
580+
class=ct>must</em> return an empty text range for the position where a
581+
text insertion point indicator would have been placed if editing was
582+
enabled and hit testing was performed at the coordinates
583+
<var>x</var>,<var>y</var> in the <a href="#viewport">viewport</a>. If
584+
either argument is negative, <var title="">x</var> is greater than the <a
585+
href="#viewport">viewport</a> width, <var title="">y</var> is greather
586+
than the <a href="#viewport">viewport</a> height, or editing is not
587+
supported, the method <em class=ct>must</em> return <code>null</code>.
574588

575589
<p class=note>The specifics of hit testing are out of scope of this
576-
specification. Hit testing might be defined in a future revision of CSS or
590+
specification and therefore the exact details of <code><a
591+
href="#documentview-elementfrompoint">elementFromPoint()</a></code> and
592+
<code><a
593+
href="#documentview-caretrangefrompoint">caretRangeFromPoint()</a></code>
594+
are too. Hit testing might be defined in a future revision of CSS or
577595
HTML&nbsp;5.
578596

579597
<h2 id=the-elementview-interface><span class=secno>7. </span>The <code

cssom-view/Overview.src.html

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,8 @@ <h2 id="the-documentview-interface">The <code title="">DocumentView</code> Inter
437437

438438
<pre class="idl">interface <dfn id="documentview">DocumentView</dfn> {
439439
readonly attribute <span>AbstractView</span> <span>defaultView</span>;
440-
Element <span>elementFromPoint</span>(in unsigned long <var title="">x</var>, in unsigned long <var title="">y</var>);
440+
Element <span>elementFromPoint</span>(in float <var title="">x</var>, in float <var title="">y</var>);
441+
Range <span>caretRangeFromPoint</span>(in float <var title="">x</var>, in float <var title="">y</var>);
441442
};</pre>
442443

443444
<p>The <dfn id="documentview-defaultview"><code>defaultView</code></dfn>
@@ -458,10 +459,24 @@ <h2 id="the-documentview-interface">The <code title="">DocumentView</code> Inter
458459
height, the method <em class="ct">must</em> return <code>null</code>. If
459460
there is no element at the given position the method
460461
<em class="ct">must</em> return the root element, if any, or
461-
<code>null</code> otherwise.</p>
462+
<code>null</code> otherwise. [<cite><span>DOM2TR</span></cite>]</p>
463+
464+
<p>The
465+
<dfn id="documentview-caretrangefrompoint" title="caretrangefrompoint"><code>caretRangeFromPoint(<var title="">x</var>,
466+
<var title="">y</var>)</code></dfn> method, when invoked,
467+
<em class="ct">must</em> return an empty text range for the position where
468+
a text insertion point indicator would have been placed if editing was
469+
enabled and hit testing was performed at the coordinates
470+
<var>x</var>,<var>y</var> in the <span>viewport</span>. If either argument
471+
is negative, <var title="">x</var> is greater than the
472+
<span>viewport</span> width, <var title="">y</var> is greather than the
473+
<span>viewport</span> height, or editing is not supported, the method
474+
<em class="ct">must</em> return <code>null</code>.</p>
462475

463476
<p class="note">The specifics of hit testing are out of scope of this
464-
specification. Hit testing might be defined in a future revision of CSS or
477+
specification and therefore the exact details of
478+
<code>elementFromPoint()</code> and <code>caretRangeFromPoint()</code> are
479+
too. Hit testing might be defined in a future revision of CSS or
465480
HTML&nbsp;5.</p>
466481

467482

0 commit comments

Comments
 (0)