mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
Previously, we optimized hover style invalidation to mark for style updates only those elements that were matched by :hover selectors in the last style calculation. This change takes it a step further by invalidating only the elements where the set of selectors that use :hover changes after hovered element is modified. The implementation is as follows: 1. Collect all elements whose styles might be affected by a change in the hovered element. 2. Retrieve a list of all selectors that use :hover. 3. Test each selector against each element and record which selectors match. 4. Update m_hovered_node to the newly hovered element. 5. Repeat step 3. 6. For each element, compare the previous and current sets of matched selectors. If they differ, mark the element for style recalculation.
34 KiB
34 KiB