Improve debug log related to selector matching

Move debug log in matches_complex_selector_internal to the front so that the
entire complex selector can be printed.

MozReview-Commit-ID: KXBDpbzBv0I
This commit is contained in:
Ting-Yu Lin 2017-08-23 16:32:19 +08:00
parent 4725a05bfb
commit a23596d377
2 changed files with 4 additions and 4 deletions

View file

@ -519,13 +519,13 @@ fn matches_complex_selector_internal<E, F>(mut selector_iter: SelectorIter<E::Im
{
*relevant_link = relevant_link.examine_potential_link(element, &mut context.shared);
debug!("Matching complex selector {:?} for {:?}, relevant link {:?}",
selector_iter, element, relevant_link);
let matches_all_simple_selectors = selector_iter.all(|simple| {
matches_simple_selector(simple, element, context, &relevant_link, flags_setter)
});
debug!("Matching for {:?}, simple selector {:?}, relevant link {:?}",
element, selector_iter, relevant_link);
let combinator = selector_iter.next_sequence();
let siblings = combinator.map_or(false, |c| c.is_sibling());
if siblings {

View file

@ -356,7 +356,7 @@ where
);
if log_enabled!(Trace) {
trace!("Matched rules:");
trace!("Matched rules for {:?}:", self.element);
for rn in rule_node.self_and_ancestors() {
let source = rn.style_source();
if source.is_some() {