Closed
Bug 59035
Opened 24 years ago
Closed 23 years ago
PDT+,[FIX]type of a BUTTON should default to submit
Categories
(Core :: Layout: Form Controls, defect, P2)
Tracking
()
VERIFIED
FIXED
mozilla0.9.5
People
(Reporter: robbe, Assigned: rods)
References
Details
(Keywords: html4, regression, Whiteboard: Have review/superreview waiting for approval to check into the branch, critical for 0.9.4,PDT)
Attachments
(4 files)
HTML 4.01 says: <!ATTLIST BUTTON [...] type (button|submit|reset) submit -- for use as form button -- In the Nov 1 nightly, <button type="submit"> will submit, while <button> will do nothing at all. Both should be equivalent.
Comment 2•24 years ago
|
||
Confirming on Linux trunk build 2000110421.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee | ||
Comment 3•24 years ago
|
||
Patch: Index: nsHTMLButtonControlFrame.cpp =================================================================== RCS file: /cvsroot/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp,v retrieving revision 3.106 diff -u -r3.106 nsHTMLButtonControlFrame.cpp --- nsHTMLButtonControlFrame.cpp 2000/10/28 22:14:50 3.106 +++ nsHTMLButtonControlFrame.cpp 2000/12/14 19:18:29 @@ -306,7 +306,7 @@ PRBool nsHTMLButtonControlFrame::IsSubmit(PRInt32 type) { - if (NS_FORM_BUTTON_SUBMIT == type) { + if (NS_FORM_BUTTON_SUBMIT == type || NS_FORM_BUTTON_BUTTON) { return PR_TRUE; } else { return PR_FALSE;
Status: NEW → ASSIGNED
Keywords: html4
Summary: type of a BUTTON should default to submit → [FIX]type of a BUTTON should default to submit
Comment 4•24 years ago
|
||
Won't this patch also make <button type=button> submit a form when clicked on? I think that the only thing to change is if no type is specified then make type be 'submit'. I just tested, and our current behaviour is exactly the same as IE 4.x and 5.x's behaviour with <button> - the default type is 'button', not 'submit'. Can this be corrected only for strict mode?
Assignee | ||
Comment 5•24 years ago
|
||
This can easily be just a Standard mode thing. But I don't see much of a difference between setting the type for button's to NS_FORM_BUTTON_SUBMIT instead of leaving them NS_FORM_BUTTON_BUTTON. Could you explain your thiking a little more? Plus, my patch was wrong, it should be: if (NS_FORM_BUTTON_SUBMIT == type || NS_FORM_BUTTON_BUTTON == type) {
Assignee | ||
Comment 6•24 years ago
|
||
Oh, I re-read what you wrote and yes, you are right, make it submit only when the type=submit or when the type isn't specified.
Assignee | ||
Comment 7•24 years ago
|
||
Comment 8•24 years ago
|
||
Rod the diff you sent me to review looks exactly like the patch on 12-18 "Plus, my patch was wrong, it should be:" if (NS_FORM_BUTTON_SUBMIT == type || NS_FORM_BUTTON_BUTTON == type) { I can not view your latest patch. Could you re-attach it so I can review it. thanks.
Assignee | ||
Comment 9•24 years ago
|
||
Comment 10•24 years ago
|
||
lastest patch looks good. r=kmcclusk@netscape.com
Assignee | ||
Comment 11•24 years ago
|
||
fixed
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 12•24 years ago
|
||
Not verified: "Submit1" in my attached testcase still does not submit. Tested with build 2000122223 which has rods's fix. How does this CompatibilityMode work?
Comment 13•23 years ago
|
||
Verified build 20010730T os:Linux7.1 *code mistake* *testcase's button1 has no assignment (type) while button2 type='submit'*
Status: RESOLVED → VERIFIED
Reporter | ||
Comment 14•23 years ago
|
||
> Verified build 20010730T os:Linux7.1 Can't comment on that. The bug is present in 0.9.3 on Linux. Will try 0.9.4 when it's there. > *testcase's button1 has no assignment (type) while button2 type='submit'* Exactly, that's the whole point of this bug. See the HTML4 DTD.
Reporter | ||
Comment 15•23 years ago
|
||
Sigh. NOT fixed in 0.9.3 (my previous post mistakenly mentioned 0.9.*4*).
Status: VERIFIED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 16•23 years ago
|
||
The correct patch: Index: nsHTMLButtonControlFrame.cpp =================================================================== RCS file: /cvsroot/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp,v retrieving revision 3.124 diff -u -r3.124 nsHTMLButtonControlFrame.cpp --- nsHTMLButtonControlFrame.cpp 2001/08/21 13:56:18 3.124 +++ nsHTMLButtonControlFrame.cpp 2001/08/27 18:05:15 @@ -330,7 +330,7 @@ // and oif it wasn't explicitly then we we allow to be a submit if (NS_FORM_BUTTON_BUTTON == type) { nsAutoString type; - if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttr(kNameSpaceID_HTML, nsH TMLAtoms::type, type)) { + if (NS_CONTENT_ATTR_HAS_VALUE != mContent->GetAttr(kNameSpaceID_HTML, nsH TMLAtoms::type, type)) { return PR_FALSE; } else { return PR_TRUE;
Status: REOPENED → ASSIGNED
Priority: P3 → P2
Whiteboard: fix in hand
Target Milestone: --- → mozilla0.9.5
Assignee | ||
Updated•23 years ago
|
Whiteboard: fix in hand → fix in hand, critical for 0.9.4
Assignee | ||
Comment 17•23 years ago
|
||
*** Bug 97829 has been marked as a duplicate of this bug. ***
Comment 18•23 years ago
|
||
Some forms will become disabled with this bug. Nominating for PDT.
Whiteboard: fix in hand, critical for 0.9.4 → fix in hand, critical for 0.9.4、PDT, nsBranch
Comment 19•23 years ago
|
||
Since the HTML 4.01 spec says that the button type should be submit, shouldn't we just fix this by backing out the patch in this bug that was checked in, and doing something like this? Index: nsHTMLButtonElement.cpp =================================================================== RCS file: /cvsroot/mozilla/content/html/content/src/nsHTMLButtonElement.cpp,v retrieving revision 1.76 diff -u -r1.76 nsHTMLButtonElement.cpp --- nsHTMLButtonElement.cpp 2001/08/17 08:12:55 1.76 +++ nsHTMLButtonElement.cpp 2001/09/06 23:10:46 @@ -127,7 +127,7 @@ nsHTMLButtonElement::nsHTMLButtonElement() { - mType = NS_FORM_BUTTON_BUTTON; // default + mType = NS_FORM_BUTTON_SUBMIT; // default } nsHTMLButtonElement::~nsHTMLButtonElement()
Whiteboard: fix in hand, critical for 0.9.4、PDT, nsBranch → fix in hand, critical for 0.9.4?APDT, nsBranch
Comment 20•23 years ago
|
||
I like kin's suggestion. Try that out, Rod, it is a lot simpler.
Assignee | ||
Comment 21•23 years ago
|
||
Assignee | ||
Comment 22•23 years ago
|
||
Yes, removing the old patch and applying Kin's patch does the trick, I guess I didn't realize the default was suppose to be "submit" thanks, kin
Comment 23•23 years ago
|
||
Rod, you going to generate a new patch based on the changes in your tree?
Comment 25•23 years ago
|
||
sr=attinasi for backing out the previous patch, and checking in Kin's suggested patch from 2001-09-06 16:16
Keywords: nsbranch+
Comment 26•23 years ago
|
||
r=kmcclusk@netscape.com for backing out the previous patch, and checking in Kin's suggested patch from 2001-09-06 16:16
Keywords: nsbranch+
Comment 27•23 years ago
|
||
removed keyword nsbranch since it now has nsbranch+, per pdt mtg.
Keywords: nsbranch
Updated•23 years ago
|
Whiteboard: fix in hand, critical for 0.9.4?APDT, nsBranch → fix in hand, critical for 0.9.4,PDT
Comment 28•23 years ago
|
||
Updated status
Whiteboard: fix in hand, critical for 0.9.4,PDT → Have review/superreview waiting for approval to check into the branch, critical for 0.9.4,PDT
Comment 29•23 years ago
|
||
check this bad boy in today.
Summary: [FIX]type of a BUTTON should default to submit → PDT+,[FIX]type of a BUTTON should default to submit
Comment 30•23 years ago
|
||
Make this work as kin thinks it should, and the spec says . . .
Assignee | ||
Comment 31•23 years ago
|
||
fixed on tip and branch
Status: ASSIGNED → RESOLVED
Closed: 24 years ago → 23 years ago
Resolution: --- → FIXED
Comment 32•23 years ago
|
||
verified fixed on RedHat Linux 7.1 build ID : 2001-09-19-04-0.9.4
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•