Bug 1325734 - Simplify ElementData and eliminate the concept of consuming styles. r=emilio
authorBobby Holley <bobbyholley@gmail.com>
Thu, 05 Jan 2017 13:12:53 -0800
changeset 328556 f650d9f42ff5acdd2f3021e53c0ff076fb1b198b
parent 328555 79c7e34346304105ab56ff302a070c4a13329627
child 328557 4a0172713d6b81c52c1dfb0113c67c3333d8a038
push id85478
push userbholley@mozilla.com
push dateMon, 09 Jan 2017 19:50:35 +0000
treeherdermozilla-inbound@e86b8ee2b13f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1325734
milestone53.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 1325734 - Simplify ElementData and eliminate the concept of consuming styles. r=emilio
dom/html/nsGenericHTMLElement.cpp
layout/base/ServoRestyleManager.cpp
layout/base/crashtests/crashtests.list
layout/base/nsCSSFrameConstructor.cpp
layout/base/nsPresContext.cpp
layout/generic/crashtests/crashtests.list
layout/generic/nsFrameSetFrame.cpp
layout/generic/nsImageFrame.cpp
layout/style/ServoBindingList.h
layout/style/ServoStyleSet.cpp
layout/style/ServoStyleSet.h
layout/style/ServoTypes.h
layout/style/StyleSetHandle.h
layout/style/StyleSetHandleInlines.h
layout/style/nsComputedDOMStyle.cpp
layout/style/nsStyleSet.h
layout/xul/nsListBoxBodyFrame.cpp
layout/xul/nsSplitterFrame.cpp
--- a/dom/html/nsGenericHTMLElement.cpp
+++ b/dom/html/nsGenericHTMLElement.cpp
@@ -2936,19 +2936,17 @@ IsOrHasAncestorWithDisplayNone(Element* 
     return false;
   }
 
   // XXXbholley: This could be done more directly with Servo's style system.
   StyleSetHandle styleSet = aPresShell->StyleSet();
   RefPtr<nsStyleContext> sc;
   for (int32_t i = elementsToCheck.Length() - 1; i >= 0; --i) {
     if (sc) {
-      sc = styleSet->ResolveStyleFor(elementsToCheck[i], sc,
-                                     ConsumeStyleBehavior::DontConsume,
-                                     LazyComputeBehavior::Assert);
+      sc = styleSet->ResolveStyleFor(elementsToCheck[i], sc, LazyComputeBehavior::Assert);
     } else {
       sc = nsComputedDOMStyle::GetStyleContextForElementNoFlush(elementsToCheck[i],
                                                                 nullptr, aPresShell);
     }
     if (sc->StyleDisplay()->mDisplay == StyleDisplay::None) {
       return true;
     }
   }
--- a/layout/base/ServoRestyleManager.cpp
+++ b/layout/base/ServoRestyleManager.cpp
@@ -141,17 +141,17 @@ ServoRestyleManager::RecreateStyleContex
                                            nsStyleContext* aParentContext,
                                            ServoStyleSet* aStyleSet,
                                            nsStyleChangeList& aChangeListToProcess)
 {
   nsIFrame* primaryFrame = aElement->GetPrimaryFrame();
 
   // FIXME(bholley): Once we transfer ownership of the styles to the frame, we
   // can fast-reject without the FFI call by checking mServoData for null.
-  nsChangeHint changeHint = Servo_CheckChangeHint(aElement);
+  nsChangeHint changeHint = Servo_TakeChangeHint(aElement);
   if (changeHint) {
       aChangeListToProcess.AppendChange(primaryFrame, aElement, changeHint);
   }
 
   // If our change hint is reconstruct, we delegate to the frame constructor,
   // which consumes the new style and expects the old style to be on the frame.
   //
   // XXXbholley: We should teach the frame constructor how to clear the dirty
@@ -160,18 +160,17 @@ ServoRestyleManager::RecreateStyleContex
     ClearDirtyDescendantsFromSubtree(aElement);
     return;
   }
 
   // If we have a frame and a non-zero + non-reconstruct change hint, we need to
   // attach a new style context.
   bool recreateContext = primaryFrame && changeHint;
   if (recreateContext) {
-    RefPtr<ServoComputedValues> computedValues
-      = aStyleSet->ResolveServoStyle(aElement, ConsumeStyleBehavior::Consume);
+    RefPtr<ServoComputedValues> computedValues = aStyleSet->ResolveServoStyle(aElement);
 
     // Hold the old style context alive, because it could become a dangling
     // pointer during the replacement. In practice it's not a huge deal (on
     // GetNextContinuationWithSameStyle the pointer is not dereferenced, only
     // compared), but better not playing with dangling pointers if not needed.
     RefPtr<nsStyleContext> oldStyleContext = primaryFrame->StyleContext();
     MOZ_ASSERT(oldStyleContext);
 
--- a/layout/base/crashtests/crashtests.list
+++ b/layout/base/crashtests/crashtests.list
@@ -329,18 +329,18 @@ asserts-if(stylo,3) load 501878-1.html #
 asserts-if(stylo,4) load 503936-1.html # bug 1324658
 load 507119.html
 load 514104-1.xul
 load 522374-1.html
 load 522374-2.html
 load 526378-1.xul
 load 534367-1.xhtml
 load 534368-1.xhtml
-asserts-if(stylo,16) load 534768-1.html # bug 1324660
-asserts-if(stylo,16) load 534768-2.html # bug 1324660
+load 534768-1.html
+load 534768-2.html
 load 535721-1.xhtml
 load 535911-1.xhtml
 load 536623-1.xhtml
 load 536720.xul
 load 537059-1.xhtml
 load 537141-1.xhtml
 load 537562-1.xhtml
 load 537624-1.html
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -2431,17 +2431,16 @@ nsCSSFrameConstructor::ConstructDocEleme
 
   // --------- CREATE AREA OR BOX FRAME -------
   // FIXME: Should this use ResolveStyleContext?  (The calls in this
   // function are the only case in nsCSSFrameConstructor where we don't
   // do so for the construction of a style context for an element.)
   RefPtr<nsStyleContext> styleContext;
   styleContext = mPresShell->StyleSet()->ResolveStyleFor(aDocElement,
                                                          nullptr,
-                                                         ConsumeStyleBehavior::Consume,
                                                          LazyComputeBehavior::Allow);
 
   const nsStyleDisplay* display = styleContext->StyleDisplay();
 
   // Ensure that our XBL bindings are installed.
   if (display->mBinding) {
     // Get the XBL loader.
     nsresult rv;
@@ -2468,17 +2467,16 @@ nsCSSFrameConstructor::ConstructDocEleme
 
     if (resolveStyle) {
       // FIXME: Should this use ResolveStyleContext?  (The calls in this
       // function are the only case in nsCSSFrameConstructor where we
       // don't do so for the construction of a style context for an
       // element.)
       styleContext = mPresShell->StyleSet()->ResolveStyleFor(aDocElement,
                                                              nullptr,
-                                                             ConsumeStyleBehavior::Consume,
                                                              LazyComputeBehavior::Allow);
       display = styleContext->StyleDisplay();
     }
   }
 
   // We delay traversing the entire document until here, since we per above we
   // may invalidate the root style when we load doc stylesheets.
   if (ServoStyleSet* set = mPresShell->StyleSet()->GetAsServo()) {
@@ -5044,23 +5042,21 @@ nsCSSFrameConstructor::ResolveStyleConte
   StyleSetHandle styleSet = mPresShell->StyleSet();
   aContent->OwnerDoc()->FlushPendingLinkUpdates();
 
   RefPtr<nsStyleContext> result;
   if (aContent->IsElement()) {
     if (aState) {
       result = styleSet->ResolveStyleFor(aContent->AsElement(),
                                          aParentStyleContext,
-                                         ConsumeStyleBehavior::Consume,
                                          LazyComputeBehavior::Assert,
                                          aState->mTreeMatchContext);
     } else {
       result = styleSet->ResolveStyleFor(aContent->AsElement(),
                                          aParentStyleContext,
-                                         ConsumeStyleBehavior::Consume,
                                          LazyComputeBehavior::Assert);
     }
   } else {
     NS_ASSERTION(aContent->IsNodeOfType(nsINode::eTEXT),
                  "shouldn't waste time creating style contexts for "
                  "comments and processing instructions");
     result = styleSet->ResolveStyleForText(aContent, aParentStyleContext);
   }
@@ -9315,17 +9311,16 @@ nsCSSFrameConstructor::MaybeRecreateFram
       return nullptr;
     }
     oldDisplay = StyleDisplay::Contents;
   }
 
   // The parent has a frame, so try resolving a new context.
   RefPtr<nsStyleContext> newContext = mPresShell->StyleSet()->
     ResolveStyleFor(aElement, oldContext->GetParent(),
-                    ConsumeStyleBehavior::Consume,
                     LazyComputeBehavior::Assert);
 
   if (oldDisplay == StyleDisplay::None) {
     ChangeUndisplayedContent(aElement, newContext);
   } else {
     ChangeDisplayContents(aElement, newContext);
   }
 
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -1375,17 +1375,16 @@ GetPropagatedScrollbarStylesForViewport(
   if (!docElement) {
     return nullptr;
   }
 
   // Check the style on the document root element
   StyleSetHandle styleSet = aPresContext->StyleSet();
   RefPtr<nsStyleContext> rootStyle;
   rootStyle = styleSet->ResolveStyleFor(docElement, nullptr,
-                                        ConsumeStyleBehavior::DontConsume,
                                         LazyComputeBehavior::Allow);
   if (CheckOverflow(rootStyle->StyleDisplay(), aStyles)) {
     // tell caller we stole the overflow style from the root element
     return docElement;
   }
 
   // Don't look in the BODY for non-HTML documents or HTML documents
   // with non-HTML roots
@@ -1405,17 +1404,16 @@ GetPropagatedScrollbarStylesForViewport(
   if (!bodyElement ||
       !bodyElement->NodeInfo()->Equals(nsGkAtoms::body)) {
     // The body is not a <body> tag, it's a <frameset>.
     return nullptr;
   }
 
   RefPtr<nsStyleContext> bodyStyle;
   bodyStyle = styleSet->ResolveStyleFor(bodyElement->AsElement(), rootStyle,
-                                        ConsumeStyleBehavior::DontConsume,
                                         LazyComputeBehavior::Allow);
 
   if (CheckOverflow(bodyStyle->StyleDisplay(), aStyles)) {
     // tell caller we stole the overflow style from the body element
     return bodyElement;
   }
 
   return nullptr;
--- a/layout/generic/crashtests/crashtests.list
+++ b/layout/generic/crashtests/crashtests.list
@@ -102,17 +102,17 @@ load 374090.html
 load 374420.xhtml
 load 375462-1.html
 load 375831.html
 asserts-if(stylo,11) load 376419.html # bug 1324663
 load 377522.html
 load 379217-1.xhtml
 load 379217-2.xhtml
 load 379917-1.xhtml
-asserts-if(stylo,0-3) load 380012-1.html # bug 1324663
+asserts-if(stylo,0-5) load 380012-1.html # bug 1324663
 load 381152-1.html
 load 381786-1.html
 load 382129-1.xhtml
 load 382131-1.html
 load 382199-1.html
 load 382208-1.xhtml
 load 382262-1.html
 load 382396-1.xhtml
@@ -120,17 +120,17 @@ load 382745-1.xhtml
 asserts-if(stylo,27) load 383089-1.html # bug 1324663
 load 385265-1.xhtml
 asserts-if(stylo,2) load 385295-1.xhtml # bug 1324660
 load 385344-1.html
 load 385344-2.html
 load 385414-1.html
 load 385414-2.html
 load 385426-1.html
-asserts-if(stylo,350) load 385526.html # bug 1324673
+asserts-if(stylo,351) load 385526.html # bug 1324673
 load 385681.html
 load 385885-1.xul
 load 386799-1.html
 load 386807-1.html
 asserts-if(stylo,4) load 386812-1.html # bug 1324663
 load 386827-1.html
 load 387058-1.html
 load 387058-2.html
@@ -165,17 +165,17 @@ load 394818-1.html
 load 394818-2.html
 load 394820-1.html
 load 395316-1.html
 load 395450-1.xhtml
 load 397007-1.html
 load 397187-1.html
 skip-if(stylo) load 397844-1.xhtml # bug 1323652
 skip-if(stylo) load 397844-2.xhtml # bug 1323652
-load 397852-1.xhtml
+asserts-if(stylo,1) load 397852-1.xhtml # bug 1324660
 load 398181-1.html
 load 398181-2.html
 load 398322-1.html
 load 398322-2.html
 load 398332-1.html
 load 398332-2.html
 asserts(0-2) load 398332-3.html # bug 436123 and bug 457397
 load 399407-1.xhtml
--- a/layout/generic/nsFrameSetFrame.cpp
+++ b/layout/generic/nsFrameSetFrame.cpp
@@ -298,17 +298,16 @@ nsHTMLFramesetFrame::Init(nsIContent*   
     if (!child->IsHTMLElement())
       continue;
 
     if (child->IsAnyOfHTMLElements(nsGkAtoms::frameset, nsGkAtoms::frame)) {
       RefPtr<nsStyleContext> kidSC;
 
       kidSC = shell->StyleSet()->ResolveStyleFor(child->AsElement(),
                                                  mStyleContext,
-                                                 ConsumeStyleBehavior::DontConsume,
                                                  LazyComputeBehavior::Allow);
       if (child->IsHTMLElement(nsGkAtoms::frameset)) {
         frame = NS_NewHTMLFramesetFrame(shell, kidSC);
 
         nsHTMLFramesetFrame* childFrame = (nsHTMLFramesetFrame*)frame;
         childFrame->SetParentFrameborder(frameborder);
         childFrame->SetParentBorderWidth(borderWidth);
         childFrame->SetParentBorderColor(borderColor);
--- a/layout/generic/nsImageFrame.cpp
+++ b/layout/generic/nsImageFrame.cpp
@@ -2054,17 +2054,16 @@ nsImageFrame::GetCursor(const nsPoint& a
       // Use the cursor from the style of the *area* element.
       // XXX Using the image as the parent style context isn't
       // technically correct, but it's probably the right thing to do
       // here, since it means that areas on which the cursor isn't
       // specified will inherit the style from the image.
       RefPtr<nsStyleContext> areaStyle = 
         PresContext()->PresShell()->StyleSet()->
           ResolveStyleFor(area->AsElement(), StyleContext(),
-                          ConsumeStyleBehavior::DontConsume,
                           LazyComputeBehavior::Allow);
       FillCursorInformationFromStyle(areaStyle->StyleUserInterface(),
                                      aCursor);
       if (NS_STYLE_CURSOR_AUTO == aCursor.mCursor) {
         aCursor.mCursor = NS_STYLE_CURSOR_DEFAULT;
       }
       return NS_OK;
     }
--- a/layout/style/ServoBindingList.h
+++ b/layout/style/ServoBindingList.h
@@ -173,36 +173,34 @@ SERVO_BINDING_FUNC(Servo_Shutdown, void)
 // Gets the snapshot for the element. This will return null if the element
 // has never been styled, since snapshotting in that case is wasted work.
 SERVO_BINDING_FUNC(Servo_Element_GetSnapshot, ServoElementSnapshot*,
                    RawGeckoElementBorrowed element)
 
 // Restyle and change hints.
 SERVO_BINDING_FUNC(Servo_NoteExplicitHints, void, RawGeckoElementBorrowed element,
                    nsRestyleHint restyle_hint, nsChangeHint change_hint)
-SERVO_BINDING_FUNC(Servo_CheckChangeHint, nsChangeHint, RawGeckoElementBorrowed element)
+SERVO_BINDING_FUNC(Servo_TakeChangeHint, nsChangeHint, RawGeckoElementBorrowed element)
 SERVO_BINDING_FUNC(Servo_ResolveStyle, ServoComputedValuesStrong,
                    RawGeckoElementBorrowed element,
-                   RawServoStyleSetBorrowed set,
-                   mozilla::ConsumeStyleBehavior consume)
+                   RawServoStyleSetBorrowed set)
 SERVO_BINDING_FUNC(Servo_ResolvePseudoStyle, ServoComputedValuesStrong,
                    RawGeckoElementBorrowed element, nsIAtom* pseudo_tag,
                    bool is_probe, RawServoStyleSetBorrowed set)
 
 // Resolves style for an element or pseudo-element without processing pending
 // restyles first. The Element and its ancestors may be unstyled, have pending
 // restyles, or be in a display:none subtree. Styles are cached when possible,
 // though caching is not possible within display:none subtrees, and the styles
 // may be invalidated by already-scheduled restyles.
 //
 // The tree must be in a consistent state such that a normal traversal could be
 // performed, and this function maintains that invariant.
 SERVO_BINDING_FUNC(Servo_ResolveStyleLazily, ServoComputedValuesStrong,
                    RawGeckoElementBorrowed element, nsIAtom* pseudo_tag,
-                   mozilla::ConsumeStyleBehavior consume,
                    RawServoStyleSetBorrowed set)
 
 // Restyle the given subtree.
 SERVO_BINDING_FUNC(Servo_TraverseSubtree, void,
                    RawGeckoElementBorrowed root, RawServoStyleSetBorrowed set,
                    mozilla::TraversalRootBehavior root_behavior)
 
 // Assert that the tree has no pending or unconsumed restyles.
--- a/layout/style/ServoStyleSet.cpp
+++ b/layout/style/ServoStyleSet.cpp
@@ -105,40 +105,38 @@ ServoStyleSet::EndUpdate()
 
   Servo_StyleSet_FlushStyleSheets(mRawSet.get());
   return NS_OK;
 }
 
 already_AddRefed<nsStyleContext>
 ServoStyleSet::ResolveStyleFor(Element* aElement,
                                nsStyleContext* aParentContext,
-                               ConsumeStyleBehavior aConsume,
                                LazyComputeBehavior aMayCompute)
 {
   return GetContext(aElement, aParentContext, nullptr,
-                    CSSPseudoElementType::NotPseudo, aConsume, aMayCompute);
+                    CSSPseudoElementType::NotPseudo, aMayCompute);
 }
 
 already_AddRefed<nsStyleContext>
 ServoStyleSet::GetContext(nsIContent* aContent,
                           nsStyleContext* aParentContext,
                           nsIAtom* aPseudoTag,
                           CSSPseudoElementType aPseudoType,
-                          ConsumeStyleBehavior aConsume,
                           LazyComputeBehavior aMayCompute)
 {
   MOZ_ASSERT(aContent->IsElement());
   Element* element = aContent->AsElement();
 
   RefPtr<ServoComputedValues> computedValues;
   if (aMayCompute == LazyComputeBehavior::Allow) {
     computedValues =
-      Servo_ResolveStyleLazily(element, nullptr, aConsume, mRawSet.get()).Consume();
+      Servo_ResolveStyleLazily(element, nullptr, mRawSet.get()).Consume();
   } else {
-    computedValues = ResolveServoStyle(element, aConsume);
+    computedValues = ResolveServoStyle(element);
   }
 
   MOZ_ASSERT(computedValues);
   return GetContext(computedValues.forget(), aParentContext, aPseudoTag, aPseudoType);
 }
 
 already_AddRefed<nsStyleContext>
 ServoStyleSet::GetContext(already_AddRefed<ServoComputedValues> aComputedValues,
@@ -154,24 +152,23 @@ ServoStyleSet::GetContext(already_AddRef
 
   return NS_NewStyleContext(aParentContext, mPresContext, aPseudoTag,
                             aPseudoType, Move(aComputedValues), skipFixup);
 }
 
 already_AddRefed<nsStyleContext>
 ServoStyleSet::ResolveStyleFor(Element* aElement,
                                nsStyleContext* aParentContext,
-                               ConsumeStyleBehavior aConsume,
                                LazyComputeBehavior aMayCompute,
                                TreeMatchContext& aTreeMatchContext)
 {
   // aTreeMatchContext is used to speed up selector matching,
   // but if the element already has a ServoComputedValues computed in
   // advance, then we shouldn't need to use it.
-  return ResolveStyleFor(aElement, aParentContext, aConsume, aMayCompute);
+  return ResolveStyleFor(aElement, aParentContext, aMayCompute);
 }
 
 already_AddRefed<nsStyleContext>
 ServoStyleSet::ResolveStyleForText(nsIContent* aTextNode,
                                    nsStyleContext* aParentContext)
 {
   MOZ_ASSERT(aTextNode && aTextNode->IsNodeOfType(nsINode::eTEXT));
   MOZ_ASSERT(aTextNode->GetParent());
@@ -234,18 +231,17 @@ already_AddRefed<nsStyleContext>
 ServoStyleSet::ResolveTransientStyle(Element* aElement, CSSPseudoElementType aType)
 {
   nsIAtom* pseudoTag = nullptr;
   if (aType != CSSPseudoElementType::NotPseudo) {
     pseudoTag = nsCSSPseudoElements::GetPseudoAtom(aType);
   }
 
   RefPtr<ServoComputedValues> computedValues =
-    Servo_ResolveStyleLazily(aElement, pseudoTag, ConsumeStyleBehavior::DontConsume,
-                             mRawSet.get()).Consume();
+    Servo_ResolveStyleLazily(aElement, pseudoTag, mRawSet.get()).Consume();
 
   return GetContext(computedValues.forget(), nullptr, pseudoTag, aType);
 }
 
 // aFlags is an nsStyleSet flags bitfield
 already_AddRefed<nsStyleContext>
 ServoStyleSet::ResolveAnonymousBoxStyle(nsIAtom* aPseudoTag,
                                         nsStyleContext* aParentContext,
@@ -562,13 +558,12 @@ ServoStyleSet::RestyleWithAddedDeclarati
                                            const ServoComputedValues* aPreviousStyle)
 {
   return Servo_RestyleWithAddedDeclaration(mRawSet.get(), aDeclarations,
                                            aPreviousStyle);
 }
 
 
 already_AddRefed<ServoComputedValues>
-ServoStyleSet::ResolveServoStyle(Element* aElement,
-                                 ConsumeStyleBehavior aConsume)
+ServoStyleSet::ResolveServoStyle(Element* aElement)
 {
-  return Servo_ResolveStyle(aElement, mRawSet.get(), aConsume).Consume();
+  return Servo_ResolveStyle(aElement, mRawSet.get()).Consume();
 }
--- a/layout/style/ServoStyleSet.h
+++ b/layout/style/ServoStyleSet.h
@@ -52,23 +52,21 @@ public:
   nsresult SetAuthorStyleDisabled(bool aStyleDisabled);
 
   void BeginUpdate();
   nsresult EndUpdate();
 
   already_AddRefed<nsStyleContext>
   ResolveStyleFor(dom::Element* aElement,
                   nsStyleContext* aParentContext,
-                  ConsumeStyleBehavior aConsume,
                   LazyComputeBehavior aMayCompute);
 
   already_AddRefed<nsStyleContext>
   ResolveStyleFor(dom::Element* aElement,
                   nsStyleContext* aParentContext,
-                  ConsumeStyleBehavior aConsume,
                   LazyComputeBehavior aMayCompute,
                   TreeMatchContext& aTreeMatchContext);
 
   already_AddRefed<nsStyleContext>
   ResolveStyleForText(nsIContent* aTextNode,
                       nsStyleContext* aParentContext);
 
   already_AddRefed<nsStyleContext>
@@ -167,18 +165,17 @@ public:
    * of default computed style structs.
    */
   void RecomputeDefaultComputedStyles();
 
   /**
    * Resolve style for the given element, and return it as a
    * ServoComputedValues, not an nsStyleContext.
    */
-  already_AddRefed<ServoComputedValues>
-    ResolveServoStyle(dom::Element* aElement, ConsumeStyleBehavior aConsume);
+  already_AddRefed<ServoComputedValues> ResolveServoStyle(dom::Element* aElement);
 
   /**
    * Restyle with added declaration, for use in animations.
    */
   ServoComputedValuesStrong RestyleWithAddedDeclaration(
     RawServoDeclarationBlock* aDeclarations,
     const ServoComputedValues* aPreviousStyle);
 
@@ -187,17 +184,16 @@ private:
                                               nsStyleContext* aParentContext,
                                               nsIAtom* aPseudoTag,
                                               CSSPseudoElementType aPseudoType);
 
   already_AddRefed<nsStyleContext> GetContext(nsIContent* aContent,
                                               nsStyleContext* aParentContext,
                                               nsIAtom* aPseudoTag,
                                               CSSPseudoElementType aPseudoType,
-                                              ConsumeStyleBehavior aConsume,
                                               LazyComputeBehavior aMayCompute);
 
   nsPresContext* mPresContext;
   UniquePtr<RawServoStyleSet> mRawSet;
   EnumeratedArray<SheetType, SheetType::Count,
                   nsTArray<RefPtr<ServoStyleSheet>>> mSheets;
   int32_t mBatching;
 };
--- a/layout/style/ServoTypes.h
+++ b/layout/style/ServoTypes.h
@@ -30,24 +30,16 @@ struct ServoUnsafeCell {
 template<typename T>
 struct ServoCell {
   ServoUnsafeCell<T> value;
   T Get() const { return value.value; }
   void Set(T arg) { value.value = arg; }
   ServoCell() : value() {};
 };
 
-// Indicates whether a style resolution should be considered to consume the style
-// for the construction of a layout frame, or whether the caller is just
-// peeking.
-enum class ConsumeStyleBehavior {
-  Consume,
-  DontConsume,
-};
-
 // Indicates whether the Servo style system should expect the style on an element
 // to have already been resolved (i.e. via a parallel traversal), or whether it
 // may be lazily computed.
 enum class LazyComputeBehavior {
   Allow,
   Assert,
 };
 
--- a/layout/style/StyleSetHandle.h
+++ b/layout/style/StyleSetHandle.h
@@ -111,22 +111,20 @@ public:
     inline void Shutdown();
     inline bool GetAuthorStyleDisabled() const;
     inline nsresult SetAuthorStyleDisabled(bool aStyleDisabled);
     inline void BeginUpdate();
     inline nsresult EndUpdate();
     inline already_AddRefed<nsStyleContext>
     ResolveStyleFor(dom::Element* aElement,
                     nsStyleContext* aParentContext,
-                    ConsumeStyleBehavior aConsume,
                     LazyComputeBehavior aMayCompute);
     inline already_AddRefed<nsStyleContext>
     ResolveStyleFor(dom::Element* aElement,
                     nsStyleContext* aParentContext,
-                    ConsumeStyleBehavior aConsume,
                     LazyComputeBehavior aMayCompute,
                     TreeMatchContext& aTreeMatchContext);
     inline already_AddRefed<nsStyleContext>
     ResolveStyleForText(nsIContent* aTextNode,
                         nsStyleContext* aParentContext);
     inline already_AddRefed<nsStyleContext>
     ResolveStyleForOtherNonElement(nsStyleContext* aParentContext);
     inline already_AddRefed<nsStyleContext>
--- a/layout/style/StyleSetHandleInlines.h
+++ b/layout/style/StyleSetHandleInlines.h
@@ -75,30 +75,28 @@ StyleSetHandle::Ptr::EndUpdate()
 {
   FORWARD(EndUpdate, ());
 }
 
 // resolve a style context
 already_AddRefed<nsStyleContext>
 StyleSetHandle::Ptr::ResolveStyleFor(dom::Element* aElement,
                                      nsStyleContext* aParentContext,
-                                     ConsumeStyleBehavior aConsume,
                                      LazyComputeBehavior aMayCompute)
 {
-  FORWARD(ResolveStyleFor, (aElement, aParentContext, aConsume, aMayCompute));
+  FORWARD(ResolveStyleFor, (aElement, aParentContext, aMayCompute));
 }
 
 already_AddRefed<nsStyleContext>
 StyleSetHandle::Ptr::ResolveStyleFor(dom::Element* aElement,
                                      nsStyleContext* aParentContext,
-                                     ConsumeStyleBehavior aConsume,
                                      LazyComputeBehavior aMayCompute,
                                      TreeMatchContext& aTreeMatchContext)
 {
-  FORWARD(ResolveStyleFor, (aElement, aParentContext, aConsume, aMayCompute, aTreeMatchContext));
+  FORWARD(ResolveStyleFor, (aElement, aParentContext, aMayCompute, aTreeMatchContext));
 }
 
 already_AddRefed<nsStyleContext>
 StyleSetHandle::Ptr::ResolveStyleForText(nsIContent* aTextNode,
                                          nsStyleContext* aParentContext)
 {
   FORWARD(ResolveStyleForText, (aTextNode, aParentContext));
 }
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -528,18 +528,17 @@ nsComputedDOMStyle::GetStyleContextForEl
 
   if (type != CSSPseudoElementType::NotPseudo) {
     nsIFrame* frame = nsLayoutUtils::GetStyleFrame(aElement);
     Element* pseudoElement =
       frame && inDocWithShell ? frame->GetPseudoElement(type) : nullptr;
     sc = styleSet->ResolvePseudoElementStyle(aElement, type, parentContext,
                                              pseudoElement);
   } else {
-    sc = styleSet->ResolveStyleFor(aElement, parentContext, ConsumeStyleBehavior::DontConsume,
-                                   LazyComputeBehavior::Allow);
+    sc = styleSet->ResolveStyleFor(aElement, parentContext, LazyComputeBehavior::Allow);
   }
 
   if (aStyleType == eDefaultOnly) {
     // We really only want the user and UA rules.  Filter out the other ones.
     nsTArray< nsCOMPtr<nsIStyleRule> > rules;
     for (nsRuleNode* ruleNode = sc->RuleNode();
          !ruleNode->IsRoot();
          ruleNode = ruleNode->GetParent()) {
--- a/layout/style/nsStyleSet.h
+++ b/layout/style/nsStyleSet.h
@@ -111,31 +111,29 @@ class nsStyleSet final
   // get a style context for a non-pseudo frame.
   already_AddRefed<nsStyleContext>
   ResolveStyleFor(mozilla::dom::Element* aElement,
                   nsStyleContext* aParentContext);
 
   already_AddRefed<nsStyleContext>
   ResolveStyleFor(mozilla::dom::Element* aElement,
                   nsStyleContext* aParentContext,
-                  mozilla::ConsumeStyleBehavior,
                   mozilla::LazyComputeBehavior)
   {
     return ResolveStyleFor(aElement, aParentContext);
   }
 
   already_AddRefed<nsStyleContext>
   ResolveStyleFor(mozilla::dom::Element* aElement,
                   nsStyleContext* aParentContext,
                   TreeMatchContext& aTreeMatchContext);
 
   already_AddRefed<nsStyleContext>
   ResolveStyleFor(mozilla::dom::Element* aElement,
                   nsStyleContext* aParentContext,
-                  mozilla::ConsumeStyleBehavior aConsume,
                   mozilla::LazyComputeBehavior aMayCompute,
                   TreeMatchContext& aTreeMatchContext)
   {
     return ResolveStyleFor(aElement, aParentContext, aTreeMatchContext);
   }
 
   // Get a style context (with the given parent) for the
   // sequence of style rules in the |aRules| array.
--- a/layout/xul/nsListBoxBodyFrame.cpp
+++ b/layout/xul/nsListBoxBodyFrame.cpp
@@ -698,17 +698,16 @@ nsListBoxBodyFrame::ComputeIntrinsicISiz
   GetItemAtIndex(index, getter_AddRefs(firstRowEl));
   nsCOMPtr<nsIContent> firstRowContent(do_QueryInterface(firstRowEl));
 
   if (firstRowContent) {
     RefPtr<nsStyleContext> styleContext;
     nsPresContext *presContext = aBoxLayoutState.PresContext();
     styleContext = presContext->StyleSet()->
       ResolveStyleFor(firstRowContent->AsElement(), nullptr,
-                      ConsumeStyleBehavior::DontConsume,
                       LazyComputeBehavior::Allow);
 
     nscoord width = 0;
     nsMargin margin(0,0,0,0);
 
     if (styleContext->StylePadding()->GetPadding(margin))
       width += margin.LeftRight();
     width += styleContext->StyleBorder()->GetComputedBorder().LeftRight();
--- a/layout/xul/nsSplitterFrame.cpp
+++ b/layout/xul/nsSplitterFrame.cpp
@@ -282,17 +282,16 @@ nsSplitterFrame::Init(nsIContent*       
     if (!aParent->IsXULHorizontal()) {
       if (!nsContentUtils::HasNonEmptyAttr(aContent, kNameSpaceID_None,
                                            nsGkAtoms::orient)) {
         aContent->SetAttr(kNameSpaceID_None, nsGkAtoms::orient,
                           NS_LITERAL_STRING("vertical"), false);
         nsStyleContext* parentStyleContext = StyleContext()->GetParent();
         RefPtr<nsStyleContext> newContext = PresContext()->StyleSet()->
           ResolveStyleFor(aContent->AsElement(), parentStyleContext,
-                          ConsumeStyleBehavior::Consume,
                           LazyComputeBehavior::Allow);
         SetStyleContextWithoutNotification(newContext);
       }
     }
   }
 
   nsBoxFrame::Init(aContent, aParent, aPrevInFlow);