Add support for non-integer values in HTML dimension attributes
Categories
(Core :: DOM: Core & HTML, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox69 | --- | fixed |
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
Details
Attachments
(4 files)
Something like this:
<img src="whatever" width="50.5%">
should make the image 101px wide in a 200px container. Similarly,
<img src="whatever" width="50.5">
should end up 50.5 CSS px wide (so 101 device pixels on 2dppx screen).
We don't do that right now, because we parse those as "50%" and "50" respectively. The issue is that nsAttrValue doesn't have generic (non-percentage) float storage. And even for percentages, we only use the mPercent of the misc container from SetIntValueAndType
, if the value doesn't fit in the bits we have available to store it.
We should just add a SetFloatValueAndType
that would explicitly store floats in the misc container as needed.
Comment 1•5 years ago
|
||
Bugbug thinks this bug is a enhancement, but please change it back in case of error.
Assignee | ||
Comment 2•5 years ago
|
||
Well, it's technically a spec violation, and may have web compat impact, though none has been reported yet.
Updated•5 years ago
|
Assignee | ||
Comment 3•5 years ago
|
||
Assignee | ||
Comment 4•5 years ago
|
||
Assignee | ||
Comment 5•5 years ago
|
||
In the new setup, if the value is an integer and fits in our restricted integer
range we store it directly; otherwise we just go ahead and store it as a double
in the misc container, since we have a double available there anyway.
Assignee | ||
Comment 6•5 years ago
|
||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Comment 8•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/56b4d2258093
https://hg.mozilla.org/mozilla-central/rev/3065c80f6ca8
https://hg.mozilla.org/mozilla-central/rev/6e8779559140
https://hg.mozilla.org/mozilla-central/rev/5277a23512a6
Description
•