Bug 122416 - getComputedStyle returns specified zIndex "" on disconnected elements
Summary: getComputedStyle returns specified zIndex "" on disconnected elements
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL: http://jsfiddle.net/m_gol/WZrYg/
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-06 10:44 PDT by Michał Gołębiowski-Owczarek
Modified: 2022-07-26 14:12 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Gołębiowski-Owczarek 2013-10-06 10:44:45 PDT
Steps to reproduce the problem:
1. Go to http://jsfiddle.net/m_gol/WZrYg/

What is the expected behavior?
According to http://www.w3.org/TR/cssom/#resolved-value getComputedStyle should return a computed value of zIndex which is 1 if set explicitely even on disconnected elements.

What went wrong?
getComputedStyle returned "" for zIndex on a disconnected element.

Did this work before? No 

Blink bug: https://code.google.com/p/chromium/issues/detail?id=304700
Comment 1 Ahmad Saleem 2022-07-26 13:38:05 PDT
Based on comment from related Chrome / Blink bug (which was marked as "Wontfix"), this is web-spec bug and this is related comment:

https://bugs.chromium.org/p/chromium/issues/detail?id=304700#c15

I am not sure, what is expected behaviour but all browsers (Safari 15.6 on macOS 12.5, Chrome Canary 106 and Firefox Nightly 104) in this JSfiddle just shows - getComputedStyle(div).zIndex:

and nothing but empty void in front of it. I think Web-spec clarification bug can be raised subject to Blink comment but nothing specific to do here IMO, if all browsers agree. (Please ignore my comment - if I am wrong). Thanks!
Comment 2 Michał Gołębiowski-Owczarek 2022-07-26 14:12:00 PDT
Yeah, it looks like all browsers align here and have for many years (Firefox has changed its behavior in version 65); I guess it's time to close it as Won't fix.