Format style component.

This commit is contained in:
chansuke 2018-09-09 16:24:45 +02:00 committed by Emilio Cobos Álvarez
parent 31fc6cd565
commit 8dab4d659a
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
120 changed files with 2207 additions and 1417 deletions

View file

@ -46,7 +46,9 @@ pub trait ElementSnapshot: Sized {
/// Gets the attribute information of the snapshot as a string.
///
/// Only for debugging purposes.
fn debug_list_attributes(&self) -> String { String::new() }
fn debug_list_attributes(&self) -> String {
String::new()
}
/// The ID attribute per this snapshot. Should only be called if
/// `has_attrs()` returns true.
@ -233,7 +235,8 @@ where
// :lang() needs to match using the closest ancestor xml:lang="" or
// lang="" attribtue from snapshots.
NonTSPseudoClass::Lang(ref lang_arg) => {
return self.element
return self
.element
.match_element_lang(Some(self.get_lang()), lang_arg);
},
@ -242,12 +245,14 @@ where
let flag = pseudo_class.state_flag();
if flag.is_empty() {
return self.element
return self
.element
.match_non_ts_pseudo_class(pseudo_class, context, &mut |_, _| {});
}
match self.snapshot().and_then(|s| s.state()) {
Some(snapshot_state) => snapshot_state.intersects(flag),
None => self.element
None => self
.element
.match_non_ts_pseudo_class(pseudo_class, context, &mut |_, _| {}),
}
}