mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
layout: Add a repaint-only incremental layout mode (#36978)
This change adds the simplest kind of incremental layout. When Servo detects that all style changes only require a repaint, only run stacking context tree and WebRender display list generation. This means that these kind of restyles do not need a re-layout. Instead, the existing box and fragment trees will be used and the styles of damaged nodes will be updated in their box and fragment tree nodes. This requires a new style repair DOM traversal for nodes that have had their style damaged. In addition, careful accounting of all the places where we store style must happen in order ot update those styles. Testing: This is covered by existing WPT tests as it should not change observable behavior. We have created a test case which shows a 50% speedup when run in Servo, even though there still a long way to go to match the speed of other browsers: https://gist.github.com/mrobinson/44ec87d028c0198917a7715a06dd98a0 Co-authored-by: Oriol Brufau <obrufau@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
51fa6cdcb6
commit
8808f9a468
20 changed files with 467 additions and 72 deletions
|
@ -359,7 +359,7 @@ impl Element {
|
|||
|
||||
if damage == NodeDamage::OtherNodeDamage {
|
||||
doc.note_node_with_dirty_descendants(self.upcast());
|
||||
restyle.damage = RestyleDamage::rebuild_and_reflow();
|
||||
restyle.damage = RestyleDamage::reconstruct();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue