Bug 1466963 followup - Make RawServoUnlockedDeclarationBlock an alias to PropertyDeclarationBlock in Servo side. r=emilio
authorXidorn Quan <me@upsuper.org>
Fri, 08 Jun 2018 19:19:28 +1000
changeset 421878 69d18e5bb7dc4836de6a65f545b500494105fe3d
parent 421877 be7c03a8800e89c3fbebcf33ceade3152250a2da
child 421935 79db03d7394385d2337ecfe967250de2db5d5bdc
push id104139
push userxquan@mozilla.com
push dateFri, 08 Jun 2018 09:20:45 +0000
treeherdermozilla-inbound@69d18e5bb7dc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1466963
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1466963 followup - Make RawServoUnlockedDeclarationBlock an alias to PropertyDeclarationBlock in Servo side. r=emilio
layout/style/ServoBindings.toml
servo/ports/geckolib/glue.rs
--- a/layout/style/ServoBindings.toml
+++ b/layout/style/ServoBindings.toml
@@ -420,16 +420,17 @@ mapped-generic-types = [
     { generic = false, gecko = "ServoNodeData", servo = "AtomicRefCell<ElementData>" },
     { generic = false, gecko = "mozilla::ServoWritingMode", servo = "::logical_geometry::WritingMode" },
     { generic = false, gecko = "mozilla::ServoCustomPropertiesMap", servo = "Option<::servo_arc::Arc<::custom_properties::CustomPropertiesMap>>" },
     { generic = false, gecko = "mozilla::ServoRuleNode", servo = "Option<::rule_tree::StrongRuleNode>" },
     { generic = false, gecko = "mozilla::ServoVisitedStyle", servo = "Option<::servo_arc::RawOffsetArc<::properties::ComputedValues>>" },
     { generic = false, gecko = "mozilla::ServoComputedValueFlags", servo = "::properties::computed_value_flags::ComputedValueFlags" },
     { generic = true, gecko = "mozilla::ServoRawOffsetArc", servo = "::servo_arc::RawOffsetArc" },
     { generic = false, gecko = "ComputedStyleStrong", servo = "::gecko_bindings::sugar::ownership::Strong<::properties::ComputedValues>" },
+    { generic = false, gecko = "RawServoUnlockedDeclarationBlock", servo = "::properties::PropertyDeclarationBlock" },
 ]
 fixups = [
     { pat = "\\broot\\s*::\\s*nsString\\b", rep = "::nsstring::nsStringRepr" },
     { pat = "\\broot\\s*::\\s*nsTString\\s*<\\s*u16\\s*>", rep = "::nsstring::nsStringRepr" },
 ]
 
 [bindings]
 headers = ["mozilla/ServoBindings.h"]
--- a/servo/ports/geckolib/glue.rs
+++ b/servo/ports/geckolib/glue.rs
@@ -169,19 +169,17 @@ use super::stylesheet_loader::{AsyncStyl
 trait ClosureHelper {
     fn invoke(&self, decls: &PropertyDeclarationBlock);
 }
 
 impl ClosureHelper for DeclarationBlockMutationClosure {
     #[inline]
     fn invoke(&self, decls: &PropertyDeclarationBlock) {
         if let Some(function) = self.function.as_ref() {
-            unsafe {
-                function(decls as *const _ as *const _, self.data);
-            }
+            unsafe { function(decls, self.data) };
         }
     }
 }
 
 /*
  * For Gecko->Servo function calls, we need to redeclare the same signature that was declared in
  * the C header in Gecko. In order to catch accidental mismatches, we run rust-bindgen against
  * those signatures as well, giving us a second declaration of all the Servo_* functions in this
@@ -3418,18 +3416,17 @@ pub unsafe extern "C" fn Servo_Declarati
     })
 }
 
 #[no_mangle]
 pub unsafe extern "C" fn Servo_UnlockedDeclarationBlock_GetCssText(
     declarations: *const structs::RawServoUnlockedDeclarationBlock,
     result: *mut nsAString,
 ) {
-    let decls = &*(declarations as *const PropertyDeclarationBlock);
-    decls.to_css(&mut *result).unwrap()
+    (*declarations).to_css(&mut *result).unwrap()
 }
 
 
 #[no_mangle]
 pub extern "C" fn Servo_DeclarationBlock_SerializeOneValue(
     declarations: RawServoDeclarationBlockBorrowed,
     property_id: nsCSSPropertyID, buffer: *mut nsAString,
     computed_values: ComputedStyleBorrowedOrNull,