Can anyone point to where this is required by the css specification? Or is this an implementation detail? The reality may be that all the browsers do it this way, but why couldn't someone add some more smarts to choose selectors based on selectivity, just as a SQL query planner would?
It’s quicker to walk up a DOM tree than it is to walk down - that’s the root reason why browsers have all implemented it this way.
A Shocking Truth About CSS
31–40 of 70 posts
Re: A Shocking Truth About CSS
#32(from the header:) The Two Alexs Alexes? Alex's? Alexi? Alexim? In hackanonical form, Alexen. As in oxen, vaxen, boxen.
Re: A Shocking Truth About CSS
#33Earlier quoted context omitted.
> a computer capable of executing millions of instructions per second Billions, not millions.
Billions of cycles per second. But executing an instruction frequently takes 20 cycles or so. That reduces instructions to hundreds of millions.
Re: A Shocking Truth About CSS
#34Earlier quoted context omitted.
It’s quicker to walk up a DOM tree than it is to walk down - that’s the root reason why browsers have all implemented it this way.
Can you please explain why this is so?
Re: A Shocking Truth About CSS
#35Earlier quoted context omitted.
> a computer capable of executing millions of instructions per second Billions, not millions.
Billions of cycles per second. But executing an instruction frequently takes 20 cycles or so. That reduces instructions to hundreds of millions.
Re: A Shocking Truth About CSS
#36Re: A Shocking Truth About CSS
#37Earlier quoted context omitted.
> a computer capable of executing millions of instructions per second Billions, not millions.
Billions of cycles per second. But executing an instruction frequently takes 20 cycles or so. That reduces instructions to hundreds of millions.
Re: A Shocking Truth About CSS
#38Re: A Shocking Truth About CSS
#39Earlier quoted context omitted.
Billions of cycles per second. But executing an instruction frequently takes 20 cycles or so. That reduces instructions to hundreds of millions.
Presumably any modern processor would use some form of pipelining, which I think would take instructions back up into the billions. (The pentium 4, if I recall correctly, had a 20+ stage pipeline)
Re: A Shocking Truth About CSS
#40Earlier quoted context omitted.
Yeah, OK. So just be ignorant instead.
do you read the source of the linux kernel to understand how to use bash? how about the source of a wifi driver before connecting to a network? your premise is rediculous.
(And I have proof that I do actually do this; I had a misbehaving joystick, and the linux fork in my github contains the fix.)
Anyway, in conclusion, if you want to know what algorithm Firefox uses to process CSS selectors, just read the Firefox source code. If you don't give a damn, then don't do that instead. But if you care and you do nothing, that's just silly.