Skip to content

[Python] Release 0.23.1

Choose a tag to compare

@github-actions github-actions released this 27 Oct 13:24
· 9 commits to master since this release
daf722f

Performance

  • Find top-level commas in selector lists with a fast scan for the common case.
  • Look up elements by a hash of their ID, class, or tag name instead of interning it.
  • Avoid a reallocation and two attribute copies per element while building the document tree.
  • Return the output buffer from inline and inline_fragment without copying it.
  • Build the remaining <style> content for remove_inlined_selectors without intermediate copies.
  • Skip selectors with pseudo-classes that never match during inlining, such as :hover, before matching them.
  • Skip a redundant UTF-8 validation pass over the input HTML.
  • Use an index of attribute names for attribute selectors instead of checking every element.
  • Check only the root element for selectors ending in :root.
  • Skip selectors whose classes, IDs, or tags are missing from the document anywhere in the selector, not only in its leftmost part.
  • Check all classes and IDs of a selector against the document before compiling it, not after.
  • Escape text by scanning bytes instead of decoding characters.
  • Skip candidates of selectors like .a .b or #x > p when no ancestor has the required names, on documents of 1 KB or more.

Fixed

  • !important not recognised when written in uppercase or with whitespace or comments after !.
  • Only the last element with a duplicated id being styled in documents of 1 KB or more.
  • Uppercase or mixed-case type selectors (e.g. H1) not matching HTML elements in documents of 1 KB or more.
  • Class selectors with non-breaking spaces or other non-CSS whitespace in class not matching in documents of 1 KB or more.
  • Selector lists being split on commas inside :not(), attribute values, or strings, so a part of a selector could match on its own.
  • Attributes from repeated <html> or <body> tags being dropped, and existing ones duplicated.
  • Selectors starting with a class, ID, or tag that contains escapes or non-ASCII characters not matching in documents of 1 KB or more.
  • At-rules written twice when keep_at_rules is combined with remove_inlined_selectors or keep_style_tags.
  • Attribute selectors on class ([class], [class*=...], etc.) never matching.