diff options
Diffstat (limited to 'components/script_layout_interface/message.rs')
-rw-r--r-- | components/script_layout_interface/message.rs | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/components/script_layout_interface/message.rs b/components/script_layout_interface/message.rs index e48ac42f509..6cf783fcd60 100644 --- a/components/script_layout_interface/message.rs +++ b/components/script_layout_interface/message.rs @@ -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(), + } + } +} |