Closed Bug 643945 Opened 14 years ago Closed 14 years ago

Consider using a <button> element as the anonymous content for drop-down comboboxes instead of the <input type=button>

Categories

(Core :: Layout: Form Controls, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla5

People

(Reporter: ehsan.akhgari, Assigned: bzbarsky)

References

(Depends on 1 open bug)

Details

(Keywords: perf)

Attachments

(1 file)

This came up in bug 237842. We should try to see if we can use a <button> element in nsComboBoxControlFrame instead of the currently used <input type=button>, which has way more overhead.
Blocks: 237842
Attached patch Like so?Splinter Review
I left the SetAttr(type, button) call, because a <button> with no type defaults to submit, unfortunately. This seems to be about 40ms faster on construction, and aabout 15ms faster on destruction on the testcase in bug 237842. We could win another 40ms or so on construction by using a <div> or something, but then we'd need to do all the styling for it correctly. Ehsan, are you willing to test this on Windows? I think that's the one place we still show the dropmarker when using the system appearance....
Attachment #521091 - Flags: review?(ehsan)
Assignee: nobody → bzbarsky
Even more ideally we would just not have a separate dropmarker element. That would take more work, though.
Whiteboard: [need review]
OS: Mac OS X → All
Hardware: x86 → All
Comment on attachment 521091 [details] [diff] [review] Like so? This looks sane to me. I'll test it on Windows too.
Attachment #521091 - Flags: review?(ehsan) → review+
This looks to be fine on Windows, too!
Whiteboard: [need review] → [need landing]
Status: NEW → RESOLVED
Closed: 14 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Whiteboard: [need landing]
Target Milestone: --- → mozilla2.2
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: