Open Bug 553957 Opened 15 years ago Updated 3 years ago

Clean CSS frame constructor code related to select element

Categories

(Core :: Layout: Form Controls, enhancement)

enhancement

Tracking

()

People

(Reporter: mounir, Unassigned)

References

Details

Since select element has now a default value when multiple attribute is used, according to bz, the CSS frame constructor could be cleaned. See bug 551846.
Specifically, this code in nsCSSFrameConstructor::ConstructSelectFrame: 3042 sel->GetSize(&size); 3043 PRBool multipleSelect = PR_FALSE; 3044 sel->GetMultiple(&multipleSelect); 3045 // Construct a combobox if size=1 or no size is specified and its multiple select 3046 if (((1 == size || 0 == size) || (kNoSizeSpecified == size)) && (PR_FALSE == multipleSelect)) { Or will it still be possible to have size == 0 or size == 1 while having multiple set?
If multiple is set, size can be set to 1. Exactly like it can be set to 1 if multiple is not set. However, 0 is a forbidden value for size so if setAttribute('size', 0) is call, IDL attribute should reflect size=1 if !multiple or size=4 if multiple is set.
Hmm. It doesn't sound like we can simplify this much, then. :(
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.