20 ms·
On the other hand: - XPath literally didn't exist when CSS selectors were introduced - XPath's flexibility makes it a lot more challenging to implement effici
by masklinn 2y ago
On the other hand:
- XPath literally didn't exist when CSS selectors were introduced
- XPath's flexibility makes it a lot more challenging to implement efficiently, even more so when there are thousands of rules which need to be dynamically reevaluated at each document update
- XPath is lacking conveniences dedicated to HTML semantics, and handrolling them in xpath 1.0 was absolutely heinous (go try and implement a class predicate in xpath 1.0 without extensions)
- mdaniel 2y ago> - XPath literally didn't exist when CSS selectors were introduced [citation required] https://www.w3.org/TR/1999/REC-xpath-19991116/ https://www.w3.org/TR/1999/REC-xpath-19991116/ https://www.w3.org/TR/REC-CSS1-961217 https://www.w3.org/TR/REC-CSS1-961217 > W3C Recommendation 17 Dec 1996, revised 11 Jan 1999 There are various drafts and statuses, so it's always open to hair-splitting but based only on the publication date CSS does appear to win