Auto merge of #9852 - bholley:stylo_uplifts_3, r=bholley

Stylo uplifts 3

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9852)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-03-05 01:48:35 +05:30
commit 49e9594fb9
11 changed files with 214 additions and 162 deletions

View file

@ -19,7 +19,7 @@ pub trait SelectorImplExt : SelectorImpl + Sized {
fn get_user_or_user_agent_stylesheets() -> &'static [Stylesheet<Self>];
fn get_quirks_mode_stylesheet() -> &'static Stylesheet<Self>;
fn get_quirks_mode_stylesheet() -> Option<&'static Stylesheet<Self>>;
}
#[derive(Clone, Debug, PartialEq, Eq, HeapSizeOf, Hash)]
@ -135,7 +135,7 @@ impl SelectorImplExt for ServoSelectorImpl {
}
#[inline]
fn get_quirks_mode_stylesheet() -> &'static Stylesheet<Self> {
&*QUIRKS_MODE_STYLESHEET
fn get_quirks_mode_stylesheet() -> Option<&'static Stylesheet<Self>> {
Some(&*QUIRKS_MODE_STYLESHEET)
}
}

View file

@ -146,7 +146,9 @@ impl<Impl: SelectorImplExt> Stylist<Impl> {
}
if self.quirks_mode {
self.add_stylesheet(&Impl::get_quirks_mode_stylesheet());
if let Some(s) = Impl::get_quirks_mode_stylesheet() {
self.add_stylesheet(s);
}
}
for ref stylesheet in doc_stylesheets.iter() {