optimal-select icon indicating copy to clipboard operation
optimal-select copied to clipboard

Full coverage for "nth-of-type" optimization

Open autarc opened this issue 9 years ago • 0 comments

The current optimization which checks if nth-child(n) selectors can be replaced with the less conditional nth-of-type(n) pseudo selectors covers only specific use cases for complex and nested selections which keep the same matching order n. This simple implementation works well for most cases but can be error prone towards some scenarios. A more advanced solution should instead handle all matches.

Furthermore the same optimization doesn't provide the best results at the server. Since the adapt module implements the necessary functions to be compatible with the browser, it can be recognized that the nth-of-type(n) pseudo selector won't be matched reliable. Although the traversal follows the description it doesn't return the same matches as DOM based clients.

autarc avatar Apr 16 '16 00:04 autarc