Closed Bug 679870 Opened 13 years ago Closed 13 years ago

getComputedStyle().getPropertyValue("z-index") serializes large values in scientific notation

Categories

(Core :: DOM: CSS Object Model, defect)

6 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 470769

People

(Reporter: antitoxic, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0
Build ID: 20110615151330

Steps to reproduce:

console.log(el.style.zIndex);
console.log(document.defaultView.getComputedStyle(el).getPropertyValue('z-index'));


Actual results:

'1e+7'
10000002


Expected results:

Nothing is modifying the z-index of that element but Firefox returns '1e+7' as computed value instead of what is declared in the CSS: 10000002
Version: 5 Branch → 6 Branch
It's still the same in FF6. Why is the computation of z-index so imprecise?
Here's a test case: http://jsfiddle.net/rembF/18/
Component: General → DOM
Product: Firefox → Core
QA Contact: general → general
Component: DOM → DOM: CSS Object Model
QA Contact: general → style-system
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Wrong value from document.defaultView.getComputedStyle(el).getPropertyValue("z-index") → getComputedStyle().getPropertyValue("z-index") serializes large values in scientific notation
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
Bug 470769 seem to be related but I emphasize that not only the z-index being serialised but the fact it only has a precision of 6 digits.

Again, look at:
http://jsfiddle.net/rembF/18/

It means a z-index 999999 will be the largest possible value for firefox.
All other will be trimmed to 6 digits.

99999999 will become 99999900
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
It's serializing as a float, which reduces the precision.
Status: REOPENED → RESOLVED
Closed: 13 years ago13 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.