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

Remove 'type' from form data set tuples. #3658

Merged
merged 4 commits into from May 8, 2018

Conversation

2 participants
@tkent-google
Copy link
Contributor

tkent-google commented May 1, 2018

Remove it to simplify the specification, and improve compatibility of
"form data set" and FormData interface.

This change introduces "append an entry" steps for line break
normalization and USV conversion.

This fixes #3648.


/form-control-infrastructure.html ( diff )

Remove 'type' from form data set tuples.
Remove it to simplify the specification, and improve compatibility of
"form data set" and FormData interface.

This change introduces "append an entry" steps for line break
normalization and USV conversion.
@annevk
Copy link
Member

annevk left a comment

Thanks for taking this on. I've mostly got nits and suggestions.

source Outdated
@@ -56234,10 +56229,11 @@ fur
user, and let <var>y</var> be the <var>y</var>-component of the coordinate
selected by the user.</p></li>

<li><p>Append an entry to the <var>form data set</var> with the name <var>name<sub>x</sub></var>, the value <var>x</var>, and the type <var>type</var>.</p></li>
<li><p><span data-x="append-an-entry">Append an entry</span> to the <var>form data set</var>
with the name <var>name<sub>x</sub></var>, and the value <var>x</var>.</p></li>

This comment has been minimized.

@annevk

annevk May 2, 2018

Member

Writing this as "with namex and x" (including the appropriate markup) would be fine I think. No need to say "name" and "value". (This applies throughout.)

This comment has been minimized.

@tkent-google

tkent-google May 7, 2018

Author Contributor

Done. I kept some of them if I felt keeping it was better to understand.

source Outdated
<span data-x="concept-input-type-file-selected">selected</span> in the <code>input</code>
element, <span data-x="append-an-entry">append an entry</span> to the <var>form data set</var>
with the <var>name</var> as the name, and the file (consisting of the name, the type, and the
body) as the value. If there are no <span data-x="concept-input-type-file-selected">selected

This comment has been minimized.

@annevk

annevk May 2, 2018

Member

How about we use a File object as the value here?

source Outdated
body) as the value. If there are no <span data-x="concept-input-type-file-selected">selected
files</span>, then <span data-x="append-an-entry">append an entry</span> to the <var>form data
set</var> with the <var>name</var> as the name, the empty string as the value, and
<code>application/octet-stream</code> as the type.</p></li>

This comment has been minimized.

@annevk

annevk May 2, 2018

Member

The value here seems incorrect. Should it be a file whose name and body are the empty string and type is that type? It seems this is observable with FormData() too. I tested this with

fd = new FormData(document.querySelector("form"))
w(fd.get("test"))

and it appears that Chrome/Safari do return a File object there, but Firefox returns the empty string. Would be good to add to web-platform-tests.

This comment has been minimized.

@annevk

annevk May 2, 2018

Member

However, neither Chrome nor Safari returns application/octet-stream from the type attribute...

This comment has been minimized.

@tkent-google

tkent-google May 7, 2018

Author Contributor

It seems the original paragraph was already broken. I fixed this in the new commit.

source Outdated
normalized.</p>
</li>
<p>To <dfn data-x="append-an-entry">append an entry</dfn> to <var>form data set</var>, given
<var>name</var>, <var>value</var>, and optional <var>line break normalization flag</var>, run

This comment has been minimized.

@annevk

annevk May 2, 2018

Member

Please invert this flag. Defaulting to true is bad practice, though I can't find a good reference right now :/

This comment has been minimized.

@tkent-google

tkent-google May 7, 2018

Author Contributor

Done. The new commit made it "prevent line break normralization flag"

tkent-google and others added some commits May 7, 2018

- Omit some "as the name" and "as the value"
- Fix empty file input
- Reverse the flag meaning

annevk added a commit to web-platform-tests/wpt that referenced this pull request May 7, 2018

@annevk

This comment has been minimized.

Copy link
Member

annevk commented May 7, 2018

I pushed some nits and created a test for the no selected files case.

@tkent-google

This comment has been minimized.

Copy link
Contributor Author

tkent-google commented May 8, 2018

I pushed some nits and created a test for the no selected files case.

Thanks!

@annevk

annevk approved these changes May 8, 2018

Copy link
Member

annevk left a comment

I think we can go ahead with this now. I'll file bugs on the application/octet-stream find.

annevk added a commit to web-platform-tests/wpt that referenced this pull request May 8, 2018

@annevk annevk merged commit a1e8b1a into whatwg:master May 8, 2018

2 checks passed

Participation tkent-google participates on behalf of Google LLC
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request May 14, 2018

Bug 1459572 [wpt PR 10865] - HTML: FormData serialization of <input t…
…ype=file> without selection, a=testonly

Automatic update from web-platform-testsHTML: FormData representation of <input type=file> without selection

For whatwg/html#3658.
--

wpt-commits: 11f912ed1d8c8da3cb23f8e77444c4bc03c18e01
wpt-pr: 10865

mykmelez pushed a commit to mozilla/gecko that referenced this pull request May 15, 2018

Bug 1459572 [wpt PR 10865] - HTML: FormData serialization of <input t…
…ype=file> without selection, a=testonly

Automatic update from web-platform-testsHTML: FormData representation of <input type=file> without selection

For whatwg/html#3658.
--

wpt-commits: 11f912ed1d8c8da3cb23f8e77444c4bc03c18e01
wpt-pr: 10865
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.