Bug 1328787 - Part 6: Update build_gecko.rs and bindings. r?heycam draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Fri, 27 Jan 2017 09:55:11 +0900
changeset 467021 5e45961d23623feef2468170606a94b50ef9318d
parent 467020 f551809c6dd8a68e15bf3a022666294b799fa30a
child 467022 9585b49ee1d9515c88340d2a3387369eac013114
push id43089
push userhikezoe@mozilla.com
push dateFri, 27 Jan 2017 01:33:18 +0000
reviewersheycam
bugs1328787
milestone54.0a1
Bug 1328787 - Part 6: Update build_gecko.rs and bindings. r?heycam 'RawServoDeclarationBlock' in structs_types in build_gecko.rs and the change in conversion.rs are needed for using set_arc_leaky() for PropertyValuePair.mServoDeclarationBlock. Without this change, mServoDeclarationBlock.set_arc_leaky() is called against RawServoDeclarationBlockVoid. MozReview-Commit-ID: FZkZ0OclXcP
servo/components/style/build_gecko.rs
servo/components/style/gecko/conversions.rs
--- a/servo/components/style/build_gecko.rs
+++ b/servo/components/style/build_gecko.rs
@@ -227,16 +227,17 @@ mod bindings {
                 ..CodegenConfig::nothing()
             })
             .header(add_include("nsStyleStruct.h"))
             .include(add_include("mozilla/ServoPropPrefList.h"))
             .header(add_include("mozilla/StyleAnimationValue.h"))
             .include(add_include("gfxFontConstants.h"))
             .include(add_include("nsThemeConstants.h"))
             .include(add_include("mozilla/dom/AnimationEffectReadOnlyBinding.h"))
+            .include(add_include("mozilla/Keyframe.h"))
             .include(add_include("mozilla/ServoElementSnapshot.h"))
             .include(add_include("mozilla/dom/Element.h"))
             .include(add_include("mozilla/ServoBindings.h"))
             .include(add_include("nsMediaFeatures.h"))
             .include(add_include("nsMediaList.h"))
             // FIXME(emilio): Incrementally remove these "pub use"s. Probably
             // mozilla::css and mozilla::dom are easier.
             .raw_line("pub use self::root::*;")
@@ -283,16 +284,17 @@ mod bindings {
             "FrameRequestCallback",
             "gfxAlternateValue",
             "gfxFontFeature",
             "gfxFontVariation",
             "GridNamedArea",
             "HalfCorner",
             "Image",
             "ImageURL",
+            "Keyframe",
             "nsAttrName",
             "nsAttrValue",
             "nsBorderColors",
             "nscolor",
             "nsChangeHint",
             "nsCSSKeyword",
             "nsCSSPropertyID",
             "nsCSSProps",
@@ -357,16 +359,17 @@ mod bindings {
             "nsStyleUnit",
             "nsStyleUserInterface",
             "nsStyleVariables",
             "nsStyleVisibility",
             "nsStyleXUL",
             "nsTArray",
             "nsTArrayHeader",
             "Position",
+            "PropertyValuePair",
             "Runnable",
             "ServoAttrSnapshot",
             "ServoElementSnapshot",
             "SheetParsingMode",
             "StaticRefPtr",
             "StyleAnimation",
             "StyleBasicShape",
             "StyleBasicShapeType",
@@ -486,28 +489,31 @@ mod bindings {
             .raw_line("pub use nsstring::{nsACString, nsAString};")
             .raw_line("type nsACString_internal = nsACString;")
             .raw_line("type nsAString_internal = nsAString;")
             .whitelisted_function("Servo_.*")
             .whitelisted_function("Gecko_.*");
         let structs_types = [
             "RawGeckoDocument",
             "RawGeckoElement",
+            "RawGeckoKeyframeList",
             "RawGeckoNode",
             "RawGeckoAnimationValueList",
             "RawServoAnimationValue",
             "RawServoAnimationValueBorrowedList",
+            "RawServoDeclarationBlock",
             "RawGeckoPresContext",
             "RawGeckoPresContextOwned",
             "ThreadSafeURIHolder",
             "ThreadSafePrincipalHolder",
             "CSSPseudoClassType",
             "TraversalRootBehavior",
             "FontFamilyList",
             "FontFamilyType",
+            "Keyframe",
             "ServoElementSnapshot",
             "SheetParsingMode",
             "StyleBasicShape",
             "StyleBasicShapeType",
             "StyleClipPath",
             "nsCSSKeyword",
             "nsCSSPropertyID",
             "nsCSSShadowArray",
@@ -552,16 +558,17 @@ mod bindings {
             "nsStyleTextReset",
             "nsStyleUIReset",
             "nsStyleUnion",
             "nsStyleUnit",
             "nsStyleUserInterface",
             "nsStyleVariables",
             "nsStyleVisibility",
             "nsStyleXUL",
+            "nsTimingFunction",
             "nscoord",
             "nsresult",
             "Loader",
             "ServoStyleSheet",
             "mozilla::EffectCompositor_CascadeLevel",
         ];
         struct ArrayType {
             cpp_type: &'static str,
@@ -593,16 +600,17 @@ mod bindings {
             "RawGeckoElement",
             "RawGeckoDocument",
             "RawServoDeclarationBlockStrong",
             "RawGeckoPresContext",
         ];
         let servo_borrow_types = [
             "nsCSSValue",
             "RawGeckoAnimationValueList",
+            "RawGeckoKeyframeList",
             "RawServoAnimationValueBorrowedList",
         ];
         for &ty in structs_types.iter() {
             builder = builder.hide_type(ty)
                 .raw_line(format!("use gecko_bindings::structs::{};", ty));
             // TODO this is hacky, figure out a better way to do it without
             // hardcoding everything...
             if ty.starts_with("nsStyle") {
--- a/servo/components/style/gecko/conversions.rs
+++ b/servo/components/style/gecko/conversions.rs
@@ -6,20 +6,21 @@
 //! Ideally, it would be in geckolib itself, but coherence
 //! forces us to keep the traits and implementations here
 
 #![allow(unsafe_code)]
 
 use app_units::Au;
 use gecko::values::convert_rgba_to_nscolor;
 use gecko_bindings::bindings::{Gecko_CreateGradient, Gecko_SetGradientImageValue, Gecko_SetUrlImageValue};
-use gecko_bindings::bindings::{RawServoStyleSheet, RawServoDeclarationBlock, RawServoStyleRule, RawServoImportRule};
+use gecko_bindings::bindings::{RawServoStyleSheet, RawServoStyleRule, RawServoImportRule};
 use gecko_bindings::bindings::{ServoComputedValues, ServoCssRules};
 use gecko_bindings::structs::{nsStyleCoord_CalcValue, nsStyleImage};
 use gecko_bindings::structs::nsresult;
+use gecko_bindings::structs::RawServoDeclarationBlock;
 use gecko_bindings::sugar::ns_style_coord::{CoordDataValue, CoordDataMut};
 use gecko_bindings::sugar::ownership::{HasArcFFI, HasFFI};
 use parking_lot::RwLock;
 use properties::{ComputedValues, PropertyDeclarationBlock};
 use stylesheets::{CssRules, RulesMutateError, Stylesheet, StyleRule, ImportRule};
 use values::computed::{CalcLengthOrPercentage, Gradient, Image, LengthOrPercentage, LengthOrPercentageOrAuto};
 
 unsafe impl HasFFI for Stylesheet {