aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/invalidation/element/state_and_attributes.rs
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2018-07-27 17:44:48 +0200
committerEmilio Cobos Álvarez <emilio@crisal.io>2018-08-08 01:36:03 +0200
commitc3289ad46e93c7d4bd8ff17d874fbf367373dfaa (patch)
treeae43ede5d2660ec5050e78a52f96a8bc3fa352fe /components/style/invalidation/element/state_and_attributes.rs
parent2e3aacdf8005bd32f48e75454abfcb7f5f2673e5 (diff)
downloadservo-c3289ad46e93c7d4bd8ff17d874fbf367373dfaa.tar.gz
servo-c3289ad46e93c7d4bd8ff17d874fbf367373dfaa.zip
style: Improve logging for attribute changes.
And general Element logging. We now print all the attributes for comparison. If this turns out to be too verbose we can change it to diff them or something. Differential Revision: https://phabricator.services.mozilla.com/D2471
Diffstat (limited to 'components/style/invalidation/element/state_and_attributes.rs')
-rw-r--r--components/style/invalidation/element/state_and_attributes.rs40
1 files changed, 26 insertions, 14 deletions
diff --git a/components/style/invalidation/element/state_and_attributes.rs b/components/style/invalidation/element/state_and_attributes.rs
index 73d73282910..a0f85ae30bb 100644
--- a/components/style/invalidation/element/state_and_attributes.rs
+++ b/components/style/invalidation/element/state_and_attributes.rs
@@ -208,20 +208,32 @@ where
}
}
- debug!("Collecting changes for: {:?}", element);
- debug!(" > state: {:?}", state_changes);
- debug!(
- " > id changed: {:?} -> +{:?} -{:?}",
- snapshot.id_changed(),
- id_added,
- id_removed
- );
- debug!(
- " > class changed: {:?} -> +{:?} -{:?}",
- snapshot.class_changed(),
- classes_added,
- classes_removed
- );
+ if log_enabled!(::log::Level::Debug) {
+ debug!("Collecting changes for: {:?}", element);
+ if !state_changes.is_empty() {
+ debug!(" > state: {:?}", state_changes);
+ }
+ if snapshot.id_changed() {
+ debug!(
+ " > id changed: +{:?} -{:?}",
+ id_added,
+ id_removed
+ );
+ }
+ if snapshot.class_changed() {
+ debug!(
+ " > class changed: +{:?} -{:?}",
+ classes_added,
+ classes_removed
+ );
+ }
+ if snapshot.other_attr_changed() {
+ debug!(
+ " > attributes changed, old: {}",
+ snapshot.debug_list_attributes()
+ )
+ }
+ }
let lookup_element = if element.implemented_pseudo_element().is_some() {
element.pseudo_element_originating_element().unwrap()