[FIX]Changing select element style mistakenly alters its height

RESOLVED FIXED in mozilla1.6alpha

Status

()

Core
Layout: Form Controls
P1
normal
RESOLVED FIXED
15 years ago
15 years ago

People

(Reporter: Chris Dolan, Assigned: bz)

Tracking

Trunk
mozilla1.6alpha
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

15 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.5) Gecko/20031007
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.5) Gecko/20031007

We have reproduced this bug in Mozilla 1.5 on Mac OSX and Windows 2000.

When JavaScript changes the class of a <select> element, and the subsequent
class has a different hard-coded width value, the height of the select changes.

In our test HTML, we alternate between two styles:
   .large { width: 100px; height: 30px }
   .small { width: 0px }


Reproducible: Always

Steps to Reproduce:
1. Go to the test URL
2. Click "Reduce"
3. Click "Enlarge"

Actual Results:  
The select has a reduced height.

Expected Results:  
The height should not have been affected.

We tried the following potential workarounds, all of which still exhibited the bug:
  * set the height to 30px in the .small style
  * set the width to between 1 and 4 pixels in the .small style

The following change prevented the bug's appearance:
  * set the width to 5 or more pixels in the .small style
Nope, pure reflow bug..
Assignee: dom_bugs → form
Component: DOM Style → Layout: Form Controls
Taking.
Assignee: form → bzbarsky
Priority: -- → P1
Summary: Changing select element style mistakenly alters its height → [FIX]Changing select element style mistakenly alters its height
Target Milestone: --- → mozilla1.6alpha
Created attachment 133739 [details] [diff] [review]
Fix

You have fallen into a Special Case.... <sigh>
Comment on attachment 133739 [details] [diff] [review]
Fix

roc, would you review?	The problem is that the "width is 0" special case fucks
up the height, and this gets cached.  So we keep losing the borderpadding width
on every iteration...
Attachment #133739 - Flags: superreview?(roc)
Attachment #133739 - Flags: review?(roc)
Attachment #133739 - Flags: superreview?(roc)
Attachment #133739 - Flags: superreview+
Attachment #133739 - Flags: review?(roc)
Attachment #133739 - Flags: review+
Fixed.
Status: NEW → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → FIXED
+    aDesiredSize.height = dispHeight + aBorderPadding.top + aBorderPadding.bottom;;

nit: there's one semicolon too much
You need to log in before you can comment on or make changes to this bug.