Files
serenity/Userland/Libraries/LibWeb/CSS/Selector.cpp
Andreas Kling 7bf0f0e908 LibWeb: Include immediate child (>) combinator in ancestor filter
Before this change, the ancestor filter would only reject rules that
required a certain set of descendant strings (class, ID or tag name)
to be present in the current element's ancestor chain.

An immediate child is also a descendant, so we can include this
relationship in the ancestor filter as well.

This substantially improves the efficiency of the ancestor filter on
websites using Tailwind CSS.

For example, https://tailwindcss.com/ itself goes from full style
updates taking ~1400ms to ~350ms. Still *way* too long, but a huge
improvement nonetheless.

(cherry picked from commit 34fdd0d44fcf916540ea66ba9c895ba005a54b9a)
2024-10-30 22:17:22 -04:00

23 KiB