mirror of
https://github.com/servo/servo.git
synced 2025-07-12 18:03:49 +01:00
geckolib: Add FFI function to parse a @counter-style name.
This commit is contained in:
parent
e4dba3abef
commit
c00944046c
1 changed files with 13 additions and 0 deletions
|
@ -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::<SourceSizeList>();
|
||||
}
|
||||
|
||||
#[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(),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue