Bug 1336646 - Apply selector flags during traversal. r=emilio

This commit is contained in:
Bobby Holley 2017-02-04 13:11:02 -08:00
parent 37b8d5231d
commit 9e860df9df
17 changed files with 295 additions and 192 deletions

View file

@ -5,7 +5,6 @@
//! Traits that nodes must implement. Breaks the otherwise-cyclic dependency between layout and
//! style.
use matching::ElementFlags;
use parser::{AttrSelector, SelectorImpl};
use std::ascii::AsciiExt;
@ -162,16 +161,4 @@ pub trait Element: MatchAttr + Sized {
// in the future when we have associated types and/or a more convenient
// JS GC story... --pcwalton
fn each_class<F>(&self, callback: F) where F: FnMut(&<Self::Impl as SelectorImpl>::ClassName);
/// Add flags to the element. See the `ElementFlags` docs for details.
///
/// This may be called while the element *or one of its children* is being
/// matched. Therefore the implementation must be thread-safe if children
/// may be matched in parallel.
fn insert_flags(&self, _flags: ElementFlags) {}
/// Clears the relevant ElementFlags. This is *not* called from
/// rust-selectors, but provided as part of the Element interface since it
/// makes sense.
fn clear_flags(&self) {}
}