Bug 1403073 - stylo: Fix some bindgen object layout issues. r?xidorn
MozReview-Commit-ID: CnW4J2ZlmfJ
--- a/layout/style/ServoBindings.toml
+++ b/layout/style/ServoBindings.toml
@@ -341,16 +341,17 @@ opaque-types = [
"JS::Rooted",
"mozilla::Maybe",
"gfxSize", # <- union { struct { T width; T height; }; T components[2] };
"gfxSize_Super", # Ditto.
"mozilla::StyleAnimationValue",
"StyleAnimationValue", # pulls in a whole bunch of stuff we don't need in the bindings
"mozilla::dom::.*Callback", # Pulls in ErrorResult and other things that
# don't align properly on Linux 32-bit
+ "mozilla::SchedulerGroup", # Non-standard-layout packing of field into superclass
]
mapped-generic-types = [
{ generic = true, gecko = "mozilla::ServoUnsafeCell", servo = "::std::cell::UnsafeCell" },
{ generic = true, gecko = "mozilla::ServoCell", servo = "::std::cell::Cell" },
{ 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>" },
--- a/layout/style/nsCSSValue.h
+++ b/layout/style/nsCSSValue.h
@@ -194,16 +194,21 @@ private:
: mRustString(aString) {}
~RustOrGeckoString() {}
nsString mString;
mozilla::ServoRawOffsetArc<RustString> mRustString;
} mStrings;
mutable bool mUsingRustString;
protected:
+ // Only used by ImageValue. Declared up here because otherwise bindgen gets
+ // confused by the non-standard-layout packing of the variable up into
+ // URLValueData.
+ bool mLoadedImage = false;
+
virtual ~URLValueData();
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
private:
URLValueData(const URLValueData& aOther) = delete;
URLValueData& operator=(const URLValueData& aOther) = delete;
@@ -262,19 +267,16 @@ struct ImageValue final : public URLValu
void Initialize(nsIDocument* aDocument);
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
protected:
~ImageValue();
-private:
- bool mLoadedImage = false;
-
public:
// Inherit Equals from URLValueData
nsRefPtrHashtable<nsPtrHashKey<nsIDocument>, imgRequestProxy> mRequests;
};
struct GridNamedArea {
nsString mName;