mirror of
https://github.com/servo/servo.git
synced 2025-06-21 07:38:59 +01:00
Consider foo
and "foo"
equal as keyframes/animation names.
This commit is contained in:
parent
0ff64bdc59
commit
be38c9a5a7
1 changed files with 16 additions and 1 deletions
|
@ -14,6 +14,7 @@ use parser::{Parse, ParserContext};
|
||||||
use std::ascii::AsciiExt;
|
use std::ascii::AsciiExt;
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use std::fmt::{self, Debug};
|
use std::fmt::{self, Debug};
|
||||||
|
use std::hash;
|
||||||
use style_traits::ToCss;
|
use style_traits::ToCss;
|
||||||
|
|
||||||
macro_rules! define_numbered_css_keyword_enum {
|
macro_rules! define_numbered_css_keyword_enum {
|
||||||
|
@ -241,7 +242,7 @@ impl ToCss for CustomIdent {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://drafts.csswg.org/css-animations/#typedef-keyframes-name
|
/// https://drafts.csswg.org/css-animations/#typedef-keyframes-name
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
#[derive(Debug, Clone)]
|
||||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||||
pub enum KeyframesName {
|
pub enum KeyframesName {
|
||||||
/// <custom-ident>
|
/// <custom-ident>
|
||||||
|
@ -268,6 +269,20 @@ impl KeyframesName {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Eq for KeyframesName {}
|
||||||
|
|
||||||
|
impl PartialEq for KeyframesName {
|
||||||
|
fn eq(&self, other: &Self) -> bool {
|
||||||
|
self.as_atom() == other.as_atom()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl hash::Hash for KeyframesName {
|
||||||
|
fn hash<H>(&self, state: &mut H) where H: hash::Hasher {
|
||||||
|
self.as_atom().hash(state)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl Parse for KeyframesName {
|
impl Parse for KeyframesName {
|
||||||
fn parse(_context: &ParserContext, input: &mut Parser) -> Result<Self, ()> {
|
fn parse(_context: &ParserContext, input: &mut Parser) -> Result<Self, ()> {
|
||||||
match input.next() {
|
match input.next() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue