Bug 1454030: followup: Fix Servo build bustage. r=me
authorEmilio Cobos Álvarez <emilio@crisal.io>
Tue, 17 Apr 2018 19:55:25 +0200
changeset 467656 c6e99e5290a81e80e08c282e9f0bcb2c68e579e9
parent 467655 86badb90129d251ed51205dc9ca438b39f55f0bd
child 467657 2e462060cbedc258c3cfbb7aba14e22fd13cf854
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1454030
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1454030: followup: Fix Servo build bustage. r=me DONTBUILD, since code is not part of the build. MozReview-Commit-ID: KU2sDFDjeNV
servo/components/script/dom/document.rs
servo/components/style/stylesheets/import_rule.rs
--- a/servo/components/script/dom/document.rs
+++ b/servo/components/script/dom/document.rs
@@ -130,17 +130,17 @@ use std::time::{Duration, Instant};
 use style::attr::AttrValue;
 use style::context::QuirksMode;
 use style::invalidation::element::restyle_hints::RestyleHint;
 use style::media_queries::{Device, MediaList, MediaType};
 use style::selector_parser::{RestyleDamage, Snapshot};
 use style::shared_lock::{SharedRwLock as StyleSharedRwLock, SharedRwLockReadGuard};
 use style::str::{split_html_space_chars, str_join};
 use style::stylesheet_set::DocumentStylesheetSet;
-use style::stylesheets::{Stylesheet, StylesheetContents, Origin, OriginSet};
+use style::stylesheets::{CssRule, Stylesheet, Origin, OriginSet};
 use task_source::TaskSource;
 use time;
 use timers::OneshotTimerCallback;
 use url::Host;
 use url::percent_encoding::percent_decode;
 
 /// The number of times we are allowed to see spurious `requestAnimationFrame()` calls before
 /// falling back to fake ones.
@@ -211,26 +211,34 @@ struct StyleSheetInDocument {
 
 impl PartialEq for StyleSheetInDocument {
     fn eq(&self, other: &Self) -> bool {
         Arc::ptr_eq(&self.sheet, &other.sheet)
     }
 }
 
 impl ::style::stylesheets::StylesheetInDocument for StyleSheetInDocument {
-    fn contents(&self, guard: &SharedRwLockReadGuard) -> &StylesheetContents {
-        self.sheet.contents(guard)
+    fn origin(&self, guard: &SharedRwLockReadGuard) -> Origin {
+        self.sheet.origin(guard)
+    }
+
+    fn quirks_mode(&self, guard: &SharedRwLockReadGuard) -> QuirksMode {
+        self.sheet.quirks_mode(guard)
+    }
+
+    fn enabled(&self) -> bool {
+        self.sheet.enabled()
     }
 
     fn media<'a>(&'a self, guard: &'a SharedRwLockReadGuard) -> Option<&'a MediaList> {
         self.sheet.media(guard)
     }
 
-    fn enabled(&self) -> bool {
-        self.sheet.enabled()
+    fn rules<'a, 'b: 'a>(&'a self, guard: &'b SharedRwLockReadGuard) -> &'a [CssRule] {
+        self.sheet.rules(guard)
     }
 }
 
 /// <https://dom.spec.whatwg.org/#document>
 #[dom_struct]
 pub struct Document {
     node: Node,
     window: Dom<Window>,
--- a/servo/components/style/stylesheets/import_rule.rs
+++ b/servo/components/style/stylesheets/import_rule.rs
@@ -78,21 +78,17 @@ impl DeepCloneWithLock for ImportSheet {
                 };
                 ImportSheet::Sheet(unsafe { GeckoStyleSheet::from_addrefed(clone) })
             },
             ImportSheet::Pending(ref p) => ImportSheet::Pending(p.clone()),
         }
     }
 }
 
-/// A sheet that is held from an import rule.
-#[cfg(feature = "servo")]
-#[derive(Debug)]
-pub struct ImportSheet(pub ::servo_arc::Arc<::stylesheets::Stylesheet>);
-
+#[cfg(feature = "gecko")]
 impl StylesheetInDocument for ImportSheet {
     fn origin(&self, _guard: &SharedRwLockReadGuard) -> Origin {
         match *self {
             ImportSheet::Sheet(ref s) => s.contents().origin,
             ImportSheet::Pending(ref p) => p.origin,
         }
     }
 
@@ -120,16 +116,44 @@ impl StylesheetInDocument for ImportShee
     fn rules<'a, 'b: 'a>(&'a self, guard: &'b SharedRwLockReadGuard) -> &'a [CssRule] {
         match *self {
             ImportSheet::Sheet(ref s) => s.contents().rules(guard),
             ImportSheet::Pending(_) => &[],
         }
     }
 }
 
+/// A sheet that is held from an import rule.
+#[cfg(feature = "servo")]
+#[derive(Debug)]
+pub struct ImportSheet(pub ::servo_arc::Arc<::stylesheets::Stylesheet>);
+
+#[cfg(feature = "servo")]
+impl StylesheetInDocument for ImportSheet {
+    fn origin(&self, guard: &SharedRwLockReadGuard) -> Origin {
+        self.0.origin(guard)
+    }
+
+    fn quirks_mode(&self, guard: &SharedRwLockReadGuard) -> QuirksMode {
+        self.0.quirks_mode(guard)
+    }
+
+    fn enabled(&self) -> bool {
+        self.0.enabled()
+    }
+
+    fn media<'a>(&'a self, guard: &'a SharedRwLockReadGuard) -> Option<&'a MediaList> {
+        self.0.media(guard)
+    }
+
+    fn rules<'a, 'b: 'a>(&'a self, guard: &'b SharedRwLockReadGuard) -> &'a [CssRule] {
+        self.0.rules(guard)
+    }
+}
+
 #[cfg(feature = "servo")]
 impl DeepCloneWithLock for ImportSheet {
     fn deep_clone_with_lock(
         &self,
         _lock: &SharedRwLock,
         _guard: &SharedRwLockReadGuard,
         _params: &DeepCloneParams,
     ) -> Self {