style: Refactor to pass animations cleanly, land animation-name parsing as experimental

This commit is contained in:
Emilio Cobos Álvarez 2016-06-17 03:51:57 +02:00
parent c1fd7432e9
commit 60192bb830
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
12 changed files with 152 additions and 30 deletions

View file

@ -90,6 +90,7 @@ pub trait SelectorImplExt : SelectorImpl + Sized {
})
}
fn pseudo_is_before_or_after(pseudo: &Self::PseudoElement) -> bool;
fn pseudo_class_state_flag(pc: &Self::NonTSPseudoClass) -> ElementState;
@ -109,6 +110,15 @@ pub enum PseudoElement {
}
impl PseudoElement {
#[inline]
pub fn is_before_or_after(&self) -> bool {
match *self {
PseudoElement::Before |
PseudoElement::After => true,
_ => false,
}
}
#[inline]
pub fn cascade_type(&self) -> PseudoElementCascadeType {
match *self {
@ -249,6 +259,11 @@ impl SelectorImplExt for ServoSelectorImpl {
pc.state_flag()
}
#[inline]
fn pseudo_is_before_or_after(pseudo: &PseudoElement) -> bool {
pseudo.is_before_or_after()
}
#[inline]
fn get_user_or_user_agent_stylesheets() -> &'static [Stylesheet<Self>] {
&*USER_OR_USER_AGENT_STYLESHEETS