style: Stop special-casing a few attributes for style sharing, and use a visitor to track dependencies.

Also, simplify all the pre-snapshot attribute hacks in the script and style
code.

MozReview-Commit-ID: 6c9ipeb7Tnr
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
Emilio Cobos Álvarez 2017-04-07 03:17:29 +02:00
parent 1748150497
commit 0ea58d1ffa
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
9 changed files with 161 additions and 312 deletions

View file

@ -6,7 +6,8 @@
#![deny(missing_docs)]
use parser::{AttrSelector, ComplexSelector, SelectorImpl, SimpleSelector};
use parser::{AttrSelector, Combinator, ComplexSelector, SelectorImpl, SimpleSelector};
use std::sync::Arc;
/// A trait to visit selector properties.
///
@ -24,7 +25,13 @@ pub trait SelectorVisitor {
}
/// Visits a complex selector.
fn visit_complex_selector(&mut self, _: &ComplexSelector<Self::Impl>) -> bool {
///
/// Gets the combinator to the right of the selector, or `None` if the
/// selector is the leftmost one.
fn visit_complex_selector(&mut self,
_: &Arc<ComplexSelector<Self::Impl>>,
_combinator_to_right: Option<Combinator>)
-> bool {
true
}