Skip to content

Commit

Permalink
style: Define types for pseudo-class string argument storage.
Browse files Browse the repository at this point in the history
  • Loading branch information
heycam committed Jun 8, 2017
1 parent 094052c commit e299905
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion components/style/gecko/selector_parser.rs
Expand Up @@ -24,6 +24,9 @@ bitflags! {
}
}

/// The type used for storing pseudo-class string arguments.
pub type PseudoClassStringArg = Box<[u16]>;

macro_rules! pseudo_class_name {
(bare: [$(($css:expr, $name:ident, $gecko_type:tt, $state:tt, $flags:tt),)*],
string: [$(($s_css:expr, $s_name:ident, $s_gecko_type:tt, $s_state:tt, $s_flags:tt),)*],
Expand All @@ -37,7 +40,7 @@ macro_rules! pseudo_class_name {
)*
$(
#[doc = $s_css]
$s_name(Box<[u16]>),
$s_name(PseudoClassStringArg),
)*
$(
#[doc = $k_css]
Expand Down
5 changes: 4 additions & 1 deletion components/style/servo/selector_parser.rs
Expand Up @@ -160,6 +160,9 @@ impl PseudoElement {
}
}

/// The type used for storing pseudo-class string arguments.
pub type PseudoClassStringArg = Box<str>;

/// A non tree-structural pseudo-class.
/// See https://drafts.csswg.org/selectors-4/#structural-pseudos
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
Expand All @@ -175,7 +178,7 @@ pub enum NonTSPseudoClass {
Fullscreen,
Hover,
Indeterminate,
Lang(Box<str>),
Lang(PseudoClassStringArg),
Link,
PlaceholderShown,
ReadWrite,
Expand Down

0 comments on commit e299905

Please sign in to comment.