diff --git a/components/style/gecko/generated/bindings.rs b/components/style/gecko/generated/bindings.rs index ab9e1f064e1..b1812da9a64 100644 --- a/components/style/gecko/generated/bindings.rs +++ b/components/style/gecko/generated/bindings.rs @@ -2684,6 +2684,13 @@ extern "C" { ServoComputedValuesBorrowed) -> u64; } +extern "C" { + pub fn Servo_ComputedValues_EqualCustomProperties(first: + ServoComputedValuesBorrowed, + second: + ServoComputedValuesBorrowed) + -> bool; +} extern "C" { pub fn Servo_ComputedValues_GetStyleRuleList(values: ServoComputedValuesBorrowed, diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index 938cac51c84..72520d64be9 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -192,6 +192,11 @@ impl ComputedValues { self.visited_style.clone() } + /// Gets a reference to the custom properties map (if one exists). + pub fn get_custom_properties(&self) -> Option<<&::custom_properties::CustomPropertiesMap> { + self.custom_properties.as_ref().map(|x| &**x) + } + pub fn custom_properties(&self) -> Option> { self.custom_properties.clone() } diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index 18c396d724e..e2b73602013 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -1741,6 +1741,16 @@ pub extern "C" fn Servo_ComputedValues_SpecifiesAnimationsOrTransitions(values: b.specifies_animations() || b.specifies_transitions() } +#[no_mangle] +pub extern "C" fn Servo_ComputedValues_EqualCustomProperties( + first: ServoComputedValuesBorrowed, + second: ServoComputedValuesBorrowed +) -> bool { + let first = ComputedValues::as_arc(&first); + let second = ComputedValues::as_arc(&second); + first.get_custom_properties() == second.get_custom_properties() +} + #[no_mangle] pub extern "C" fn Servo_ComputedValues_GetStyleRuleList(values: ServoComputedValuesBorrowed, rules: RawGeckoServoStyleRuleListBorrowedMut) {