servo: Merge #20039 - style: Use consistent formatting for functions in the glue file (from emilio:indent); r=nox
authorEmilio Cobos Álvarez <emilio@crisal.io>
Tue, 13 Feb 2018 10:25:30 -0500
changeset 456059 5ede77fd6d7875bf1ad7e4b2458a59238eae683d
parent 456058 24cd8e6e5b2a6ee6a6767f4111b119f9f795b601
child 456060 a8a0ca1b2ea520541f296670db9aa9f50d0c1df0
push id8799
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 16:46:23 +0000
treeherdermozilla-beta@15334014dc67 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnox
milestone60.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
servo: Merge #20039 - style: Use consistent formatting for functions in the glue file (from emilio:indent); r=nox I'm tired of only drive-by fixing them :) Source-Repo: https://github.com/servo/servo Source-Revision: 7e31ae35e1036467e25484ab30132f8bd49f0ee8
servo/ports/geckolib/glue.rs
--- a/servo/ports/geckolib/glue.rs
+++ b/servo/ports/geckolib/glue.rs
@@ -385,19 +385,20 @@ pub extern "C" fn Servo_AnimationValues_
     if let Ok(value) = from_value.animate(to_value, Procedure::Interpolate { progress }) {
         Arc::new(value).into_strong()
     } else {
         RawServoAnimationValueStrong::null()
     }
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_AnimationValues_IsInterpolable(from: RawServoAnimationValueBorrowed,
-                                                       to: RawServoAnimationValueBorrowed)
-                                                       -> bool {
+pub extern "C" fn Servo_AnimationValues_IsInterpolable(
+    from: RawServoAnimationValueBorrowed,
+    to: RawServoAnimationValueBorrowed,
+) -> bool {
     let from_value = AnimationValue::as_arc(&from);
     let to_value = AnimationValue::as_arc(&to);
     from_value.animate(to_value, Procedure::Interpolate { progress: 0.5 }).is_ok()
 }
 
 #[no_mangle]
 pub extern "C" fn Servo_AnimationValues_Add(
     a: RawServoAnimationValueBorrowed,
@@ -424,31 +425,31 @@ pub extern "C" fn Servo_AnimationValues_
         Arc::new(value).into_strong()
     } else {
         RawServoAnimationValueStrong::null()
     }
 }
 
 #[no_mangle]
 pub extern "C" fn Servo_AnimationValues_GetZeroValue(
-    value_to_match: RawServoAnimationValueBorrowed)
-    -> RawServoAnimationValueStrong
-{
+    value_to_match: RawServoAnimationValueBorrowed,
+) -> RawServoAnimationValueStrong {
     let value_to_match = AnimationValue::as_arc(&value_to_match);
     if let Ok(zero_value) = value_to_match.to_animated_zero() {
         Arc::new(zero_value).into_strong()
     } else {
         RawServoAnimationValueStrong::null()
     }
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_AnimationValues_ComputeDistance(from: RawServoAnimationValueBorrowed,
-                                                        to: RawServoAnimationValueBorrowed)
-                                                        -> f64 {
+pub extern "C" fn Servo_AnimationValues_ComputeDistance(
+    from: RawServoAnimationValueBorrowed,
+    to: RawServoAnimationValueBorrowed,
+) -> f64 {
     let from_value = AnimationValue::as_arc(&from);
     let to_value = AnimationValue::as_arc(&to);
     // If compute_squared_distance() failed, this function will return negative value
     // in order to check whether we support the specified paced animation values.
     from_value.compute_squared_distance(to_value).map(|d| d.sqrt()).unwrap_or(-1.0)
 }
 
 /// Compute one of the endpoints for the interpolation interval, compositing it with the
@@ -587,35 +588,38 @@ pub extern "C" fn Servo_ComposeAnimation
     underlying_value: RawServoAnimationValueBorrowedOrNull,
     last_value: RawServoAnimationValueBorrowedOrNull,
     iteration_composite: IterationCompositeOperation,
     progress: f64,
     current_iteration: u64
 ) -> RawServoAnimationValueStrong {
     let underlying_value = AnimationValue::arc_from_borrowed(&underlying_value).map(|v| &**v);
     let last_value = AnimationValue::arc_from_borrowed(&last_value).map(|v| &**v);
-    let result = compose_animation_segment(segment,
-                                           underlying_value,
-                                           last_value,
-                                           iteration_composite,
-                                           current_iteration,
-                                           progress,
-                                           progress);
+    let result = compose_animation_segment(
+        segment,
+        underlying_value,
+        last_value,
+        iteration_composite,
+        current_iteration,
+        progress,
+        progress,
+    );
     Arc::new(result).into_strong()
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_AnimationCompose(raw_value_map: RawServoAnimationValueMapBorrowedMut,
-                                         base_values: RawServoAnimationValueTableBorrowed,
-                                         css_property: nsCSSPropertyID,
-                                         segment: RawGeckoAnimationPropertySegmentBorrowed,
-                                         last_segment: RawGeckoAnimationPropertySegmentBorrowed,
-                                         computed_timing: RawGeckoComputedTimingBorrowed,
-                                         iteration_composite: IterationCompositeOperation)
-{
+pub extern "C" fn Servo_AnimationCompose(
+    raw_value_map: RawServoAnimationValueMapBorrowedMut,
+    base_values: RawServoAnimationValueTableBorrowed,
+    css_property: nsCSSPropertyID,
+    segment: RawGeckoAnimationPropertySegmentBorrowed,
+    last_segment: RawGeckoAnimationPropertySegmentBorrowed,
+    computed_timing: RawGeckoComputedTimingBorrowed,
+    iteration_composite: IterationCompositeOperation,
+) {
     use style::gecko_bindings::bindings::Gecko_AnimationGetBaseStyle;
     use style::gecko_bindings::bindings::Gecko_GetPositionInSegment;
     use style::gecko_bindings::bindings::Gecko_GetProgressFromComputedTiming;
     use style::properties::animated_properties::AnimationValueMap;
 
     let property = match LonghandId::from_nscsspropertyid(css_property) {
         Ok(longhand) if longhand.is_animatable() => longhand,
         _ => return,
@@ -664,40 +668,43 @@ pub extern "C" fn Servo_AnimationCompose
     let position = if segment.mToKey == segment.mFromKey {
         // Note: compose_animation_segment doesn't use this value
         // if segment.mFromKey == segment.mToKey, so assigning |progress| directly is fine.
         progress
     } else {
         unsafe { Gecko_GetPositionInSegment(segment, progress, computed_timing.mBeforeFlag) }
     };
 
-    let result = compose_animation_segment(segment,
-                                           underlying_value.as_ref(),
-                                           last_value,
-                                           iteration_composite,
-                                           computed_timing.mCurrentIteration,
-                                           progress,
-                                           position);
+    let result = compose_animation_segment(
+        segment,
+        underlying_value.as_ref(),
+        last_value,
+        iteration_composite,
+        computed_timing.mCurrentIteration,
+        progress,
+        position,
+    );
     value_map.insert(property, result);
 }
 
 macro_rules! get_property_id_from_nscsspropertyid {
     ($property_id: ident, $ret: expr) => {{
         match PropertyId::from_nscsspropertyid($property_id) {
             Ok(property_id) => property_id,
             Err(()) => { return $ret; }
         }
     }}
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_AnimationValue_Serialize(value: RawServoAnimationValueBorrowed,
-                                                 property: nsCSSPropertyID,
-                                                 buffer: *mut nsAString)
-{
+pub extern "C" fn Servo_AnimationValue_Serialize(
+    value: RawServoAnimationValueBorrowed,
+    property: nsCSSPropertyID,
+    buffer: *mut nsAString,
+) {
     let uncomputed_value = AnimationValue::as_arc(&value).uncompute();
     let buffer = unsafe { buffer.as_mut().unwrap() };
     let rv = PropertyDeclarationBlock::with_one(uncomputed_value, Importance::Normal)
         .single_value_to_css(&get_property_id_from_nscsspropertyid!(property, ()), buffer,
                              None, None /* No extra custom properties */);
     debug_assert!(rv.is_ok());
 }
 
@@ -724,17 +731,17 @@ pub extern "C" fn Servo_Shorthand_Animat
     if rv.is_ok() {
         let buffer = unsafe { buffer.as_mut().unwrap() };
         buffer.assign_utf8(&string);
     }
 }
 
 #[no_mangle]
 pub extern "C" fn Servo_AnimationValue_GetOpacity(
-    value: RawServoAnimationValueBorrowed
+    value: RawServoAnimationValueBorrowed,
 ) -> f32 {
     let value = AnimationValue::as_arc(&value);
     if let AnimationValue::Opacity(opacity) = **value {
         opacity
     } else {
         panic!("The AnimationValue should be Opacity");
     }
 }
@@ -949,64 +956,69 @@ pub extern "C" fn Servo_StyleWorkerThrea
 }
 
 #[no_mangle]
 pub extern "C" fn Servo_Element_ClearData(element: RawGeckoElementBorrowed) {
     unsafe { GeckoElement(element).clear_data() };
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_Element_SizeOfExcludingThisAndCVs(malloc_size_of: GeckoMallocSizeOf,
-                                                          malloc_enclosing_size_of:
-                                                              GeckoMallocSizeOf,
-                                                          seen_ptrs: *mut SeenPtrs,
-                                                          element: RawGeckoElementBorrowed) -> usize {
+pub extern "C" fn Servo_Element_SizeOfExcludingThisAndCVs(
+    malloc_size_of: GeckoMallocSizeOf,
+    malloc_enclosing_size_of: GeckoMallocSizeOf,
+    seen_ptrs: *mut SeenPtrs,
+    element: RawGeckoElementBorrowed,
+) -> usize {
     let element = GeckoElement(element);
     let borrow = element.borrow_data();
     if let Some(data) = borrow {
         let have_seen_ptr = move |ptr| { unsafe { Gecko_HaveSeenPtr(seen_ptrs, ptr) } };
-        let mut ops = MallocSizeOfOps::new(malloc_size_of.unwrap(),
-                                           Some(malloc_enclosing_size_of.unwrap()),
-                                           Some(Box::new(have_seen_ptr)));
+        let mut ops = MallocSizeOfOps::new(
+            malloc_size_of.unwrap(),
+            Some(malloc_enclosing_size_of.unwrap()),
+            Some(Box::new(have_seen_ptr)),
+        );
         (*data).size_of_excluding_cvs(&mut ops)
     } else {
         0
     }
 }
 
 #[no_mangle]
 pub extern "C" fn Servo_Element_HasPrimaryComputedValues(element: RawGeckoElementBorrowed) -> bool
 {
     let element = GeckoElement(element);
     let data = element.borrow_data().expect("Looking for CVs on unstyled element");
     data.has_styles()
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_Element_GetPrimaryComputedValues(element: RawGeckoElementBorrowed)
-                                                         -> ServoStyleContextStrong
-{
+pub extern "C" fn Servo_Element_GetPrimaryComputedValues(
+    element: RawGeckoElementBorrowed,
+) -> ServoStyleContextStrong {
     let element = GeckoElement(element);
     let data = element.borrow_data().expect("Getting CVs on unstyled element");
     data.styles.primary().clone().into()
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_Element_HasPseudoComputedValues(element: RawGeckoElementBorrowed,
-                                                        index: usize) -> bool
-{
+pub extern "C" fn Servo_Element_HasPseudoComputedValues(
+    element: RawGeckoElementBorrowed,
+    index: usize,
+) -> bool {
     let element = GeckoElement(element);
     let data = element.borrow_data().expect("Looking for CVs on unstyled element");
     data.styles.pseudos.as_array()[index].is_some()
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_Element_GetPseudoComputedValues(element: RawGeckoElementBorrowed,
-                                                        index: usize) -> ServoStyleContextStrong
-{
+pub extern "C" fn Servo_Element_GetPseudoComputedValues(
+    element: RawGeckoElementBorrowed,
+    index: usize,
+) -> ServoStyleContextStrong {
     let element = GeckoElement(element);
     let data = element.borrow_data().expect("Getting CVs that aren't present");
     data.styles.pseudos.as_array()[index].as_ref().expect("Getting CVs that aren't present")
         .clone().into()
 }
 
 #[no_mangle]
 pub extern "C" fn Servo_Element_IsDisplayNone(element: RawGeckoElementBorrowed) -> bool {
@@ -1057,17 +1069,17 @@ pub extern "C" fn Servo_StyleSheet_FromU
     loader: *mut Loader,
     stylesheet: *mut ServoStyleSheet,
     data: *const u8,
     data_len: usize,
     mode: SheetParsingMode,
     extra_data: *mut URLExtraData,
     line_number_offset: u32,
     quirks_mode: nsCompatibility,
-    reusable_sheets: *mut LoaderReusableStyleSheets
+    reusable_sheets: *mut LoaderReusableStyleSheets,
 ) -> RawServoStyleSheetContentsStrong {
     let global_style_data = &*GLOBAL_STYLE_DATA;
     let input = unsafe { ::std::str::from_utf8_unchecked(::std::slice::from_raw_parts(data, data_len)) };
 
     let origin = match mode {
         SheetParsingMode::eAuthorSheetFeatures => Origin::Author,
         SheetParsingMode::eUserSheetFeatures => Origin::User,
         SheetParsingMode::eAgentSheetFeatures => Origin::UserAgent,
@@ -1314,17 +1326,17 @@ pub extern "C" fn Servo_StyleSheet_SizeO
     let mut ops = MallocSizeOfOps::new(malloc_size_of.unwrap(),
                                        Some(malloc_enclosing_size_of.unwrap()),
                                        None);
     StylesheetContents::as_arc(&sheet).size_of(&guard, &mut ops)
 }
 
 #[no_mangle]
 pub extern "C" fn Servo_StyleSheet_GetOrigin(
-    sheet: RawServoStyleSheetContentsBorrowed
+    sheet: RawServoStyleSheetContentsBorrowed,
 ) -> u8 {
     let origin = match StylesheetContents::as_arc(&sheet).origin {
         Origin::UserAgent => OriginFlags_UserAgent,
         Origin::User => OriginFlags_User,
         Origin::Author => OriginFlags_Author,
     };
     // We'd like to return `OriginFlags` here, but bindgen bitfield enums don't
     // work as return values with the Linux 32-bit ABI at the moment because
@@ -1383,18 +1395,20 @@ fn write_locked_arc<T, R, F>(raw: &<Lock
     where Locked<T>: HasArcFFI, F: FnOnce(&mut T) -> R
 {
     let global_style_data = &*GLOBAL_STYLE_DATA;
     let mut guard = global_style_data.shared_lock.write();
     func(Locked::<T>::as_arc(&raw).write_with(&mut guard))
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_CssRules_ListTypes(rules: ServoCssRulesBorrowed,
-                                           result: nsTArrayBorrowed_uintptr_t) {
+pub extern "C" fn Servo_CssRules_ListTypes(
+    rules: ServoCssRulesBorrowed,
+    result: nsTArrayBorrowed_uintptr_t,
+) {
     read_locked_arc(rules, |rules: &CssRules| {
         let iter = rules.0.iter().map(|rule| rule.rule_type() as usize);
         let (size, upper) = iter.size_hint();
         debug_assert_eq!(size, upper.unwrap());
         unsafe { result.set_len(size as u32) };
         result.iter_mut().zip(iter).fold((), |_, (r, v)| *r = v);
     })
 }
@@ -1482,19 +1496,22 @@ macro_rules! impl_basic_rule_funcs_witho
 
 macro_rules! impl_basic_rule_funcs {
     { ($name:ident, $rule_type:ty, $raw_type:ty),
         getter: $getter:ident,
         debug: $debug:ident,
         to_css: $to_css:ident,
     } => {
         #[no_mangle]
-        pub extern "C" fn $getter(rules: ServoCssRulesBorrowed, index: u32,
-                                  line: *mut u32, column: *mut u32)
-            -> Strong<$raw_type> {
+        pub extern "C" fn $getter(
+            rules: ServoCssRulesBorrowed,
+            index: u32,
+            line: *mut u32,
+            column: *mut u32,
+        ) -> Strong<$raw_type> {
             let global_style_data = &*GLOBAL_STYLE_DATA;
             let guard = global_style_data.shared_lock.read();
             let rules = Locked::<CssRules>::as_arc(&rules).read_with(&guard);
             let index = index as usize;
 
             if index >= rules.0.len() {
                 return Strong::null();
             }
@@ -1610,19 +1627,19 @@ macro_rules! impl_getter_for_embedded_ru
                 _ => unreachable!(concat!(stringify!($getter), " should only be called on a ",
                                           stringify!($name), " rule")),
             }
         }
     }
 }
 
 impl_getter_for_embedded_rule!(Servo_CssRules_GetFontFaceRuleAt:
-                              FontFace -> nsCSSFontFaceRule);
+                               FontFace -> nsCSSFontFaceRule);
 impl_getter_for_embedded_rule!(Servo_CssRules_GetCounterStyleRuleAt:
-                              CounterStyle -> nsCSSCounterStyleRule);
+                               CounterStyle -> nsCSSCounterStyleRule);
 
 #[no_mangle]
 pub extern "C" fn Servo_StyleRule_GetStyle(rule: RawServoStyleRuleBorrowed) -> RawServoDeclarationBlockStrong {
     read_locked_arc(rule, |rule: &StyleRule| {
         rule.block.clone().into_strong()
     })
 }
 
@@ -1638,19 +1655,21 @@ pub extern "C" fn Servo_StyleRule_SetSty
 #[no_mangle]
 pub extern "C" fn Servo_StyleRule_GetSelectorText(rule: RawServoStyleRuleBorrowed, result: *mut nsAString) {
     read_locked_arc(rule, |rule: &StyleRule| {
         rule.selectors.to_css(unsafe { result.as_mut().unwrap() }).unwrap();
     })
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_StyleRule_GetSelectorTextAtIndex(rule: RawServoStyleRuleBorrowed,
-                                                         index: u32,
-                                                         result: *mut nsAString) {
+pub extern "C" fn Servo_StyleRule_GetSelectorTextAtIndex(
+    rule: RawServoStyleRuleBorrowed,
+    index: u32,
+    result: *mut nsAString,
+) {
     read_locked_arc(rule, |rule: &StyleRule| {
         let index = index as usize;
         if index >= rule.selectors.0.len() {
             return;
         }
         rule.selectors.0[index].to_css(unsafe { result.as_mut().unwrap() }).unwrap();
     })
 }
@@ -1675,20 +1694,22 @@ pub extern "C" fn Servo_StyleRule_GetSpe
             *specificity = 0;
             return;
         }
         *specificity = rule.selectors.0[index].specificity() as u64;
     })
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_StyleRule_SelectorMatchesElement(rule: RawServoStyleRuleBorrowed,
-                                                         element: RawGeckoElementBorrowed,
-                                                         index: u32,
-                                                         pseudo_type: CSSPseudoElementType) -> bool {
+pub extern "C" fn Servo_StyleRule_SelectorMatchesElement(
+    rule: RawServoStyleRuleBorrowed,
+    element: RawGeckoElementBorrowed,
+    index: u32,
+    pseudo_type: CSSPseudoElementType,
+) -> bool {
     read_locked_arc(rule, |rule: &StyleRule| {
         let index = index as usize;
         if index >= rule.selectors.0.len() {
             return false;
         }
 
         let selector = &rule.selectors.0[index];
         let mut matching_mode = MatchingMode::Normal;
@@ -1828,17 +1849,17 @@ pub unsafe extern "C" fn Servo_SelectorL
 pub extern "C" fn Servo_ImportRule_GetHref(rule: RawServoImportRuleBorrowed, result: *mut nsAString) {
     read_locked_arc(rule, |rule: &ImportRule| {
         write!(unsafe { &mut *result }, "{}", rule.url.as_str()).unwrap();
     })
 }
 
 #[no_mangle]
 pub extern "C" fn Servo_ImportRule_GetSheet(
-    rule: RawServoImportRuleBorrowed
+    rule: RawServoImportRuleBorrowed,
 ) -> *const ServoStyleSheet {
     read_locked_arc(rule, |rule: &ImportRule| {
         rule.stylesheet.0.raw() as *const ServoStyleSheet
     })
 }
 
 #[no_mangle]
 pub extern "C" fn Servo_Keyframe_GetKeyText(
@@ -1891,31 +1912,37 @@ pub extern "C" fn Servo_KeyframesRule_Se
 }
 
 #[no_mangle]
 pub extern "C" fn Servo_KeyframesRule_GetCount(rule: RawServoKeyframesRuleBorrowed) -> u32 {
     read_locked_arc(rule, |rule: &KeyframesRule| rule.keyframes.len() as u32)
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_KeyframesRule_GetKeyframeAt(rule: RawServoKeyframesRuleBorrowed, index: u32,
-                                                    line: *mut u32, column: *mut u32) -> RawServoKeyframeStrong {
+pub extern "C" fn Servo_KeyframesRule_GetKeyframeAt(
+    rule: RawServoKeyframesRuleBorrowed,
+    index: u32,
+    line: *mut u32,
+    column: *mut u32,
+) -> RawServoKeyframeStrong {
     let global_style_data = &*GLOBAL_STYLE_DATA;
     let guard = global_style_data.shared_lock.read();
     let key = Locked::<KeyframesRule>::as_arc(&rule).read_with(&guard)
                   .keyframes[index as usize].clone();
     let location = key.read_with(&guard).source_location;
     *unsafe { line.as_mut().unwrap() } = location.line as u32;
     *unsafe { column.as_mut().unwrap() } = location.column as u32;
     key.into_strong()
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_KeyframesRule_FindRule(rule: RawServoKeyframesRuleBorrowed,
-                                               key: *const nsACString) -> u32 {
+pub extern "C" fn Servo_KeyframesRule_FindRule(
+    rule: RawServoKeyframesRuleBorrowed,
+    key: *const nsACString,
+) -> u32 {
     let key = unsafe { key.as_ref().unwrap().as_str_unchecked() };
     let global_style_data = &*GLOBAL_STYLE_DATA;
     let guard = global_style_data.shared_lock.read();
     Locked::<KeyframesRule>::as_arc(&rule).read_with(&guard)
         .find_rule(&guard, key).map(|index| index as u32)
         .unwrap_or(u32::max_value())
 }
 
@@ -1969,51 +1996,61 @@ pub extern "C" fn Servo_NamespaceRule_Ge
 #[no_mangle]
 pub extern "C" fn Servo_PageRule_GetStyle(rule: RawServoPageRuleBorrowed) -> RawServoDeclarationBlockStrong {
     read_locked_arc(rule, |rule: &PageRule| {
         rule.block.clone().into_strong()
     })
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_PageRule_SetStyle(rule: RawServoPageRuleBorrowed,
-                                           declarations: RawServoDeclarationBlockBorrowed) {
+pub extern "C" fn Servo_PageRule_SetStyle(
+    rule: RawServoPageRuleBorrowed,
+    declarations: RawServoDeclarationBlockBorrowed,
+) {
     let declarations = Locked::<PropertyDeclarationBlock>::as_arc(&declarations);
     write_locked_arc(rule, |rule: &mut PageRule| {
         rule.block = declarations.clone_arc();
     })
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_SupportsRule_GetConditionText(rule: RawServoSupportsRuleBorrowed,
-                                                      result: *mut nsAString) {
+pub extern "C" fn Servo_SupportsRule_GetConditionText(
+    rule: RawServoSupportsRuleBorrowed,
+    result: *mut nsAString,
+) {
     read_locked_arc(rule, |rule: &SupportsRule| {
         rule.condition.to_css(&mut CssWriter::new(unsafe { result.as_mut().unwrap() })).unwrap();
     })
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_DocumentRule_GetConditionText(rule: RawServoDocumentRuleBorrowed,
-                                                      result: *mut nsAString) {
+pub extern "C" fn Servo_DocumentRule_GetConditionText(
+    rule: RawServoDocumentRuleBorrowed,
+    result: *mut nsAString,
+) {
     read_locked_arc(rule, |rule: &DocumentRule| {
         rule.condition.to_css(&mut CssWriter::new(unsafe { result.as_mut().unwrap() })).unwrap();
     })
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_FontFeatureValuesRule_GetFontFamily(rule: RawServoFontFeatureValuesRuleBorrowed,
-                                                            result: *mut nsAString) {
+pub extern "C" fn Servo_FontFeatureValuesRule_GetFontFamily(
+    rule: RawServoFontFeatureValuesRuleBorrowed,
+    result: *mut nsAString,
+) {
     read_locked_arc(rule, |rule: &FontFeatureValuesRule| {
         rule.font_family_to_css(&mut CssWriter::new(unsafe { result.as_mut().unwrap() })).unwrap();
     })
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_FontFeatureValuesRule_GetValueText(rule: RawServoFontFeatureValuesRuleBorrowed,
-                                                           result: *mut nsAString) {
+pub extern "C" fn Servo_FontFeatureValuesRule_GetValueText(
+    rule: RawServoFontFeatureValuesRuleBorrowed,
+    result: *mut nsAString,
+) {
     read_locked_arc(rule, |rule: &FontFeatureValuesRule| {
         rule.value_to_css(&mut CssWriter::new(unsafe { result.as_mut().unwrap() })).unwrap();
     })
 }
 
 #[no_mangle]
 pub extern "C" fn Servo_ComputedValues_GetForAnonymousBox(
     parent_style_or_null: ServoStyleContextBorrowedOrNull,
@@ -2065,23 +2102,23 @@ pub extern "C" fn Servo_ComputedValues_G
         &pseudo,
         parent_style_or_null.map(|x| &*x),
         &metrics,
         rule_node
     ).into()
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_ResolvePseudoStyle(element: RawGeckoElementBorrowed,
-                                           pseudo_type: CSSPseudoElementType,
-                                           is_probe: bool,
-                                           inherited_style: ServoStyleContextBorrowedOrNull,
-                                           raw_data: RawServoStyleSetBorrowed)
-     -> ServoStyleContextStrong
-{
+pub extern "C" fn Servo_ResolvePseudoStyle(
+    element: RawGeckoElementBorrowed,
+    pseudo_type: CSSPseudoElementType,
+    is_probe: bool,
+    inherited_style: ServoStyleContextBorrowedOrNull,
+    raw_data: RawServoStyleSetBorrowed,
+) -> ServoStyleContextStrong {
     let element = GeckoElement(element);
     let doc_data = PerDocumentStyleData::from_ffi(raw_data).borrow();
 
     debug!("Servo_ResolvePseudoStyle: {:?} {:?}, is_probe: {}",
            element, PseudoElement::from_pseudo_type(pseudo_type), is_probe);
 
     let data = element.borrow_data();
 
@@ -2186,36 +2223,37 @@ pub extern "C" fn Servo_ComputedValues_R
         Some(inherited_style),
         &*doc_data,
         /* is_probe = */ false,
         Some(&matching_fn),
     ).unwrap().into()
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_SetExplicitStyle(element: RawGeckoElementBorrowed,
-                                         style: ServoStyleContextBorrowed)
-{
+pub extern "C" fn Servo_SetExplicitStyle(
+    element: RawGeckoElementBorrowed,
+    style: ServoStyleContextBorrowed,
+) {
     let element = GeckoElement(element);
     debug!("Servo_SetExplicitStyle: {:?}", element);
     // We only support this API for initial styling. There's no reason it couldn't
     // work for other things, we just haven't had a reason to do so.
     debug_assert!(element.get_data().is_none());
     let mut data = unsafe { element.ensure_data() };
     data.styles.primary = Some(unsafe { ArcBorrow::from_ref(style) }.clone_arc());
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_HasAuthorSpecifiedRules(style: ServoStyleContextBorrowed,
-                                                element: RawGeckoElementBorrowed,
-                                                pseudo_type: CSSPseudoElementType,
-                                                rule_type_mask: u32,
-                                                author_colors_allowed: bool)
-    -> bool
-{
+pub extern "C" fn Servo_HasAuthorSpecifiedRules(
+    style: ServoStyleContextBorrowed,
+    element: RawGeckoElementBorrowed,
+    pseudo_type: CSSPseudoElementType,
+    rule_type_mask: u32,
+    author_colors_allowed: bool,
+) -> bool {
     let element = GeckoElement(element);
     let pseudo = PseudoElement::from_pseudo_type(pseudo_type);
 
     let guard = (*GLOBAL_STYLE_DATA).shared_lock.read();
     let guards = StylesheetGuards::same(&guard);
 
     style.rules().has_author_specified_rules(element,
                                              pseudo,
@@ -2374,18 +2412,19 @@ pub extern "C" fn Servo_ComputedValues_G
     }
     if flags.contains(ComputedValueFlags::IS_IN_DISPLAY_NONE_SUBTREE) {
         result |= structs::NS_STYLE_IN_DISPLAY_NONE_SUBTREE as u64;
     }
     result
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_ComputedValues_SpecifiesAnimationsOrTransitions(values: ServoStyleContextBorrowed)
-                                                                        -> bool {
+pub extern "C" fn Servo_ComputedValues_SpecifiesAnimationsOrTransitions(
+    values: ServoStyleContextBorrowed,
+) -> bool {
     let b = values.get_box();
     b.specifies_animations() || b.specifies_transitions()
 }
 
 #[no_mangle]
 pub extern "C" fn Servo_ComputedValues_EqualCustomProperties(
     first: ServoComputedDataBorrowed,
     second: ServoComputedDataBorrowed
@@ -2428,18 +2467,19 @@ pub extern "C" fn Servo_ComputedValues_G
         })
     }
 }
 
 /// See the comment in `Device` to see why it's ok to pass an owned reference to
 /// the pres context (hint: the context outlives the StyleSet, that holds the
 /// device alive).
 #[no_mangle]
-pub extern "C" fn Servo_StyleSet_Init(pres_context: RawGeckoPresContextOwned)
-  -> *mut RawServoStyleSet {
+pub extern "C" fn Servo_StyleSet_Init(
+    pres_context: RawGeckoPresContextOwned,
+) -> *mut RawServoStyleSet {
     let data = Box::new(PerDocumentStyleData::new(pres_context));
     Box::into_raw(data) as *mut RawServoStyleSet
 }
 
 #[no_mangle]
 pub extern "C" fn Servo_StyleSet_RebuildCachedData(raw_data: RawServoStyleSetBorrowed) {
     let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut();
     data.stylist.device_mut().rebuild_cached_data();
@@ -2541,19 +2581,21 @@ pub extern "C" fn Servo_ParseEasing(
             *output = parsed_easing.into();
             true
         },
         Err(_) => false
     }
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_GetProperties_Overriding_Animation(element: RawGeckoElementBorrowed,
-                                                           list: RawGeckoCSSPropertyIDListBorrowed,
-                                                           set: nsCSSPropertyIDSetBorrowedMut) {
+pub extern "C" fn Servo_GetProperties_Overriding_Animation(
+    element: RawGeckoElementBorrowed,
+    list: RawGeckoCSSPropertyIDListBorrowed,
+    set: nsCSSPropertyIDSetBorrowedMut,
+) {
     let element = GeckoElement(element);
     let element_data = match element.borrow_data() {
         Some(data) => data,
         None => return
     };
     let global_style_data = &*GLOBAL_STYLE_DATA;
     let guard = global_style_data.shared_lock.read();
     let guards = StylesheetGuards::same(&guard);
@@ -2626,18 +2668,19 @@ pub extern "C" fn Servo_ParseStyleAttrib
 
 #[no_mangle]
 pub extern "C" fn Servo_DeclarationBlock_CreateEmpty() -> RawServoDeclarationBlockStrong {
     let global_style_data = &*GLOBAL_STYLE_DATA;
     Arc::new(global_style_data.shared_lock.wrap(PropertyDeclarationBlock::new())).into_strong()
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_DeclarationBlock_Clone(declarations: RawServoDeclarationBlockBorrowed)
-                                               -> RawServoDeclarationBlockStrong {
+pub extern "C" fn Servo_DeclarationBlock_Clone(
+    declarations: RawServoDeclarationBlockBorrowed,
+) -> RawServoDeclarationBlockStrong {
     let global_style_data = &*GLOBAL_STYLE_DATA;
     let guard = global_style_data.shared_lock.read();
     let declarations = Locked::<PropertyDeclarationBlock>::as_arc(&declarations);
     Arc::new(global_style_data.shared_lock.wrap(
         declarations.read_with(&guard).clone()
     )).into_strong()
 }
 
@@ -3037,20 +3080,20 @@ macro_rules! match_wrap_declared {
             _ => {
                 panic!("stylo: Don't know how to handle presentation property");
             }
         }
     )
 }
 
 #[no_mangle]
-pub extern "C" fn Servo_DeclarationBlock_PropertyIsSet(declarations:
-                                                       RawServoDeclarationBlockBorrowed,
-                                                       property: nsCSSPropertyID)
-        -> bool {
+pub extern "C" fn Servo_DeclarationBlock_PropertyIsSet(
+    declarations: RawServoDeclarationBlockBorrowed,
+    property: nsCSSPropertyID,
+) -> bool {
     read_locked_arc(declarations, |decls: &PropertyDeclarationBlock| {
         decls.contains(get_longhand_from_id!(property))
     })
 }
 
 #[no_mangle]
 pub extern "C" fn Servo_DeclarationBlock_SetIdentStringValue(
     declarations: RawServoDeclarationBlockBorrowed,
@@ -3472,17 +3515,17 @@ pub extern "C" fn Servo_NoteExplicitHint
     change_hint: nsChangeHint,
 ) {
     GeckoElement(element).note_explicit_hints(restyle_hint, change_hint);
 }
 
 #[no_mangle]
 pub extern "C" fn Servo_TakeChangeHint(
     element: RawGeckoElementBorrowed,
-    was_restyled: *mut bool
+    was_restyled: *mut bool,
 ) -> u32 {
     let was_restyled =  unsafe { was_restyled.as_mut().unwrap() };
     let element = GeckoElement(element);
 
     let damage = match element.mutate_data() {
         Some(mut data) => {
             *was_restyled = data.is_restyle();
 
@@ -3521,17 +3564,17 @@ pub extern "C" fn Servo_ResolveStyle(
 
 #[no_mangle]
 pub extern "C" fn Servo_ResolveStyleLazily(
     element: RawGeckoElementBorrowed,
     pseudo_type: CSSPseudoElementType,
     rule_inclusion: StyleRuleInclusion,
     snapshots: *const ServoElementSnapshotTable,
     raw_data: RawServoStyleSetBorrowed,
-    ignore_existing_styles: bool
+    ignore_existing_styles: bool,
 ) -> ServoStyleContextStrong {
     debug_assert!(!snapshots.is_null());
     let global_style_data = &*GLOBAL_STYLE_DATA;
     let guard = global_style_data.shared_lock.read();
     let element = GeckoElement(element);
     let doc_data = PerDocumentStyleData::from_ffi(raw_data);
     let data = doc_data.borrow();
     let rule_inclusion = RuleInclusion::from(rule_inclusion);