Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's easy to cook up a syntax for selecting parents. The hard part is implementing it efficiently. It requires browsers to scan more of the DOM tree when elements are changed. I expect it to be one of the (many) parts of CSS that are avoided by websites that want to render quickly.


I'm not sure, CSS selectors are already matched left-to-right so you're not scanning more stuff, it's just that you're selecting an other level of your match tree.

    ul > li > p

    ul > $li > p
have the same matching complexity: the browser finds all p on the page, then checks if their parent is a li, then checks if that parent is a ul. The difference (which may or may not require significant work) is that before the check acted as a filter on the originally matched object, whereas now there's a transform/translation.


s/left-to-right/right-to-left/ of course


Exactly. And just because there's a draft specification, doesn't mean browsers will implement it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: