Closed Bug 28844 Opened 26 years ago Closed 26 years ago

submit " " instead of "" for button with no value

Categories

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

defect

Tracking

()

VERIFIED WORKSFORME

People

(Reporter: bernd.mielke, Assigned: pollmann)

References

()

Details

(Keywords: html4, Whiteboard: [nsbeta3+])

Attachments

(1 file)

No description provided.
I think it was an server internal error. Works fine for me. Please try one's more.
I'm not seeing the problem on WinNT.
Status: UNCONFIRMED → RESOLVED
Closed: 26 years ago
Resolution: --- → WORKSFORME
This bug is still present and does not work for me: Build 2000022216 Win98de (german) Please look for the different kinds of informations send to the server with Mozilla 2000022216 and NV4.6 mozilla: http://www.smsc.com:8765/query.html?col=smsc&qp=++&qt=mozilla&qs=++&qc=++&pw=100%25&ws=0&la=++&qm=0&st=1&nh=10&lk=1&rf=0&oq=++&rq=0 NV 4.6 http://www.smsc.com:8765/query.html?col=smsc&qp=&qt=mozilla&qs=&qc=&pw=100%25&ws=0&qm=0&st=1&nh=10&lk=1&rf=0&rq=0
Status: RESOLVED → UNCONFIRMED
Resolution: WORKSFORME → ---
Mielke, thanks for the info. Reassigning to EricP.
Assignee: karnaze → pollmann
Status: UNCONFIRMED → NEW
Ever confirmed: true
On a quick inspection, it looks like the hidden inputs with value "" is returning a value of " " (space is converted to + in url encoding). Since hidden inputs are really buttons, this could be related to bug 16999, checking...
Status: NEW → ASSIGNED
OS: other → All
Hardware: PC → All
I'm also unable to reproduce this on Windows or Linux. However, I think I see the code that is the culprit: This is from nsGfxButtonControlFrame::DoNavQuirksReflow. It was there both before and after the recent changes for 16999: const nsStyleText* textStyle; GetStyleData(eStyleStruct_Text, (const nsStyleStruct *&)textStyle); if (!textStyle->WhiteSpaceIsSignificant()) { value.CompressWhitespace(); if (value.Length() == 0) { value = " "; } } I don't know why this code is here. Rod, can you recall why it was added? CVS log for nsGfxButtonControlFrame.cpp version 1.16 says: "now trims white space and makes sure the text is two spaces if empty"
Rod, is it okay if I remove the above code? :)
Severity: normal → minor
Target Milestone: --- → M19
Hearing no objections then, I'll get this in when the tree opens to general developement.
Whiteboard: fix in hand
Target Milestone: M19 → M17
(updating mutiple bugs) Nominating this bug for beta3 because it is either a crasher or a correctness bug and I have a straightforward fix in hand. This bug fix is small, low risk, and can easily be reverted with no side effects.
Keywords: nsbeta3
Summary: the language flag is correctly transmitted → submit " " instead of "" for button with no value
Marking NEEDINFO.
Whiteboard: fix in hand → [NEEDINFO]fix in hand
Ok, somehow I missed Eric's requests for info in this bug. The problem is Nav uses two spaces for the "content" (or value) when no value is specified. This makes the control size correctly. I don't think the issue here is in the DoNavQuirksReflow it is probably in the CreateAnonymousContent method. The fix for both methods is probably: const nsStyleText* textStyle; GetStyleData(eStyleStruct_Text, (const nsStyleStruct *&)textStyle); if (!textStyle->WhiteSpaceIsSignificant()) { value.CompressWhitespace(); if (value.Length() == 0) { PRInt32 type; GetType(&type); if (type != NS_FORM_INPUT_HIDDEN) { value.AssignWithConversion(" "); } } }
Marking nsbeta3+
Keywords: correctness, html4
Whiteboard: [NEEDINFO]fix in hand → [nsbeta3+]fix in hand
For the record, in standard mode we do not want to be changing blank values into two spaces, since that violates HTML4. This is a quirks issue only, right?
Thanks Rod! Actually, tracing through this, the code in question is no longer needed anyway. In nsGfxButtonControlFrame::Reflow we check to see if we are dealing with a hidden input or not. If it's a hidden it never gets into DoNavQuirksReflow. (This bug WORKSFORME with no changes) In DoNavQuirksReflow we call GetDefaultLabel. This returns " " for a normal button, so we never end up with value.Length() == 0 anyway. In other words, I think this bug was fixed some time back, but the code can still be removed just for cleanliness sake. Rod, does this sound okay to you?
> For the record, in standard mode we do not want to be changing blank values > into two spaces, since that violates HTML4. > > This is a quirks issue only, right? Yes, this is in quirks mode only. Also, we only convert "" to " " for buttons, and we don't submit name/value pairs for buttons. I don't know if this behaviour is in line with the spec or not, though I suspect it may not be. (But it is what IE does)
Still looking into this one. The test case does not show the bug but I was able to come up with another test case that ended up calling the code I was suggesting we remove.
Whiteboard: [nsbeta3+]fix in hand → [nsbeta3+]
It sounds like it can be removed...
rods@netscape.com wrote: > const nsStyleText* textStyle; > GetStyleData(eStyleStruct_Text, (const nsStyleStruct *&)textStyle); > if (!textStyle->WhiteSpaceIsSignificant()) { > value.CompressWhitespace(); > if (value.Length() == 0) { > PRInt32 type; > GetType(&type); > if (type != NS_FORM_INPUT_HIDDEN) { > value.AssignWithConversion(" "); > } > } > } This worries me. Does this mean that whitespace is getting compressed in hidden fields?
Yes, this was the code I suggested using, but I think eric is doing something different and more than likely correct. eric?
Changing priority to P4.
Priority: P3 → P4
This bug was fixed somewhere along the line, don't know when though: Nav's query string for the term "test"----\/ GET /query.html?col=smsc&qp=&qt=test&qs=&qc=&pw=100%25&ws=0&la=&qm=0&st=1&nh=10&lk=1&rf=0&oq=&rq=0 HTTP/1.0 GET /query.html?col=smsc&qp=&qt=test&qs=&qc=&pw=100%25&ws=0&la=&qm=0&st=1&nh=10&lk=1&rf=0&oq=&rq=0 HTTP/1.1 Moz's query string for the term "test" ----^ The page works now, and there are no extra spaces (encoded as '+') in the query string. Marking this one as WORKSFORME. To verify, go the URL above: http://www.smsc.com/search/search.html Enter a search term and then submit it - compare the results to Nav - should be the same! :)
Status: ASSIGNED → RESOLVED
Closed: 26 years ago → 26 years ago
Resolution: --- → WORKSFORME
Per Pollmann's comments, marking VERFIED WORKSFORME on: - LinuxRH62 2000-09-08-08-M18 Commercial - Win98 2000-09-08-08-M18 Mozilla - MacOS86 2000-09-07-04-M18 Commercial
Status: RESOLVED → VERIFIED
Component: HTML: Form Submission → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: