hidden inputs are rendered when display:block

Bug #129173 reported by Richard Eames
4
Affects Status Importance Assigned to Milestone
Mozilla Firefox
Invalid
Medium
mozilla-firefox (Ubuntu)
Invalid
Undecided
Mozilla Bugs

Bug Description

Binary package hint: mozilla-firefox

I'm using FF 2.0.0.5 (gutsy)

If the following is in css, hidden inputs are displayed. This should not be the case since it is against the w3c standard.

input {
display: block;
}

They become visible if padding or a border is set.

A fix would be to add "display: none !important;" to forms.css. I've tried this on my machine and results are what is expected.

I will include a diff report.

Bug was originally reported: https://bugzilla.mozilla.org/show_bug.cgi?id=332841
But given their earlier response I'm not sure they'll do anything about it.

Steps to Reproduce:
1. Create a form with hidden inputs (a bunch makes them more visible)
2. Add a CSS containing: input {display: block; border: thin solid red;}
3. Make sure the border color in #2 is not the same as you background color

Revision history for this message
In , Junk-thinkof (junk-thinkof) wrote :

Created attachment 217291
Example of the bug in action

View this to see what this is about.

Revision history for this message
In , Junk-thinkof (junk-thinkof) wrote :

Created attachment 217292
Previous example was incorrect, sorry

Revision history for this message
In , Martijn-martijn (martijn-martijn) wrote :

Hidden inputs are set to display:none in forms.css
Web designers can override that with display:block.
That's not really a bug, it is done this way on purpose.

Revision history for this message
In , Bzbarsky (bzbarsky) wrote :

Yep. This is by design.

Revision history for this message
In , Philringnalda (philringnalda) wrote :

*** Bug 334865 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Gavin Sharp (gavin-sharp) wrote :

*** Bug 356054 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Nick-spidexweb (nick-spidexweb) wrote :

*** Bug 360346 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Jruderman (jruderman) wrote :

*** Bug 390091 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Richard Eames (naddiseo) wrote :

Explain how it's not a bug.

According to the w3c HTML 4.01 standard for hidden inputs, they "are not rendered" and so it IS A BUG!

http://www.w3.org/TR/html401/interact/forms.html#hidden-control

Revision history for this message
In , Richard Eames (naddiseo) wrote :

To follow the standard a fix would be to put

display: none !important;

in forms.css for hidden inputs.

Revision history for this message
Richard Eames (naddiseo) wrote :

Binary package hint: mozilla-firefox

I'm using FF 2.0.0.5 (gutsy)

If the following is in css, hidden inputs are displayed. This should not be the case since it is against the w3c standard.

input {
display: block;
}

They become visible if padding or a border is set.

A fix would be to add "display: none !important;" to forms.css. I've tried this on my machine and results are what is expected.

I will include a diff report.

Bug was originally reported: https://bugzilla.mozilla.org/show_bug.cgi?id=332841
But given their earlier response I'm not sure they'll do anything about it.

Revision history for this message
Richard Eames (naddiseo) wrote :
Revision history for this message
Amir Eldor (amireldor) wrote :

I am a bit confused.
On the link you sent to bugzilla, some guy said that this "bug" is by design. The bug has also been marked 'resolved invalid' (on their bugzilla).
I do agree that hidden controls should be, well, hidden.

Revision history for this message
Richard Eames (naddiseo) wrote :

Yes, I reported a new one on bugzilla, and it got marked as a dup of the link I posted above. After reading the comment about it being a bug by design I came to the conclusion that they wouldn't do anything about it, despite it being a very simple fix that makes firefox more standard compliant, so I reported it here in hopes that the ubuntu mozilla team can add it in to the ubuntu firefox build. Or does the ubuntu team only deal with ubuntu related issues and not display issues? Which ever may be, the fix is in best interest for the browser.

Revision history for this message
In , Matt Nordhoff (mnordhoff) wrote :

"display: block !important;" in the website's CSS would still overwrite that, though, right?

Revision history for this message
John Vivirito (gnomefreak) wrote :

Assigned to mozilla-bugs, tag added: mt-needtester, added steps to reproduce from upstream bug.

description: updated
Changed in mozilla-firefox:
assignee: nobody → mozilla-bugs
Revision history for this message
John Vivirito (gnomefreak) wrote :

Marking invalid due to it being a feature not a bug. We will not change this for that reason unless upstream changes this.

Changed in mozilla-firefox:
status: New → Invalid
Revision history for this message
In , Martijn-martijn (martijn-martijn) wrote :

No, display: none !important; in forms.css would override every other css, so that would work as a solution.

Opera 9.20 and IE7 don't allow styling of an <input type="hidden"> element (it always stays hidden).
I guess I've changed my mind on this one. It seems to me better to be compatible with IE7 then allowing the hidden input to be styled (although I think that's more logical).

Changed in firefox:
status: Unknown → Invalid
Changed in firefox:
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.