Setting display: block on a hidden input allows borders on those hidden inputs

RESOLVED INVALID

Status

()

Firefox
General
RESOLVED INVALID
13 years ago
8 years ago

People

(Reporter: Greg M., Unassigned)

Tracking

({testcase})

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8) Gecko/20051229 Camino/1.0b2
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8) Gecko/20051229 Camino/1.0b2

Display block (when applied to hidden input elements) is allowing styling of those elements, such as borders.

Reproducible: Always

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


Actual Results:  
Load the file, and you should see collapsed borders around your hidden inputs (in the example they would be the color red.

Expected Results:  
No borders around hidden inputs, the display mode on a hidden input type should not matter.

This occurs in Camino 1.0b2 and Firefox 1.5.0.1
(Reporter)

Comment 1

13 years ago
Created attachment 217291 [details]
Example of the bug in action

View this to see what this is about.
(Reporter)

Comment 2

13 years ago
Created attachment 217292 [details]
Previous example was incorrect, sorry
(Reporter)

Updated

13 years ago
Attachment #217291 - Attachment is obsolete: true
(Reporter)

Updated

13 years ago
Summary: Setting display: block on a hidden input allows borders on thos hidden inputs → Setting display: block on a hidden input allows borders on those hidden inputs

Updated

13 years ago
Keywords: testcase
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.
Yep.  This is by design.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → INVALID
*** Bug 334865 has been marked as a duplicate of this bug. ***
*** Bug 356054 has been marked as a duplicate of this bug. ***

Comment 7

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

Updated

11 years ago
Duplicate of this bug: 390091

Comment 9

11 years ago
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

Comment 10

11 years ago
To follow the standard a fix would be to put 

display: none !important;

in forms.css for hidden inputs.
"display: block !important;" in the website's CSS would still overwrite that, though, right?
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).

Updated

8 years ago
You need to log in before you can comment on or make changes to this bug.