P.S. for all ... the reason getComputedStyle does not make sense for a node
is that styles are inherited and you'll never know in which position that
style would be respected or not.

You append the div in a node with style color:red !important and your div
had style color:black ... how can you predict a style if you don't know what
kind of dependencies/inheritance that node is gonna have one appended
somewhere?

If an engine does it by default it's silly cause lots of properties gonna be
replaced, changed, modified, due to Cascade Style Sheet inheritance.

Regards



On Sat, Oct 24, 2009 at 11:05 AM, Andrea Giammarchi <
andrea.giammar...@gmail.com> wrote:

> Sizzle searches over nodes already present in the document.
>
> If I create a div inside whatever function thanks gosh Sizzle won't return
> that div in a search $("div"), do you follow me?
>
> I know you simply brought here yet another inconsistency in the browsers
> panorama, but to fix this doubtfully useful operation which logically does
> not make sense I would go for the other way .... if(!node.parentNode)return
> null;
>
> To have a computed style for a not in DOM element you need to append it,
> retrieve the style, remove the node ... no way, since this is gonna be a
> performances killer and we all take care about performances, don't we?
>
> Regards
>
>
> On Sat, Oct 24, 2009 at 10:14 AM, DBJDBJ <dbj...@gmail.com> wrote:
>
>>
>> @Andrea : thanks for normal tone, but again somehow you fundamentaly
>> misunderstood me ? If anything you (probably) followed my code
>> through ;o)
>>
>> One of the strengths of jQuery is: It smooths the sharply uneven
>> surface of cross browser javascript.
>> If I post something that does not mean I want to do it that way and no
>> other way.
>> I simply stumbled upon this issue which , I thought, might be
>> interesting for the jQ team, because this is yet another "feature"
>> that works in some browsers and does not work in others.
>> 99% of jQuery are much more concerned to have code that works and that
>> uses jQuery, than to engage in W3C spec minutiae...
>>
>> My example/finding uses somewhat esoteric code, but the issue of
>> CHROME not allowing getComputedStyle() on non-attached new elements,
>> might break some other part of Sizzle or jQ core, so I thought I
>> report it...
>>
>> --DBJ
>>
>> On Oct 24, 1:23 am, Andrea Giammarchi <andrea.giammar...@gmail.com>
>> wrote:
>> > On Sat, Oct 24, 2009 at 12:22 AM, DBJDBJ <dbj...@gmail.com> wrote:
>> >
>> > > Well for the FF team this was not meaningless, since it is possible to
>> > > set/get css value on the non-attached newly created dom element in FF
>> > > and then get to it through getComputedStyle()
>> > > You just have to follow in the Firebug and Chrome console, what I have
>> > > posted initally. Instead of "wondering" ...
>> >
>> > DBJ it does not matter what an engine does internally, it maters why on
>> > earth you would ask for a Computed property when this has never been
>> > computed ... this would be normal for a JScript engine, not SpiderMonkey
>> or
>> > V8 where performances should be a priority.
>> >
>> > Accordingly, I would rather ask Firefox (or Firebug plug-in) or Chrome
>> why
>> > they provide such information for an element has never been rendered
>> since
>> > from *Computation* point of view this is the real waste of time/resurces
>> and
>> > probablythe reason Firefox 3.5 is so slow with DOM render compared even
>> with
>> > Internet Explorer.
>> >
>> > It's nice in any case to see how you trust "applications" more than
>> logic
>> > ... do you agree that a picture could never be showed if that fact never
>> > happened?
>> >
>> > Regards
>> >>
>>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to