mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
style: Refactor to pass animations cleanly, land animation-name parsing as experimental
This commit is contained in:
parent
c1fd7432e9
commit
60192bb830
12 changed files with 152 additions and 30 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue