Skip to content

Commit ae78004

Browse files
Add stacking context damage when outline-width becomes non-zero (#274)
As an optimization, we skip outlines in the stacking context if they have a width of zero. This means that when it becomes non-zero, we need stacking context damage. Signed-off-by: Oriol Brufau <[email protected]> Co-authored-by: Martin Robinson <[email protected]>
1 parent 1ffea9c commit ae78004

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

style/servo/restyle_damage.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use crate::properties::{
1919
use crate::values::computed::basic_shape::ClipPath;
2020
use crate::values::computed::Perspective;
2121
use crate::values::generics::transform::{GenericRotate, GenericScale, GenericTranslate};
22+
use crate::Zero;
2223
use std::fmt;
2324

2425
bitflags! {
@@ -148,6 +149,7 @@ fn augmented_restyle_damage_rebuild_stacking_context(
148149
) -> bool {
149150
restyle_damage_rebuild_stacking_context(old, new)
150151
|| old.guarantees_stacking_context() != new.guarantees_stacking_context()
152+
|| old.get_outline().outline_width.is_zero() != new.get_outline().outline_width.is_zero()
151153
}
152154
fn compute_damage(old: &ComputedValues, new: &ComputedValues) -> ServoRestyleDamage {
153155
let mut damage = ServoRestyleDamage::empty();

0 commit comments

Comments
 (0)