style: Define a CascadeLevel enum, and make the rule tree operate on it.

We'll use this level to know where to stop replacing nodes in the tree.
This commit is contained in:
Emilio Cobos Álvarez 2017-01-29 02:59:54 +01:00
parent 31ecc9b692
commit 314f2ce714
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
6 changed files with 144 additions and 64 deletions

View file

@ -105,6 +105,7 @@ use style::properties::{DeclaredValue, Importance};
use style::properties::{PropertyDeclaration, PropertyDeclarationBlock, parse_style_attribute};
use style::properties::longhands::{background_image, border_spacing, font_family, font_size, overflow_x};
use style::restyle_hints::RESTYLE_SELF;
use style::rule_tree::CascadeLevel;
use style::selector_parser::{NonTSPseudoClass, RestyleDamage, SelectorImpl, SelectorParser};
use style::sink::Push;
use style::stylist::ApplicableDeclarationBlock;
@ -380,7 +381,7 @@ impl LayoutElementHelpers for LayoutJS<Element> {
declarations: vec![(declaration, Importance::Normal)],
important_count: 0,
})),
Importance::Normal)
CascadeLevel::PresHints)
}
let bgcolor = if let Some(this) = self.downcast::<HTMLBodyElement>() {