mirror of
https://github.com/servo/servo.git
synced 2025-08-14 01:45:33 +01:00
Bug 1343153 - Support Servo_ParseEasing.
This commit is contained in:
parent
3b15efd2ba
commit
708f446364
3 changed files with 33 additions and 0 deletions
|
@ -48,6 +48,7 @@ use style::gecko_bindings::bindings::RawServoAnimationValueStrong;
|
|||
use style::gecko_bindings::bindings::RawServoImportRuleBorrowed;
|
||||
use style::gecko_bindings::bindings::ServoComputedValuesBorrowedOrNull;
|
||||
use style::gecko_bindings::bindings::nsTArrayBorrowed_uintptr_t;
|
||||
use style::gecko_bindings::bindings::nsTimingFunctionBorrowedMut;
|
||||
use style::gecko_bindings::structs;
|
||||
use style::gecko_bindings::structs::{SheetParsingMode, nsIAtom, nsCSSPropertyID};
|
||||
use style::gecko_bindings::structs::{ThreadSafePrincipalHolder, ThreadSafeURIHolder};
|
||||
|
@ -790,6 +791,27 @@ pub extern "C" fn Servo_ParseProperty(property: *const nsACString, value: *const
|
|||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_ParseEasing(easing: *const nsAString,
|
||||
base: *const nsACString,
|
||||
data: *const structs::GeckoParserExtraData,
|
||||
output: nsTimingFunctionBorrowedMut)
|
||||
-> bool {
|
||||
use style::properties::longhands::transition_timing_function;
|
||||
|
||||
make_context!((base, data) => (base_url, extra_data));
|
||||
let reporter = StdoutErrorReporter;
|
||||
let context = ParserContext::new_with_extra_data(Origin::Author, &base_url, &reporter, extra_data);
|
||||
let easing = unsafe { (*easing).to_string() };
|
||||
match transition_timing_function::single_value::parse(&context, &mut Parser::new(&easing)) {
|
||||
Ok(parsed_easing) => {
|
||||
*output = parsed_easing.into();
|
||||
true
|
||||
},
|
||||
Err(_) => false
|
||||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_ParseStyleAttribute(data: *const nsACString,
|
||||
base: *const nsACString,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue