servo/components/shared/layout/layout_damage.rs
Martin Robinson 5286869b96
layout: Start using the new extensible RestyleDamage type from Stylo (#37592)
This will allow Servo to add custom types of damage in the near future
which correspond to minor phases layout. The damage exposed by Stylo
only corresponds to the major layout phses. In the future, both phases
will likely be managed by Servo itself and implementors will need to
provide their own damage system entirely.

Testing: This shouldn't change behavior and thus is covered by existing
tests.

Stylo PR: https://github.com/servo/stylo/pull/207

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-06-26 14:10:48 +00:00

16 lines
679 B
Rust

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use bitflags::bitflags;
bitflags! {
/// Individual layout actions that may be necessary after restyling. This is an extension
/// of `RestyleDamage` from stylo, which only uses the 4 lower bits.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct LayoutDamage: u16 {
/// Rebuild the entire box for this element, which means that every part of layout
/// needs to happena again.
const REBUILD_BOX = 0b111111111111 << 4;
}
}