mirror of
https://github.com/servo/servo
synced 2026-05-09 08:32:31 +02:00
This change optimizes `RestyleDamage` propagation and cleanup to reduce unnecessary box reconstruction and relayouts, while preventing damage from the current reflow affecting subsequent ones. Improvements include: - For box damage caused by `NodeDamage`, `RestyleDamage::RELAYOUT` is no longer marked immediately—avoiding erroneous propagation of `LayoutDamage::RECOLLECT_BOX_TREE_CHILDREN` to descendants during `RestyleDamage` propagation. - Clearing damage for nodes whose boxes will be preserved, preventing it from carrying over to the next reflow and increasing its workload. Testing: This should not change observable behavior and is thus covered by existing WPT tests. Although Servo lacks performance test cases, manual testing shows that this modification reduces reflow time by nearly 250ms, representing a decrease of approximately 25%. Signed-off-by: sharpshooter_pt <ibluegalaxy_taoj@163.com>