Bug 1365162 - Part 3: Record on snapshots whether the element supports lang="" attributes. r=emilio
authorCameron McCormack <cam@mcc.id.au>
Wed, 07 Jun 2017 11:11:44 +0800
changeset 411012 e10c7dba03490b6c74c8b3cdcb11948684e8e867
parent 411011 6751fa7c52610960e62ab6e743037c7f43951682
child 411013 c1cac2541d866bdca8d405df2ba432f6d65ccb6f
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1365162
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1365162 - Part 3: Record on snapshots whether the element supports lang="" attributes. r=emilio MozReview-Commit-ID: KpzwsKpBiOO
layout/style/ServoElementSnapshot.cpp
layout/style/ServoElementSnapshot.h
--- a/layout/style/ServoElementSnapshot.cpp
+++ b/layout/style/ServoElementSnapshot.cpp
@@ -15,18 +15,18 @@ ServoElementSnapshot::ServoElementSnapsh
   : mState(0)
   , mContains(Flags(0))
   , mIsTableBorderNonzero(false)
   , mIsMozBrowserFrame(false)
 {
   MOZ_COUNT_CTOR(ServoElementSnapshot);
   mIsHTMLElementInHTMLDocument =
     aElement->IsHTMLElement() && aElement->IsInHTMLDocument();
-  mIsInChromeDocument =
-    nsContentUtils::IsChromeDoc(aElement->OwnerDoc());
+  mIsInChromeDocument = nsContentUtils::IsChromeDoc(aElement->OwnerDoc());
+  mSupportsLangAttr = aElement->SupportsLangAttr();
 }
 
 ServoElementSnapshot::~ServoElementSnapshot()
 {
   MOZ_COUNT_DTOR(ServoElementSnapshot);
 }
 
 void
--- a/layout/style/ServoElementSnapshot.h
+++ b/layout/style/ServoElementSnapshot.h
@@ -140,20 +140,18 @@ public:
       if (mAttrs[i].mName.Equals(aLocalName, aNamespaceID)) {
         return &mAttrs[i].mValue;
       }
     }
 
     return nullptr;
   }
 
-  bool IsInChromeDocument() const
-  {
-    return mIsInChromeDocument;
-  }
+  bool IsInChromeDocument() const { return mIsInChromeDocument; }
+  bool SupportsLangAttr() const { return mSupportsLangAttr; }
 
   bool HasAny(Flags aFlags) const { return bool(mContains & aFlags); }
 
   bool IsTableBorderNonzero() const
   {
     MOZ_ASSERT(HasOtherPseudoClassState());
     return mIsTableBorderNonzero;
   }
@@ -169,15 +167,16 @@ private:
   // 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.
   nsTArray<ServoAttrSnapshot> mAttrs;
   ServoStateType mState;
   Flags mContains;
   bool mIsHTMLElementInHTMLDocument : 1;
   bool mIsInChromeDocument : 1;
+  bool mSupportsLangAttr : 1;
   bool mIsTableBorderNonzero : 1;
   bool mIsMozBrowserFrame : 1;
 };
 
 } // namespace mozilla
 
 #endif