Re: [cssom] Proposing a getDefaultComputedStyle method

On 10/12/12 3:36 PM, Kang-Hao (Kenny) Lu wrote:
> For what's worth, is
> closed as RESOLVED WORKSFORME because the relevant jQuery bug is fixed.

It's "fixed" by hardcoding the default display value for "body" in 
jQuery.  It's more of a moldy scrap of wallpaper than a fix.

> What really should be brought up as an issue is perhaps getComputedStyle
> of elements inside a 'display: none' iframe but I haven't read through
> the history of this problem...

Again, the whole iframe thing is a complete hack.  In this case a hack 
around the fact that they're trying to determine the display of an 
element by appending it to the body, but then it's affected by 
stylesheets in the page, so they have to create the iframe in an attempt 
to escape those stylesheets, etc.

But why should they need to create an entire separate document just to 
ask for the default style, when the UA has that information already? 
That's just silly, and all sorts of error-prone, not just in 
display:none cases.  For one thing, nothing guarantees that the UA 
default style in that subframe is the same as in the parent document!


Received on Friday, 12 October 2012 19:43:26 UTC