Navigation Menu

Skip to content

Commit

Permalink
[giow] (0) Also update the Touch object for hit regions
Browse files Browse the repository at this point in the history
Affected topics: Canvas, DOM APIs

git-svn-id: http://svn.whatwg.org/webapps@8546 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Mar 14, 2014
1 parent b32d147 commit b0b6b92
Show file tree
Hide file tree
Showing 3 changed files with 203 additions and 8 deletions.
67 changes: 64 additions & 3 deletions complete.html
Expand Up @@ -3808,6 +3808,12 @@ <h4 id=dependencies><span class=secno>2.2.2 </span>Dependencies</h4>
<li><dfn id=event-keyup title=event-keyup><code>keyup</code></dfn> event</li>
<li><dfn id=event-keypress title=event-keypress><code>keypress</code></dfn> event</li>

</ul><p>The following features are defined in the Touch Events specification: <a href=#refsTOUCH>[TOUCH]</a></p>

<ul class=brief><li><dfn id=touch><code>Touch</code></dfn> interface</li>

<li><dfn id=touch-point>Touch point</dfn> concept</li>

</ul><p>This specification sometimes uses the term <dfn title="">name</dfn> to refer to the event's
<code title=dom-event-type>type</code>; as in, "an event named <code title="">click</code>"
or "if the event name is <code title="">keypress</code>". The terms "name" and "type" for
Expand Down Expand Up @@ -59048,8 +59054,8 @@ <h6 id=hit-regions><span class=secno>4.12.4.2.15 </span>Hit regions</h6>
say to <i>act as normal</i>, that means that the event must be fired as it would have had these
requirements not been applied.</p>

<ol><li><p>If the pointing device is not indicating a pixel on the <code><a href=#the-canvas-element>canvas</a></code>, act as normal
and abort these steps.</li>
<ol><li><p>If the pointing device is not indicating a pixel on the <code><a href=#the-canvas-element>canvas</a></code>, then act as
normal and abort these steps.</li>

<li><p>If the <code><a href=#the-canvas-element>canvas</a></code> element has no <a href=#hit-region-list>hit region list</a>, then act as normal
and abort these steps.</li>
Expand Down Expand Up @@ -59077,7 +59083,58 @@ <h6 id=hit-regions><span class=secno>4.12.4.2.15 </span>Hit regions</h6>
<li><p>Continue dispatching the event, but with the updated event object and target as given in
the above steps.</li>

</ol><hr><p>When a user's pointing device cursor is positioned over a <code><a href=#the-canvas-element>canvas</a></code> element, user
</ol><hr></div>

<p>The <code><a href=#touch>Touch</a></code> interface is extended to support hit regions also: <a href=#refsTOUCH>[TOUCH]</a></p>

<pre class=idl>partial interface <a href=#touch id=Touch-partial>Touch</a> {
readonly attribute DOMString? <a href=#dom-touch-region title=dom-Touch-region>region</a>;
};</pre>

<dl class=domintro><dt><var title="">touch</var> . <code title=dom-Touch-region><a href=#dom-touch-region>region</a></code></dt>

<dd>

<p>If the <a href=#touch-point>touch point</a> was over a <a href=#hit-region>hit region</a> when it was first placed
on the surface, then this returns the <a href="#hit-region's-id">hit region's ID</a>, if it has one.</p>

<p>Otherwise, returns null.</p>

</dd>

</dl><div class=impl>

<p>The <dfn id=dom-touch-region title=dom-Touch-region><code>region</code></dfn> attribute on a <code><a href=#touch>Touch</a></code>
object representing a <a href=#touch-point>touch point</a> <var title="">T</var> must return the value
obtained by running the following algorithm when <var title="">T</var> was first placed on the
surface: <a href=#refsTOUCH>[TOUCH]</a></p>

<ol><li><p>If the <a href=#touch-point>touch point</a> is not on a pixel on the <code><a href=#the-canvas-element>canvas</a></code>, then return
null and abort these steps.</li>

<li><p>If the <code><a href=#the-canvas-element>canvas</a></code> element has no <a href=#hit-region-list>hit region list</a>, then return null
and abort these steps.</li>

<li><p>Let <var title="">pixel</var> be the pixel that the <a href=#touch-point>touch point</a> is
on.</li>

<li><p>Let <var title="">region</var> be the <a href=#hit-region>hit region</a> that is <a href=#the-region-for-a-pixel title="the
region for a pixel">the region for the pixel</a> <var title="">pixel</var> on this
<code><a href=#the-canvas-element>canvas</a></code> element's bitmap, if any.</li>

<li><p>If there is no <var title="">region</var>, then return null and abort these
steps.</li>

<li><p>Let <var title="">id</var> be the <var title="">region</var>'s <a href="#hit-region's-id" title="hit region's
ID">ID</a>, if any, or else null.</li>

<li><p>Return <var title="">id</var>.</li>

</ol></div>

<div class=impl>

<hr><p>When a user's pointing device cursor is positioned over a <code><a href=#the-canvas-element>canvas</a></code> element, user
agents should render the pointing device cursor according to the cursor specification described by
<a href=#the-cursor-for-a-hit-region title="the cursor for a hit region">the cursor for the hit region</a> that is <a href=#the-region-for-a-pixel title="the region for a pixel">the region for the pixel</a> that the pointing device designates
on the <code><a href=#the-canvas-element>canvas</a></code> element's bitmap.</p>
Expand Down Expand Up @@ -103487,6 +103544,7 @@ <h3 class="no-num">Reflecting IDL attributes</h3>
<li><code><a href=#texttrackcuelist>TextTrackCueList</a></code>
<li><code><a href=#texttracklist>TextTrackList</a></code>
<li><code><a href=#timeranges>TimeRanges</a></code>
<li><code>Touch</code>, <a href=#Touch-partial>partial</a>
<li><code><a href=#trackevent>TrackEvent</a></code>
<li><code><a href=#validitystate>ValidityState</a></code>
<li><code><a href=#videotrack>VideoTrack</a></code>
Expand Down Expand Up @@ -104095,6 +104153,9 @@ <h2 class=no-num id=references>References</h2><!--REFS-->
<dt id=refsTOR>[TOR]</dt>
<dd>(Non-normative) <cite><a href=https://www.torproject.org/>Tor</a></cite>.</dd>

<dt id=refsTOUCH>[TOUCH]</dt>
<dd><cite><a href=https://dvcs.w3.org/hg/webevents/raw-file/v1/touchevents.html>Touch Events</a></cite>, D. Schepers, S. Moon, M. Brubeck, A. Barstow. W3C.</dd>

<dt id=refsTZDATABASE>[TZDATABASE]</dt>
<dd>(Non-normative) <cite><a href=http://www.iana.org/time-zones>Time Zone Database</a></cite>. IANA.</dd>

Expand Down
67 changes: 64 additions & 3 deletions index
Expand Up @@ -3808,6 +3808,12 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
<li><dfn id=event-keyup title=event-keyup><code>keyup</code></dfn> event</li>
<li><dfn id=event-keypress title=event-keypress><code>keypress</code></dfn> event</li>

</ul><p>The following features are defined in the Touch Events specification: <a href=#refsTOUCH>[TOUCH]</a></p>

<ul class=brief><li><dfn id=touch><code>Touch</code></dfn> interface</li>

<li><dfn id=touch-point>Touch point</dfn> concept</li>

</ul><p>This specification sometimes uses the term <dfn title="">name</dfn> to refer to the event's
<code title=dom-event-type>type</code>; as in, "an event named <code title="">click</code>"
or "if the event name is <code title="">keypress</code>". The terms "name" and "type" for
Expand Down Expand Up @@ -59048,8 +59054,8 @@ partial dictionary <a href=#mouseeventinit>MouseEventInit</a> {
say to <i>act as normal</i>, that means that the event must be fired as it would have had these
requirements not been applied.</p>

<ol><li><p>If the pointing device is not indicating a pixel on the <code><a href=#the-canvas-element>canvas</a></code>, act as normal
and abort these steps.</li>
<ol><li><p>If the pointing device is not indicating a pixel on the <code><a href=#the-canvas-element>canvas</a></code>, then act as
normal and abort these steps.</li>

<li><p>If the <code><a href=#the-canvas-element>canvas</a></code> element has no <a href=#hit-region-list>hit region list</a>, then act as normal
and abort these steps.</li>
Expand Down Expand Up @@ -59077,7 +59083,58 @@ partial dictionary <a href=#mouseeventinit>MouseEventInit</a> {
<li><p>Continue dispatching the event, but with the updated event object and target as given in
the above steps.</li>

</ol><hr><p>When a user's pointing device cursor is positioned over a <code><a href=#the-canvas-element>canvas</a></code> element, user
</ol><hr></div>

<p>The <code><a href=#touch>Touch</a></code> interface is extended to support hit regions also: <a href=#refsTOUCH>[TOUCH]</a></p>

<pre class=idl>partial interface <a href=#touch id=Touch-partial>Touch</a> {
readonly attribute DOMString? <a href=#dom-touch-region title=dom-Touch-region>region</a>;
};</pre>

<dl class=domintro><dt><var title="">touch</var> . <code title=dom-Touch-region><a href=#dom-touch-region>region</a></code></dt>

<dd>

<p>If the <a href=#touch-point>touch point</a> was over a <a href=#hit-region>hit region</a> when it was first placed
on the surface, then this returns the <a href="#hit-region's-id">hit region's ID</a>, if it has one.</p>

<p>Otherwise, returns null.</p>

</dd>

</dl><div class=impl>

<p>The <dfn id=dom-touch-region title=dom-Touch-region><code>region</code></dfn> attribute on a <code><a href=#touch>Touch</a></code>
object representing a <a href=#touch-point>touch point</a> <var title="">T</var> must return the value
obtained by running the following algorithm when <var title="">T</var> was first placed on the
surface: <a href=#refsTOUCH>[TOUCH]</a></p>

<ol><li><p>If the <a href=#touch-point>touch point</a> is not on a pixel on the <code><a href=#the-canvas-element>canvas</a></code>, then return
null and abort these steps.</li>

<li><p>If the <code><a href=#the-canvas-element>canvas</a></code> element has no <a href=#hit-region-list>hit region list</a>, then return null
and abort these steps.</li>

<li><p>Let <var title="">pixel</var> be the pixel that the <a href=#touch-point>touch point</a> is
on.</li>

<li><p>Let <var title="">region</var> be the <a href=#hit-region>hit region</a> that is <a href=#the-region-for-a-pixel title="the
region for a pixel">the region for the pixel</a> <var title="">pixel</var> on this
<code><a href=#the-canvas-element>canvas</a></code> element's bitmap, if any.</li>

<li><p>If there is no <var title="">region</var>, then return null and abort these
steps.</li>

<li><p>Let <var title="">id</var> be the <var title="">region</var>'s <a href="#hit-region's-id" title="hit region's
ID">ID</a>, if any, or else null.</li>

<li><p>Return <var title="">id</var>.</li>

</ol></div>

<div class=impl>

<hr><p>When a user's pointing device cursor is positioned over a <code><a href=#the-canvas-element>canvas</a></code> element, user
agents should render the pointing device cursor according to the cursor specification described by
<a href=#the-cursor-for-a-hit-region title="the cursor for a hit region">the cursor for the hit region</a> that is <a href=#the-region-for-a-pixel title="the region for a pixel">the region for the pixel</a> that the pointing device designates
on the <code><a href=#the-canvas-element>canvas</a></code> element's bitmap.</p>
Expand Down Expand Up @@ -103487,6 +103544,7 @@ if (s = prompt('What is your name?')) {
<li><code><a href=#texttrackcuelist>TextTrackCueList</a></code>
<li><code><a href=#texttracklist>TextTrackList</a></code>
<li><code><a href=#timeranges>TimeRanges</a></code>
<li><code>Touch</code>, <a href=#Touch-partial>partial</a>
<li><code><a href=#trackevent>TrackEvent</a></code>
<li><code><a href=#validitystate>ValidityState</a></code>
<li><code><a href=#videotrack>VideoTrack</a></code>
Expand Down Expand Up @@ -104095,6 +104153,9 @@ if (s = prompt('What is your name?')) {
<dt id=refsTOR>[TOR]</dt>
<dd>(Non-normative) <cite><a href=https://www.torproject.org/>Tor</a></cite>.</dd>

<dt id=refsTOUCH>[TOUCH]</dt>
<dd><cite><a href=https://dvcs.w3.org/hg/webevents/raw-file/v1/touchevents.html>Touch Events</a></cite>, D. Schepers, S. Moon, M. Brubeck, A. Barstow. W3C.</dd>

<dt id=refsTZDATABASE>[TZDATABASE]</dt>
<dd>(Non-normative) <cite><a href=http://www.iana.org/time-zones>Time Zone Database</a></cite>. IANA.</dd>

Expand Down
77 changes: 75 additions & 2 deletions source
Expand Up @@ -2539,6 +2539,17 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d

</ul>

<p>The following features are defined in the Touch Events specification: <a
href="#refsTOUCH">[TOUCH]</a></p>

<ul class="brief">

<li><dfn><code>Touch</code></dfn> interface</li>

<li><dfn>Touch point</dfn> concept</li>

</ul>

<p>This specification sometimes uses the term <dfn data-x="">name</dfn> to refer to the event's
<code data-x="dom-event-type">type</code>; as in, "an event named <code data-x="">click</code>"
or "if the event name is <code data-x="">keypress</code>". The terms "name" and "type" for
Expand Down Expand Up @@ -65756,8 +65767,8 @@ partial dictionary <span>MouseEventInit</span> {

<ol>

<li><p>If the pointing device is not indicating a pixel on the <code>canvas</code>, act as normal
and abort these steps.</p></li>
<li><p>If the pointing device is not indicating a pixel on the <code>canvas</code>, then act as
normal and abort these steps.</p></li>

<li><p>If the <code>canvas</code> element has no <span>hit region list</span>, then act as normal
and abort these steps.</p></li>
Expand Down Expand Up @@ -65791,6 +65802,68 @@ partial dictionary <span>MouseEventInit</span> {

<hr>

</div>

<p>The <code>Touch</code> interface is extended to support hit regions also: <a
href="#refsTOUCH">[TOUCH]</a></p>

<pre class="idl">partial interface <span id="Touch-partial">Touch</span> {
readonly attribute DOMString? <span data-x="dom-Touch-region">region</span>;
};</pre>

<dl class="domintro">

<dt><var data-x="">touch</var> . <code data-x="dom-Touch-region">region</code></dt>

<dd>

<p>If the <span>touch point</span> was over a <span>hit region</span> when it was first placed
on the surface, then this returns the <span>hit region's ID</span>, if it has one.</p>

<p>Otherwise, returns null.</p>

</dd>

</dl>

<div class="impl">

<p>The <dfn data-x="dom-Touch-region"><code>region</code></dfn> attribute on a <code>Touch</code>
object representing a <span>touch point</span> <var data-x="">T</var> must return the value
obtained by running the following algorithm when <var data-x="">T</var> was first placed on the
surface: <a href="#refsTOUCH">[TOUCH]</a></p>

<ol>

<li><p>If the <span>touch point</span> is not on a pixel on the <code>canvas</code>, then return
null and abort these steps.</p></li>

<li><p>If the <code>canvas</code> element has no <span>hit region list</span>, then return null
and abort these steps.</p></li>

<li><p>Let <var data-x="">pixel</var> be the pixel that the <span>touch point</span> is
on.</p></li>

<li><p>Let <var data-x="">region</var> be the <span>hit region</span> that is <span data-x="the
region for a pixel">the region for the pixel</span> <var data-x="">pixel</var> on this
<code>canvas</code> element's bitmap, if any.</p></li>

<li><p>If there is no <var data-x="">region</var>, then return null and abort these
steps.</p></li>

<li><p>Let <var data-x="">id</var> be the <var data-x="">region</var>'s <span data-x="hit region's
ID">ID</span>, if any, or else null.</p></li>

<li><p>Return <var data-x="">id</var>.</p></li>

</ol>

</div>

<div class="impl">

<hr>

<p>When a user's pointing device cursor is positioned over a <code>canvas</code> element, user
agents should render the pointing device cursor according to the cursor specification described by
<span data-x="the cursor for a hit region">the cursor for the hit region</span> that is <span
Expand Down

0 comments on commit b0b6b92

Please sign in to comment.