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)
Core
DOM: Core & HTML
Tracking
()
VERIFIED
WORKSFORME
M17
People
(Reporter: bernd.mielke, Assigned: pollmann)
References
()
Details
(Keywords: html4, Whiteboard: [nsbeta3+])
Attachments
(1 file)
|
3.79 KB,
text/plain
|
Details |
No description provided.
| Reporter | ||
Comment 1•26 years ago
|
||
Comment 2•26 years ago
|
||
I think it was an server internal error. Works fine for me.
Please try one's more.
Comment 3•26 years ago
|
||
I'm not seeing the problem on WinNT.
Status: UNCONFIRMED → RESOLVED
Closed: 26 years ago
Resolution: --- → WORKSFORME
| Reporter | ||
Comment 4•26 years ago
|
||
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 → ---
Comment 5•26 years ago
|
||
Mielke, thanks for the info. Reassigning to EricP.
Assignee: karnaze → pollmann
Status: UNCONFIRMED → NEW
Ever confirmed: true
| Assignee | ||
Comment 6•26 years ago
|
||
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
| Assignee | ||
Comment 7•26 years ago
|
||
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"
| Assignee | ||
Comment 8•26 years ago
|
||
Rod, is it okay if I remove the above code? :)
Severity: normal → minor
Target Milestone: --- → M19
| Assignee | ||
Comment 9•26 years ago
|
||
Hearing no objections then, I'll get this in when the tree opens to general
developement.
Whiteboard: fix in hand
Target Milestone: M19 → M17
| Assignee | ||
Comment 10•26 years ago
|
||
(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
| Assignee | ||
Updated•26 years ago
|
Summary: the language flag is correctly transmitted → submit " " instead of "" for button with no value
Comment 12•26 years ago
|
||
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(" ");
}
}
}
Comment 13•26 years ago
|
||
Marking nsbeta3+
Keywords: correctness,
html4
Whiteboard: [NEEDINFO]fix in hand → [nsbeta3+]fix in hand
Comment 14•26 years ago
|
||
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?
| Assignee | ||
Comment 15•26 years ago
|
||
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?
| Assignee | ||
Comment 16•26 years ago
|
||
> 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)
| Assignee | ||
Comment 17•26 years ago
|
||
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+]
Comment 18•26 years ago
|
||
It sounds like it can be removed...
Comment 19•26 years ago
|
||
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?
Comment 20•26 years ago
|
||
Yes, this was the code I suggested using, but I think eric is doing something
different and more than likely correct. eric?
| Assignee | ||
Comment 22•26 years ago
|
||
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
Comment 23•26 years ago
|
||
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
Updated•7 years ago
|
Component: HTML: Form Submission → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•