Bug 1390691 - Fix up Gecko_CalcStyleDifference for Linux 32-bit ABI. r=Manishearth
Bindgen bitfield enums don't work as return values with the Linux 32-bit ABI at
the moment because they wrap the value in a struct.
This causes the Rust side to believe the callee expects space for the struct
return value, while C++ believes it's just an integer value.
MozReview-Commit-ID: FRBqlZuMiAR
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -449,17 +449,17 @@ Gecko_GetStyleContext(RawGeckoElementBor
}
CSSPseudoElementType
Gecko_GetImplementedPseudo(RawGeckoElementBorrowed aElement)
{
return aElement->GetPseudoElementType();
}
-nsChangeHint
+uint32_t
Gecko_CalcStyleDifference(ServoStyleContextBorrowed aOldStyle,
ServoStyleContextBorrowed aNewStyle,
uint64_t aOldStyleBits,
bool* aAnyStyleChanged)
{
MOZ_ASSERT(aOldStyle);
MOZ_ASSERT(aNewStyle);
--- a/layout/style/ServoBindings.h
+++ b/layout/style/ServoBindings.h
@@ -390,20 +390,23 @@ void Gecko_NoteDirtyElement(RawGeckoElem
void Gecko_NoteAnimationOnlyDirtyElement(RawGeckoElementBorrowed element);
// Incremental restyle.
// Also, we might want a ComputedValues to ComputedValues API for animations?
// Not if we do them in Gecko...
nsStyleContext* Gecko_GetStyleContext(RawGeckoElementBorrowed element,
nsIAtom* aPseudoTagOrNull);
mozilla::CSSPseudoElementType Gecko_GetImplementedPseudo(RawGeckoElementBorrowed element);
-nsChangeHint Gecko_CalcStyleDifference(ServoStyleContextBorrowed old_style,
- ServoStyleContextBorrowed new_style,
- uint64_t old_style_bits,
- bool* any_style_changed);
+// We'd like to return `nsChangeHint` here, but bindgen bitfield enums don't
+// work as return values with the Linux 32-bit ABI at the moment because
+// they wrap the value in a struct.
+uint32_t Gecko_CalcStyleDifference(ServoStyleContextBorrowed old_style,
+ ServoStyleContextBorrowed new_style,
+ uint64_t old_style_bits,
+ bool* any_style_changed);
nsChangeHint Gecko_HintsHandledForDescendants(nsChangeHint aHint);
// Get an element snapshot for a given element from the table.
const ServoElementSnapshot*
Gecko_GetElementSnapshot(const mozilla::ServoElementSnapshotTable* table,
RawGeckoElementBorrowed element);
void Gecko_DropElementSnapshot(ServoElementSnapshotOwned snapshot);