Repository navigation
[Ruby] Release 0.23.1
·
3 commits
to master
since this release
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
inlineandinline_fragmentwithout copying it. - Build the remaining
<style>content forremove_inlined_selectorswithout 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 .bor#x > pwhen no ancestor has the required names, on documents of 1 KB or more.
Fixed
!importantnot recognised when written in uppercase or with whitespace or comments after!.- Only the last element with a duplicated
idbeing 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
classnot 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_rulesis combined withremove_inlined_selectorsorkeep_style_tags. - Attribute selectors on
class([class],[class*=...], etc.) never matching.