Bug 1331326 - stylo: Shuffle some nsIDocument fields around to avoid rust-bindgen problem. r?bz
MozReview-Commit-ID: sYpRzC2t0E
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -1279,32 +1279,32 @@ nsIDocument::nsIDocument()
mReferrerPolicySet(false),
mReferrerPolicy(mozilla::net::RP_Unset),
mBlockAllMixedContent(false),
mBlockAllMixedContentPreloads(false),
mUpgradeInsecureRequests(false),
mUpgradeInsecurePreloads(false),
mCharacterSet(NS_LITERAL_CSTRING("ISO-8859-1")),
mNodeInfoManager(nullptr),
- mCompatMode(eCompatibility_FullStandards),
- mVisibilityState(dom::VisibilityState::Hidden),
mIsInitialDocumentInWindow(false),
mMayStartLayout(true),
mVisible(true),
mRemovedFromDocShell(false),
// mAllowDNSPrefetch starts true, so that we can always reliably && it
// with various values that might disable it. Since we never prefetch
// unless we get a window, and in that case the docshell value will get
// &&-ed in, this is safe.
mAllowDNSPrefetch(true),
mIsBeingUsedAsImage(false),
mHasLinksToUpdate(false),
mFontFaceSetDirty(true),
mGetUserFontSetCalled(false),
mPostedFlushUserFontSet(false),
+ mCompatMode(eCompatibility_FullStandards),
+ mVisibilityState(dom::VisibilityState::Hidden),
mBidiOptions(IBMBIDI_DEFAULT_BIDI_OPTIONS),
mPartID(0),
mDidFireDOMContentLoaded(true),
mHasScrollLinkedEffect(false),
mUserHasInteracted(false)
{
SetIsInDocument();
--- a/dom/base/nsIDocument.h
+++ b/dom/base/nsIDocument.h
@@ -3027,34 +3027,22 @@ protected:
nsTArray<nsAutoPtr<nsPropertyTable> > mExtraPropertyTables;
// Our cached .children collection
nsCOMPtr<nsIHTMLCollection> mChildrenCollection;
// container for per-context fonts (downloadable, SVG, etc.)
RefPtr<mozilla::dom::FontFaceSet> mFontFaceSet;
- // Compatibility mode
- nsCompatibility mCompatMode;
-
- // Our readyState
- ReadyState mReadyState;
-
- // Whether this document has (or will have, once we have a pres shell) a
- // Gecko- or Servo-backed style system.
- mozilla::StyleBackendType mStyleBackendType;
-
-#ifdef MOZILLA_INTERNAL_API
- // Our visibility state
- mozilla::dom::VisibilityState mVisibilityState;
- static_assert(sizeof(mozilla::dom::VisibilityState) == sizeof(uint8_t),
- "Error size of mVisibilityState and mDummy");
-#else
- uint8_t mDummy;
-#endif
+ // XXXheycam rust-bindgen currently doesn't generate correctly aligned fields
+ // to represent the following bitfields if they are preceded by something
+ // non-pointer aligned, so if adding non-pointer sized fields, please do so
+ // somewhere other than right here.
+ //
+ // https://github.com/servo/rust-bindgen/issues/111
// True if BIDI is enabled.
bool mBidiEnabled : 1;
// True if a MathML element has ever been owned by this document.
bool mMathMLEnabled : 1;
// True if this document is the initial document for a window. This should
// basically be true only for documents that exist in newly-opened windows or
@@ -3194,16 +3182,35 @@ protected:
bool mGetUserFontSetCalled : 1;
// Do we currently have an event posted to call FlushUserFontSet?
bool mPostedFlushUserFontSet : 1;
// True is document has ever been in a foreground window.
bool mEverInForeground : 1;
+ // Compatibility mode
+ nsCompatibility mCompatMode;
+
+ // Our readyState
+ ReadyState mReadyState;
+
+ // Whether this document has (or will have, once we have a pres shell) a
+ // Gecko- or Servo-backed style system.
+ mozilla::StyleBackendType mStyleBackendType;
+
+#ifdef MOZILLA_INTERNAL_API
+ // Our visibility state
+ mozilla::dom::VisibilityState mVisibilityState;
+ static_assert(sizeof(mozilla::dom::VisibilityState) == sizeof(uint8_t),
+ "Error size of mVisibilityState and mDummy");
+#else
+ uint8_t mDummy;
+#endif
+
enum Type {
eUnknown, // should never be used
eHTML,
eXHTML,
eGenericXML,
eSVG,
eXUL
};