Auto merge of #17724 - heycam:custom-props, r=emilio

add support for Gecko style difference noticing custom property changes

From https://bugzilla.mozilla.org/show_bug.cgi?id=1380224.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17724)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-07-13 23:21:30 -07:00 committed by GitHub
commit 59f00f5826
3 changed files with 22 additions and 0 deletions

View file

@ -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,

View file

@ -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()
}

View file

@ -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) {