Auto merge of #17212 - jryans:visited-selectors, r=emilio

Stylo: Visited selectors for nested links

https://bugzilla.mozilla.org/show_bug.cgi?id=1370358

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17212)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-06-07 12:49:34 -07:00 committed by GitHub
commit 0934df77fd
8 changed files with 42 additions and 7 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.