diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index 3a1af21f726..ad3e32f2458 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -18,6 +18,7 @@ use std::ptr; use style::applicable_declarations::ApplicableDeclarationBlock; use style::context::{CascadeInputs, QuirksMode, SharedStyleContext, StyleContext}; use style::context::ThreadLocalStyleContext; +use style::counter_style; use style::data::{ElementStyles, self}; use style::dom::{ShowSubtreeData, TDocument, TElement, TNode}; use style::driver; @@ -4735,3 +4736,15 @@ pub unsafe extern "C" fn Servo_SourceSizeList_Evaluate( pub unsafe extern "C" fn Servo_SourceSizeList_Drop(list: RawServoSourceSizeListOwned) { let _ = list.into_box::(); } + +#[no_mangle] +pub extern "C" fn Servo_ParseCounterStyleName( + value: *const nsACString, +) -> *mut nsAtom { + let value = unsafe { value.as_ref().unwrap().as_str_unchecked() }; + let mut input = ParserInput::new(&value); + match Parser::new(&mut input).parse_entirely(counter_style::parse_counter_style_name) { + Ok(name) => name.0.into_addrefed(), + Err(_) => ptr::null_mut(), + } +}