Bug 4125

Summary: getComputedStyle returns null when called on an element which has display: none set
Product: WebKit Reporter: Thomas Fuchs <thomas>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: ian, mitz, ssaviano
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
Test case showing the null return none

Description Thomas Fuchs 2005-07-25 03:40:53 PDT
getComputedStyle returns null when called on an element which has display: none set.

<style>
 #x { display:none; }
</style>

<div id="x">test</div>

document.defaultView.getComputedStyle(document.getElementById('x'), null)  returns null (but should 
return the computed CSS styles object). This works when display:none; is removed.

Note that this works all ok in Gecko-based browsers.
Comment 1 Thomas Fuchs 2005-07-25 03:44:22 PDT
Created attachment 3079 [details]
Test case showing the null return
Comment 2 David Kilzer (:ddkilzer) 2006-05-25 11:43:54 PDT
Reassigning bug to default assignee to make it more visible.  (I don't believe Dave is working on this.)
Comment 3 Vladimir Olexa (vladinecko) 2006-10-11 15:54:47 PDT
this seems to be working/fixed now. (using r. 16732)
Comment 4 mitz 2007-01-23 11:51:56 PST
*** Bug 12384 has been marked as a duplicate of this bug. ***
Comment 5 mitz 2007-01-23 11:53:53 PST
Oops, bug 12384 is not a duplicate of this bug. This bug seems to be fixed in that a style declaration is returned, however all its properties are null, which bug 12384 is about.