hixie: Make contextmenu into a MouseEvent. (whatwg r5516)

hixie: Make contextmenu into a MouseEvent. (whatwg r5516)

http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.4405&r2=1.4406&f=h
http://html5.org/tools/web-apps-tracker?from=5515&to=5516

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.4405
retrieving revision 1.4406
diff -u -d -r1.4405 -r1.4406
--- Overview.html 26 Sep 2010 17:34:14 -0000 1.4405
+++ Overview.html 26 Sep 2010 18:26:09 -0000 1.4406
@@ -39025,11 +39025,28 @@
   so identified.</span><div class="impl">
 
   <p>When an element's context menu is requested (e.g. by the user
-  right-clicking the element, or pressing a context menu key), the UA
-  must <a href="#fire-a-simple-event">fire a simple event</a> named <code title="event-contextmenu">contextmenu</code> that bubbles and is
-  cancelable at the element for which the menu was requested.</p>
+  right-clicking the element, or pressing a context menu key), the
+  user agent must apply the appropriate rules from the following
+  list:</p>
 
-  <p class="note">Typically, therefore, the firing of the <code title="event-contextmenu">contextmenu</code> event will be the
+  <dl class="switch"><dt>If the user requested a context menu using a pointing device</dt>
+
+   <dd><p>The user agent must dispatch an event with the name <code title="event-contextmenu">contextmenu</code>, that bubbles and is
+   cancelable, and that uses the <code>MouseEvent</code> interface, at
+   the element for which the menu was requested. The context
+   information of the event must be set to the same values as the last
+   <code>MouseEvent</code> user interaction event that was dispatched
+   as part of the gesture that that was interpreted as a request for
+   the context menu.</dd>
+
+   <dt>Otherwise</dt>
+
+   <dd><p>The user agent must <a href="#fire-a-synthetic-mouse-event" title="fire a synthetic mouse
+   event">fire a synthetic mouse event named <code title="event-contextmenu">contextmenu</code></a> that bubbles
+   and is cancelable at the element for which the menu was
+   requested.</dd>
+
+  </dl><p class="note">Typically, therefore, the firing of the <code title="event-contextmenu">contextmenu</code> event will be the
   default action of a <code title="mouseup">mouseup</code> or <code title="event-keyup">keyup</code> event. The exact sequence of events
   is UA-dependent, as it will vary based on platform conventions.</p>
 
@@ -47911,53 +47928,29 @@
   firing a <code title="event-click"><a href="#event-click">click</a></code> event on the
   element. <a href="#refsDOMEVENTS">[DOMEVENTS]</a></p>
 
-  <p><dfn id="fire-a-click-event" title="fire a click event">Firing a <code title="event-click">click</code> event</dfn> means that a <code title="event-click"><a href="#event-click">click</a></code> event, which bubbles and is
-  cancelable, and which uses the <code>MouseEvent</code> interface,
-  must be dispatched at the given target. The event object must have
-  its <code title="">screenX</code>, <code title="">screenY</code>,
-  <code title="">clientX</code>, <code title="">clientY</code>, and
-  <code title="">button</code> attributes set to 0, its <code title="">ctrlKey</code>, <code title="">shiftKey</code>, <code title="">altKey</code>, and <code title="">metaKey</code> attributes
-  set according to the current state of the key input device, if any
-  (false for any keys that are not available), its <code title="">detail</code> attribute set to 1, and its <code title="">relatedTarget</code> attribute set to null. The <code title="">getModifierState()</code> method on the object must return
-  values appropriately describing the state of the key input device at
-  the time the event is created.</p>
-
   <p><dfn id="fire-a-simple-event" title="fire a simple event">Firing a simple event named <var title="">e</var></dfn> means that an event with the name <var title="">e</var>, which does not bubble (except where otherwise
   stated) and is not cancelable (except where otherwise stated), and
   which uses the <code><a href="#event">Event</a></code> interface, must be dispatched at
   the given target.</p>
 
-<!--
-  <p><dfn title="fire a progress event">Firing a progress event named
-  <var title="">e</var></dfn>, optionally in the context of a
-  particular instance of the <span title="fetch">fetching
-  algorithm</span>, means that an event with the name <var
-  title="">e</var>, which does not bubble (except where otherwise
-  stated) and is not cancelable (except where otherwise stated), and
-  which uses the <code>ProgressEvent</code> interface, must be
-  dispatched at the given target element. If there is a <span
-  title="fetch">fetching algorithm</span>, and the <span>URL</span>
-  being <span title="fetch">fetched</span> has the <span>same
-  origin</span> as the <code>Document</code> of the target element,
-  then the <code
-  title="dom-ProgressEvents-lengthComputable">lengthComputable</code>
-  attribute must be set to true if the <span title="fetch">fetching
-  algorithm</span>'s subject has a known <span
-  title="concept-fetch-total">size</span>; the <code
-  title="dom-ProgressEvents-total">total</code> attribute must be set
-  to the subject's <span title="concept-fetch-total">size</span> if it
-  is known and zero otherwise; and the <code
-  title="dom-ProgressEvents-loaded">loaded</code> attribute must be
-  set to the <span title="concept-fetch-loaded">number of bytes
-  downloaded</span>, excluding HTTP headers <span
-  title="concept-http-equivalent-headers">or
-  equivalent</span>. Otherwise, the <code
-  title="dom-ProgressEvents-lengthComputable">lengthComputable</code>
-  attribute must be set to false, and the <code
-  title="dom-ProgressEvents-total">total</code> and the <code
-  title="dom-ProgressEvents-loaded">loaded</code> attributes must be
-  set to zero. <a href="#r-e-f-sPROGRESS">[PROGRESS]</a></p>
-(also fix reference in line above)-->
+  <p><dfn id="fire-a-synthetic-mouse-event" title="fire a synthetic mouse event">Firing a synthetic
+  mouse event named <var title="">e</var></dfn> means that an event
+  with the name <var title="">e</var>, which does not bubble (except
+  where otherwise stated) and is not cancelable (except where
+  otherwise stated), and which uses the <code>MouseEvent</code>
+  interface, must be dispatched at the given target. The event object
+  must have its <code title="">screenX</code>, <code title="">screenY</code>, <code title="">clientX</code>, <code title="">clientY</code>, and <code title="">button</code> attributes
+  set to 0, its <code title="">ctrlKey</code>, <code title="">shiftKey</code>, <code title="">altKey</code>, and <code title="">metaKey</code> attributes set according to the current
+  state of the key input device, if any (false for any keys that are
+  not available), its <code title="">detail</code> attribute set to 1,
+  and its <code title="">relatedTarget</code> attribute set to null.
+  The <code title="">getModifierState()</code> method on the object
+  must return values appropriately describing the state of the key
+  input device at the time the event is created.</p>
+
+  <p><dfn id="fire-a-click-event" title="fire a click event">Firing a <code title="event-click">click</code> event</dfn> means <a href="#fire-a-synthetic-mouse-event" title="fire
+  a synthetic mouse event">firing a synthetic mouse event named <code title="event-click">click</code></a>, which bubbles and is
+  cancelable.</p>
 
   <p>The default action of these events is to do nothing except where
   otherwise stated.</p>

Received on Sunday, 26 September 2010 18:27:21 UTC