serializeArray: Document Behavior for Value-less Input Elements#1018
Closed
jugglinmike wants to merge 1 commit into
Closed
serializeArray: Document Behavior for Value-less Input Elements#1018jugglinmike wants to merge 1 commit into
jugglinmike wants to merge 1 commit into
Conversation
Formally define jQuery's behavior when `<input>` elements which specify a `name` property but no corresponding `value`. This behavior should be considered stable because it is implicitly asserted in jQuery's unit test suite through tests for the `serialize` method [1]. [1] https://github.com/jquery/jquery/blob/efdb8a46e4213dcf69f792c42c234c6b112ba471/test/unit/serialize.js#L125-L127
dmethvin
approved these changes
Jan 16, 2017
Member
dmethvin
left a comment
There was a problem hiding this comment.
Even reading the spec that's already referenced in the paragraph, I can see how this could be ambiguous because of the roundabout way the spec talks about current value. The value attribute can be undefined but the value property is always present and defaults to an empty string if there's no value attribute.
Contributor
Author
|
Thanks, Dave! Is there anything more I can do to get this patch landed? |
Contributor
Author
|
Thanks, Karl! |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Formally define jQuery's behavior when
<input>elements which specify anameproperty but no correspondingvalue. This behavior should be consideredstable because it is implicitly asserted in jQuery's unit test suite through
tests for the
serializemethod [1].[1] https://github.com/jquery/jquery/blob/efdb8a46e4213dcf69f792c42c234c6b112ba471/test/unit/serialize.js#L125-L127
The expected behavior here is a little ambiguous because it could also be valid to simply skip such elements in the serialization process. That is the Cheerio project's current behavior, but before altering it to match jQuery's current behavior, I'd like to make the behavior explicit.