mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Bug 1331047: Implement the new traversal semantics for stylo. r=bholley,hiro
MozReview-Commit-ID: 4BXx9JpGZKX Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
parent
85ad961104
commit
be0139ff3c
11 changed files with 548 additions and 363 deletions
|
@ -532,6 +532,21 @@ impl ElementData {
|
|||
self.styles = Some(styles);
|
||||
}
|
||||
|
||||
/// Sets the computed element rules, and returns whether the rules changed.
|
||||
pub fn set_primary_rules(&mut self, rules: StrongRuleNode) -> bool {
|
||||
if !self.has_styles() {
|
||||
self.set_styles(ElementStyles::new(ComputedStyle::new_partial(rules)));
|
||||
return true;
|
||||
}
|
||||
|
||||
if self.styles().primary.rules == rules {
|
||||
return false;
|
||||
}
|
||||
|
||||
self.styles_mut().primary.rules = rules;
|
||||
true
|
||||
}
|
||||
|
||||
/// Returns true if the Element has a RestyleData.
|
||||
pub fn has_restyle(&self) -> bool {
|
||||
self.restyle.is_some()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue