News for hackers. Stuff that matters.
Re:Google Speed Tips Get Picked Apart by grandalf on Thursday June 25, 2009 @11:32PM (#674897)
I like the feature of assessing slow CSS. I'd never realized that constructs like the following would be "very inefficient":

  #foo p span{
    color: #fff;
  }
Re:Google Speed Tips Get Picked Apart by apsurd on Thursday June 25, 2009 @11:51PM (#674918)
i read it, but still have to ask why ?
Re:Google Speed Tips Get Picked Apart by dezwald on Friday June 26, 2009 @01:40AM (#675000)
it's inefficient because the browser has to search/loop through the DOM looking for the exact pattern of the corresponding css rules, instead of a direct pointer like:

#my_foo_span{ color:#fff }.

Re:Google Speed Tips Get Picked Apart by jonhohle on Friday June 26, 2009 @02:20AM (#675024)
but they mean different things. one says, all spans which are descendants of divs which are descendants of some elements with id=foo. the other says one element with id=my_foo_span. duplicating rules in CSS to match overly specific IDs defeats one of its major advantages.
Re:Google Speed Tips Get Picked Apart by grandalf on Friday June 26, 2009 @07:08PM (#676314)
one thing I don't understand is, does that mean it's bad CSS style? Is doing the suggested optimization equivalent to writing really huge functions in c before compilers could inline?
Re:Google Speed Tips Get Picked Apart by grandalf on Friday June 26, 2009 @12:50AM (#674966)
why they're inefficient?