style: Add methods to iterate a subtree in preorder.

Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
Emilio Cobos Álvarez 2017-10-22 01:18:44 +02:00
parent 6ae8bdee61
commit 4f997bf333
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 65 additions and 2 deletions

View file

@ -104,6 +104,12 @@ use stylist::Stylist;
#[derive(Clone, Copy)]
pub struct GeckoNode<'ln>(pub &'ln RawGeckoNode);
impl<'ln> PartialEq for GeckoNode<'ln> {
fn eq(&self, other: &Self) -> bool {
self.0 as *const _ == other.0 as *const _
}
}
impl<'ln> fmt::Debug for GeckoNode<'ln> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
if let Some(el) = self.as_element() {