mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Bug 1357583: style: Recurse into @import rules when looking at the added rules. r=heycam
Apparently my whole conception of how the list of sheets in the styleset looked like was flawled, and we only ever get one append_sheet for the topmost stylesheet, instead of one for each. MozReview-Commit-ID: FMClygMJkTc
This commit is contained in:
parent
f569274cca
commit
ebd6f47be3
1 changed files with 17 additions and 2 deletions
|
@ -182,6 +182,9 @@ impl StylesheetInvalidationSet {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Collects invalidations for a given list of CSS rules.
|
/// Collects invalidations for a given list of CSS rules.
|
||||||
|
///
|
||||||
|
/// TODO(emilio): Convert stylesheet.effective_rules into an iterator to
|
||||||
|
/// share code. This needs the ability to stop ASAP.
|
||||||
fn collect_invalidations_for_rule_list(
|
fn collect_invalidations_for_rule_list(
|
||||||
&mut self,
|
&mut self,
|
||||||
rules: &CssRules,
|
rules: &CssRules,
|
||||||
|
@ -294,8 +297,20 @@ impl StylesheetInvalidationSet {
|
||||||
Namespace(..) => {
|
Namespace(..) => {
|
||||||
// Irrelevant to which selector scopes match.
|
// Irrelevant to which selector scopes match.
|
||||||
}
|
}
|
||||||
Import(..) => {
|
// NB: We need to do it here, we won't visit the appropriate sheet
|
||||||
// We'll visit the appropriate stylesheet if/when it matters.
|
// otherwise!
|
||||||
|
Import(ref lock) => {
|
||||||
|
let import_rule = lock.read_with(guard);
|
||||||
|
|
||||||
|
let mq = import_rule.stylesheet.media.read_with(guard);
|
||||||
|
if !mq.evaluate(stylist.device(), stylist.quirks_mode()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
self.collect_invalidations_for_rule_list(
|
||||||
|
import_rule.stylesheet.rules.read_with(guard),
|
||||||
|
stylist,
|
||||||
|
guard);
|
||||||
}
|
}
|
||||||
Media(ref lock) => {
|
Media(ref lock) => {
|
||||||
let media_rule = lock.read_with(guard);
|
let media_rule = lock.read_with(guard);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue