Skip to content

Full coverage for "nth-of-type" optimization #8

@autarc

Description

@autarc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions