Bug 1365659 part 1. Change stylo element snapshot member ordering to pack a bit better. r=emilio draft
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 18 May 2017 11:30:42 -0400
changeset 580465 95d02763720de8797367304e90b9eeef2a22309c
parent 579653 85e5d15c31691c89b82d6068c26260416493071f
child 580466 e103418eb75fda17a3f83fd017514b2b9d821ec3
push id59565
push userbzbarsky@mozilla.com
push dateThu, 18 May 2017 15:36:04 +0000
reviewersemilio
bugs1365659
milestone55.0a1
Bug 1365659 part 1. Change stylo element snapshot member ordering to pack a bit better. r=emilio MozReview-Commit-ID: 4pe8JJAXiXz
layout/style/ServoElementSnapshot.cpp
layout/style/ServoElementSnapshot.h
--- a/layout/style/ServoElementSnapshot.cpp
+++ b/layout/style/ServoElementSnapshot.cpp
@@ -7,18 +7,18 @@
 #include "mozilla/ServoElementSnapshot.h"
 #include "mozilla/dom/Element.h"
 #include "nsIContentInlines.h"
 #include "nsContentUtils.h"
 
 namespace mozilla {
 
 ServoElementSnapshot::ServoElementSnapshot(const Element* aElement)
-  : mContains(Flags(0))
-  , mState(0)
+  : mState(0)
+  , mContains(Flags(0))
 {
   MOZ_COUNT_CTOR(ServoElementSnapshot);
   mIsHTMLElementInHTMLDocument =
     aElement->IsHTMLElement() && aElement->IsInHTMLDocument();
   mIsInChromeDocument =
     nsContentUtils::IsChromeDoc(aElement->OwnerDoc());
 }
 
--- a/layout/style/ServoElementSnapshot.h
+++ b/layout/style/ServoElementSnapshot.h
@@ -139,18 +139,18 @@ public:
 
   bool HasAny(Flags aFlags) const { return bool(mContains & aFlags); }
 
 private:
   // TODO: Profile, a 1 or 2 element AutoTArray could be worth it, given we know
   // we're dealing with attribute changes when we take snapshots of attributes,
   // though it can be wasted space if we deal with a lot of state-only
   // snapshots.
-  Flags mContains;
   nsTArray<ServoAttrSnapshot> mAttrs;
   ServoStateType mState;
+  Flags mContains;
   bool mIsHTMLElementInHTMLDocument;
   bool mIsInChromeDocument;
 };
 
 } // namespace mozilla
 
 #endif