Add support for user stylesheets specified on the command-line.

This commit is contained in:
Simon Sapin 2015-08-05 17:06:31 +02:00
parent 4bcb1dc926
commit 9317a30b91
2 changed files with 25 additions and 3 deletions

View file

@ -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,6 +77,10 @@ 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
}