aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/rule_tree
diff options
context:
space:
mode:
authorKuoE0 <kuoe0.tw@gmail.com>2017-08-14 15:09:24 +0800
committerKuoE0 <kuoe0.tw@gmail.com>2017-08-16 11:08:49 +0800
commita6ceafe3daaea3d207a3cbc6e5c4944c4d8f00d9 (patch)
tree0748148352cb275518142f66eef03d310ac8ce3f /components/style/rule_tree
parentf93c6dfbd54f1ec40a0feba12932ef5aac379624 (diff)
downloadservo-a6ceafe3daaea3d207a3cbc6e5c4944c4d8f00d9.tar.gz
servo-a6ceafe3daaea3d207a3cbc6e5c4944c4d8f00d9.zip
Make emtpy rule can be inserted into rule tree
Diffstat (limited to 'components/style/rule_tree')
-rw-r--r--components/style/rule_tree/mod.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/components/style/rule_tree/mod.rs b/components/style/rule_tree/mod.rs
index ff511a2a583..1b1062d255a 100644
--- a/components/style/rule_tree/mod.rs
+++ b/components/style/rule_tree/mod.rs
@@ -210,7 +210,10 @@ impl RuleTree {
_ => {},
};
}
- if any_normal {
+ // We really want to ensure empty rule nodes appear in the rule tree for
+ // devtools, this condition ensures that if we find an empty rule node, we
+ // insert it at the normal level.
+ if any_normal || !any_important {
if matches!(level, Transitions) && found_important {
// There can be at most one transition, and it will come at
// the end of the iterator. Stash it and apply it after