-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
domenic
merged 4 commits into
whatwg:master
from
tkent-google:tkent-submit-event-protection
May 15, 2019
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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> | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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> | ||
|
@@ -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> | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.