Alpha values in #RRGGBBAA format can lose accuracy
Categories
(DevTools :: Inspector: Rules, defect, P2)
Tracking
(firefox67 fixed)
Tracking | Status | |
---|---|---|
firefox67 | --- | fixed |
People
(Reporter: mgol, Assigned: miker)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
Bug 1271191 added support for the #RRGGBBAA hexadecimal with alpha color format:
https://drafts.csswg.org/css-color/#hex-notation
However, when set via DevTools CSS Rules pane, the value is converted in a lossy way, losing the opacity precision.
To reproduce:
- Open DevTools.
- Focus some element.
- In the CSS Rules pane, add a new property:
color: #fefefef0
. - Notice the browser changes it to
color: #fefefee6
.
The weird thing is this looks only as a representation problem - CSSOM APIs return the correct value:
document.body.style.color; // "rgba(254, 254, 254, 0.94)"
If you set the Firefox-modified value via CSSOM, you can see it's different:
document.body.style.color = '#fefefee6';
document.body.style.color; // "rgba(254, 254, 254, 0.90)"
Assignee | ||
Comment 1•5 years ago
|
||
Adding to the above STR:
You must first set the default color unit to "Hex" in settings.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 2•5 years ago
|
||
Reporter | ||
Comment 3•5 years ago
|
||
(In reply to Mike Ratcliffe [:miker] [:mratcliffe] [:mikeratcliffe] from comment #1)
Adding to the above STR:
You must first set the default color unit to "Hex" in settings.
You don't have to, it also works with the default "As authored". If you changed that to a non-hex format then yes, my STR won't work.
Assignee | ||
Comment 4•5 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=e51b137ed66d9905e14a6e371f633ed9cddf6a60
Assignee | ||
Comment 5•5 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=50337c88a371cefecd805687583dd9c8a00aba2d
Pushed by mratcliffe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2a4f6bb7524a Alpha values in #RRGGBBAA format can lose accuracy r=nchevobbe
Comment 7•5 years ago
|
||
bugherder |
Description
•