select elements ignore 'size' when parent has padding

VERIFIED DUPLICATE of bug 1939

Status

()

Core
Layout: Form Controls
P3
normal
VERIFIED DUPLICATE of bug 1939
19 years ago
18 years ago

People

(Reporter: Hixie (not reading bugmail), Assigned: rods (gone))

Tracking

Trunk
x86
Windows 98
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

19 years ago
Select elements treat their 'size' attribute very oddly when their parent has
padding. They seem to decide to have a height which is a multiple of the size
and some other figure, and inherit the padding of their parent (!). This is
very odd to look at.

Furthermore, the padding-left is then carried through to the padding-right (!)
forcing, if the padding-left is bigger than the -right, a scroll bar to appear.
A similar oddity occurs with the -top and -bottom paddings.

For example:

   <p style="padding: 2em">
      <select size=4>
         <option>a</option>
         <option>b</option>
         <option>c</option>
         <option>d</option>
         <option>e</option>
         <option>f</option>
         <option>g</option>
      </select>
   </p>

In the above, the select element gets 2em padding between its frame and its
options, and has a huge height. This is visible on the following test pages:

   http://www.bath.ac.uk/%7Epy8ieh/internet/projects/mozilla/selectsize.html
   http://www.bath.ac.uk/%7Epy8ieh/internet/projects/mozilla/optgroup.shtml

Explicitly setting the padding on SELECT or OPTION seems to have little or
no effect.

Updated

19 years ago
Assignee: karnaze → rods

Comment 1

19 years ago
Reassigning to Rod.
(Assignee)

Comment 2

19 years ago
I thought there was a bug on this already, but I guess not. I did mention this
in some check in message. Yes, we don't obey padding or borders and it is a bug
problem (code wise) on trying to make this happen.

Basically, if you set the border and padding on a select the dropdown picks
those style settings and messes all the sizing up. So I will keep this bug open
to track this problem, this probably won't be fixed for beta.
(Reporter)

Comment 3

19 years ago
rods: I'm not setting padding on the SELECT. I'm setting it on its parent.
(Reporter)

Updated

19 years ago
Status: NEW → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → DUPLICATE
(Reporter)

Comment 4

19 years ago
Yup, there is a bug already open on this: bug 1939. Marking as DUP.

*** This bug has been marked as a duplicate of 1939 ***

Comment 5

18 years ago
cleaning up: VERIFY duplicate
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.