mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
style: Add FFI function to compare ComputedValues for custom property differences.
This commit is contained in:
parent
18c5ba108d
commit
e8ffd9dbba
2 changed files with 15 additions and 0 deletions
|
@ -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<Arc<CustomPropertiesMap>> {
|
||||
self.custom_properties.clone()
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue