Log element during selector matching

MozReview-Commit-ID: D8eFyRCy5BR
This commit is contained in:
J. Ryan Stinnett 2017-06-06 16:36:25 -05:00
parent eaefcbe551
commit 6b1b8bbee8
8 changed files with 35 additions and 2 deletions

View file

@ -453,6 +453,16 @@ impl<'a, Impl: SelectorImpl> Iterator for SelectorIter<'a, Impl> {
}
}
impl<'a, Impl: SelectorImpl> fmt::Debug for SelectorIter<'a, Impl> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let iter = self.iter.clone().rev();
for component in iter {
component.to_css(f)?
}
Ok(())
}
}
/// An iterator over all simple selectors belonging to ancestors.
pub struct AncestorIter<'a, Impl: 'a + SelectorImpl>(SelectorIter<'a, Impl>);
impl<'a, Impl: 'a + SelectorImpl> AncestorIter<'a, Impl> {