4.1.3
- FIX: Fix
filter()given a list of tags taking time and memory quadratic in the number of top level elements
of a document, such as a fragment parsed withhtml.parser, for selectors that count siblings, like
:nth-child()or:first-of-type. The tags were grouped by their top level element, so each top level element
counted all of its siblings again with caches of its own. The tags of a document now share one group, as with
select(). - FIX: Fix
of-typeselectors, such as:first-of-type,:last-of-type,:only-of-type, and
:nth-of-type(), taking time quadratic in the number of siblings when many of them have distinct tag names, as
the siblings were scanned again for each tag name. Siblings of every type now share one scan. - FIX:
:lang()stops checking a language against its list of values at the first value that matches. Along with
each distinct language being matched against a list only once per select, a list with many values no longer costs
time for every element. - FIX: Document that
max_selectorsdoes not limit the length of selector strings, or the number of values in
the argument of a pseudo-class, and that limiting the length of selectors, if that is a concern, is the
responsibility of the application.