Firefox isn't internally consistent about sizing of empty vs. near-empty <select> elements
Categories
(Core :: Layout: Form Controls, defect, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox64 | --- | affected |
People
(Reporter: dholbert, Unassigned)
References
Details
(Keywords: testcase)
Attachments
(1 file)
|
749 bytes,
text/html
|
Details |
Comment 1•7 years ago
|
||
| Reporter | ||
Comment 2•7 years ago
|
||
| Reporter | ||
Comment 3•7 years ago
|
||
| Reporter | ||
Updated•7 years ago
|
Comment 4•7 years ago
|
||
| Reporter | ||
Comment 5•7 years ago
|
||
| Reporter | ||
Comment 6•6 years ago
|
||
Here's a bugzilla-hosted version of comment 0's jsfiddle testcase, BTW.
| Reporter | ||
Comment 7•6 years ago
|
||
(In reply to Morgan Reschenberg [:morgan] from comment #1)
FWIW, MacOS has some (different) weird results on Nightly (64.0a1 (2018-09-19) (64-bit)). I get:
selEmpty: 27.5, 18.5
selOptionEmpty: 35, 17.5
selOptionNbsp: 38.149993896484375, 18.5
Maybe this has gotten better? Right now I'm getting nearly-consistent measurements on Mac ("Mojave", on a remote machine viewed using BrowserStack, using Firefox Beta 67 on that Mac machine).
selEmpty: 38.149993896484375, 19
selOptionEmpty: 38.15000915527344, 19
selOptionNbsp: 38.149993896484375, 19
The difference in the second measurement there as compared to the first/third is ~ 0.000015px, which is much less than an app unit in size (1/60th pixel i.e. 0.016px), so I suspect it's just a rounding error or some other weird unimportant artifact.
And I do get consistent results on Linux and BrowserStack-hosted Windows10:
Linux, Firefox Nightly 69: 44, 25 (for all 3 measurement rows)
Windows, Firefox Beta 67: 31, 20 (for all 3 measurement rows)
Comment 8•6 years ago
|
||
Linux, Firefox Nightly 69: 44, 29 (for all 3 measurement rows)
OSX Mojave (10.14.4), Firefox Nightly 69:
selEmpty: 38.100006103515625, 18.5
selOptionEmpty: 38.09999084472656, 18.5
selOptionNbsp: 38.100006103515625, 18.5
| Reporter | ||
Comment 9•6 years ago
•
|
||
I just confirmed that on my Mac machine, the remaining (negligible) difference between the select boxes is simply due to rounding error and conversion issues.
All three select elements have width=2286 app units, but their x positions var and aren't necessarily pixel-aligned (in layout). (In particular, they have x=480, 3006, and 5532.) And the API in the testcase here, getBoundingClientRect, produces its resulting rect in an "x, y, XMost(), YMost()" representation (where XMost() = x + width):
https://searchfox.org/mozilla-central/rev/f8b11433159cbc9cc80500b3e579d767473fa539/dom/base/Element.cpp#1036
https://searchfox.org/mozilla-central/rev/f8b11433159cbc9cc80500b3e579d767473fa539/dom/base/DOMRect.cpp#83-84
So: even for equally-sized objects, they may end up with a subtly different getBoundingClientRect rect-widths if they're positioned at spots that trigger rounding behavior.
So: the remaining differences here are negligible and well-understood, and are in fact not a difference at all at the nscoord level. And the significant "real" differences from comment 0 and comment 1 have gone away. So, this is WORKSFORME.
Description
•