Bug 4125 - getComputedStyle returns null when called on an element which has display: none set
Summary: getComputedStyle returns null when called on an element which has display: no...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-25 03:40 PDT by Thomas Fuchs
Modified: 2007-01-23 11:53 PST (History)
3 users (show)

See Also:


Attachments
Test case showing the null return (702 bytes, application/xhtml+xml)
2005-07-25 03:44 PDT, Thomas Fuchs
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.