Summary: 1) Make a table with td's 2) Set one of the td's display to "none" 3) getComputedStyle on that td will report that element's display as "" (empty string) This was tested with TOT Webkit (r19043).
Created attachment 12631 [details] Test Case
*** This bug has been marked as a duplicate of 4125 ***
Sorry, this is not a duplicate of bug 4125.
True for all properties of all objects that do not have a renderer.
Hyatt and I discussed how to fix this a long time ago. We need to change the CSS style selector so it can create a style for a DOM element that does not have a RenderObject, which should be relatively straightforward. Then we need to create a cache of these RenderStyle objects for elements they have been computed for -- presumably a HashMap. We need to invalidate the styles in the cache when changes are made to the element. And we need to make the computed style look up the RenderStyle in this cache.
<rdar://problem/4960104>
Although an annoying bug, this has workarounds and is not a regression, thus not P1.
(In reply to comment #4) > True for all properties of all objects that do not have a renderer. > Starting with <http://trac.webkit.org/projects/webkit/changeset/20570>, this is true for all properties *except* display.
Created attachment 15441 [details] [WIP] return rich computed style declarations for elements without renderers Still not thoroughly tested. I am also worried that I missed something: > We need to change the CSS style selector so it can create a style for a DOM > element that does not have a RenderObject.
Created attachment 15442 [details] Return rich computed style declarations for elements without renderers Added a test and a change log. Still wondering what needs changed in CSSStyleSelector.
Comment on attachment 15442 [details] Return rich computed style declarations for elements without renderers + virtual RenderStyle* computedStyle() { return parent() ? parent()->computedStyle() : 0; } I don't think it's helpful to define a virtual function like this one as an inline in the header. It's easier to modify it if it's even needed if you keep it in the .cpp file instead, and it would only actually get inlined if it was a non-virtual call, which should never happen in this case. But that's a nitpick. This looks great! I guess I was wrong about CSSStyleSelector needing a change! r=me
Landed in r24099 with Darin's suggestion.
Leaks fixed in r24103, which introduced bug 14563.