Allow style sharing for elements with ids as long as the ID is not being used for styling.

This commit is contained in:
Boris Zbarsky 2017-05-26 12:48:03 -04:00
parent d031b5badb
commit ad1309552d
5 changed files with 93 additions and 8 deletions

View file

@ -159,6 +159,12 @@ impl SelectorMap<Rule> {
|block| (block.specificity, block.source_order));
}
/// Check whether we have rules for the given id
#[inline]
pub fn has_rules_for_id(&self, id: &Atom) -> bool {
self.id_hash.get(id).is_some()
}
/// Append to `rule_list` all universal Rules (rules with selector `*|*`) in
/// `self` sorted by specificity and source order.
pub fn get_universal_rules(&self,