Created attachment 61124 [details] demonstrates the bug When the background color is set to rgba(255, 255, 0.5), the computed style's background color indicates the actual alpha value to be 0.496094. Firefox returns 0.5 correctly. The bug is demonstrated in the attachment.
Also, sometimes, assigning the generated rgba color append to generate a new value : document.body.style.backgroundColor="rgba(0,0,0,0.3)"; "rgba(0,0,0,0.3)" document.body.style.backgroundColor = document.body.style.backgroundColor; "rgba(0, 0, 0, 0.296875)" document.body.style.backgroundColor = document.body.style.backgroundColor; "rgba(0, 0, 0, 0.292969)" document.body.style.backgroundColor = document.body.style.backgroundColor; "rgba(0, 0, 0, 0.292969)"
Created attachment 76360 [details] demonstrates issue with getComputedStyle for opacity Similarly, if an element's opacity is set to 0.7, getComputedStyle returns 0.699999988079071.
I think this is a divide-by-255 vs. 256 issue.
Internally rgba(255, 255, 0, 0.5) is stored as 0x7fffff00 (ARGB), and 127/255 is 0.49803921568627. (In reply to comment #2) > Created an attachment (id=76360) [details] > demonstrates issue with getComputedStyle for opacity > > Similarly, if an element's opacity is set to 0.7, getComputedStyle returns 0.699999988079071. This is just floating point rounding error.
*** This bug has been marked as a duplicate of bug 91355 ***