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

RESOLVED FIXED in mozilla5

Status

()

RESOLVED FIXED
8 years ago
6 years ago

People

(Reporter: Ehsan, Assigned: bzbarsky)

Tracking

(Depends on: 1 bug, Blocks: 1 bug, {perf})

Trunk
mozilla5
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

8 years ago
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.
(Assignee)

Updated

8 years ago
Blocks: 237842
(Assignee)

Comment 1

8 years ago
Created attachment 521091 [details] [diff] [review]
Like so?

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)

Updated

8 years ago
Assignee: nobody → bzbarsky
(Assignee)

Comment 2

8 years ago
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
(Reporter)

Comment 3

8 years ago
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+
(Reporter)

Comment 4

8 years ago
This looks to be fine on Windows, too!
(Assignee)

Updated

8 years ago
Whiteboard: [need review] → [need landing]
(Assignee)

Comment 5

8 years ago
Pushed http://hg.mozilla.org/mozilla-central/rev/256d72a8245c
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Whiteboard: [need landing]
Target Milestone: --- → mozilla2.2
Depends on: 677117
You need to log in before you can comment on or make changes to this bug.