Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event-based form participation #4239

Merged
merged 4 commits into from
Jan 8, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -3410,6 +3410,8 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<li><dfn data-x="dom-ProgressEvent-loaded" data-x-href="https://xhr.spec.whatwg.org/#dom-progressevent-loaded"><code>ProgressEvent.loaded</code></dfn> attribute</li>
<li><dfn data-x="dom-ProgressEvent-total" data-x-href="https://xhr.spec.whatwg.org/#dom-progressevent-total"><code>ProgressEvent.total</code></dfn> attribute</li>
<li><dfn data-x="fire a progress event" data-x-href="https://xhr.spec.whatwg.org/#concept-event-fire-progress">Fire a progress event named <var>e</var></dfn></li>
<li><dfn data-x-href="https://xhr.spec.whatwg.org/#formdata"><code>FormData</code></dfn>
interface</li>
<li>The concept of <dfn data-x="formdata-entry" data-x-href="https://xhr.spec.whatwg.org/#concept-formdata-entry">entry</dfn></li>
<li><dfn data-x-href="https://xhr.spec.whatwg.org/#create-an-entry">create an entry</dfn></li>
</ul>
Expand Down Expand Up @@ -55784,6 +55786,9 @@ fur

<h5>Form submission algorithm</h5>

<p>Each of <code>form</code> elements has a flag named <var>constructing entry list</var>
tkent-google marked this conversation as resolved.
Show resolved Hide resolved
initialized to false.</p>

<p>When a <code>form</code> element <var>form</var> is <dfn
data-x="concept-form-submit">submitted</dfn> from an element <var>submitter</var>
(typically a button), optionally with a <var>submitted from <code
Expand All @@ -55793,6 +55798,9 @@ fur
<ol>
<li><p>If <var>form</var> <span>cannot navigate</span>, then return.</p></li>

<li><p>If <var>constructing entry list</var> flag of <var>form</var> is true, then
annevk marked this conversation as resolved.
Show resolved Hide resolved
return.</p></li>

<li><p>Let <var>form document</var> be <var>form</var>'s <span>node document</span>.</p></li>

<li id="sandboxSubmitBlocked"><p>If <var>form document</var>'s <span>active sandboxing flag
Expand Down Expand Up @@ -55842,6 +55850,8 @@ fur
<li><p>Let <var>entry list</var> be the result of <span>constructing the entry list</span> with
<var>form</var>, <var>submitter</var>, and <var>encoding</var>.</p></li>

tkent-google marked this conversation as resolved.
Show resolved Hide resolved
<li><p>If <var>form</var> <span>cannot navigate</span>, then return.</p></li>

<li><p>Let <var>action</var> be the <var>submitter</var> element's <span
data-x="concept-fs-action">action</span>.</p></li>

Expand Down Expand Up @@ -56156,6 +56166,11 @@ fur
follows. If not specified otherwise, <var>submitter</var> is null.</p>

<ol>
<li><p>if <var>constructing entry list</var> flag of <var>form</var> is true, then let
<var>entry list</var> be null and return <var>entry list</var>.</p></li>

<li><p>Let <var>constructing entry list</var> flag of <var>form</var> be true.</p></li>

<li><p>Let <var>controls</var> be a list of all the <span
data-x="category-submit">submittable elements</span> whose <span>form owner</span> is <var>form</var>, in <span>tree order</span>.</p></li>

Expand Down Expand Up @@ -56345,6 +56360,16 @@ fur
</ol>
</li>

<li><p>Let <var>form data</var> be a new <code>FormData</code> object associated with
<var>entry list</var>.</p></li>

<li><p><span data-x="concept-event-fire">Fire an event</span> named
<code data-x="event-formdata">formdata</code> at <var>form</var> using
<code>FormDataEvent</code>, with the <code data-x="dom-FormDataEvent-formData">formData</code>
attribute initialized to <var>form data</var>.</p></li>

<li><p>Let <var>constructing entry list</var> flag of <var>form</var> be false.</p></li>

<li><p>Return <var>entry list</var>.</p></li>
</ol>

Expand Down Expand Up @@ -56542,7 +56567,30 @@ fur
not reliably interpretable by computer, as the format is ambiguous (for example, there is no way
to distinguish a literal newline in a value from the newline at the end of the value).</p>

<h5>The <code>FormDataEvent</code> interface</h5>

<pre><code class="idl" data-x="">[Exposed=Window]
tkent-google marked this conversation as resolved.
Show resolved Hide resolved
interface <dfn>FormDataEvent</dfn> : <span>Event</span> {
readonly attribute <span>FormData</span> <span data-x="dom-FormDataEvent-formData">formData</span>;
};</code></pre>

<dl class="domintro">

tkent-google marked this conversation as resolved.
Show resolved Hide resolved
<dt><var>event</var> . <code data-x="dom-FormDataEvent-formData">formData</code></dt>

<dd>

<p>Returns a <code>FormData</code> object representing names and values of elements associated
to the target <code>form</code>. Operations on the <code>FormData</code> object will affect
form data to be submitted.</p>

</dd>

</dl>

<p>The <dfn><code data-x="dom-FormDataEvent-formData">formData</code></dfn> attribute returns a
<code>FormData</code> object associating to <var>entry list</var> in
<span>constructing the entry list</span> algorithm.</p>

<div w-nodev>

Expand Down Expand Up @@ -90779,6 +90827,7 @@ typedef <span>OnBeforeUnloadEventHandlerNonNull</span>? <dfn>OnBeforeUnloadEvent
<tr><td><dfn data-export="" data-dfn-type="attribute" data-dfn-for="HTMLElement,Document,Window,GlobalEventHandlers"><code data-x="handler-ondurationchange">ondurationchange</code></dfn> <td> <code data-x="event-media-durationchange">durationchange</code>
<tr><td><dfn data-export="" data-dfn-type="attribute" data-dfn-for="HTMLElement,Document,Window,GlobalEventHandlers"><code data-x="handler-onemptied">onemptied</code></dfn> <td> <code data-x="event-media-emptied">emptied</code>
<tr><td><dfn data-export="" data-dfn-type="attribute" data-dfn-for="HTMLElement,Document,Window,GlobalEventHandlers"><code data-x="handler-onended">onended</code></dfn> <td> <code data-x="event-media-ended">ended</code>
<tr><td><dfn data-export="" data-dfn-type="attribute" data-dfn-for="HTMLElement,Document,Window,GlobalEventHandlers"><code data-x="handler-onformdata">onformdata</code></dfn> <td> q<code data-x="event-formdata">formdata</code>
<tr><td><dfn data-export="" data-dfn-type="attribute" data-dfn-for="HTMLElement,Document,Window,GlobalEventHandlers"><code data-x="handler-oninput">oninput</code></dfn> <td> <code data-x="event-input">input</code>
<tr><td><dfn data-export="" data-dfn-type="attribute" data-dfn-for="HTMLElement,Document,Window,GlobalEventHandlers"><code data-x="handler-oninvalid">oninvalid</code></dfn> <td> <code data-x="event-invalid">invalid</code>
<tr><td><dfn data-export="" data-dfn-type="attribute" data-dfn-for="HTMLElement,Document,Window,GlobalEventHandlers"><code data-x="handler-onkeydown">onkeydown</code></dfn> <td> <code data-x="event-keydown">keydown</code> <!-- widely used -->
Expand Down Expand Up @@ -90959,6 +91008,7 @@ typedef <span>OnBeforeUnloadEventHandlerNonNull</span>? <dfn>OnBeforeUnloadEvent
attribute <span>EventHandler</span> <span data-x="handler-onended">onended</span>;
attribute <span>OnErrorEventHandler</span> <span data-x="handler-onerror">onerror</span>;
attribute <span>EventHandler</span> <span data-x="handler-onfocus">onfocus</span>;
attribute <span>EventHandler</span> <span data-x="handler-onformdata">onformdata</span>;
attribute <span>EventHandler</span> <span data-x="handler-oninput">oninput</span>;
attribute <span>EventHandler</span> <span data-x="handler-oninvalid">oninvalid</span>;
attribute <span>EventHandler</span> <span data-x="handler-onkeydown">onkeydown</span>;
Expand Down Expand Up @@ -119917,6 +119967,12 @@ interface <dfn>External</dfn> {
<td> <code data-x="event-focus">focus</code> event handler
<td> <span data-x="event handler content attributes">Event handler content attribute</span>

<tr>
<th id="ix-handler-onformdata"> <code data-x="">onformdata</code>
<td> <span data-x="handler-onformdata">HTML elements</span>
<td> <code data-x="event-formdata">formdata</code> event handler
<td> <span data-x="event handler content attributes">Event handler content attribute</span>

<tr>
<th id="ix-handler-window-onhashchange"> <code data-x="">onhashchange</code>
<td> <code data-x="handler-window-onhashchange">body</code>
Expand Down Expand Up @@ -120810,6 +120866,12 @@ INSERT INTERFACES HERE
<td> <code>Window</code>, elements
<td> Fired at nodes <span data-x="gains focus">gaining focus</span>

<tr> <!-- formdata -->
<td> <dfn data-dfn-type="event" data-dfn-for="HTMLElement" data-export=""><code data-x="event-formdata">formdata</code></dfn>
<td> <code>FormDataEvent</code>
<td> <code>form</code> elements
<td> Fired at a <code>form</code> element when it is <span>constructing the entry list</span>

<tr> <!-- hashchange -->
<td> <dfn data-dfn-type="event" data-dfn-for="Window" data-export=""><code data-x="event-hashchange">hashchange</code></dfn>
<td> <code>HashChangeEvent</code>
Expand Down