Move PendingRestyle to the style_layout_interface crate

This commit is contained in:
Anthony Ramine 2020-03-27 15:16:57 +01:00
parent 04af32128c
commit df0118dd10
6 changed files with 34 additions and 30 deletions

View file

@ -23,8 +23,9 @@ use std::sync::atomic::AtomicBool;
use std::sync::Arc;
use style::context::QuirksMode;
use style::dom::OpaqueNode;
use style::invalidation::element::restyle_hints::RestyleHint;
use style::properties::PropertyId;
use style::selector_parser::PseudoElement;
use style::selector_parser::{PseudoElement, RestyleDamage, Snapshot};
use style::stylesheets::Stylesheet;
/// Asynchronous messages that script can send to layout.
@ -234,3 +235,29 @@ pub struct LayoutThreadInit {
pub layout_is_busy: Arc<AtomicBool>,
pub window_size: WindowSizeData,
}
/// A pending restyle.
#[derive(Debug, MallocSizeOf)]
pub struct PendingRestyle {
/// If this element had a state or attribute change since the last restyle, track
/// the original condition of the element.
pub snapshot: Option<Snapshot>,
/// Any explicit restyles hints that have been accumulated for this element.
pub hint: RestyleHint,
/// Any explicit restyles damage that have been accumulated for this element.
pub damage: RestyleDamage,
}
impl PendingRestyle {
/// Creates a new empty pending restyle.
#[inline]
pub fn new() -> Self {
PendingRestyle {
snapshot: None,
hint: RestyleHint::empty(),
damage: RestyleDamage::empty(),
}
}
}