Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Define dictionary defaults for events. Clean up createEvent(). Note i…

  • Loading branch information...
commit 508b3d58eb9df5250cc42cefa71062945c154ef0 1 parent 559d925
@annevk annevk authored
Showing with 43 additions and 49 deletions.
  1. +20 −23 Overview.src.html
  2. +23 −26 dom-core.html
View
43 Overview.src.html
@@ -732,8 +732,8 @@ <h2 class=no-num>Goals</h2>
};
dictionary <dfn>EventInit</dfn> {
- boolean <span title=dom-EventInit-bubbles>bubbles</span>;
- boolean <span title=dom-EventInit-cancelable>cancelable</span>;
+ boolean <span title=dom-EventInit-bubbles>bubbles</span> = false;
+ boolean <span title=dom-EventInit-cancelable>cancelable</span> = false;
};</pre>
<p>An <dfn title=concept-event>event</dfn> allows for signaling that
@@ -883,7 +883,9 @@ <h2 class=no-num>Goals</h2>
<dfn title=dom-Event-cancelable><code>cancelable</code></dfn> attributes
must return the values they were initialized to. When an
<span title=concept-event>event</span> is created, they must be initialized
-to false.
+to false. <span class=note>The <code>EventInit</code> dictionary is not sufficient due to
+the existence of the legacy
+<code title=dom-Document-createEvent>createEvent()</code>.</span>
<p>The
<dfn title=dom-Event-preventDefault><code>preventDefault()</code></dfn>
@@ -956,7 +958,7 @@ <h2 class=no-num>Goals</h2>
};
dictionary <dfn>CustomEventInit</dfn> : <span>EventInit</span> {
- any <span title=dom-CustomEventInit-detail>detail</span>;
+ any <span title=dom-CustomEventInit-detail>detail</span> = null;
};</pre>
<p><span title=concept-event>Events</span> using the
@@ -979,7 +981,9 @@ <h2 class=no-num>Goals</h2>
<p>The <dfn title=dom-CustomEvent-detail><code>detail</code></dfn> attribute
must return the value it was initialized to. When an
<span title=concept-event>event</span> is created the attribute must be
-initialized to null.
+initialized to null. <span class=note>The <code>CustomEventInit</code> dictionary is not
+sufficient due to the existence of the legacy
+<code title=dom-Document-createEvent>createEvent()</code>.</span>
<p>The
<dfn title=dom-CustomEvent-initCustomEvent><code>initCustomEvent(<var title>type</var>, <var title>bubbles</var>, <var title>cancelable</var>, <var title>details</var>)</code></dfn>
@@ -4374,7 +4378,6 @@ <h2 class=no-num>Goals</h2>
<hr>
-<!-- no "domintro" because better to use constructors -->
<p>The
<dfn title=dom-Document-createEvent><code>createEvent(<var title>interface</var>)</code></dfn>
method must run these steps:
@@ -4390,32 +4393,26 @@ <h2 class=no-num>Goals</h2>
<table>
<thead>
- <tr><th>String<th>Interface
+ <tr><th>String<th>Interface<td>Notes
<tbody>
+ <tr><td>"<code title>customevent</code>"<td><code>CustomEvent</code><td rowspan=4>
<tr><td>"<code title>event</code>"<td rowspan=3><code>Event</code>
<tr><td>"<code title>events</code>"
<tr><td>"<code title>htmlevents</code>"
- <tr><td>"<code title>mouseevent</code>"<td rowspan=2><code>MouseEvent</code>
+ <tr><td>"<code title>mouseevent</code>"<td rowspan=2><code>MouseEvent</code><td rowspan=4><span data-anolis-ref>UIEVENTS</span>
<tr><td>"<code title>mouseevents</code>"
- <!--
- <tr><td>"<code title>mutationevent</code>"<td rowspan=2><code>MutationEvent</code>
- <tr><td>"<code title>mutationevents</code>"
- -->
<tr><td>"<code title>uievent</code>"<td rowspan=2><code>UIEvent</code>
<tr><td>"<code title>uievents</code>"
</table>
+ <!-- XXX WebKit's architecture is broken here and both browsers support more than DOM.
+ http://trac.webkit.org/browser/trunk/Source/WebCore/dom/EventNames.in
+ http://mxr.mozilla.org/mozilla-central/source/content/events/src/nsEventDispatcher.cpp#819 -->
- <li>
- <p>If <var title>event</var> is null or an interface that is not
- supported, <span title=concept-throw>throw</span> a
- "<code>NotSupportedError</code>" and terminate these steps.
-
- <p class=note>In practice all user agents will support the
- <code>MouseEvent</code> and <code>UIEvent</code> interface, but this
- specification is not going to require that to avoid a needless dependency.
+ <li><p>If <var title>event</var> is null, <span title=concept-throw>throw</span> a
+ "<code>NotSupportedError</code>".
- <li><p>Create an <span title=concept-event>event</span> implementing the
- <var title>event</var> interface and return it.
+ <li><p>Return a new <span title=concept-event>event</span> implementing the
+ <var title>event</var> interface.
</ol>
<p class="note"><span title=concept-event>Event</span> constructors can be used instead.
@@ -8745,7 +8742,7 @@ <h2 class=no-num>Goals</h2>
"Mutation Name Event Types" chapters of <cite>DOM Level 3 Events</cite>. The
other chapters are defined by the <cite>UI Events</cite> specification.
<span class=informative data-anolis-ref>DOM3EVENTS</span>
-<span class=informative data-anolis-ref>UIEVENTS</span>
+<span data-anolis-ref>UIEVENTS</span>
<ul class=brief>
<li>Events have constructors now.
View
49 dom-core.html
@@ -11,7 +11,7 @@
<p><a class="logo" href="//www.whatwg.org/"><img alt="WHATWG" height="100" src="//resources.whatwg.org/logo-dom.svg" width="100"></a></p>
<h1>DOM</h1>
-<h2 class="no-num no-toc" id="living-standard-—-last-updated-21-february-2013">Living Standard — Last Updated 21 February 2013</h2>
+<h2 class="no-num no-toc" id="living-standard-—-last-updated-22-february-2013">Living Standard — Last Updated 22 February 2013</h2>
<dl>
<dt>This Version:
@@ -45,7 +45,7 @@ <h2 class="no-num no-toc" id="living-standard-—-last-updated-21-february-2013"
<p class="copyright"><a href="http://creativecommons.org/publicdomain/zero/1.0/" rel="license"><img alt="CC0" src="http://i.creativecommons.org/p/zero/1.0/80x15.png"></a>
To the extent possible under law, the editors have waived all copyright and
related or neighboring rights to this work. In addition, as of
-21 February 2013, the editors have made this specification available
+22 February 2013, the editors have made this specification available
under the
<a href="http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0" rel="license">Open Web Foundation Agreement Version 1.0</a>,
which is available at
@@ -805,8 +805,8 @@ <h3 id="interface-event"><span class="secno">4.2 </span>Interface <code><a href=
};
dictionary <dfn id="eventinit">EventInit</dfn> {
- boolean <span title="dom-EventInit-bubbles">bubbles</span>;
- boolean <span title="dom-EventInit-cancelable">cancelable</span>;
+ boolean <span title="dom-EventInit-bubbles">bubbles</span> = false;
+ boolean <span title="dom-EventInit-cancelable">cancelable</span> = false;
};</pre>
<p>An <dfn id="concept-event" title="concept-event">event</dfn> allows for signaling that
@@ -956,7 +956,9 @@ <h3 id="interface-event"><span class="secno">4.2 </span>Interface <code><a href=
<dfn id="dom-event-cancelable" title="dom-Event-cancelable"><code>cancelable</code></dfn> attributes
must return the values they were initialized to. When an
<a href="#concept-event" title="concept-event">event</a> is created, they must be initialized
-to false.
+to false. <span class="note">The <code><a href="#eventinit">EventInit</a></code> dictionary is not sufficient due to
+the existence of the legacy
+<code title="dom-Document-createEvent"><a href="#dom-document-createevent">createEvent()</a></code>.</span>
<p>The
<dfn id="dom-event-preventdefault" title="dom-Event-preventDefault"><code>preventDefault()</code></dfn>
@@ -1029,7 +1031,7 @@ <h3 id="interface-customevent"><span class="secno">4.3 </span>Interface <code><a
};
dictionary <dfn id="customeventinit">CustomEventInit</dfn> : <a href="#eventinit">EventInit</a> {
- any <span title="dom-CustomEventInit-detail">detail</span>;
+ any <span title="dom-CustomEventInit-detail">detail</span> = null;
};</pre>
<p><a href="#concept-event" title="concept-event">Events</a> using the
@@ -1052,7 +1054,9 @@ <h3 id="interface-customevent"><span class="secno">4.3 </span>Interface <code><a
<p>The <dfn id="dom-customevent-detail" title="dom-CustomEvent-detail"><code>detail</code></dfn> attribute
must return the value it was initialized to. When an
<a href="#concept-event" title="concept-event">event</a> is created the attribute must be
-initialized to null.
+initialized to null. <span class="note">The <code><a href="#customeventinit">CustomEventInit</a></code> dictionary is not
+sufficient due to the existence of the legacy
+<code title="dom-Document-createEvent"><a href="#dom-document-createevent">createEvent()</a></code>.</span>
<p>The
<dfn id="dom-customevent-initcustomevent" title="dom-CustomEvent-initCustomEvent"><code>initCustomEvent(<var title="">type</var>, <var title="">bubbles</var>, <var title="">cancelable</var>, <var title="">details</var>)</code></dfn>
@@ -4442,7 +4446,6 @@ <h3 id="interface-document"><span class="secno">5.5 </span>Interface <code><a hr
<hr>
-<!-- no "domintro" because better to use constructors -->
<p>The
<dfn id="dom-document-createevent" title="dom-Document-createEvent"><code>createEvent(<var title="">interface</var>)</code></dfn>
method must run these steps:
@@ -4458,32 +4461,26 @@ <h3 id="interface-document"><span class="secno">5.5 </span>Interface <code><a hr
<table>
<thead>
- <tr><th>String<th>Interface
+ <tr><th>String<th>Interface<td>Notes
<tbody>
+ <tr><td>"<code title="">customevent</code>"<td><code><a href="#customevent">CustomEvent</a></code><td rowspan="4">
<tr><td>"<code title="">event</code>"<td rowspan="3"><code><a href="#event">Event</a></code>
<tr><td>"<code title="">events</code>"
<tr><td>"<code title="">htmlevents</code>"
- <tr><td>"<code title="">mouseevent</code>"<td rowspan="2"><code>MouseEvent</code>
+ <tr><td>"<code title="">mouseevent</code>"<td rowspan="2"><code>MouseEvent</code><td rowspan="4"><a href="#refsUIEVENTS">[UIEVENTS]</a>
<tr><td>"<code title="">mouseevents</code>"
- <!--
- <tr><td>"<code title>mutationevent</code>"<td rowspan=2><code>MutationEvent</code>
- <tr><td>"<code title>mutationevents</code>"
- -->
<tr><td>"<code title="">uievent</code>"<td rowspan="2"><code>UIEvent</code>
<tr><td>"<code title="">uievents</code>"
</table>
+ <!-- XXX WebKit's architecture is broken here and both browsers support more than DOM.
+ http://trac.webkit.org/browser/trunk/Source/WebCore/dom/EventNames.in
+ http://mxr.mozilla.org/mozilla-central/source/content/events/src/nsEventDispatcher.cpp#819 -->
- <li>
- <p>If <var title="">event</var> is null or an interface that is not
- supported, <a href="#concept-throw" title="concept-throw">throw</a> a
- "<code><a href="#notsupportederror">NotSupportedError</a></code>" and terminate these steps.
-
- <p class="note">In practice all user agents will support the
- <code>MouseEvent</code> and <code>UIEvent</code> interface, but this
- specification is not going to require that to avoid a needless dependency.
+ <li><p>If <var title="">event</var> is null, <a href="#concept-throw" title="concept-throw">throw</a> a
+ "<code><a href="#notsupportederror">NotSupportedError</a></code>".
- <li><p>Create an <a href="#concept-event" title="concept-event">event</a> implementing the
- <var title="">event</var> interface and return it.
+ <li><p>Return a new <a href="#concept-event" title="concept-event">event</a> implementing the
+ <var title="">event</var> interface.
</ol>
<p class="note"><a href="#concept-event" title="concept-event">Event</a> constructors can be used instead.
@@ -8771,7 +8768,7 @@ <h3 id="dom-events"><span class="secno">10.1 </span>DOM Events</h3>
"Mutation Name Event Types" chapters of <cite>DOM Level 3 Events</cite>. The
other chapters are defined by the <cite>UI Events</cite> specification.
<a class="informative" href="#refsDOM3EVENTS">[DOM3EVENTS]</a>
-<a class="informative" href="#refsUIEVENTS">[UIEVENTS]</a>
+<a href="#refsUIEVENTS">[UIEVENTS]</a>
<ul class="brief">
<li>Events have constructors now.
@@ -9003,7 +9000,7 @@ <h2 class="no-num" id="references">References</h2>
<dd><cite><a href="http://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a></cite>, Scott Bradner. IETF.
<dt id="refsUIEVENTS">[UIEVENTS]
-<dd>(Non-normative) <cite><a href="https://dvcs.w3.org/hg/d4e/raw-file/tip/source_respec.htm">UI Events</a></cite>, Gary Kacmarcik and Travis Leithead. W3C.
+<dd><cite><a href="https://dvcs.w3.org/hg/d4e/raw-file/tip/source_respec.htm">UI Events</a></cite>, Gary Kacmarcik and Travis Leithead. W3C.
<dt id="refsURL">[URL]
<dd><cite><a href="http://url.spec.whatwg.org/">URL Standard</a></cite>, Anne van Kesteren. WHATWG.
Please sign in to comment.
Something went wrong with that request. Please try again.