servo: Merge #15720 - Added deep equal operator for animation value (from shinglyu:animation-value); r=Manishearth
authorShing Lyu <slyu@mozilla.com>
Thu, 23 Feb 2017 23:16:14 -0800
changeset 373711 757d5ee3dbc38876d9c207857ab239d55e26a6dd
parent 373710 647cbb760050200a9e0c810acf23541c98f0f5ca
child 373712 7967050a8fa0fa8706cae540f1e125ec4d4690eb
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersManishearth
bugs15720, 1337229
milestone54.0a1
servo: Merge #15720 - Added deep equal operator for animation value (from shinglyu:animation-value); r=Manishearth <!-- Please describe your changes on the following line: --> This is the servo side patch for [Bug 1337229](https://bugzilla.mozilla.org/show_bug.cgi?id=1337229) --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 9a438ab3b40bd6ed5e4f8c2ae1fcb90f9ca27175
servo/ports/geckolib/glue.rs
--- a/servo/ports/geckolib/glue.rs
+++ b/servo/ports/geckolib/glue.rs
@@ -311,16 +311,26 @@ pub extern "C" fn Servo_AnimationValue_G
     let value = AnimationValue::as_arc(&value);
     if let AnimationValue::Transform(ref servo_list) = **value {
         style_structs::Box::convert_transform(servo_list.0.clone().unwrap(), unsafe { &mut *list });
     } else {
         panic!("The AnimationValue should be transform");
     }
 }
 
+#[no_mangle]
+pub extern "C" fn Servo_AnimationValue_DeepEqual(this: RawServoAnimationValueBorrowed,
+                                                 other: RawServoAnimationValueBorrowed)
+     -> bool
+{
+    let this_value = AnimationValue::as_arc(&this);
+    let other_value = AnimationValue::as_arc(&other);
+    this_value == other_value
+}
+
 /// Takes a ServoAnimationValues and populates it with the animation values corresponding
 /// to a given property declaration block
 #[no_mangle]
 pub extern "C" fn Servo_AnimationValues_Populate(anim: RawGeckoAnimationValueListBorrowedMut,
                                                  declarations: RawServoDeclarationBlockBorrowed,
                                                  style: ServoComputedValuesBorrowed,
                                                  parent_style: ServoComputedValuesBorrowedOrNull,
                                                  pres_context: RawGeckoPresContextBorrowed)