[Webkit-unassigned] [Bug 93445] New: getComputedStyle for `opacity` is not the value specified.
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Aug 8 00:20:25 PDT 2012
https://bugs.webkit.org/show_bug.cgi?id=93445
Summary: getComputedStyle for `opacity` is not the value
specified.
Product: WebKit
Version: 528+ (Nightly build)
Platform: Unspecified
URL: javascript: var el = document.body;
void(el.style.opacity = '0.95');
alert([el.style.opacity,
getComputedStyle(el).opacity]);
OS/Version: Unspecified
Status: UNCONFIRMED
Severity: Normal
Priority: P2
Component: CSS
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: dhtmlkitchen at gmail.com
Reading `opacity` back from `getComputedStyle` results in a value that is not the value specified.
var el = document.body;
el.style.opacity = '0.95'; // Specified value.
el.style.opacity;// Specified value returned.
"0.95"
getComputedStyle(el).opacity; // Not the specified value.
"0.949999988079071"
With getComputedStyle(el).opacity, an internal number of the opacity is returned. Is it that '9.5' sets the opacity as a (lossy) binary number, which, when returned, is converted to a string?
Css3 spec says that the value returned must be "The same as the specified value after clipping the <alphavalue> to the range [0.0,1.0]."
Since the value returned ("0.949999988079071") is not the specified value ("9.5"), then this is a violation of a spec.
http://www.w3.org/TR/css3-color/#transparency
| Computed value: The same as the specified value
| after clipping the <alphavalue> to the range [0.0,1.0].
Version 5.1.1 (6534.51.22)
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.51.22 (KHTML, like Gecko) Version/5.1.1 Safari/534.51.22"
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list