Closed Bug 330469 Opened 20 years ago Closed 19 years ago

[FIX]Submit button with empty value now has "Submit Query" text

Categories

(Core :: DOM: Core & HTML, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: martijn.martijn, Assigned: bzbarsky)

References

()

Details

(Keywords: fixed1.8.1, regression, testcase)

Attachments

(2 files, 2 obsolete files)

See upcoming testcase, basically this: <input type="submit" value=""> should not give a "Submit Query" text inside the button. This used to work in 2005-10-27 build, but not anymore in 2005-10-28 build: http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=all&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=explicit&mindate=2005-10-26+21&maxdate=2005-10-28+06&cvsroot=%2Fcvsroot So my guess is a regression from bug 308270.
Attached file testcase
Attached patch Fix (obsolete) — Splinter Review
Yeah, this is a regression from the attribute landing... Martijn, for future please also cc the author of the patch that caused the regression, not just the reviewer? ;) Note that the code has changed some since (to use GetValue()). I'm not too happy combining that with HasAttr, but I don't really see a better way...
Assignee: general → bzbarsky
Status: NEW → ASSIGNED
Attachment #215023 - Flags: superreview?(peterv)
Attachment #215023 - Flags: review?(bugmail)
Blocks: 308270
OS: Windows XP → All
Priority: -- → P2
Hardware: PC → All
Summary: Submit button with empty value now has "Submit Query" text → [FIX]Submit button with empty value now has "Submit Query" text
Target Milestone: --- → mozilla1.9alpha
dupe of 318552? or the other way since this has a patch
*** Bug 318552 has been marked as a duplicate of this bug. ***
Attached patch Right fix (obsolete) — Splinter Review
Attachment #215023 - Attachment is obsolete: true
Attachment #215025 - Flags: superreview?(peterv)
Attachment #215025 - Flags: review?(bugmail)
Attachment #215023 - Flags: superreview?(peterv)
Attachment #215023 - Flags: review?(bugmail)
(In reply to comment #2) > Yeah, this is a regression from the attribute landing... Martijn, for future > please also cc the author of the patch that caused the regression, not just the > reviewer? ;) Uhm, my guess was a regression from bug 308270, which you fixed, not?
Oh, oops. It was a regression from 311827, not 308270. ;) I looked at the bonsai list and didn't realize that the bug# cited in this bug was different.... It's clearly time for vacation.
Blocks: 311827
No longer blocks: 308270
Attachment #215025 - Flags: superreview?(peterv) → superreview+
Comment on attachment 215025 [details] [diff] [review] Right fix Just call GetAttr instead. You're relying on that the label lives in the value-attribute anyway. (which is a pretty safe assumption i'd say)
Attachment #215025 - Flags: review?(bugmail) → review-
Comment on attachment 215025 [details] [diff] [review] Right fix Calling GetAttr() will get the wrong string. The label is _based_ on the value attribute, but is not _equal_ to the value attribute. See the blame for the code I'm modifying for details. All I want to tell is whether what GetValue() is returning is based on something the page specified or not; if it returned null for no value attr I wouldn't have to do this, but it doesn't, so...
Attachment #215025 - Flags: review- → review?(bugmail)
Could we do this: if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::value)) { elt->GetValue(aLabel); } else { rv = GetDefaultLabel(aLabel); NS_ENSURE_SUCCESS(rv, rv); }
We could if we want to assume GetValue is infallible.
I'd be fine with that. Or you could add an NS_ENSURE_SUCCESS after GetValue. If GetValue fails I'm not sure we want to use fallback.
Attachment #215025 - Attachment is obsolete: true
Attachment #217181 - Flags: superreview?(bugmail)
Attachment #217181 - Flags: review?(bugmail)
Attachment #215025 - Flags: review?(bugmail)
Comment on attachment 217181 [details] [diff] [review] With that approach r/sr=sicking
Attachment #217181 - Flags: superreview?(bugmail)
Attachment #217181 - Flags: superreview+
Attachment #217181 - Flags: review?(bugmail)
Attachment #217181 - Flags: review+
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Fixed on 1.8 branch by combined patch from bug 114997 comment 83 (checkin by bzbarsky, comment 86).
Keywords: fixed1.8.1
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: