diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-08-16 15:46:17 +0200 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-08-18 14:31:35 +0200 |
commit | d1725b1f195652bf947d5ce00622807597bc0b9c (patch) | |
tree | 5c0416212d033bcbbf19574134ff7fc74531a17a /components/script/dom/bindings/trace.rs | |
parent | b8159e659e787c1e792d13b0939bb88e978ae84e (diff) | |
download | servo-d1725b1f195652bf947d5ce00622807597bc0b9c.tar.gz servo-d1725b1f195652bf947d5ce00622807597bc0b9c.zip |
style: Replicate the list of stylesheets on the layout thread.
This is a patch that unifies a bit how Gecko and Stylo stylesheets work, in
order to be able to eventually move the stylesheets into the stylist, and be
able to incrementally update the invalidation map.
Diffstat (limited to 'components/script/dom/bindings/trace.rs')
-rw-r--r-- | components/script/dom/bindings/trace.rs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs index 4168fb4effa..df681e3add9 100644 --- a/components/script/dom/bindings/trace.rs +++ b/components/script/dom/bindings/trace.rs @@ -102,7 +102,8 @@ use style::media_queries::MediaList; use style::properties::PropertyDeclarationBlock; use style::selector_parser::{PseudoElement, Snapshot}; use style::shared_lock::{SharedRwLock as StyleSharedRwLock, Locked as StyleLocked}; -use style::stylesheets::{CssRules, FontFaceRule, KeyframesRule, MediaRule}; +use style::stylesheet_set::StylesheetSet; +use style::stylesheets::{CssRules, FontFaceRule, KeyframesRule, MediaRule, Stylesheet}; use style::stylesheets::{NamespaceRule, StyleRule, ImportRule, SupportsRule, ViewportRule}; use style::stylesheets::keyframes_rule::Keyframe; use style::values::specified::Length; @@ -374,6 +375,7 @@ unsafe_no_jsmanaged_fields!(AttrIdentifier); unsafe_no_jsmanaged_fields!(AttrValue); unsafe_no_jsmanaged_fields!(Snapshot); unsafe_no_jsmanaged_fields!(PendingRestyle); +unsafe_no_jsmanaged_fields!(Stylesheet); unsafe_no_jsmanaged_fields!(HttpsState); unsafe_no_jsmanaged_fields!(Request); unsafe_no_jsmanaged_fields!(RequestInit); @@ -641,6 +643,18 @@ unsafe impl JSTraceable for StyleLocked<MediaList> { } } +unsafe impl<S> JSTraceable for StylesheetSet<S> +where + S: JSTraceable + ::style::stylesheets::StylesheetInDocument + PartialEq + 'static, +{ + unsafe fn trace(&self, tracer: *mut JSTracer) { + for s in self.iter() { + s.trace(tracer) + } + } +} + + /// Holds a set of JSTraceables that need to be rooted struct RootedTraceableSet { set: Vec<*const JSTraceable>, |