aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/selector_matching.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/style/selector_matching.rs')
-rw-r--r--components/style/selector_matching.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/components/style/selector_matching.rs b/components/style/selector_matching.rs
index 677114f93d8..6d4c22e399b 100644
--- a/components/style/selector_matching.rs
+++ b/components/style/selector_matching.rs
@@ -12,6 +12,7 @@ use selectors::Element;
use std::process;
use smallvec::VecLike;
use util::resource_files::read_resource_file;
+use util::opts;
use legacy::PresentationalHintSynthesis;
use media_queries::Device;
@@ -76,9 +77,18 @@ impl Stylist {
}
}
}
+ for &(ref contents, ref url) in &opts::get().user_stylesheets {
+ stylist.add_stylesheet(Stylesheet::from_bytes(
+ &contents, url.clone(), None, None, Origin::User));
+ }
stylist
}
+ #[inline]
+ pub fn stylesheets(&self) -> &[Stylesheet] {
+ &self.stylesheets
+ }
+
pub fn constrain_viewport(&self) -> Option<ViewportConstraints> {
let cascaded_rule = self.stylesheets.iter()
.flat_map(|s| s.effective_rules(&self.device).viewport())