Bug 1365659 part 2. Add id/class flags to stylo snapshots and set them correctly on the Gecko side. r=emilio
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 18 May 2017 11:31:54 -0400
changeset 359069 296338483720809657faf01bbb8a65c7c3923ca9
parent 359068 a6e31b43d76bf0a1139a2d8a14e04cd59fc2c70b
child 359070 54d8c1a5ca9a48546650a6223ec990ec5c081b3b
push id31849
push userryanvm@gmail.com
push dateFri, 19 May 2017 15:38:10 +0000
treeherdermozilla-central@52b207e50972 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1365659
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 1365659 part 2. Add id/class flags to stylo snapshots and set them correctly on the Gecko side. r=emilio MozReview-Commit-ID: 4ylYDIbR3lI
layout/style/ServoElementSnapshot.cpp
layout/style/ServoElementSnapshot.h
--- a/layout/style/ServoElementSnapshot.cpp
+++ b/layout/style/ServoElementSnapshot.cpp
@@ -40,11 +40,17 @@ ServoElementSnapshot::AddAttrs(Element* 
   const nsAttrName* attrName;
   for (uint32_t i = 0; i < attrCount; ++i) {
     attrName = aElement->GetAttrNameAt(i);
     const nsAttrValue* attrValue =
       aElement->GetParsedAttr(attrName->LocalName(), attrName->NamespaceID());
     mAttrs.AppendElement(ServoAttrSnapshot(*attrName, *attrValue));
   }
   mContains |= Flags::Attributes;
+  if (aElement->HasID()) {
+    mContains |= Flags::Id;
+  }
+  if (aElement->MayHaveClass()) {
+    mContains |= Flags::MaybeClass;
+  }
 }
 
 } // namespace mozilla
--- a/layout/style/ServoElementSnapshot.h
+++ b/layout/style/ServoElementSnapshot.h
@@ -41,17 +41,18 @@ struct ServoAttrSnapshot
 /**
  * A bitflags enum class used to determine what data does a ServoElementSnapshot
  * contains.
  */
 enum class ServoElementSnapshotFlags : uint8_t
 {
   State = 1 << 0,
   Attributes = 1 << 1,
-  All = State | Attributes
+  Id = 1 << 2,
+  MaybeClass = 1 << 3,
 };
 
 MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(ServoElementSnapshotFlags)
 
 /**
  * This class holds all non-tree-structural state of an element that might be
  * used for selector matching eventually.
  *