Re:A Shocking Truth About CSS
by niyazpk on Tuesday March 09, 2010 @11:41AM
(#1178674)
Can you please explain why this is so?
[ Parent
| on HN ]
Re:A Shocking Truth About CSS
by robin_reala on Tuesday March 09, 2010 @11:53AM
(#1178715)
A DOM node can have multiple children but only one parent. To go up the tree and check for a hit you simply call (in pseudocode) node.parent.isOK?.parent.isOK? etc. To go down the tree you have to not only choose your search strategy (depth-first, breadth-first) but also check a whole lot more nodes in the hope that you’ll find what you want.