Skip to content

Commit bc50d30

Browse files
authored
Correct <input type=image> form submission behavior
Tests: xhr/formdata/constructor-submitter.html. Closes #8785.
1 parent 78551f6 commit bc50d30

File tree

1 file changed

+22
-28
lines changed

1 file changed

+22
-28
lines changed

source

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -49655,29 +49655,25 @@ ldh-str = &lt; as defined in <a href="https://www.rfc-editor.org/rfc/rfc10
4965549655
<li><p>If the element's <span>node document</span> is not <span>fully active</span>, then
4965649656
return.</p></li>
4965749657

49658-
<li><p>Let <var>coordinate</var> be (0, 0).</p></li>
49659-
4966049658
<li>
49661-
<p>If the user activated the control while explicitly selecting a coordinate, then set
49662-
<var>coordinate</var> to that coordinate.</p>
49659+
<p>If the user activated the control while explicitly selecting a coordinate, then set the
49660+
element's <span data-x="concept-input-type-image-coordinate">selected coordinate</span> to that
49661+
coordinate.</p>
4966349662

4966449663
<p class="note">This is only possible under the conditions outlined above, when the element
4966549664
<span>represents</span> a control for selecting such a coordinate. Even then, the user
4966649665
might activate the control without explicitly selecting a coordinate.</p>
4966749666
</li>
4966849667

49669-
<li><p>Set the element's <span data-x="concept-input-type-image-coordinate">selected
49670-
coordinate</span> to <var>coordinate</var>.</p></li>
49671-
4967249668
<li><p><span data-x="concept-form-submit">Submit</span> the <span>form owner</span> from the
4967349669
element.</p></li>
4967449670
</ol>
4967549671

49676-
<p>The <dfn data-x="concept-input-type-image-coordinate">selected coordinate</dfn> must consist of
49677-
an <var>x</var>-component and a <var>y</var>-component. The coordinates
49678-
represent the position relative to the edge of the image, with the coordinate space having the
49679-
positive <var>x</var> direction to the right, and the positive <var>y</var>
49680-
direction downwards.</p>
49672+
<p>The element's <dfn data-x="concept-input-type-image-coordinate">selected coordinate</dfn>
49673+
consists of an <var>x</var>-component and a <var>y</var>-component. It is initially (0, 0). The
49674+
coordinates represent the position relative to the edge of the element's image, with the
49675+
coordinate space having the positive <var>x</var> direction to the right, and the positive
49676+
<var>y</var> direction downwards.</p>
4968149677

4968249678
<p>The <var>x</var>-component must be a <span>valid integer</span> representing a number
4968349679
<var>x</var> in the range <span data-x="">&#x2212;(<var>border<sub>left</sub></var>+<var>padding<sub>left</sub></var>) &le; <var>x</var> &le; <var>width</var>+<var>border<sub>right</sub></var>+<var>padding<sub>right</sub></var></span>, where <var>width</var> is the rendered width of the image, <var>border<sub>left</sub></var> is the width of the border on the left of the image, <var>padding<sub>left</sub></var> is the width of the padding on the left of the
@@ -58390,23 +58386,21 @@ fur
5839058386
data-x="attr-input-type-image">Image Button</span> state, then:</p>
5839158387

5839258388
<ol>
58389+
<li><p>If the <var>field</var> element is not <var>submitter</var>, then
58390+
<span>continue</span>.</p></li>
58391+
5839358392
<li><p>If the <var>field</var> element has a <code data-x="attr-fe-name">name</code>
58394-
attribute specified and its value is not the empty string, let <var>name</var> be
58395-
that value followed by a single U+002E FULL STOP character (.). Otherwise, let <var>name</var> be the empty string.</p></li>
58396-
58397-
<li><p>Let <var>name<sub>x</sub></var> be the string consisting of the
58398-
concatenation of <var>name</var> and a single U+0078 LATIN SMALL LETTER X character
58399-
(x).</p></li>
58400-
58401-
<li><p>Let <var>name<sub>y</sub></var> be the string consisting of the
58402-
concatenation of <var>name</var> and a single U+0079 LATIN SMALL LETTER Y character
58403-
(y).</p></li>
58404-
58405-
<li><p>The <var>field</var> element is <var>submitter</var>, and before
58406-
this algorithm was invoked the user <span
58407-
data-x="concept-input-type-image-coordinate">indicated a coordinate</span>. Let <var>x</var> be the <var>x</var>-component of the coordinate selected by the
58408-
user, and let <var>y</var> be the <var>y</var>-component of the coordinate
58409-
selected by the user.</p></li>
58393+
attribute specified and its value is not the empty string, let <var>name</var> be that value
58394+
followed by U+002E (.). Otherwise, let <var>name</var> be the empty string.</p></li>
58395+
58396+
<li><p>Let <var>name<sub>x</sub></var> be the concatenation of <var>name</var> and
58397+
U+0078 (x).</p></li>
58398+
58399+
<li><p>Let <var>name<sub>y</sub></var> be the concatenation of <var>name</var> and
58400+
U+0079 (y).</p></li>
58401+
58402+
<li><p>Let (<var>x</var>, <var>y</var>) be the <span
58403+
data-x="concept-input-type-image-coordinate">selected coordinate</span>.</p></li>
5841058404

5841158405
<li><p><span>Create an entry</span> with <var>name<sub>x</sub></var> and <var>x</var>, and
5841258406
<span data-x="list append">append</span> it to <var>entry list</var>.</p></li>

0 commit comments

Comments
 (0)