Skip to content

Commit

Permalink
[giow] (2) Make contextmenu into a MouseEvent.
Browse files Browse the repository at this point in the history
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=10595

git-svn-id: http://svn.whatwg.org/webapps@5516 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Sep 26, 2010
1 parent ff5a519 commit e8cf661
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 145 deletions.
85 changes: 39 additions & 46 deletions complete.html
Expand Up @@ -50310,11 +50310,28 @@ <h5 id=context-menus><span class=secno>4.11.4.3 </span><dfn>Context menus</dfn><
<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>

<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>

<p class=note>Typically, therefore, the firing of the <code title=event-contextmenu>contextmenu</code> event will be the
<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>

Expand Down Expand Up @@ -65217,53 +65234,29 @@ <h5 id=event-firing><span class=secno>7.1.6.3 </span>Event firing</h5>
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>
Expand Down
85 changes: 39 additions & 46 deletions index
Expand Up @@ -50290,11 +50290,28 @@ interface <dfn>DataGridListener</dfn> {
<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>

<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>

<p class=note>Typically, therefore, the firing of the <code title=event-contextmenu>contextmenu</code> event will be the
<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>

Expand Down Expand Up @@ -65217,53 +65234,29 @@ interface <dfn id=function>Function</dfn> {
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>
Expand Down

0 comments on commit e8cf661

Please sign in to comment.