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

@ -29,6 +29,7 @@ use smallvec::SmallVec;
use std::cell::Cell;
use std::clone::Clone;
use std::cmp;
use std::fmt;
/// When the ElementState of an element (like IN_HOVER_STATE) changes,
/// certain pseudo-classes (like :hover) may require us to restyle that
@ -607,6 +608,15 @@ impl<'a, E> ElementWrapper<'a, E>
}
}
impl<'a, E> fmt::Debug for ElementWrapper<'a, E>
where E: TElement,
{
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
// Ignore other fields for now, can change later if needed.
self.element.fmt(f)
}
}
#[cfg(feature = "gecko")]
fn dir_selector_to_state(s: &[u16]) -> ElementState {
// Jump through some hoops to deal with our Box<[u16]> thing.