CSSS! and computational complexity of selectors.

Lets say we have following markup: <ul> <li>First</li> <li>Second (with <a href=#>hyperlink</a>)</li> <li>Third</li> <li>Fourth (with <a href=#>hyperlink</a> too)</li> </ul> and the styling task: all <li> that have <a> elements inside have yellow background. If we would have hypothetic selector :with-child(selector) then we could write this as: li:with-child(a:link) { background:yellow; } Problem with this selector lies…