mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-18 07:50:13 +00:00
* fix(producer): bound the static media selector check by the page it walks The pre-check matched every script selector against each media element and bounded the work by selector length alone. A selector such as :has(...), a positional pseudo-class or a chain of descendant combinators can walk the whole page on each match, so the check could block the render process. Only tags, ids, classes and attributes joined by child combinators and at most one descendant combinator are now matched statically. Each check is charged for the media element's ancestors and their attribute text, and everything else is left to the browser probe. * fix(producer): charge each selector's full text and every simple test The selector check charged the collapsed selector shape, so a long attribute value or whitespace run was nearly free even though the matcher compiles the whole selector on every call. Each media element is now charged the raw selector length per ancestor. Attribute text is charged per simple test rather than per compound, and it is measured only once a non-id selector needs costing. * style(producer): shorten the selector cost comment