Bug 23202 - rgba() and hsla() opacity doesn't end up as-specified in DOM
Summary: rgba() and hsla() opacity doesn't end up as-specified in DOM
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P3 Normal
Assignee: Nobody
URL: http://farukat.es/bugs/webkit-rgba.html
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-08 17:52 PST by Faruk Ates
Modified: 2023-02-18 06:30 PST (History)
4 users (show)

See Also:


Attachments
Same testcase file as URL: shows rgba() and opacity properties with inconsistent outcomes in the DOM (345 bytes, text/html)
2009-01-08 17:56 PST, Faruk Ates
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Faruk Ates 2009-01-08 17:52:31 PST
When setting e.g. opacity: .42 on an element, retrieving that property in the DOM again returns 0.42 as expected.

This doesn't work for rgba() and hsla() values. E.g. specifying rgba(0,0,0, .42) returns rgba(0,0,0, 0.417969) in the DOM, the same for hsla().

This is inconsistent and unexpected.
Comment 1 Faruk Ates 2009-01-08 17:56:19 PST
Created attachment 26553 [details]
Same testcase file as URL: shows rgba() and opacity properties with inconsistent outcomes in the DOM

Adding the testcase as a file attachment as well for scenarios where my site might possibly be down or something similar.
Comment 2 mitz 2009-01-09 00:53:10 PST
This probably happens because opacity is stored as a float and the alpha component of a color is stored as a byte.
Comment 3 Ahmad Saleem 2023-02-18 06:30:38 PST
Using STP163, I get opacity and rgba as 0.42 in computed tab of Developer Tools? Do we need anything else or we can close this?