Skip to content

Commit

Permalink
Fix cue-region-function ast
Browse files Browse the repository at this point in the history
  • Loading branch information
devongovett committed Feb 12, 2023
1 parent 331c8a9 commit 6a53944
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
7 changes: 4 additions & 3 deletions node/ast.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6444,12 +6444,13 @@ export type PseudoElement =
*/
selector: Selector;
}
| (
| {
kind: "cue-region-function";
/**
* The selector argument.
*/
selector: Selector;
}
| SelectorComponent[]
)
| {
kind: "custom";
/**
Expand Down
9 changes: 6 additions & 3 deletions src/selector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ impl<'a, 'o, 'i> parcel_selectors::parser::Parser<'i> for SelectorParser<'a, 'o,
use PseudoElement::*;
let pseudo_element = match_ignore_ascii_case! { &name,
"cue" => CueFunction { selector: Box::new(Selector::parse(self, arguments)?) },
"cue-region" => CueRegionFunction(Box::new(Selector::parse(self, arguments)?)),
"cue-region" => CueRegionFunction { selector: Box::new(Selector::parse(self, arguments)?) },
_ => {
if !name.starts_with('-') {
self.options.warn(arguments.new_custom_error(SelectorParseErrorKind::UnsupportedPseudoClassOrElement(name.clone())));
Expand Down Expand Up @@ -815,7 +815,10 @@ pub enum PseudoElement<'i> {
selector: Box<Selector<'i>>,
},
/// The [::cue-region()](https://w3c.github.io/webvtt/#cue-region-selector) functional pseudo element.
CueRegionFunction(Box<Selector<'i>>),
CueRegionFunction {
/// The selector argument.
selector: Box<Selector<'i>>,
},
/// An unknown pseudo element.
Custom {
/// The name of the pseudo element.
Expand Down Expand Up @@ -913,7 +916,7 @@ where
serialize_selector(selector, dest, context, false)?;
dest.write_char(')')
}
CueRegionFunction(selector) => {
CueRegionFunction { selector } => {
dest.write_str("::cue-region(")?;
serialize_selector(selector, dest, context, false)?;
dest.write_char(')')
Expand Down

0 comments on commit 6a53944

Please sign in to comment.