Bug 1444580: Mark JS::Value as opaque instead of hidden. r=xidorn draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Sat, 10 Mar 2018 06:33:55 +0100
changeset 765765 e6530b7c09b13f2cec850d331c04149201806292
parent 765764 38de88908ceabf878f8cdc4c972b1bdb95b3ea19
child 765766 477cc5476f6cf560dd40dbb934e7b4d06c8752a5
push id102160
push userbmo:emilio@crisal.io
push dateSat, 10 Mar 2018 06:32:21 +0000
reviewersxidorn
bugs1444580
milestone60.0a1
Bug 1444580: Mark JS::Value as opaque instead of hidden. r=xidorn The next commit will move js::ExpandoAndGeneration (which contains a JS::Value) into nsIDocument instead of nsDocument, so it needs to be defined. I plan to land this after https://github.com/rust-lang-nursery/rust-bindgen/pull/1271, so it shouldn't break anything. MozReview-Commit-ID: Kwu21AqFbPv
layout/style/ServoBindings.toml
--- a/layout/style/ServoBindings.toml
+++ b/layout/style/ServoBindings.toml
@@ -93,30 +93,22 @@ raw-lines = [
     "pub use self::root::mozilla::dom::*;",
     "use atomic_refcell::AtomicRefCell;",
     "use data::ElementData;",
 ]
 hide-types = [
     "nsString",
     ".*char_traits",
     ".*incompatible_char_type",
-    # JS::Value and JS::UninitializedValue use alignas(8) which bindgen
-    # can't represent correctly on Linux 32-bit.  See
-    # https://github.com/rust-lang-nursery/rust-bindgen/issues/917.
-    # It's also not used by Stylo.  The following types are also hidden for
-    # making use of it and being similarly unused by Stylo.
-    "JS::Value",
-    "JS::UninitializedValue",
     "mozilla::binding_danger::TErrorResult.*",
     "mozilla::ErrorResult.*", # Causes JSWhyMagic to be included & handled incorrectly.
     "mozilla::dom::CallbackFunction",
     "mozilla::dom::CallbackObject.*",
     "nsINode_ErrorResult",
     "nsDOMAttributeMap_ErrorResult",
-    # End of JS::Value related types
 ]
 bitfield-enums = [
     "nsChangeHint",
     "nsRestyleHint",
     "mozilla::OriginFlags",
 ]
 rusty-enums = [
     "nsCompatibility",
@@ -379,16 +371,19 @@ whitelist-types = [
     "mozilla::ParsingMode",
     "mozilla::InheritTarget",
     "mozilla::ServoDeclarationBlock",
     "mozilla::ServoMediaList",
     "mozilla::StyleRuleInclusion",
     "nsStyleTransformMatrix::MatrixTransformOperator",
 ]
 opaque-types = [
+    "JS::Value",
+    "JS::UninitializedValue",
+
     "std::pair__PCCP",
     "std::namespace::atomic___base", "std::atomic__My_base",
     "std::atomic",
     "std::atomic___base",
     # We want everything but FontVariation and Float to be opaque but we don't
     # have negative regexes.
     "mozilla::gfx::(.{0,4}|.{6,12}|.{14,}|([^F][^o][^n][^t][^V][^a][^r][^i][^a][^t][^i][^o][^n])|([^F][^l][^o][^a][^t]))",
     "mozilla::dom::Sequence",