diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index 483a044f153..f00fb4a6c0a 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -1493,6 +1493,20 @@ pub extern "C" fn Servo_ResolvePseudoStyle(element: RawGeckoElementBorrowed, } } +#[no_mangle] +pub extern "C" fn Servo_SetExplicitStyle(element: RawGeckoElementBorrowed, + style: ServoComputedValuesBorrowed) +{ + let element = GeckoElement(element); + let style = ComputedValues::as_arc(&style); + debug!("Servo_SetExplicitStyle: {:?}", element); + // We only support this API for initial styling. There's no reason it couldn't + // work for other things, we just haven't had a reason to do so. + debug_assert!(element.get_data().is_none()); + let mut data = unsafe { element.ensure_data() }.borrow_mut(); + data.styles.primary = Some(style.clone()); +} + #[no_mangle] pub extern "C" fn Servo_HasAuthorSpecifiedRules(element: RawGeckoElementBorrowed, rule_type_mask: u32, @@ -1627,6 +1641,14 @@ pub extern "C" fn Servo_ComputedValues_GetVisitedStyle(values: ServoComputedValu } } +#[no_mangle] +pub extern "C" fn Servo_ComputedValues_SpecifiesAnimationsOrTransitions(values: ServoComputedValuesBorrowed) + -> bool { + let values = ComputedValues::as_arc(&values); + let b = values.get_box(); + b.specifies_animations() || b.specifies_transitions() +} + /// See the comment in `Device` to see why it's ok to pass an owned reference to /// the pres context (hint: the context outlives the StyleSet, that holds the /// device alive).