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

Add <form>'s "firing submission events" flag #4621

Merged
merged 4 commits into from
May 15, 2019
Merged
Changes from 3 commits
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
37 changes: 20 additions & 17 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -56036,6 +56036,9 @@ fur
<p>Each <code>form</code> element has a <dfn>constructing entry list</dfn> boolean, initially
false.</p>

<p>Each <code>form</code> element has a <dfn>firing submission events</dfn> boolean, initially
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 @@ -56055,26 +56058,30 @@ fur
<li><p>Let <var>form browsing context</var> be the <span data-x="concept-document-bc">browsing
context</span> of <var>form document</var>.</p></li>

<!-- lock (all the following steps are skipped if called from submit() - see unlock step below) -->

<li><p>If the <var>submitted from <code data-x="dom-form-submit">submit()</code>
method</var> flag is not set, and the <var>submitter</var> element's <span
data-x="concept-fs-novalidate">no-validate state</span> is false, then <span>interactively
validate the constraints</span> of <var>form</var> and examine the result: if the result
is negative (the constraint validation concluded that there were invalid fields and probably
informed the user of this) then <span data-x="concept-event-fire">fire an event</span> named
<code data-x="event-invalid">invalid</code> at the <var>form</var> element and then return.</p></li>

<li>
<p>If the <var>submitted from <code data-x="dom-form-submit">submit()</code> method</var> flag
is not set, then:

<ol>
<li><p>If <var>form</var>'s <span>firing submission events</span> is true, then
return.</p></li>

<li><p>Set <var>form</var>'s <span>firing submission events</span> to true.</p></li>

<li><p>If the <var>submitter</var> element's <span data-x="concept-fs-novalidate">no-validate
state</span> is false, then <span>interactively validate the constraints</span> of
<var>form</var> and examine the result: if the result is negative (the constraint validation
concluded that there were invalid fields and probably informed the user of this) then <span
data-x="concept-event-fire">fire an event</span> named <code
data-x="event-invalid">invalid</code> at the <var>form</var> element and then return.</p></li>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to reset the flag here too. I'll update the PR tomorrow.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update it now so we can merge; I want to rebase #4597 on top.


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this wrapping introduces an observable space after the period. I will fix.

<li><p>Let <var>continue</var> be the result of <span data-x="concept-event-fire">firing an
event</span> named <code data-x="event-submit">submit</code> at <var>form</var>, with the
<code data-x="dom-Event-bubbles">bubbles</code> attribute initialized to true and the <code
event</span> named <code data-x="event-submit">submit</code> at <var>form</var>, with the <code
data-x="dom-Event-bubbles">bubbles</code> attribute initialized to true and the <code
data-x="dom-Event-cancelable">cancelable</code> attribute initialized to true.</p></li>

<li><p>Set <var>form</var>'s <span>firing submission events</span> to false.</p></li>

<li><p>If <var>continue</var> is false, then return.</p></li>

<li>
Expand All @@ -56084,11 +56091,7 @@ fur
data-x="event-submit">submit</code> event could have changed the outcome.</p>
</li>
</ol>

<!-- if you add any steps between the "lock" and "unlock" lines, make sure to update the step
immediately before the "lock" line -->

<!-- unlock -->
</li>

<li><p>Let <var>encoding</var> be the result of <span>picking an encoding for the
form</span>.</p>
Expand Down