mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
style: List the matched rules with trace-level logging is enabled.
This commit is contained in:
parent
8b7a414b1c
commit
c13be5cd13
1 changed files with 17 additions and 4 deletions
|
@ -16,6 +16,7 @@ use context::{CurrentElementInfo, SelectorFlagsMap, SharedStyleContext, StyleCon
|
||||||
use data::{ComputedStyle, ElementData, ElementStyles, RestyleData};
|
use data::{ComputedStyle, ElementData, ElementStyles, RestyleData};
|
||||||
use dom::{AnimationRules, SendElement, TElement, TNode};
|
use dom::{AnimationRules, SendElement, TElement, TNode};
|
||||||
use font_metrics::FontMetricsProvider;
|
use font_metrics::FontMetricsProvider;
|
||||||
|
use log::LogLevel::Trace;
|
||||||
use properties::{CascadeFlags, ComputedValues, SKIP_ROOT_AND_ITEM_BASED_DISPLAY_FIXUP, cascade};
|
use properties::{CascadeFlags, ComputedValues, SKIP_ROOT_AND_ITEM_BASED_DISPLAY_FIXUP, cascade};
|
||||||
use properties::longhands::display::computed_value as display;
|
use properties::longhands::display::computed_value as display;
|
||||||
use restyle_hints::{RESTYLE_CSS_ANIMATIONS, RESTYLE_CSS_TRANSITIONS, RestyleHint};
|
use restyle_hints::{RESTYLE_CSS_ANIMATIONS, RESTYLE_CSS_TRANSITIONS, RestyleHint};
|
||||||
|
@ -1163,10 +1164,22 @@ pub trait MatchMethods : TElement {
|
||||||
&mut applicable_declarations,
|
&mut applicable_declarations,
|
||||||
&context.shared.guards);
|
&context.shared.guards);
|
||||||
|
|
||||||
let important_rules_changed = self.has_animations() &&
|
if log_enabled!(Trace) {
|
||||||
data.has_styles() &&
|
trace!("Matched rules:");
|
||||||
data.important_rules_are_different(&primary_rule_node,
|
for rn in primary_rule_node.self_and_ancestors() {
|
||||||
&context.shared.guards);
|
if let Some(source) = rn.style_source() {
|
||||||
|
trace!(" > {:?}", source);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let important_rules_changed =
|
||||||
|
self.has_animations() &&
|
||||||
|
data.has_styles() &&
|
||||||
|
data.important_rules_are_different(
|
||||||
|
&primary_rule_node,
|
||||||
|
&context.shared.guards
|
||||||
|
);
|
||||||
|
|
||||||
RulesMatchedResult {
|
RulesMatchedResult {
|
||||||
rule_nodes_changed: data.set_primary_rules(primary_rule_node),
|
rule_nodes_changed: data.set_primary_rules(primary_rule_node),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue