This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 17185 - Remove the missing value default for formmethod=""
Summary: Remove the missing value default for formmethod=""
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-25 10:50 UTC by contributor
Modified: 2013-01-24 23:45 UTC (History)
4 users (show)

See Also:


Attachments

Description contributor 2012-05-25 10:50:22 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html
Multipage: http://www.whatwg.org/C#attr-fs-formmethod
Complete: http://www.whatwg.org/c#attr-fs-formmethod

Comment:
Remove the missing value default for formmethod=""

Posted from: 85.227.154.145 by simonp@opera.com
User agent: Opera/9.80 (Macintosh; Intel Mac OS X 10.7.3; U; en) Presto/2.10.229 Version/11.64
Comment 1 Simon Pieters 2012-05-25 10:54:51 UTC
formmethod should only have an invalid value default, not a missing value default.

Consider

<form method=post> <input type=submit> </form>

input.formMethod will return "get", which is bogus since the attribute isn't specified so the form's method is really "post". With the proposed change, input.formMethod would return the empty string.

Since <form method=post> <input type=submit formmethod=invalid> </form> causes the form to use GET, making input.formMethod return "get" there makes sense, and allows for feature detection.

The same thing applies to formenctype.
Comment 2 contributor 2012-07-18 17:37:20 UTC
This bug was cloned to create bug 18191 as part of operation convergence.
Comment 3 contributor 2012-08-27 17:54:33 UTC
Checked in as WHATWG revision r7282.
Check-in comment: Make .formenctype and .formaction IDL attributes return '' rather than default values when they are not set, to indicate that they defer to the form.
http://html5.org/tools/web-apps-tracker?from=7281&to=7282
Comment 4 Mounir Lamouri 2013-01-21 17:00:25 UTC
Ian, I think your change made form.method and form.encoding and form.enctype to follow the reflection rules Simon asked for formControl.formMethod and formControl.formEnctype.

I think Simon's proposal really makes sense for .formMethod and .formEnctype reflection but it doesn't make much sense to apply this to HTMLFormElement.{method,enctype,encoding} given that the rationale from comment 1 would not apply (ie. <form></form> will use the 'GET' method).
Comment 5 Mounir Lamouri 2013-01-23 12:35:44 UTC
FWIW, we just landed some code in Gecko to implement's Simon's proposal but without following the change that has been made to the attribute reflection on the form elements. See https://bugzilla.mozilla.org/show_bug.cgi?id=787095
Comment 6 Ian 'Hixie' Hickson 2013-01-24 23:43:17 UTC
Wow, yeah, dunno what I was thinking there.
Comment 7 contributor 2013-01-24 23:45:45 UTC
Checked in as WHATWG revision r7648.
Check-in comment: Fix broken logic around IDL attributes for form submission.
http://html5.org/tools/web-apps-tracker?from=7647&to=7648