aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_layout_interface/message.rs
diff options
context:
space:
mode:
authorAnthony Ramine <nox@nox.paris>2020-03-27 15:16:57 +0100
committerAnthony Ramine <nox@nox.paris>2020-03-28 14:00:53 +0100
commitdf0118dd104318e2d0a1400aaf880c1826769e78 (patch)
tree3c9b1b61514c0debb817c29bf259ab9e8ce91eec /components/script_layout_interface/message.rs
parent04af32128c10f8a67e8c012e68359169bbb8ef5e (diff)
downloadservo-df0118dd104318e2d0a1400aaf880c1826769e78.tar.gz
servo-df0118dd104318e2d0a1400aaf880c1826769e78.zip
Move PendingRestyle to the style_layout_interface crate
Diffstat (limited to 'components/script_layout_interface/message.rs')
-rw-r--r--components/script_layout_interface/message.rs29
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(),
+ }
+ }
+}