Back out changeset b683bb3f22a1 (Bug 1447483) for not landing with all the files. r=me on a CLOSED TREE
authorEmilio Cobos Álvarez <emilio@crisal.io>
Thu, 22 Mar 2018 20:04:20 +0100
changeset 465601 b7c7195b99f43e8f493f013877938ec2edd19a58
parent 465600 b683bb3f22a1aef672332aa3ee9d2c7a77149913
child 465602 0016368787a44bdf5deb4c9b73f3c0b59d2bc27a
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1447483
milestone61.0a1
backs outb683bb3f22a1aef672332aa3ee9d2c7a77149913
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
Back out changeset b683bb3f22a1 (Bug 1447483) for not landing with all the files. r=me on a CLOSED TREE This reverts commit 1808914126bb9f9e4a82d2c3d7ac961885fe7d62. MozReview-Commit-ID: 5skESBseEvo
accessible/base/StyleInfo.cpp
accessible/base/StyleInfo.h
dom/animation/EffectCompositor.cpp
dom/animation/EffectCompositor.h
dom/animation/KeyframeEffect.cpp
dom/animation/KeyframeEffect.h
dom/animation/KeyframeEffectReadOnly.cpp
dom/animation/KeyframeEffectReadOnly.h
dom/animation/KeyframeUtils.cpp
dom/animation/KeyframeUtils.h
dom/base/Element.cpp
dom/base/nsDOMWindowUtils.cpp
dom/base/nsPlainTextSerializer.cpp
dom/base/nsRange.cpp
dom/base/nsWindowMemoryReporter.cpp
dom/base/nsWindowSizes.h
dom/base/nsXHTMLContentSerializer.cpp
dom/canvas/CanvasRenderingContext2D.cpp
dom/html/ImageDocument.cpp
dom/smil/nsSMILCSSProperty.cpp
dom/smil/nsSMILCSSProperty.h
dom/smil/nsSMILCSSValueType.cpp
dom/smil/nsSMILCompositor.cpp
dom/smil/nsSMILCompositor.h
dom/svg/SVGContentUtils.cpp
dom/svg/SVGContentUtils.h
dom/svg/SVGFEDropShadowElement.cpp
dom/svg/SVGFEFloodElement.cpp
dom/svg/SVGGeometryElement.cpp
dom/svg/SVGPathElement.cpp
dom/svg/nsSVGFilters.cpp
dom/xbl/nsXBLResourceLoader.cpp
dom/xbl/nsXBLService.cpp
editor/libeditor/EditorBase.cpp
editor/libeditor/HTMLAbsPositionEditor.cpp
js/src/devtools/rootAnalysis/analyzeHeapWrites.js
layout/base/ArenaRefPtrInlines.h
layout/base/PresShell.cpp
layout/base/PresShell.h
layout/base/RestyleManager.cpp
layout/base/RestyleManager.h
layout/base/RestyleManagerInlines.h
layout/base/ServoRestyleManager.cpp
layout/base/ServoRestyleManager.h
layout/base/UndisplayedNode.h
layout/base/nsBidiPresUtils.cpp
layout/base/nsBidiPresUtils.h
layout/base/nsCSSFrameConstructor.cpp
layout/base/nsCSSFrameConstructor.h
layout/base/nsChangeHint.h
layout/base/nsFrameManager.cpp
layout/base/nsFrameManager.h
layout/base/nsGenConList.cpp
layout/base/nsGenConList.h
layout/base/nsIPresShell.h
layout/base/nsLayoutUtils.cpp
layout/base/nsLayoutUtils.h
layout/base/nsPresArena.cpp
layout/base/nsPresArena.h
layout/base/nsPresArenaObjectList.h
layout/base/nsPresContext.cpp
layout/doc/Layout_Overview.html
layout/doc/adding-style-props.html
layout/doc/obsolete/layout.xml
layout/forms/nsButtonFrameRenderer.cpp
layout/forms/nsButtonFrameRenderer.h
layout/forms/nsCheckboxRadioFrame.cpp
layout/forms/nsCheckboxRadioFrame.h
layout/forms/nsColorControlFrame.cpp
layout/forms/nsColorControlFrame.h
layout/forms/nsComboboxControlFrame.cpp
layout/forms/nsComboboxControlFrame.h
layout/forms/nsDateTimeControlFrame.cpp
layout/forms/nsDateTimeControlFrame.h
layout/forms/nsFieldSetFrame.cpp
layout/forms/nsFieldSetFrame.h
layout/forms/nsFileControlFrame.cpp
layout/forms/nsFileControlFrame.h
layout/forms/nsGfxButtonControlFrame.cpp
layout/forms/nsGfxButtonControlFrame.h
layout/forms/nsHTMLButtonControlFrame.cpp
layout/forms/nsHTMLButtonControlFrame.h
layout/forms/nsImageControlFrame.cpp
layout/forms/nsLegendFrame.cpp
layout/forms/nsLegendFrame.h
layout/forms/nsListControlFrame.cpp
layout/forms/nsListControlFrame.h
layout/forms/nsMeterFrame.cpp
layout/forms/nsMeterFrame.h
layout/forms/nsNumberControlFrame.cpp
layout/forms/nsNumberControlFrame.h
layout/forms/nsProgressFrame.cpp
layout/forms/nsProgressFrame.h
layout/forms/nsRangeFrame.cpp
layout/forms/nsRangeFrame.h
layout/forms/nsSelectsAreaFrame.cpp
layout/forms/nsSelectsAreaFrame.h
layout/forms/nsTextControlFrame.cpp
layout/forms/nsTextControlFrame.h
layout/generic/BRFrame.cpp
layout/generic/DetailsFrame.cpp
layout/generic/DetailsFrame.h
layout/generic/MathMLTextRunFactory.cpp
layout/generic/ReflowInput.cpp
layout/generic/ReflowInput.h
layout/generic/TextOverflow.cpp
layout/generic/ViewportFrame.cpp
layout/generic/ViewportFrame.h
layout/generic/WritingModes.h
layout/generic/crashtests/350370.html
layout/generic/nsAtomicContainerFrame.h
layout/generic/nsBackdropFrame.cpp
layout/generic/nsBackdropFrame.h
layout/generic/nsBlockFrame.cpp
layout/generic/nsBlockFrame.h
layout/generic/nsBulletFrame.cpp
layout/generic/nsBulletFrame.h
layout/generic/nsCanvasFrame.cpp
layout/generic/nsCanvasFrame.h
layout/generic/nsColumnSetFrame.cpp
layout/generic/nsColumnSetFrame.h
layout/generic/nsContainerFrame.cpp
layout/generic/nsContainerFrame.h
layout/generic/nsFirstLetterFrame.cpp
layout/generic/nsFirstLetterFrame.h
layout/generic/nsFlexContainerFrame.cpp
layout/generic/nsFlexContainerFrame.h
layout/generic/nsFrame.cpp
layout/generic/nsFrame.h
layout/generic/nsFrameSelection.cpp
layout/generic/nsFrameSetFrame.cpp
layout/generic/nsFrameSetFrame.h
layout/generic/nsGfxScrollFrame.cpp
layout/generic/nsGfxScrollFrame.h
layout/generic/nsGridContainerFrame.cpp
layout/generic/nsGridContainerFrame.h
layout/generic/nsHTMLCanvasFrame.cpp
layout/generic/nsHTMLCanvasFrame.h
layout/generic/nsHTMLParts.h
layout/generic/nsIAnonymousContentCreator.h
layout/generic/nsIFrame.h
layout/generic/nsIFrameInlines.h
layout/generic/nsImageFrame.cpp
layout/generic/nsImageFrame.h
layout/generic/nsInlineFrame.cpp
layout/generic/nsInlineFrame.h
layout/generic/nsLeafFrame.h
layout/generic/nsLineLayout.cpp
layout/generic/nsPageContentFrame.cpp
layout/generic/nsPageContentFrame.h
layout/generic/nsPageFrame.cpp
layout/generic/nsPageFrame.h
layout/generic/nsPlaceholderFrame.cpp
layout/generic/nsPlaceholderFrame.h
layout/generic/nsPluginFrame.cpp
layout/generic/nsPluginFrame.h
layout/generic/nsRubyBaseContainerFrame.cpp
layout/generic/nsRubyBaseContainerFrame.h
layout/generic/nsRubyBaseFrame.cpp
layout/generic/nsRubyBaseFrame.h
layout/generic/nsRubyContentFrame.cpp
layout/generic/nsRubyContentFrame.h
layout/generic/nsRubyFrame.cpp
layout/generic/nsRubyFrame.h
layout/generic/nsRubyTextContainerFrame.cpp
layout/generic/nsRubyTextContainerFrame.h
layout/generic/nsRubyTextFrame.cpp
layout/generic/nsRubyTextFrame.h
layout/generic/nsSimplePageSequenceFrame.cpp
layout/generic/nsSimplePageSequenceFrame.h
layout/generic/nsSplittableFrame.h
layout/generic/nsSubDocumentFrame.cpp
layout/generic/nsSubDocumentFrame.h
layout/generic/nsTextFrame.cpp
layout/generic/nsTextFrame.h
layout/generic/nsTextRunTransformations.cpp
layout/generic/nsTextRunTransformations.h
layout/generic/nsVideoFrame.cpp
layout/generic/nsVideoFrame.h
layout/inspector/InspectorUtils.cpp
layout/inspector/InspectorUtils.h
layout/mathml/nsMathMLChar.cpp
layout/mathml/nsMathMLChar.h
layout/mathml/nsMathMLContainerFrame.cpp
layout/mathml/nsMathMLContainerFrame.h
layout/mathml/nsMathMLFrame.cpp
layout/mathml/nsMathMLFrame.h
layout/mathml/nsMathMLParts.h
layout/mathml/nsMathMLSelectedFrame.h
layout/mathml/nsMathMLTokenFrame.cpp
layout/mathml/nsMathMLTokenFrame.h
layout/mathml/nsMathMLmactionFrame.cpp
layout/mathml/nsMathMLmactionFrame.h
layout/mathml/nsMathMLmencloseFrame.cpp
layout/mathml/nsMathMLmencloseFrame.h
layout/mathml/nsMathMLmfencedFrame.cpp
layout/mathml/nsMathMLmfencedFrame.h
layout/mathml/nsMathMLmfracFrame.cpp
layout/mathml/nsMathMLmfracFrame.h
layout/mathml/nsMathMLmmultiscriptsFrame.cpp
layout/mathml/nsMathMLmmultiscriptsFrame.h
layout/mathml/nsMathMLmoFrame.cpp
layout/mathml/nsMathMLmoFrame.h
layout/mathml/nsMathMLmpaddedFrame.cpp
layout/mathml/nsMathMLmpaddedFrame.h
layout/mathml/nsMathMLmrootFrame.cpp
layout/mathml/nsMathMLmrootFrame.h
layout/mathml/nsMathMLmrowFrame.cpp
layout/mathml/nsMathMLmrowFrame.h
layout/mathml/nsMathMLmspaceFrame.cpp
layout/mathml/nsMathMLmspaceFrame.h
layout/mathml/nsMathMLmsqrtFrame.cpp
layout/mathml/nsMathMLmsqrtFrame.h
layout/mathml/nsMathMLmtableFrame.cpp
layout/mathml/nsMathMLmtableFrame.h
layout/mathml/nsMathMLmunderoverFrame.cpp
layout/mathml/nsMathMLmunderoverFrame.h
layout/mathml/nsMathMLsemanticsFrame.cpp
layout/mathml/nsMathMLsemanticsFrame.h
layout/painting/ActiveLayerTracker.cpp
layout/painting/FrameLayerBuilder.h
layout/painting/nsCSSRendering.cpp
layout/painting/nsCSSRendering.h
layout/painting/nsCSSRenderingGradients.cpp
layout/painting/nsDisplayList.cpp
layout/painting/nsDisplayList.h
layout/painting/nsImageRenderer.cpp
layout/style/CSSVariableImageTable.h
layout/style/CachedInheritingStyles.cpp
layout/style/CachedInheritingStyles.h
layout/style/ServoBindingList.h
layout/style/ServoBindingTypes.h
layout/style/ServoBindings.cpp
layout/style/ServoBindings.h
layout/style/ServoBindings.toml
layout/style/ServoStyleContext.cpp
layout/style/ServoStyleContext.h
layout/style/ServoStyleContextInlines.h
layout/style/ServoStyleSet.cpp
layout/style/ServoStyleSet.h
layout/style/ServoTypes.h
layout/style/StyleAnimationValue.cpp
layout/style/StyleAnimationValue.h
layout/style/StyleSetHandle.h
layout/style/StyleSetHandleInlines.h
layout/style/StyleSheet.cpp
layout/style/generate-stylestructlist.py
layout/style/moz.build
layout/style/nsAnimationManager.cpp
layout/style/nsAnimationManager.h
layout/style/nsCSSProps.cpp
layout/style/nsCSSPseudoElementList.h
layout/style/nsComputedDOMStyle.cpp
layout/style/nsComputedDOMStyle.h
layout/style/nsFontFaceUtils.cpp
layout/style/nsStyleConsts.h
layout/style/nsStyleContext.cpp
layout/style/nsStyleContext.h
layout/style/nsStyleContextInlines.h
layout/style/nsStyleStruct.cpp
layout/style/nsStyleStruct.h
layout/style/nsStyleStructInlines.h
layout/style/nsStyleTransformMatrix.cpp
layout/style/nsStyleTransformMatrix.h
layout/style/nsTransitionManager.cpp
layout/style/nsTransitionManager.h
layout/svg/SVGContextPaint.cpp
layout/svg/SVGFEContainerFrame.cpp
layout/svg/SVGFEImageFrame.cpp
layout/svg/SVGFELeafFrame.cpp
layout/svg/SVGFEUnstyledLeafFrame.cpp
layout/svg/SVGGeometryFrame.cpp
layout/svg/SVGGeometryFrame.h
layout/svg/SVGImageContext.cpp
layout/svg/SVGImageContext.h
layout/svg/SVGTextFrame.cpp
layout/svg/SVGTextFrame.h
layout/svg/SVGViewFrame.cpp
layout/svg/nsSVGAFrame.cpp
layout/svg/nsSVGClipPathFrame.cpp
layout/svg/nsSVGClipPathFrame.h
layout/svg/nsSVGContainerFrame.cpp
layout/svg/nsSVGContainerFrame.h
layout/svg/nsSVGFilterFrame.cpp
layout/svg/nsSVGFilterFrame.h
layout/svg/nsSVGForeignObjectFrame.cpp
layout/svg/nsSVGForeignObjectFrame.h
layout/svg/nsSVGGFrame.cpp
layout/svg/nsSVGGFrame.h
layout/svg/nsSVGGenericContainerFrame.cpp
layout/svg/nsSVGGenericContainerFrame.h
layout/svg/nsSVGGradientFrame.cpp
layout/svg/nsSVGGradientFrame.h
layout/svg/nsSVGImageFrame.cpp
layout/svg/nsSVGImageFrame.h
layout/svg/nsSVGInnerSVGFrame.cpp
layout/svg/nsSVGInnerSVGFrame.h
layout/svg/nsSVGIntegrationUtils.cpp
layout/svg/nsSVGMarkerFrame.cpp
layout/svg/nsSVGMarkerFrame.h
layout/svg/nsSVGMaskFrame.cpp
layout/svg/nsSVGMaskFrame.h
layout/svg/nsSVGOuterSVGFrame.cpp
layout/svg/nsSVGOuterSVGFrame.h
layout/svg/nsSVGPaintServerFrame.h
layout/svg/nsSVGPatternFrame.cpp
layout/svg/nsSVGPatternFrame.h
layout/svg/nsSVGStopFrame.cpp
layout/svg/nsSVGSwitchFrame.cpp
layout/svg/nsSVGSymbolFrame.cpp
layout/svg/nsSVGSymbolFrame.h
layout/svg/nsSVGUseFrame.cpp
layout/svg/nsSVGUseFrame.h
layout/svg/nsSVGUtils.cpp
layout/svg/nsSVGUtils.h
layout/svg/nsSVGViewportFrame.h
layout/tables/nsTableCellFrame.cpp
layout/tables/nsTableCellFrame.h
layout/tables/nsTableColFrame.cpp
layout/tables/nsTableColFrame.h
layout/tables/nsTableColGroupFrame.cpp
layout/tables/nsTableColGroupFrame.h
layout/tables/nsTableFrame.cpp
layout/tables/nsTableFrame.h
layout/tables/nsTableRowFrame.cpp
layout/tables/nsTableRowFrame.h
layout/tables/nsTableRowGroupFrame.cpp
layout/tables/nsTableRowGroupFrame.h
layout/tables/nsTableWrapperFrame.cpp
layout/tables/nsTableWrapperFrame.h
layout/tools/layout-debug/src/nsILayoutDebuggingTools.idl
layout/tools/layout-debug/src/nsLayoutDebuggingTools.cpp
layout/tools/layout-debug/ui/content/layoutdebug.xul
layout/tools/layout-debug/ui/locale/en-US/layoutdebug.dtd
layout/xul/grid/nsGridRowGroupFrame.cpp
layout/xul/grid/nsGridRowGroupFrame.h
layout/xul/grid/nsGridRowLeafFrame.cpp
layout/xul/grid/nsGridRowLeafFrame.h
layout/xul/nsBoxFrame.cpp
layout/xul/nsBoxFrame.h
layout/xul/nsButtonBoxFrame.cpp
layout/xul/nsButtonBoxFrame.h
layout/xul/nsDeckFrame.cpp
layout/xul/nsDeckFrame.h
layout/xul/nsDocElementBoxFrame.cpp
layout/xul/nsGroupBoxFrame.cpp
layout/xul/nsImageBoxFrame.cpp
layout/xul/nsImageBoxFrame.h
layout/xul/nsLeafBoxFrame.cpp
layout/xul/nsLeafBoxFrame.h
layout/xul/nsListBoxBodyFrame.cpp
layout/xul/nsListBoxBodyFrame.h
layout/xul/nsListItemFrame.cpp
layout/xul/nsListItemFrame.h
layout/xul/nsMenuBarFrame.cpp
layout/xul/nsMenuBarFrame.h
layout/xul/nsMenuFrame.cpp
layout/xul/nsMenuFrame.h
layout/xul/nsMenuPopupFrame.cpp
layout/xul/nsMenuPopupFrame.h
layout/xul/nsPopupSetFrame.cpp
layout/xul/nsPopupSetFrame.h
layout/xul/nsProgressMeterFrame.cpp
layout/xul/nsProgressMeterFrame.h
layout/xul/nsResizerFrame.cpp
layout/xul/nsResizerFrame.h
layout/xul/nsRootBoxFrame.cpp
layout/xul/nsScrollBoxFrame.cpp
layout/xul/nsScrollbarButtonFrame.cpp
layout/xul/nsScrollbarButtonFrame.h
layout/xul/nsScrollbarFrame.cpp
layout/xul/nsScrollbarFrame.h
layout/xul/nsSliderFrame.cpp
layout/xul/nsSliderFrame.h
layout/xul/nsSplitterFrame.cpp
layout/xul/nsSplitterFrame.h
layout/xul/nsStackFrame.cpp
layout/xul/nsStackFrame.h
layout/xul/nsTextBoxFrame.cpp
layout/xul/nsTextBoxFrame.h
layout/xul/nsTitleBarFrame.cpp
layout/xul/nsTitleBarFrame.h
layout/xul/nsXULLabelFrame.cpp
layout/xul/nsXULLabelFrame.h
layout/xul/tree/nsTreeBodyFrame.cpp
layout/xul/tree/nsTreeBodyFrame.h
layout/xul/tree/nsTreeColFrame.cpp
layout/xul/tree/nsTreeColFrame.h
layout/xul/tree/nsTreeColumns.cpp
layout/xul/tree/nsTreeStyleCache.cpp
layout/xul/tree/nsTreeStyleCache.h
modules/libpref/init/all.js
tools/jprof/README.html
widget/cocoa/nsMenuItemIconX.mm
widget/nsNativeTheme.cpp
--- a/accessible/base/StyleInfo.cpp
+++ b/accessible/base/StyleInfo.cpp
@@ -12,45 +12,45 @@
 #include "nsIFrame.h"
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
 StyleInfo::StyleInfo(dom::Element* aElement) :
   mElement(aElement)
 {
-  mComputedStyle =
-    nsComputedDOMStyle::GetComputedStyleNoFlush(aElement, nullptr);
+  mStyleContext =
+    nsComputedDOMStyle::GetStyleContextNoFlush(aElement, nullptr);
 }
 
 void
 StyleInfo::Display(nsAString& aValue)
 {
   aValue.Truncate();
   AppendASCIItoUTF16(
-    nsCSSProps::ValueToKeyword(mComputedStyle->StyleDisplay()->mDisplay,
+    nsCSSProps::ValueToKeyword(mStyleContext->StyleDisplay()->mDisplay,
                                nsCSSProps::kDisplayKTable), aValue);
 }
 
 void
 StyleInfo::TextAlign(nsAString& aValue)
 {
   aValue.Truncate();
   AppendASCIItoUTF16(
-    nsCSSProps::ValueToKeyword(mComputedStyle->StyleText()->mTextAlign,
+    nsCSSProps::ValueToKeyword(mStyleContext->StyleText()->mTextAlign,
                                nsCSSProps::kTextAlignKTable), aValue);
 }
 
 void
 StyleInfo::TextIndent(nsAString& aValue)
 {
   aValue.Truncate();
 
   const nsStyleCoord& styleCoord =
-    mComputedStyle->StyleText()->mTextIndent;
+    mStyleContext->StyleText()->mTextIndent;
 
   nscoord coordVal = 0;
   switch (styleCoord.GetUnit()) {
     case eStyleUnit_Coord:
       coordVal = styleCoord.GetCoordValue();
       aValue.AppendFloat(nsPresContext::AppUnitsToFloatCSSPixels(coordVal));
       aValue.AppendLiteral("px");
       break;
--- a/accessible/base/StyleInfo.h
+++ b/accessible/base/StyleInfo.h
@@ -3,17 +3,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef _mozilla_a11y_style_h_
 #define _mozilla_a11y_style_h_
 
 #include "mozilla/gfx/Types.h"
-#include "mozilla/ComputedStyle.h"
+#include "nsStyleContext.h"
 
 namespace mozilla {
 namespace a11y {
 
 class StyleInfo
 {
 public:
   explicit StyleInfo(dom::Element* aElement);
@@ -34,15 +34,15 @@ public:
 private:
   StyleInfo() = delete;
   StyleInfo(const StyleInfo&) = delete;
   StyleInfo& operator = (const StyleInfo&) = delete;
 
   void Margin(Side aSide, nsAString& aValue);
 
   dom::Element* mElement;
-  RefPtr<ComputedStyle> mComputedStyle;
+  RefPtr<nsStyleContext> mStyleContext;
 };
 
 } // namespace a11y
 } // namespace mozilla
 
 #endif
--- a/dom/animation/EffectCompositor.cpp
+++ b/dom/animation/EffectCompositor.cpp
@@ -12,33 +12,33 @@
 #include "mozilla/dom/Animation.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/KeyframeEffectReadOnly.h"
 #include "mozilla/AnimationComparator.h"
 #include "mozilla/AnimationPerformanceWarning.h"
 #include "mozilla/AnimationTarget.h"
 #include "mozilla/AnimationUtils.h"
 #include "mozilla/AutoRestore.h"
-#include "mozilla/ComputedStyleInlines.h"
 #include "mozilla/EffectSet.h"
 #include "mozilla/LayerAnimationInfo.h"
 #include "mozilla/RestyleManager.h"
 #include "mozilla/RestyleManagerInlines.h"
 #include "mozilla/ServoBindings.h" // Servo_GetProperties_Overriding_Animation
 #include "mozilla/ServoStyleSet.h"
 #include "mozilla/StyleAnimationValue.h"
 #include "mozilla/TypeTraits.h" // For Forward<>
 #include "nsContentUtils.h"
 #include "nsCSSPseudoElements.h"
 #include "nsCSSPropertyIDSet.h"
 #include "nsCSSProps.h"
 #include "nsAtom.h"
 #include "nsIPresShell.h"
 #include "nsIPresShellInlines.h"
 #include "nsLayoutUtils.h"
+#include "nsStyleContextInlines.h"
 #include "nsTArray.h"
 #include "PendingAnimationTracker.h"
 
 using mozilla::dom::Animation;
 using mozilla::dom::Element;
 using mozilla::dom::KeyframeEffectReadOnly;
 
 namespace mozilla {
@@ -162,21 +162,24 @@ FindAnimationsForCompositor(const nsIFra
   // from test control after seeking where it might not be the case.
   //
   // Those cases are probably not important but just to be safe, let's make
   // sure the cascade is up to date since if it *is* up to date, this is
   // basically a no-op.
   Maybe<NonOwningAnimationTarget> pseudoElement =
     EffectCompositor::GetAnimationElementAndPseudoForFrame(aFrame);
   if (pseudoElement) {
-    StyleBackendType backend = StyleBackendType::Servo;
+    StyleBackendType backend =
+      aFrame->StyleContext()->IsServo()
+      ? StyleBackendType::Servo
+      : StyleBackendType::Gecko;
     EffectCompositor::MaybeUpdateCascadeResults(backend,
                                                 pseudoElement->mElement,
                                                 pseudoElement->mPseudoType,
-                                                aFrame->Style());
+                                                aFrame->StyleContext());
   }
 
   if (!nsLayoutUtils::AreAsyncAnimationsEnabled()) {
     if (nsLayoutUtils::IsAnimationLoggingEnabled()) {
       nsCString message;
       message.AppendLiteral("Performance warning: Async animations are "
                             "disabled");
       AnimationUtils::LogAsyncAnimationFailure(message);
@@ -542,37 +545,37 @@ EffectCompositor::ClearIsRunningOnCompos
     effect->SetIsRunningOnCompositor(aProperty, false);
   }
 }
 
 /* static */ void
 EffectCompositor::MaybeUpdateCascadeResults(StyleBackendType aBackendType,
                                             Element* aElement,
                                             CSSPseudoElementType aPseudoType,
-                                            ComputedStyle* aComputedStyle)
+                                            nsStyleContext* aStyleContext)
 {
   EffectSet* effects = EffectSet::GetEffectSet(aElement, aPseudoType);
   if (!effects || !effects->CascadeNeedsUpdate()) {
     return;
   }
 
   UpdateCascadeResults(aBackendType, *effects, aElement, aPseudoType,
-                       aComputedStyle);
+                       aStyleContext);
 
   MOZ_ASSERT(!effects->CascadeNeedsUpdate(), "Failed to update cascade state");
 }
 
 /* static */ Maybe<NonOwningAnimationTarget>
 EffectCompositor::GetAnimationElementAndPseudoForFrame(const nsIFrame* aFrame)
 {
   // Always return the same object to benefit from return-value optimization.
   Maybe<NonOwningAnimationTarget> result;
 
   CSSPseudoElementType pseudoType =
-    aFrame->Style()->GetPseudoType();
+    aFrame->StyleContext()->GetPseudoType();
 
   if (pseudoType != CSSPseudoElementType::NotPseudo &&
       pseudoType != CSSPseudoElementType::before &&
       pseudoType != CSSPseudoElementType::after) {
     return result;
   }
 
   nsIContent* content = aFrame->GetContent();
@@ -598,26 +601,26 @@ EffectCompositor::GetAnimationElementAnd
 }
 
 
 /* static */ nsCSSPropertyIDSet
 EffectCompositor::GetOverriddenProperties(StyleBackendType aBackendType,
                                           EffectSet& aEffectSet,
                                           Element* aElement,
                                           CSSPseudoElementType aPseudoType,
-                                          ComputedStyle* aComputedStyle)
+                                          nsStyleContext* aStyleContext)
 {
   MOZ_ASSERT(aBackendType != StyleBackendType::Servo || aElement,
              "Should have an element to get style data from if we are using"
              " the Servo backend");
 
   nsCSSPropertyIDSet result;
 
   Element* elementToRestyle = GetElementToRestyle(aElement, aPseudoType);
-  if (aBackendType == StyleBackendType::Gecko && !aComputedStyle) {
+  if (aBackendType == StyleBackendType::Gecko && !aStyleContext) {
     MOZ_CRASH("old style system disabled");
   } else if (aBackendType == StyleBackendType::Servo && !elementToRestyle) {
     return result;
   }
 
   AutoTArray<nsCSSPropertyID, LayerAnimationInfo::kRecords> propertiesToTrack;
   {
     nsCSSPropertyIDSet propertiesToTrackAsSet;
@@ -659,17 +662,17 @@ EffectCompositor::GetOverriddenPropertie
   return result;
 }
 
 /* static */ void
 EffectCompositor::UpdateCascadeResults(StyleBackendType aBackendType,
                                        EffectSet& aEffectSet,
                                        Element* aElement,
                                        CSSPseudoElementType aPseudoType,
-                                       ComputedStyle* aComputedStyle)
+                                       nsStyleContext* aStyleContext)
 {
   MOZ_ASSERT(EffectSet::GetEffectSet(aElement, aPseudoType) == &aEffectSet,
              "Effect set should correspond to the specified (pseudo-)element");
   if (aEffectSet.IsEmpty()) {
     aEffectSet.MarkCascadeUpdated();
     return;
   }
 
@@ -684,17 +687,17 @@ EffectCompositor::UpdateCascadeResults(S
   //
   // We only do this for properties that we can animate on the compositor
   // since we will apply other properties on the main thread where the usual
   // cascade applies.
   nsCSSPropertyIDSet overriddenProperties =
     GetOverriddenProperties(aBackendType,
                             aEffectSet,
                             aElement, aPseudoType,
-                            aComputedStyle);
+                            aStyleContext);
 
   // Returns a bitset the represents which properties from
   // LayerAnimationInfo::sRecords are present in |aPropertySet|.
   auto compositorPropertiesInSet =
     [](nsCSSPropertyIDSet& aPropertySet) ->
       std::bitset<LayerAnimationInfo::kRecords> {
         std::bitset<LayerAnimationInfo::kRecords> result;
         for (size_t i = 0; i < LayerAnimationInfo::kRecords; i++) {
@@ -1024,13 +1027,13 @@ EffectCompositor::PreTraverse(dom::Eleme
   }
   return found;
 }
 
 
 template
 void
 EffectCompositor::UpdateEffectProperties(
-  const ComputedStyle* aComputedStyle,
+  const ServoStyleContext* aStyleContext,
   Element* aElement,
   CSSPseudoElementType aPseudoType);
 
 } // namespace mozilla
--- a/dom/animation/EffectCompositor.h
+++ b/dom/animation/EffectCompositor.h
@@ -17,22 +17,22 @@
 #include "nsCycleCollectionParticipant.h"
 #include "nsDataHashtable.h"
 #include "nsTArray.h"
 
 class nsCSSPropertyIDSet;
 class nsAtom;
 class nsIFrame;
 class nsPresContext;
+class nsStyleContext;
 struct RawServoAnimationValueMap;
 typedef RawServoAnimationValueMap* RawServoAnimationValueMapBorrowedMut;
 
 namespace mozilla {
 
-class ComputedStyle;
 class EffectSet;
 class RestyleTracker;
 class StyleAnimationValue;
 struct AnimationPerformanceWarning;
 struct AnimationProperty;
 struct NonOwningAnimationTarget;
 
 namespace dom {
@@ -148,53 +148,53 @@ public:
   static void ClearIsRunningOnCompositor(const nsIFrame* aFrame,
                                          nsCSSPropertyID aProperty);
 
   // Update animation cascade results for the specified (pseudo-)element
   // but only if we have marked the cascade as needing an update due a
   // the change in the set of effects or a change in one of the effects'
   // "in effect" state.
   //
-  // When |aBackendType| is StyleBackendType::Gecko, |aComputedStyle| is used to
-  // find overridden properties. If it is nullptr, the ComputedStyle of the
+  // When |aBackendType| is StyleBackendType::Gecko, |aStyleContext| is used to
+  // find overridden properties. If it is nullptr, the nsStyleContext of the
   // primary frame of the specified (pseudo-)element, if available, is used.
   //
   // When |aBackendType| is StyleBackendType::Servo, we fetch the rule node
-  // from the |aElement| (i.e. |aComputedStyle| is ignored).
+  // from the |aElement| (i.e. |aStyleContext| is ignored).
   //
   // This method does NOT detect if other styles that apply above the
   // animation level of the cascade have changed.
   static void
   MaybeUpdateCascadeResults(StyleBackendType aBackendType,
                             dom::Element* aElement,
                             CSSPseudoElementType aPseudoType,
-                            ComputedStyle* aComputedStyle);
+                            nsStyleContext* aStyleContext);
 
   // Update the mPropertiesWithImportantRules and
   // mPropertiesForAnimationsLevel members of the given EffectSet, and also
   // request any restyles required by changes to the cascade result.
   //
   // NOTE: This can be expensive so we should only call it if styles that apply
   // above the animation level of the cascade might have changed. For all
   // other cases we should call MaybeUpdateCascadeResults.
   //
   // This is typically reserved for internal callers but is public here since
   // when we detect changes to the cascade on the Servo side we can't call
   // MarkCascadeNeedsUpdate during the traversal so instead we call this as part
   // of a follow-up sequential task.
   //
-  // As with MaybeUpdateCascadeResults, |aComputedStyle| is only used
+  // As with MaybeUpdateCascadeResults, |aStyleContext| is only used
   // when |aBackendType| is StyleBackendType::Gecko. When |aBackendType| is
   // StyleBackendType::Servo, it is ignored.
   static void
   UpdateCascadeResults(StyleBackendType aBackendType,
                        EffectSet& aEffectSet,
                        dom::Element* aElement,
                        CSSPseudoElementType aPseudoType,
-                       ComputedStyle* aComputedStyle);
+                       nsStyleContext* aStyleContext);
 
   // Helper to fetch the corresponding element and pseudo-type from a frame.
   //
   // For frames corresponding to pseudo-elements, the returned element is the
   // element on which we store the animations (i.e. the EffectSet and/or
   // AnimationCollection), *not* the generated content.
   //
   // Returns an empty result when a suitable element cannot be found including
@@ -237,29 +237,29 @@ private:
   ~EffectCompositor() = default;
 
 
   // Get the properties in |aEffectSet| that we are able to animate on the
   // compositor but which are also specified at a higher level in the cascade
   // than the animations level.
   //
   // When |aBackendType| is StyleBackendType::Gecko, we determine which
-  // properties are specified using the provided |aComputedStyle| and
-  // |aElement| and |aPseudoType| are ignored. If |aComputedStyle| is nullptr,
+  // properties are specified using the provided |aStyleContext| and
+  // |aElement| and |aPseudoType| are ignored. If |aStyleContext| is nullptr,
   // we automatically look up the style context of primary frame of the
   // (pseudo-)element.
   //
   // When |aBackendType| is StyleBackendType::Servo, we use the |StrongRuleNode|
   // stored on the (pseudo-)element indicated by |aElement| and |aPseudoType|.
   static nsCSSPropertyIDSet
   GetOverriddenProperties(StyleBackendType aBackendType,
                           EffectSet& aEffectSet,
                           dom::Element* aElement,
                           CSSPseudoElementType aPseudoType,
-                          ComputedStyle* aComputedStyle);
+                          nsStyleContext* aStyleContext);
 
   static nsPresContext* GetPresContext(dom::Element* aElement);
 
   nsPresContext* mPresContext;
 
   // Elements with a pending animation restyle. The associated bool value is
   // true if a pending animation restyle has also been dispatched. For
   // animations that can be throttled, we will add an entry to the hashtable to
--- a/dom/animation/KeyframeEffect.cpp
+++ b/dom/animation/KeyframeEffect.cpp
@@ -1,23 +1,23 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/KeyframeEffect.h"
 
-#include "mozilla/ComputedStyle.h"
 #include "mozilla/dom/KeyframeAnimationOptionsBinding.h"
   // For UnrestrictedDoubleOrKeyframeAnimationOptions
 #include "mozilla/dom/AnimationEffectTiming.h"
 #include "mozilla/dom/KeyframeEffectBinding.h"
 #include "nsDocument.h" // For nsDocument::IsWebAnimationsEnabled
 #include "nsDOMMutationObserver.h" // For nsAutoAnimationMutationBatch
+#include "nsStyleContext.h"
 
 namespace mozilla {
 namespace dom {
 
 KeyframeEffect::KeyframeEffect(nsIDocument* aDocument,
                                const Maybe<OwningAnimationTarget>& aTarget,
                                const TimingParams& aTiming,
                                const KeyframeEffectParams& aOptions)
@@ -105,17 +105,17 @@ KeyframeEffect::SetTarget(const Nullable
       nsNodeUtils::AnimationRemoved(mAnimation);
     }
   }
 
   mTarget = newTarget;
 
   if (mTarget) {
     UpdateTargetRegistration();
-    RefPtr<ComputedStyle> styleContext = GetTargetComputedStyle();
+    RefPtr<nsStyleContext> styleContext = GetTargetStyleContext();
     if (styleContext) {
       UpdateProperties(styleContext);
     }
 
     MaybeUpdateFrameForCompositor();
 
     RequestRestyle(EffectCompositor::RestyleType::Layer);
 
@@ -158,17 +158,17 @@ KeyframeEffect::SetComposite(const Compo
 
   mEffectOptions.mComposite = aComposite;
 
   if (mAnimation && mAnimation->IsRelevant()) {
     nsNodeUtils::AnimationChanged(mAnimation);
   }
 
   if (mTarget) {
-    RefPtr<ComputedStyle> styleContext = GetTargetComputedStyle();
+    RefPtr<nsStyleContext> styleContext = GetTargetStyleContext();
     if (styleContext) {
       UpdateProperties(styleContext);
     }
   }
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/animation/KeyframeEffect.h
+++ b/dom/animation/KeyframeEffect.h
@@ -60,21 +60,21 @@ public:
   Constructor(const GlobalObject& aGlobal,
               const Nullable<ElementOrCSSPseudoElement>& aTarget,
               JS::Handle<JSObject*> aKeyframes,
               const UnrestrictedDoubleOrKeyframeAnimationOptions& aOptions,
               ErrorResult& aRv);
 
   void NotifySpecifiedTimingUpdated();
 
-  // This method calls GetTargetComputedStyle which is not safe to use when
+  // This method calls GetTargetStyleContext which is not safe to use when
   // we are in the middle of updating style. If we need to use this when
-  // updating style, we should pass the ComputedStyle into this method and use
+  // updating style, we should pass the nsStyleContext into this method and use
   // that to update the properties rather than calling
-  // GetComputedStyle.
+  // GetStyleContext.
   void SetTarget(const Nullable<ElementOrCSSPseudoElement>& aTarget);
 
   IterationCompositeOperation IterationComposite(CallerType aCallerType)
   {
     return KeyframeEffectReadOnly::IterationComposite();
   }
   void SetIterationComposite(
     const IterationCompositeOperation& aIterationComposite,
--- a/dom/animation/KeyframeEffectReadOnly.cpp
+++ b/dom/animation/KeyframeEffectReadOnly.cpp
@@ -9,35 +9,35 @@
 #include "FrameLayerBuilder.h"
 #include "mozilla/dom/Animation.h"
 #include "mozilla/dom/KeyframeAnimationOptionsBinding.h"
   // For UnrestrictedDoubleOrKeyframeAnimationOptions;
 #include "mozilla/dom/CSSPseudoElement.h"
 #include "mozilla/dom/KeyframeEffectBinding.h"
 #include "mozilla/AnimationUtils.h"
 #include "mozilla/AutoRestore.h"
-#include "mozilla/ComputedStyleInlines.h"
 #include "mozilla/EffectSet.h"
 #include "mozilla/FloatingPoint.h" // For IsFinite
 #include "mozilla/LayerAnimationInfo.h"
 #include "mozilla/LookAndFeel.h" // For LookAndFeel::GetInt
 #include "mozilla/KeyframeUtils.h"
 #include "mozilla/ServoBindings.h"
 #include "mozilla/TypeTraits.h"
 #include "Layers.h" // For Layer
-#include "nsComputedDOMStyle.h" // nsComputedDOMStyle::GetComputedStyle
+#include "nsComputedDOMStyle.h" // nsComputedDOMStyle::GetStyleContext
 #include "nsContentUtils.h"
 #include "nsCSSPropertyIDSet.h"
 #include "nsCSSProps.h" // For nsCSSProps::PropHasFlags
 #include "nsCSSPseudoElements.h" // For CSSPseudoElementType
 #include "nsDocument.h" // For nsDocument::IsWebAnimationsEnabled
 #include "nsIFrame.h"
 #include "nsIPresShell.h"
 #include "nsIScriptError.h"
 #include "nsRefreshDriver.h"
+#include "nsStyleContextInlines.h"
 
 namespace mozilla {
 
 bool
 PropertyValuePair::operator==(const PropertyValuePair& aOther) const
 {
   if (mProperty != aOther.mProperty || mValue != aOther.mValue) {
     return false;
@@ -185,31 +185,35 @@ KeyframeEffectReadOnly::SetKeyframes(JSC
                                      ErrorResult& aRv)
 {
   nsTArray<Keyframe> keyframes =
     KeyframeUtils::GetKeyframesFromObject(aContext, mDocument, aKeyframes, aRv);
   if (aRv.Failed()) {
     return;
   }
 
-  RefPtr<ComputedStyle> style = GetTargetComputedStyle();
-  if (style) {
-    SetKeyframes(Move(keyframes), style);
+  RefPtr<nsStyleContext> styleContext = GetTargetStyleContext();
+  if (styleContext) {
+    if (styleContext->IsGecko()) {
+      MOZ_CRASH("old style system disabled");
+    } else {
+      SetKeyframes(Move(keyframes), styleContext->AsServo());
+    }
   } else {
     // SetKeyframes has the same behavior for null StyleType* for
     // both backends, just pick one and use it.
-    SetKeyframes(Move(keyframes), (ComputedStyle*) nullptr);
+    SetKeyframes(Move(keyframes), (ServoStyleContext*) nullptr);
   }
 }
 
 
 void
 KeyframeEffectReadOnly::SetKeyframes(
   nsTArray<Keyframe>&& aKeyframes,
-  const ComputedStyle* aComputedValues)
+  const ServoStyleContext* aComputedValues)
 {
   DoSetKeyframes(Move(aKeyframes), aComputedValues);
 }
 
 template<typename StyleType>
 void
 KeyframeEffectReadOnly::DoSetKeyframes(nsTArray<Keyframe>&& aKeyframes,
                                        StyleType* aStyle)
@@ -288,30 +292,43 @@ SpecifiedKeyframeArraysAreEqual(const ns
     }
   }
 
   return true;
 }
 #endif
 
 void
-KeyframeEffectReadOnly::UpdateProperties(const ComputedStyle* aComputedStyle)
+KeyframeEffectReadOnly::UpdateProperties(nsStyleContext* aStyleContext)
 {
-  DoUpdateProperties(aComputedStyle);
+  MOZ_ASSERT(aStyleContext);
+
+  if (aStyleContext->IsGecko()) {
+    MOZ_CRASH("old style system disabled");
+  }
+
+  UpdateProperties(aStyleContext->AsServo());
+}
+
+void
+KeyframeEffectReadOnly::UpdateProperties(
+  const ServoStyleContext* aStyleContext)
+{
+  DoUpdateProperties(aStyleContext);
 }
 
 template<typename StyleType>
 void
 KeyframeEffectReadOnly::DoUpdateProperties(StyleType* aStyle)
 {
   MOZ_ASSERT(aStyle);
 
   // Skip updating properties when we are composing style.
   // FIXME: Bug 1324966. Drop this check once we have a function to get
-  // ComputedStyle without resolving animating style.
+  // nsStyleContext without resolving animating style.
   MOZ_DIAGNOSTIC_ASSERT(!mIsComposingStyle,
                         "Should not be called while processing ComposeStyle()");
   if (mIsComposingStyle) {
     return;
   }
 
   nsTArray<AnimationProperty> properties = BuildProperties(aStyle);
 
@@ -345,17 +362,17 @@ KeyframeEffectReadOnly::DoUpdateProperti
   MarkCascadeNeedsUpdate();
 
   RequestRestyle(EffectCompositor::RestyleType::Layer);
 }
 
 
 void
 KeyframeEffectReadOnly::EnsureBaseStyles(
-  const ComputedStyle* aComputedValues,
+  const ServoStyleContext* aComputedValues,
   const nsTArray<AnimationProperty>& aProperties)
 {
   if (!mTarget) {
     return;
   }
 
   mBaseStyleValuesForServo.Clear();
 
@@ -370,57 +387,57 @@ KeyframeEffectReadOnly::EnsureBaseStyles
   // case where |presContext| is nullptr is so rare (we've only ever seen in
   // fuzzing, and even then we've never been able to reproduce it reliably)
   // it's not worth the runtime cost of an extra branch.
   MOZ_ASSERT(presContext || aProperties.IsEmpty(),
              "Typically presContext should not be nullptr but if it is"
              " we should have also failed to calculate the computed values"
              " passed-in as aProperties");
 
-  RefPtr<ComputedStyle> baseComputedStyle;
+  RefPtr<ServoStyleContext> baseStyleContext;
   for (const AnimationProperty& property : aProperties) {
     EnsureBaseStyle(property,
                     presContext,
                     aComputedValues,
-                    baseComputedStyle);
+                    baseStyleContext);
   }
 }
 
 void
 KeyframeEffectReadOnly::EnsureBaseStyle(
   const AnimationProperty& aProperty,
   nsPresContext* aPresContext,
-  const ComputedStyle* aComputedStyle,
- RefPtr<ComputedStyle>& aBaseComputedStyle)
+  const ServoStyleContext* aComputedStyle,
+ RefPtr<ServoStyleContext>& aBaseStyleContext)
 {
   bool hasAdditiveValues = false;
 
   for (const AnimationPropertySegment& segment : aProperty.mSegments) {
     if (!segment.HasReplaceableValues()) {
       hasAdditiveValues = true;
       break;
     }
   }
 
   if (!hasAdditiveValues) {
     return;
   }
 
-  if (!aBaseComputedStyle) {
+  if (!aBaseStyleContext) {
     Element* animatingElement =
       EffectCompositor::GetElementToRestyle(mTarget->mElement,
                                             mTarget->mPseudoType);
-    aBaseComputedStyle =
+    aBaseStyleContext =
       aPresContext->StyleSet()->AsServo()->GetBaseContextForElement(
           animatingElement,
           aPresContext,
           aComputedStyle);
   }
   RefPtr<RawServoAnimationValue> baseValue =
-    Servo_ComputedValues_ExtractAnimationValue(aBaseComputedStyle,
+    Servo_ComputedValues_ExtractAnimationValue(aBaseStyleContext,
                                                aProperty.mProperty).Consume();
   mBaseStyleValuesForServo.Put(aProperty.mProperty, baseValue);
 }
 
 void
 KeyframeEffectReadOnly::WillComposeStyle()
 {
   ComputedTiming computedTiming = GetComputedTiming();
@@ -817,31 +834,31 @@ KeyframeEffectReadOnly::RequestRestyle(
   nsPresContext* presContext = nsContentUtils::GetContextForContent(mTarget->mElement);
   if (presContext && mAnimation) {
     presContext->EffectCompositor()->
       RequestRestyle(mTarget->mElement, mTarget->mPseudoType,
                      aRestyleType, mAnimation->CascadeLevel());
   }
 }
 
-already_AddRefed<ComputedStyle>
-KeyframeEffectReadOnly::GetTargetComputedStyle()
+already_AddRefed<nsStyleContext>
+KeyframeEffectReadOnly::GetTargetStyleContext()
 {
   if (!GetRenderedDocument()) {
     return nullptr;
   }
 
   MOZ_ASSERT(mTarget,
              "Should only have a document when we have a target element");
 
   nsAtom* pseudo = mTarget->mPseudoType < CSSPseudoElementType::Count
                     ? nsCSSPseudoElements::GetPseudoAtom(mTarget->mPseudoType)
                     : nullptr;
 
-  return nsComputedDOMStyle::GetComputedStyle(mTarget->mElement, pseudo);
+  return nsComputedDOMStyle::GetStyleContext(mTarget->mElement, pseudo);
 }
 
 #ifdef DEBUG
 void
 DumpAnimationProperties(nsTArray<AnimationProperty>& aAnimationProperties)
 {
   for (auto& p : aAnimationProperties) {
     printf("%s\n", nsCSSProps::GetStringValue(p.mProperty).get());
@@ -1018,27 +1035,27 @@ KeyframeEffectReadOnly::GetKeyframes(JSC
   // a longhand that comes from a variable reference in a shorthand? Servo says,
   // "an empty string" which is not particularly helpful.
   //
   // We should just store shorthands as-is (bug 1391537) and then return the
   // variable references, but for now, since we don't do that, and in order to
   // be consistent with Gecko, we just expand the variables (assuming we have
   // enough context to do so). For that we need to grab the style context so we
   // know what custom property values to provide.
-  RefPtr<ComputedStyle> styleContext;
+  RefPtr<nsStyleContext> styleContext;
   if (isServo && isCSSAnimation) {
     // The following will flush style but that's ok since if you update
     // a variable's computed value, you expect to see that updated value in the
     // result of getKeyframes().
     //
     // If we don't have a target, the following will return null. In that case
     // we might end up returning variables as-is or empty string. That should be
     // acceptable however, since such a case is rare and this is only
     // short-term (and unshipped) behavior until bug 1391537 is fixed.
-    styleContext = GetTargetComputedStyle();
+    styleContext = GetTargetStyleContext();
   }
 
   for (const Keyframe& keyframe : mKeyframes) {
     // Set up a dictionary object for the explicit members
     BaseComputedKeyframe keyframeDict;
     if (keyframe.mOffset) {
       keyframeDict.mOffset.SetValue(keyframe.mOffset.value());
     }
@@ -1080,23 +1097,23 @@ KeyframeEffectReadOnly::GetKeyframes(JSC
       nsAutoString stringValue;
       if (isServo) {
         // Don't serialize the custom properties for this keyframe.
         if (propertyValue.mProperty ==
               nsCSSPropertyID::eCSSPropertyExtra_variable) {
           continue;
         }
         if (propertyValue.mServoDeclarationBlock) {
-          const ComputedStyle* servoComputedStyle =
+          const ServoStyleContext* servoStyleContext =
             styleContext ? styleContext->AsServo() : nullptr;
           Servo_DeclarationBlock_SerializeOneValue(
             propertyValue.mServoDeclarationBlock,
             propertyValue.mProperty,
             &stringValue,
-            servoComputedStyle,
+            servoStyleContext,
             customProperties);
         } else {
           RawServoAnimationValue* value =
             mBaseStyleValuesForServo.GetWeak(propertyValue.mProperty);
 
           if (value) {
             Servo_AnimationValue_Serialize(value,
                                            propertyValue.mProperty,
@@ -1481,40 +1498,40 @@ KeyframeEffectReadOnly::SetPerformanceWa
         AnimationUtils::LogAsyncAnimationFailure(logMessage, mTarget->mElement);
       }
       return;
     }
   }
 }
 
 
-already_AddRefed<ComputedStyle>
-KeyframeEffectReadOnly::CreateComputedStyleForAnimationValue(
+already_AddRefed<nsStyleContext>
+KeyframeEffectReadOnly::CreateStyleContextForAnimationValue(
   nsCSSPropertyID aProperty,
   const AnimationValue& aValue,
-  const ComputedStyle* aBaseComputedStyle)
+  const ServoStyleContext* aBaseStyleContext)
 {
-  MOZ_ASSERT(aBaseComputedStyle,
-             "CreateComputedStyleForAnimationValue needs to be called "
-             "with a valid ComputedStyle");
+  MOZ_ASSERT(aBaseStyleContext,
+             "CreateStyleContextForAnimationValue needs to be called "
+             "with a valid ServoStyleContext");
 
   ServoStyleSet* styleSet =
-    aBaseComputedStyle->PresContext()->StyleSet()->AsServo();
+    aBaseStyleContext->PresContext()->StyleSet()->AsServo();
   Element* elementForResolve =
     EffectCompositor::GetElementToRestyle(mTarget->mElement,
                                           mTarget->mPseudoType);
   MOZ_ASSERT(elementForResolve, "The target element shouldn't be null");
   return styleSet->ResolveServoStyleByAddingAnimation(elementForResolve,
-                                                      aBaseComputedStyle,
+                                                      aBaseStyleContext,
                                                       aValue.mServo);
 }
 
 template<typename StyleType>
 void
-KeyframeEffectReadOnly::CalculateCumulativeChangeHint(StyleType* aComputedStyle)
+KeyframeEffectReadOnly::CalculateCumulativeChangeHint(StyleType* aStyleContext)
 {
   mCumulativeChangeHint = nsChangeHint(0);
 
   for (const AnimationProperty& property : mProperties) {
     // For opacity property we don't produce any change hints that are not
     // included in nsChangeHint_Hints_CanIgnoreIfNotVisible so we can throttle
     // opacity animations regardless of the change they produce.  This
     // optimization is particularly important since it allows us to throttle
@@ -1527,29 +1544,29 @@ KeyframeEffectReadOnly::CalculateCumulat
       // In case composite operation is not 'replace' or value is null,
       // we can't throttle animations which will not cause any layout changes
       // on invisible elements because we can't calculate the change hint for
       // such properties until we compose it.
       if (!segment.HasReplaceableValues()) {
         mCumulativeChangeHint = ~nsChangeHint_Hints_CanIgnoreIfNotVisible;
         return;
       }
-      RefPtr<ComputedStyle> fromContext =
-        CreateComputedStyleForAnimationValue(property.mProperty,
+      RefPtr<nsStyleContext> fromContext =
+        CreateStyleContextForAnimationValue(property.mProperty,
                                             segment.mFromValue,
-                                            aComputedStyle);
+                                            aStyleContext);
       if (!fromContext) {
         mCumulativeChangeHint = ~nsChangeHint_Hints_CanIgnoreIfNotVisible;
         return;
       }
 
-      RefPtr<ComputedStyle> toContext =
-        CreateComputedStyleForAnimationValue(property.mProperty,
+      RefPtr<nsStyleContext> toContext =
+        CreateStyleContextForAnimationValue(property.mProperty,
                                             segment.mToValue,
-                                            aComputedStyle);
+                                            aStyleContext);
       if (!toContext) {
         mCumulativeChangeHint = ~nsChangeHint_Hints_CanIgnoreIfNotVisible;
         return;
       }
 
       uint32_t equalStructs = 0;
       uint32_t samePointerStructs = 0;
       nsChangeHint changeHint =
--- a/dom/animation/KeyframeEffectReadOnly.h
+++ b/dom/animation/KeyframeEffectReadOnly.h
@@ -40,18 +40,18 @@ class nsIPresShell;
 namespace mozilla {
 
 class AnimValuesStyleRule;
 enum class CSSPseudoElementType : uint8_t;
 class ErrorResult;
 struct AnimationRule;
 struct TimingParams;
 class EffectSet;
-class ComputedStyle;
-class GeckoComputedStyle;
+class ServoStyleContext;
+class GeckoStyleContext;
 
 namespace dom {
 class ElementOrCSSPseudoElement;
 class GlobalObject;
 class OwningElementOrCSSPseudoElement;
 class UnrestrictedDoubleOrKeyframeAnimationOptions;
 class UnrestrictedDoubleOrKeyframeEffectOptions;
 enum class IterationCompositeOperation : uint8_t;
@@ -161,17 +161,17 @@ public:
   IterationCompositeOperation IterationComposite() const;
   CompositeOperation Composite() const;
   void NotifyAnimationTimingUpdated();
   void RequestRestyle(EffectCompositor::RestyleType aRestyleType);
   void SetAnimation(Animation* aAnimation) override;
   void SetKeyframes(JSContext* aContext, JS::Handle<JSObject*> aKeyframes,
                     ErrorResult& aRv);
   void SetKeyframes(nsTArray<Keyframe>&& aKeyframes,
-                    const ComputedStyle* aComputedValues);
+                    const ServoStyleContext* aComputedValues);
 
   // Returns true if the effect includes |aProperty| regardless of whether the
   // property is overridden by !important rule.
   bool HasAnimationOfProperty(nsCSSPropertyID aProperty) const;
 
   // GetEffectiveAnimationOfProperty returns AnimationProperty corresponding
   // to a given CSS property if the effect includes the property and the
   // property is not overridden by !important rules.
@@ -187,18 +187,20 @@ public:
     nsCSSPropertyID aProperty) const;
 
   const InfallibleTArray<AnimationProperty>& Properties() const
   {
     return mProperties;
   }
 
   // Update |mProperties| by recalculating from |mKeyframes| using
-  // |aComputedStyle| to resolve specified values.
-  void UpdateProperties(const ComputedStyle* aComputedValues);
+  // |aStyleContext| to resolve specified values.
+  void UpdateProperties(nsStyleContext* aStyleContext);
+  // Servo version of the above function.
+  void UpdateProperties(const ServoStyleContext* aComputedValues);
 
   // Update various bits of state related to running ComposeStyle().
   // We need to update this outside ComposeStyle() because we should avoid
   // mutating any state in ComposeStyle() since it might be called during
   // parallel traversal.
   void WillComposeStyle();
 
   // Updates |aComposeResult| with the animation values produced by this
@@ -240,17 +242,17 @@ public:
   // will be used to generate a localized message for devtools.
   void SetPerformanceWarning(
     nsCSSPropertyID aProperty,
     const AnimationPerformanceWarning& aWarning);
 
   // Cumulative change hint on each segment for each property.
   // This is used for deciding the animation is paint-only.
   template<typename StyleType>
-  void CalculateCumulativeChangeHint(StyleType* aComputedStyle);
+  void CalculateCumulativeChangeHint(StyleType* aStyleContext);
 
   // Returns true if all of animation properties' change hints
   // can ignore painting if the animation is not visible.
   // See nsChangeHint_Hints_CanIgnoreIfNotVisible in nsChangeHint.h
   // in detail which change hint can be ignored.
   bool CanIgnoreIfNotVisible() const;
 
   // Returns true if the effect is current state and has scale animation.
@@ -293,17 +295,17 @@ protected:
                           ErrorResult& aRv);
 
   template<class KeyframeEffectType>
   static already_AddRefed<KeyframeEffectType>
   ConstructKeyframeEffect(const GlobalObject& aGlobal,
                           KeyframeEffectReadOnly& aSource,
                           ErrorResult& aRv);
 
-  // Build properties by recalculating from |mKeyframes| using |aComputedStyle|
+  // Build properties by recalculating from |mKeyframes| using |aStyleContext|
   // to resolve specified values. This function also applies paced spacing if
   // needed.
   template<typename StyleType>
   nsTArray<AnimationProperty> BuildProperties(StyleType* aStyle);
 
   // This effect is registered with its target element so long as:
   //
   // (a) It has a target element, and
@@ -321,34 +323,34 @@ protected:
   // Update the associated frame state bits so that, if necessary, a stacking
   // context will be created and the effect sent to the compositor.  We
   // typically need to do this when the properties referenced by the keyframe
   // have changed, or when the target frame might have changed.
   void MaybeUpdateFrameForCompositor();
 
   // Looks up the style context associated with the target element, if any.
   // We need to be careful to *not* call this when we are updating the style
-  // context. That's because calling GetComputedStyle when we are in the process
+  // context. That's because calling GetStyleContext when we are in the process
   // of building a style context may trigger various forms of infinite
   // recursion.
-  already_AddRefed<ComputedStyle> GetTargetComputedStyle();
+  already_AddRefed<nsStyleContext> GetTargetStyleContext();
 
   // A wrapper for marking cascade update according to the current
   // target and its effectSet.
   void MarkCascadeNeedsUpdate();
 
-  void EnsureBaseStyles(const ComputedStyle* aComputedValues,
+  void EnsureBaseStyles(const ServoStyleContext* aComputedValues,
                         const nsTArray<AnimationProperty>& aProperties);
 
   // Stylo version of the above function that also first checks for an additive
   // value in |aProperty|'s list of segments.
   void EnsureBaseStyle(const AnimationProperty& aProperty,
                        nsPresContext* aPresContext,
-                       const ComputedStyle* aComputedValues,
-                       RefPtr<ComputedStyle>& aBaseComputedValues);
+                       const ServoStyleContext* aComputedValues,
+                       RefPtr<mozilla::ServoStyleContext>& aBaseComputedValues);
 
   Maybe<OwningAnimationTarget> mTarget;
 
   KeyframeEffectParams mEffectOptions;
 
   // The specified keyframes.
   nsTArray<Keyframe>          mKeyframes;
 
@@ -391,20 +393,20 @@ private:
 
 
   void ComposeStyleRule(RawServoAnimationValueMap& aAnimationValues,
                         const AnimationProperty& aProperty,
                         const AnimationPropertySegment& aSegment,
                         const ComputedTiming& aComputedTiming);
 
 
-  already_AddRefed<ComputedStyle> CreateComputedStyleForAnimationValue(
+  already_AddRefed<nsStyleContext> CreateStyleContextForAnimationValue(
     nsCSSPropertyID aProperty,
     const AnimationValue& aValue,
-    const ComputedStyle* aBaseComputedStyle);
+    const ServoStyleContext* aBaseStyleContext);
 
   nsIFrame* GetAnimationFrame() const;
 
   bool CanThrottle() const;
   bool CanThrottleTransformChanges(const nsIFrame& aFrame) const;
   bool CanThrottleTransformChangesInScrollable(nsIFrame& aFrame) const;
 
   // Returns true if the computedTiming has changed since the last
--- a/dom/animation/KeyframeUtils.cpp
+++ b/dom/animation/KeyframeUtils.cpp
@@ -1,17 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/KeyframeUtils.h"
 
-#include "mozilla/ComputedStyle.h"
 #include "mozilla/ErrorResult.h"
 #include "mozilla/Move.h"
 #include "mozilla/RangedArray.h"
 #include "mozilla/ServoBindings.h"
 #include "mozilla/ServoBindingTypes.h"
 #include "mozilla/ServoCSSParser.h"
 #include "mozilla/StyleAnimationValue.h"
 #include "mozilla/TimingParams.h"
@@ -24,16 +23,17 @@
 #include "nsContentUtils.h" // For GetContextForContent, and
                             // AnimationsAPICoreEnabled
 #include "nsCSSParser.h"
 #include "nsCSSPropertyIDSet.h"
 #include "nsCSSProps.h"
 #include "nsCSSPseudoElements.h" // For CSSPseudoElementType
 #include "nsDocument.h" // For nsDocument::IsWebAnimationsEnabled
 #include "nsIScriptError.h"
+#include "nsStyleContext.h"
 #include "nsTArray.h"
 #include <algorithm> // For std::stable_sort, std::min
 
 namespace mozilla {
 
 // ------------------------------------------------------------------
 //
 // Internal data types
@@ -365,17 +365,17 @@ static void
 MarkAsComputeValuesFailureKey(PropertyValuePair& aPair);
 
 #endif
 
 
 static nsTArray<ComputedKeyframeValues>
 GetComputedKeyframeValues(const nsTArray<Keyframe>& aKeyframes,
                           dom::Element* aElement,
-                          const ComputedStyle* aComputedValues);
+                          const ServoStyleContext* aComputedValues);
 
 static void
 BuildSegmentsFromValueEntries(nsTArray<KeyframeValueEntry>& aEntries,
                               nsTArray<AnimationProperty>& aResult);
 
 static void
 GetKeyframeListFromPropertyIndexedKeyframe(JSContext* aCx,
                                            nsIDocument* aDocument,
@@ -940,34 +940,34 @@ MarkAsComputeValuesFailureKey(PropertyVa
 
 
 /**
  * The variation of the above function. This is for Servo backend.
  */
 static nsTArray<ComputedKeyframeValues>
 GetComputedKeyframeValues(const nsTArray<Keyframe>& aKeyframes,
                           dom::Element* aElement,
-                          const ComputedStyle* aComputedStyle)
+                          const ServoStyleContext* aStyleContext)
 {
   MOZ_ASSERT(aElement);
   MOZ_ASSERT(aElement->IsStyledByServo());
 
   nsTArray<ComputedKeyframeValues> result;
 
   nsPresContext* presContext = nsContentUtils::GetContextForContent(aElement);
   if (!presContext) {
     // This has been reported to happen with some combinations of content
     // (particularly involving resize events and layout flushes? See bug 1407898
     // and bug 1408420) but no reproducible steps have been found.
     // For now we just return an empty array.
     return result;
   }
 
   result = presContext->StyleSet()->AsServo()
-    ->GetComputedKeyframeValuesFor(aKeyframes, aElement, aComputedStyle);
+    ->GetComputedKeyframeValuesFor(aKeyframes, aElement, aStyleContext);
   return result;
 }
 
 static void
 AppendInitialSegment(AnimationProperty* aAnimationProperty,
                      const KeyframeValueEntry& aFirstEntry)
 {
   AnimationPropertySegment* segment =
@@ -1528,12 +1528,12 @@ DistributeRange(const Range<Keyframe>& a
 }
 
 
 template
 nsTArray<AnimationProperty>
 KeyframeUtils::GetAnimationPropertiesFromKeyframes(
   const nsTArray<Keyframe>& aKeyframes,
   dom::Element* aElement,
-  const ComputedStyle* aStyle,
+  const ServoStyleContext* aStyle,
   dom::CompositeOperation aEffectComposite);
 
 } // namespace mozilla
--- a/dom/animation/KeyframeUtils.h
+++ b/dom/animation/KeyframeUtils.h
@@ -10,17 +10,17 @@
 #include "mozilla/KeyframeEffectParams.h" // For CompositeOperation
 #include "nsCSSPropertyID.h"
 #include "nsTArrayForwardDeclare.h" // For nsTArray
 #include "js/RootingAPI.h" // For JS::Handle
 
 struct JSContext;
 class JSObject;
 class nsIDocument;
-class ComputedStyle;
+class nsStyleContext;
 struct RawServoDeclarationBlock;
 
 namespace mozilla {
 struct AnimationProperty;
 enum class CSSPseudoElementType : uint8_t;
 class ErrorResult;
 struct Keyframe;
 struct PropertyStyleAnimationValuePair;
@@ -76,17 +76,17 @@ public:
   /**
    * Converts an array of Keyframe objects into an array of AnimationProperty
    * objects. This involves creating an array of computed values for each
    * longhand property and determining the offset and timing function to use
    * for each value.
    *
    * @param aKeyframes The input keyframes.
    * @param aElement The context element.
-   * @param aStyleType The |ComputedStyle| or |GeckoComputedStyle| to use
+   * @param aStyleType The |ServoStyleContext| or |GeckoStyleContext| to use
    *   when computing values.
    * @param aEffectComposite The composite operation specified on the effect.
    *   For any keyframes in |aKeyframes| that do not specify a composite
    *   operation, this value will be used.
    * @return The set of animation properties. If an error occurs, the returned
    *   array will be empty.
    */
   template<typename StyleType>
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -539,18 +539,18 @@ Element::GetBindingURL(nsIDocument *aDoc
                                IsHTMLElement(nsGkAtoms::object) ||
                                IsHTMLElement(nsGkAtoms::embed));
   if (!aDocument->GetShell() || GetPrimaryFrame() || !isXULorPluginElement) {
     *aResult = nullptr;
     return true;
   }
 
   // Get the computed -moz-binding directly from the style context
-  RefPtr<ComputedStyle> sc =
-    nsComputedDOMStyle::GetComputedStyleNoFlush(this, nullptr);
+  RefPtr<nsStyleContext> sc =
+    nsComputedDOMStyle::GetStyleContextNoFlush(this, nullptr);
   NS_ENSURE_TRUE(sc, false);
 
   NS_IF_ADDREF(*aResult = sc->StyleDisplay()->mBinding);
   return true;
 }
 
 JSObject*
 Element::WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
@@ -1500,18 +1500,18 @@ Element::GetElementsByClassName(const ns
 void
 Element::GetElementsWithGrid(nsTArray<RefPtr<Element>>& aElements)
 {
   // This helper function is passed to GetElementsByMatching()
   // to identify elements with styling which will cause them to
   // generate a nsGridContainerFrame during layout.
   auto IsDisplayGrid = [](Element* aElement) -> bool
   {
-    RefPtr<ComputedStyle> styleContext =
-      nsComputedDOMStyle::GetComputedStyle(aElement, nullptr);
+    RefPtr<nsStyleContext> styleContext =
+      nsComputedDOMStyle::GetStyleContext(aElement, nullptr);
     if (styleContext) {
       const nsStyleDisplay* display = styleContext->StyleDisplay();
       return (display->mDisplay == StyleDisplay::Grid ||
               display->mDisplay == StyleDisplay::InlineGrid);
     }
     return false;
   };
 
@@ -4380,17 +4380,17 @@ Element::AddSizeOfExcludingThis(nsWindow
     // code.
     *aNodeSize +=
       Servo_Element_SizeOfExcludingThisAndCVs(ServoElementMallocSizeOf,
                                               ServoElementMallocEnclosingSizeOf,
                                               &aSizes.mState.mSeenPtrs, this);
 
     // Now measure just the ComputedValues (and style structs) under
     // mServoData. This counts towards the relevant fields in |aSizes|.
-    RefPtr<ComputedStyle> sc;
+    RefPtr<ServoStyleContext> sc;
     if (Servo_Element_HasPrimaryComputedValues(this)) {
       sc = Servo_Element_GetPrimaryComputedValues(this).Consume();
       if (!aSizes.mState.HaveSeenPtr(sc.get())) {
         sc->AddSizeOfIncludingThis(aSizes, &aSizes.mLayoutComputedValuesDom);
       }
 
       for (size_t i = 0; i < nsCSSPseudoElements::kEagerPseudoCount; i++) {
         if (Servo_Element_HasPseudoComputedValues(this, i)) {
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -2721,18 +2721,18 @@ nsDOMWindowUtils::ComputeAnimationDistan
 
   Element* element = content->AsElement();
   AnimationValue v1 = AnimationValue::FromString(property, aValue1, element);
   AnimationValue v2 = AnimationValue::FromString(property, aValue2, element);
   if (v1.IsNull() || v2.IsNull()) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
 
-  RefPtr<ComputedStyle> styleContext =
-    nsComputedDOMStyle::GetComputedStyle(element, nullptr);
+  RefPtr<nsStyleContext> styleContext =
+    nsComputedDOMStyle::GetStyleContext(element, nullptr);
   *aResult = v1.ComputeDistance(property, v2, styleContext);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMWindowUtils::GetAnimationTypeForLonghand(const nsAString& aProperty,
                                               nsAString& aResult)
 {
@@ -2819,30 +2819,34 @@ nsDOMWindowUtils::GetUnanimatedComputedS
   }
 
   nsIPresShell* shell = GetPresShell();
   if (!shell) {
     return NS_ERROR_FAILURE;
   }
 
   RefPtr<nsAtom> pseudo = nsCSSPseudoElements::GetPseudoAtom(aPseudoElement);
-  RefPtr<ComputedStyle> styleContext =
-    nsComputedDOMStyle::GetUnanimatedComputedStyleNoFlush(element, pseudo);
+  RefPtr<nsStyleContext> styleContext =
+    nsComputedDOMStyle::GetUnanimatedStyleContextNoFlush(element, pseudo);
   if (!styleContext) {
     return NS_ERROR_FAILURE;
   }
 
-  RefPtr<RawServoAnimationValue> value =
-    Servo_ComputedValues_ExtractAnimationValue(styleContext->AsServo(),
-                                               propertyID).Consume();
-  if (!value) {
-    return NS_ERROR_FAILURE;
+  if (styleContext->IsServo()) {
+    RefPtr<RawServoAnimationValue> value =
+      Servo_ComputedValues_ExtractAnimationValue(styleContext->AsServo(),
+                                                 propertyID).Consume();
+    if (!value) {
+      return NS_ERROR_FAILURE;
+    }
+    Servo_AnimationValue_Serialize(value, propertyID, &aResult);
+    return NS_OK;
   }
-  Servo_AnimationValue_Serialize(value, propertyID, &aResult);
-  return NS_OK;
+
+  MOZ_CRASH("old style system disabled");
 }
 
 nsresult
 nsDOMWindowUtils::RenderDocument(const nsRect& aRect,
                                  uint32_t aFlags,
                                  nscolor aBackgroundColor,
                                  gfxContext* aThebesContext)
 {
--- a/dom/base/nsPlainTextSerializer.cpp
+++ b/dom/base/nsPlainTextSerializer.cpp
@@ -1846,31 +1846,31 @@ bool
 nsPlainTextSerializer::IsInPre()
 {
   return !mPreformatStack.empty() && mPreformatStack.top();
 }
 
 bool
 nsPlainTextSerializer::IsElementPreformatted(Element* aElement)
 {
-  RefPtr<ComputedStyle> styleContext =
-    nsComputedDOMStyle::GetComputedStyleNoFlush(aElement, nullptr);
+  RefPtr<nsStyleContext> styleContext =
+    nsComputedDOMStyle::GetStyleContextNoFlush(aElement, nullptr);
   if (styleContext) {
     const nsStyleText* textStyle = styleContext->StyleText();
     return textStyle->WhiteSpaceOrNewlineIsSignificant();
   }
   // Fall back to looking at the tag, in case there is no style information.
   return GetIdForContent(aElement) == nsGkAtoms::pre;
 }
 
 bool
 nsPlainTextSerializer::IsElementBlock(Element* aElement)
 {
-  RefPtr<ComputedStyle> styleContext =
-    nsComputedDOMStyle::GetComputedStyleNoFlush(aElement, nullptr);
+  RefPtr<nsStyleContext> styleContext =
+    nsComputedDOMStyle::GetStyleContextNoFlush(aElement, nullptr);
   if (styleContext) {
     const nsStyleDisplay* displayStyle = styleContext->StyleDisplay();
     return displayStyle->IsBlockOutsideStyle();
   }
   // Fall back to looking at the tag, in case there is no style information.
   return nsContentUtils::IsHTMLBlock(aElement);
 }
 
--- a/dom/base/nsRange.cpp
+++ b/dom/base/nsRange.cpp
@@ -3736,18 +3736,18 @@ IsVisibleAndNotInReplacedElement(nsIFram
 }
 
 static bool
 ElementIsVisibleNoFlush(Element* aElement)
 {
   if (!aElement) {
     return false;
   }
-  RefPtr<ComputedStyle> sc =
-    nsComputedDOMStyle::GetComputedStyleNoFlush(aElement, nullptr);
+  RefPtr<nsStyleContext> sc =
+    nsComputedDOMStyle::GetStyleContextNoFlush(aElement, nullptr);
   return sc && sc->StyleVisibility()->IsVisible();
 }
 
 static void
 AppendTransformedText(InnerTextAccumulator& aResult, nsIContent* aContainer)
 {
   auto textNode = static_cast<CharacterData*>(aContainer);
 
--- a/dom/base/nsWindowMemoryReporter.cpp
+++ b/dom/base/nsWindowMemoryReporter.cpp
@@ -437,17 +437,17 @@ CollectWindowReports(nsGlobalWindowInner
                "listeners on nodes and other event targets.");
 
   REPORT_SIZE("/layout/line-boxes", mArenaSizes.mLineBoxes,
               "Memory used by line boxes within a window.");
 
   REPORT_SIZE("/layout/rule-nodes", mArenaSizes.mRuleNodes,
               "Memory used by CSS rule nodes within a window.");
 
-  REPORT_SIZE("/layout/style-contexts", mArenaSizes.mComputedStyles,
+  REPORT_SIZE("/layout/style-contexts", mArenaSizes.mStyleContexts,
               "Memory used by style contexts within a window.");
 
   // There are many different kinds of style structs, but it is likely that
   // only a few matter. Implement a cutoff so we don't bloat about:memory with
   // many uninteresting entries.
   const size_t STYLE_SUNDRIES_THRESHOLD =
     js::MemoryReportingSundriesThreshold();
 
@@ -703,17 +703,17 @@ nsWindowMemoryReporter::CollectReports(n
          windowTotalSizes.mArenaSizes.mLineBoxes,
          "This is the sum of all windows' 'layout/line-boxes' numbers.");
 
   REPORT("window-objects/layout/rule-nodes",
          windowTotalSizes.mArenaSizes.mRuleNodes,
          "This is the sum of all windows' 'layout/rule-nodes' numbers.");
 
   REPORT("window-objects/layout/style-contexts",
-         windowTotalSizes.mArenaSizes.mComputedStyles,
+         windowTotalSizes.mArenaSizes.mStyleContexts,
          "This is the sum of all windows' 'layout/style-contexts' numbers.");
 
   size_t geckoStyleTotal = 0;
 #define STYLE_STRUCT(name_, cb_) \
   geckoStyleTotal += \
     windowTotalSizes.mArenaSizes.mGeckoStyleSizes.NS_STYLE_SIZES_FIELD(name_);
 #define STYLE_STRUCT_LIST_IGNORE_VARIABLES
 #include "nsStyleStructList.h"
--- a/dom/base/nsWindowSizes.h
+++ b/dom/base/nsWindowSizes.h
@@ -98,17 +98,17 @@ struct nsStyleSizes
 };
 
 #define NS_ARENA_SIZES_FIELD(classname) mArena##classname
 
 struct nsArenaSizes {
 #define FOR_EACH_SIZE(macro) \
   macro(Other, mLineBoxes) \
   macro(Style, mRuleNodes) \
-  macro(Style, mComputedStyles)
+  macro(Style, mStyleContexts)
 
   nsArenaSizes()
     :
       FOR_EACH_SIZE(ZERO_SIZE)
 
       #define FRAME_ID(classname, ...) \
         NS_ARENA_SIZES_FIELD(classname)(0),
       #define ABSTRACT_FRAME_ID(...)
--- a/dom/base/nsXHTMLContentSerializer.cpp
+++ b/dom/base/nsXHTMLContentSerializer.cpp
@@ -715,18 +715,18 @@ nsXHTMLContentSerializer::MaybeLeaveFrom
 bool
 nsXHTMLContentSerializer::IsElementPreformatted(nsIContent* aNode)
 {
   MOZ_ASSERT(ShouldMaintainPreLevel(), "We should not be calling this needlessly");
 
   if (!aNode->IsElement()) {
     return false;
   }
-  RefPtr<ComputedStyle> styleContext =
-    nsComputedDOMStyle::GetComputedStyleNoFlush(aNode->AsElement(), nullptr);
+  RefPtr<nsStyleContext> styleContext =
+    nsComputedDOMStyle::GetStyleContextNoFlush(aNode->AsElement(), nullptr);
   if (styleContext) {
     const nsStyleText* textStyle = styleContext->StyleText();
     return textStyle->WhiteSpaceOrNewlineIsSignificant();
   }
   return false;
 }
 
 bool
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -1170,18 +1170,18 @@ CanvasRenderingContext2D::ParseColor(con
     if (!ServoCSSParser::ComputeColor(set, NS_RGB(0, 0, 0), aString, aColor,
                                       &wasCurrentColor, loader)) {
       return false;
     }
 
     if (wasCurrentColor && mCanvasElement) {
       // Otherwise, get the value of the color property, flushing style
       // if necessary.
-      RefPtr<ComputedStyle> canvasStyle =
-        nsComputedDOMStyle::GetComputedStyle(mCanvasElement, nullptr);
+      RefPtr<nsStyleContext> canvasStyle =
+        nsComputedDOMStyle::GetStyleContext(mCanvasElement, nullptr);
       if (canvasStyle) {
         *aColor = canvasStyle->StyleColor()->mColor;
       }
       // Beware that the presShell could be gone here.
     }
     return true;
   }
 
@@ -1950,18 +1950,18 @@ CanvasRenderingContext2D::ClearTarget()
   SetInitialState();
 
   if (!mCanvasElement || !mCanvasElement->IsInComposedDoc()) {
     return;
   }
 
   // For vertical writing-mode, unless text-orientation is sideways,
   // we'll modify the initial value of textBaseline to 'middle'.
-  RefPtr<ComputedStyle> canvasStyle =
-    nsComputedDOMStyle::GetComputedStyle(mCanvasElement, nullptr);
+  RefPtr<nsStyleContext> canvasStyle =
+    nsComputedDOMStyle::GetStyleContext(mCanvasElement, nullptr);
   if (canvasStyle) {
     WritingMode wm(canvasStyle);
     if (wm.IsVertical() && !wm.IsSideways()) {
       CurrentState().textBaseline = TextBaseline::MIDDLE;
     }
   }
 }
 
@@ -2678,17 +2678,17 @@ CreateDeclarationForServo(nsCSSPropertyI
 
 static already_AddRefed<RawServoDeclarationBlock>
 CreateFontDeclarationForServo(const nsAString& aFont,
                               nsIDocument* aDocument)
 {
   return CreateDeclarationForServo(eCSSProperty_font, aFont, aDocument);
 }
 
-static already_AddRefed<ComputedStyle>
+static already_AddRefed<ServoStyleContext>
 GetFontStyleForServo(Element* aElement, const nsAString& aFont,
                      nsIPresShell* aPresShell,
                      nsAString& aOutUsedFont,
                      ErrorResult& aError)
 {
   MOZ_ASSERT(aPresShell->StyleSet()->IsServo());
 
   RefPtr<RawServoDeclarationBlock> declarations =
@@ -2703,21 +2703,21 @@ GetFontStyleForServo(Element* aElement, 
   // at font-size-adjust, which the font shorthand resets to 'none'.
   if (Servo_DeclarationBlock_HasCSSWideKeyword(declarations,
                                                eCSSProperty_font_size_adjust)) {
     return nullptr;
   }
 
   ServoStyleSet* styleSet = aPresShell->StyleSet()->AsServo();
 
-  RefPtr<ComputedStyle> parentStyle;
+  RefPtr<nsStyleContext> parentStyle;
   // have to get a parent style context for inherit-like relative
   // values (2em, bolder, etc.)
   if (aElement && aElement->IsInComposedDoc()) {
-    parentStyle = nsComputedDOMStyle::GetComputedStyle(aElement, nullptr);
+    parentStyle = nsComputedDOMStyle::GetStyleContext(aElement, nullptr);
     if (!parentStyle) {
       // The flush killed the shell, so we couldn't get any meaningful style
       // back.
       aError.Throw(NS_ERROR_FAILURE);
       return nullptr;
     }
   } else {
     RefPtr<RawServoDeclarationBlock> declarations =
@@ -2730,17 +2730,17 @@ GetFontStyleForServo(Element* aElement, 
   }
 
   MOZ_RELEASE_ASSERT(parentStyle, "Should have a valid parent style");
 
   MOZ_ASSERT(!aPresShell->IsDestroying(),
              "We should have returned an error above if the presshell is "
              "being destroyed.");
 
-  RefPtr<ComputedStyle> sc =
+  RefPtr<ServoStyleContext> sc =
     styleSet->ResolveForDeclarations(parentStyle->AsServo(), declarations);
 
   // The font getter is required to be reserialized based on what we
   // parsed (including having line-height removed).  (Older drafts of
   // the spec required font sizes be converted to pixels, but that no
   // longer seems to be required.)
   Servo_SerializeFontValueForCanvas(declarations, &aOutUsedFont);
   return sc.forget();
@@ -2749,19 +2749,19 @@ GetFontStyleForServo(Element* aElement, 
 
 static already_AddRefed<RawServoDeclarationBlock>
 CreateFilterDeclarationForServo(const nsAString& aFilter,
                                 nsIDocument* aDocument)
 {
   return CreateDeclarationForServo(eCSSProperty_filter, aFilter, aDocument);
 }
 
-static already_AddRefed<ComputedStyle>
+static already_AddRefed<ServoStyleContext>
 ResolveFilterStyleForServo(const nsAString& aFilterString,
-                           const ComputedStyle* aParentStyle,
+                           const ServoStyleContext* aParentStyle,
                            nsIPresShell* aPresShell,
                            ErrorResult& aError)
 {
   MOZ_ASSERT(aPresShell->StyleSet()->IsServo());
 
   RefPtr<RawServoDeclarationBlock> declarations =
     CreateFilterDeclarationForServo(aFilterString, aPresShell->GetDocument());
   if (!declarations) {
@@ -2772,17 +2772,17 @@ ResolveFilterStyleForServo(const nsAStri
   // In addition to unparseable values, the spec says we need to reject
   // 'inherit' and 'initial'.
   if (Servo_DeclarationBlock_HasCSSWideKeyword(declarations,
                                                eCSSProperty_filter)) {
     return nullptr;
   }
 
   ServoStyleSet* styleSet = aPresShell->StyleSet()->AsServo();
-  RefPtr<ComputedStyle> computedValues =
+  RefPtr<ServoStyleContext> computedValues =
     styleSet->ResolveForDeclarations(aParentStyle, declarations);
 
   return computedValues.forget();
 }
 
 bool
 CanvasRenderingContext2D::ParseFilter(const nsAString& aString,
                                       nsTArray<nsStyleFilter>& aFilterChain,
@@ -2804,27 +2804,27 @@ CanvasRenderingContext2D::ParseFilter(co
   if (presShell->StyleSet()->IsGecko()) {
     MOZ_CRASH("old style system disabled");
     return false;
   }
 
   // For stylo
   MOZ_ASSERT(presShell->StyleSet()->IsServo());
 
-  RefPtr<ComputedStyle> parentStyle =
+  RefPtr<ServoStyleContext> parentStyle =
     GetFontStyleForServo(mCanvasElement,
                          GetFont(),
                          presShell,
                          usedFont,
                          aError);
   if (!parentStyle) {
     return false;
   }
 
-  RefPtr<ComputedStyle> computedValues =
+  RefPtr<ServoStyleContext> computedValues =
     ResolveFilterStyleForServo(aString,
                                parentStyle,
                                presShell,
                                aError);
   if (!computedValues) {
     return false;
   }
 
@@ -3730,17 +3730,17 @@ CanvasRenderingContext2D::SetFontInterna
   }
 
   nsCOMPtr<nsIPresShell> presShell = GetPresShell();
   if (!presShell) {
     aError.Throw(NS_ERROR_FAILURE);
     return false;
   }
 
-  RefPtr<ComputedStyle> sc;
+  RefPtr<nsStyleContext> sc;
   nsString usedFont;
   if (presShell->StyleSet()->IsServo()) {
     sc =
       GetFontStyleForServo(mCanvasElement, aFont, presShell, usedFont, aError);
   } else {
     MOZ_CRASH("old style system disabled");
   }
   if (!sc) {
@@ -4300,21 +4300,21 @@ CanvasRenderingContext2D::DrawOrMeasureT
   // but is less than or equal to zero or equal to NaN.
   if (aMaxWidth.WasPassed() && (aMaxWidth.Value() <= 0 || IsNaN(aMaxWidth.Value()))) {
     textToDraw.Truncate();
   }
 
   // for now, default to ltr if not in doc
   bool isRTL = false;
 
-  RefPtr<ComputedStyle> canvasStyle;
+  RefPtr<nsStyleContext> canvasStyle;
   if (mCanvasElement && mCanvasElement->IsInComposedDoc()) {
     // try to find the closest context
     canvasStyle =
-      nsComputedDOMStyle::GetComputedStyle(mCanvasElement, nullptr);
+      nsComputedDOMStyle::GetStyleContext(mCanvasElement, nullptr);
     if (!canvasStyle) {
       return NS_ERROR_FAILURE;
     }
 
     isRTL = canvasStyle->StyleVisibility()->mDirection ==
       NS_STYLE_DIRECTION_RTL;
   } else {
     isRTL = GET_BIDI_OPTION_DIRECTION(document->GetBidiOptions()) == IBMBIDI_TEXTDIRECTION_RTL;
--- a/dom/html/ImageDocument.cpp
+++ b/dom/html/ImageDocument.cpp
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "ImageDocument.h"
-#include "mozilla/ComputedStyle.h"
 #include "mozilla/dom/DOMPrefs.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/ImageDocumentBinding.h"
 #include "mozilla/dom/HTMLImageElement.h"
 #include "mozilla/dom/MouseEvent.h"
 #include "nsRect.h"
 #include "nsIImageLoadingContent.h"
 #include "nsGenericHTMLElement.h"
@@ -22,16 +21,17 @@
 #include "nsIFrame.h"
 #include "nsGkAtoms.h"
 #include "imgIRequest.h"
 #include "imgILoader.h"
 #include "imgIContainer.h"
 #include "imgINotificationObserver.h"
 #include "nsIPresShell.h"
 #include "nsPresContext.h"
+#include "nsStyleContext.h"
 #include "nsIChannel.h"
 #include "nsIContentPolicy.h"
 #include "nsContentPolicyUtils.h"
 #include "nsPIDOMWindow.h"
 #include "nsIDOMElement.h"
 #include "nsError.h"
 #include "nsURILoader.h"
 #include "nsIDocShell.h"
--- a/dom/smil/nsSMILCSSProperty.cpp
+++ b/dom/smil/nsSMILCSSProperty.cpp
@@ -18,20 +18,20 @@
 #include "nsCSSProps.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 // Class Methods
 nsSMILCSSProperty::nsSMILCSSProperty(nsCSSPropertyID aPropID,
                                      Element* aElement,
-                                     ComputedStyle* aBaseComputedStyle)
+                                     nsStyleContext* aBaseStyleContext)
   : mPropID(aPropID)
   , mElement(aElement)
-  , mBaseComputedStyle(aBaseComputedStyle)
+  , mBaseStyleContext(aBaseStyleContext)
 {
   MOZ_ASSERT(IsPropertyAnimatable(mPropID,
                aElement->OwnerDoc()->GetStyleBackendType()),
              "Creating a nsSMILCSSProperty for a property "
              "that's not supported for animation");
 }
 
 nsSMILValue
@@ -42,17 +42,17 @@ nsSMILCSSProperty::GetBaseValue() const
   // from ALL return points. This function must only return THIS variable:
   nsSMILValue baseValue;
 
   // SPECIAL CASE: (a) Shorthands
   //               (b) 'display'
   //               (c) No base style context
   if (nsCSSProps::IsShorthand(mPropID) ||
       mPropID == eCSSProperty_display ||
-      !mBaseComputedStyle) {
+      !mBaseStyleContext) {
     // We can't look up the base (computed-style) value of shorthand
     // properties because they aren't guaranteed to have a consistent computed
     // value.
     //
     // Also, although we can look up the base value of the display property,
     // doing so involves clearing and resetting the property which can cause
     // frames to be recreated which we'd like to avoid.
     //
@@ -64,17 +64,17 @@ nsSMILCSSProperty::GetBaseValue() const
     nsSMILValue tmpVal(&nsSMILCSSValueType::sSingleton);
     Swap(baseValue, tmpVal);
     return baseValue;
   }
 
   AnimationValue computedValue;
   if (mElement->IsStyledByServo()) {
     computedValue.mServo =
-      Servo_ComputedValues_ExtractAnimationValue(mBaseComputedStyle->AsServo(), mPropID)
+      Servo_ComputedValues_ExtractAnimationValue(mBaseStyleContext->AsServo(), mPropID)
       .Consume();
     if (!computedValue.mServo) {
       return baseValue;
     }
   } else {
     MOZ_CRASH("old style system disabled");
   }
 
--- a/dom/smil/nsSMILCSSProperty.h
+++ b/dom/smil/nsSMILCSSProperty.h
@@ -11,18 +11,19 @@
 
 #include "mozilla/Attributes.h"
 #include "mozilla/StyleBackendType.h"
 #include "nsISMILAttr.h"
 #include "nsAtom.h"
 #include "nsCSSPropertyID.h"
 #include "nsCSSValue.h"
 
+class nsStyleContext;
+
 namespace mozilla {
-class ComputedStyle;
 namespace dom {
 class Element;
 } // namespace dom
 } // namespace mozilla
 
 /**
  * nsSMILCSSProperty: Implements the nsISMILAttr interface for SMIL animations
  * that target CSS properties.  Represents a particular animation-targeted CSS
@@ -30,24 +31,24 @@ class Element;
  */
 class nsSMILCSSProperty : public nsISMILAttr
 {
 public:
   /**
    * Constructs a new nsSMILCSSProperty.
    * @param  aPropID   The CSS property we're interested in animating.
    * @param  aElement  The element whose CSS property is being animated.
-   * @param  aBaseComputedStyle  The style context to use when getting the base
-   *                             value. If this is nullptr and GetBaseValue is
-   *                             called, an empty nsSMILValue initialized with
-   *                             the nsSMILCSSValueType will be returned.
+   * @param  aBaseStyleContext  The style context to use when getting the base
+   *                            value. If this is nullptr and GetBaseValue is
+   *                            called, an empty nsSMILValue initialized with
+   *                            the nsSMILCSSValueType will be returned.
    */
   nsSMILCSSProperty(nsCSSPropertyID aPropID,
                     mozilla::dom::Element* aElement,
-                    mozilla::ComputedStyle* aBaseComputedStyle);
+                    nsStyleContext* aBaseStyleContext);
 
   // nsISMILAttr methods
   virtual nsresult ValueFromString(const nsAString& aStr,
                                    const mozilla::dom::SVGAnimationElement* aSrcElement,
                                    nsSMILValue& aValue,
                                    bool& aPreventCachingOfSandwich) const override;
   virtual nsSMILValue GetBaseValue() const override;
   virtual nsresult    SetAnimValue(const nsSMILValue& aValue) override;
@@ -70,17 +71,16 @@ public:
 protected:
   nsCSSPropertyID mPropID;
   // Using non-refcounted pointer for mElement -- we know mElement will stay
   // alive for my lifetime because a nsISMILAttr (like me) only lives as long
   // as the Compositing step, and DOM elements don't get a chance to die during
   // that time.
   mozilla::dom::Element*   mElement;
 
-  // The style to use when fetching base styles.
-  //
+  // The style context to use when fetching base styles.
   // As with mElement, since an nsISMILAttr only lives as long as the
   // compositing step and since ComposeAttribute holds an owning reference to
   // the base style context, we can use a non-owning reference here.
-  mozilla::ComputedStyle* mBaseComputedStyle;
+  nsStyleContext* mBaseStyleContext;
 };
 
 #endif // NS_SMILCSSPROPERTY_H_
--- a/dom/smil/nsSMILCSSValueType.cpp
+++ b/dom/smil/nsSMILCSSValueType.cpp
@@ -21,17 +21,16 @@
 #include "mozilla/ServoCSSParser.h"
 #include "mozilla/StyleSetHandleInlines.h"
 #include "mozilla/dom/BaseKeyframeTypesBinding.h" // For CompositeOperation
 #include "mozilla/dom/Element.h"
 #include "nsDebug.h"
 #include "nsStyleUtil.h"
 #include "nsIDocument.h"
 
-using namespace mozilla;
 using namespace mozilla::dom;
 using mozilla::StyleAnimationValue;
 
 typedef AutoTArray<RefPtr<RawServoAnimationValue>, 1> ServoAnimationValues;
 
 /*static*/ nsSMILCSSValueType nsSMILCSSValueType::sSingleton;
 
 struct ValueWrapper {
@@ -491,17 +490,17 @@ GetPresContextForElement(Element* aElem)
   return doc->GetPresContext();
 }
 
 
 static ServoAnimationValues
 ValueFromStringHelper(nsCSSPropertyID aPropID,
                       Element* aTargetElement,
                       nsPresContext* aPresContext,
-                      ComputedStyle* aComputedStyle,
+                      nsStyleContext* aStyleContext,
                       const nsAString& aString)
 {
   ServoAnimationValues result;
 
   nsIDocument* doc = aTargetElement->GetUncomposedDoc();
   if (!doc) {
     return result;
   }
@@ -515,17 +514,17 @@ ValueFromStringHelper(nsCSSPropertyID aP
                                     ParsingMode::AllowAllNumericValues);
   if (!servoDeclarationBlock) {
     return result;
   }
 
   // Compute value
   aPresContext->StyleSet()->AsServo()->GetAnimationValues(servoDeclarationBlock,
                                                           aTargetElement,
-                                                          aComputedStyle->AsServo(),
+                                                          aStyleContext->AsServo(),
                                                           result);
 
   return result;
 }
 
 // static
 void
 nsSMILCSSValueType::ValueFromString(nsCSSPropertyID aPropID,
@@ -545,35 +544,40 @@ nsSMILCSSValueType::ValueFromString(nsCS
   if (doc && !nsStyleUtil::CSPAllowsInlineStyle(nullptr,
                                                 doc->NodePrincipal(),
                                                 nullptr,
                                                 doc->GetDocumentURI(),
                                                 0, aString, nullptr)) {
     return;
   }
 
-  RefPtr<ComputedStyle> styleContext =
-    nsComputedDOMStyle::GetComputedStyle(aTargetElement, nullptr);
+  RefPtr<nsStyleContext> styleContext =
+    nsComputedDOMStyle::GetStyleContext(aTargetElement, nullptr);
   if (!styleContext) {
     return;
   }
 
-  ServoAnimationValues parsedValues =
-    ValueFromStringHelper(aPropID, aTargetElement, presContext,
-                          styleContext, aString);
-  if (aIsContextSensitive) {
-    // FIXME: Bug 1358955 - detect context-sensitive values and set this value
-    // appropriately.
-    *aIsContextSensitive = false;
+  if (styleContext->IsServo()) {
+    ServoAnimationValues parsedValues =
+      ValueFromStringHelper(aPropID, aTargetElement, presContext,
+                            styleContext, aString);
+    if (aIsContextSensitive) {
+      // FIXME: Bug 1358955 - detect context-sensitive values and set this value
+      // appropriately.
+      *aIsContextSensitive = false;
+    }
+
+    if (!parsedValues.IsEmpty()) {
+      sSingleton.Init(aValue);
+      aValue.mU.mPtr = new ValueWrapper(aPropID, Move(parsedValues));
+    }
+    return;
   }
 
-  if (!parsedValues.IsEmpty()) {
-    sSingleton.Init(aValue);
-    aValue.mU.mPtr = new ValueWrapper(aPropID, Move(parsedValues));
-  }
+    MOZ_CRASH("old style system disabled");
 }
 
 // static
 nsSMILValue
 nsSMILCSSValueType::ValueFromAnimationValue(nsCSSPropertyID aPropID,
                                             Element* aTargetElement,
                                             const AnimationValue& aValue)
 {
--- a/dom/smil/nsSMILCompositor.cpp
+++ b/dom/smil/nsSMILCompositor.cpp
@@ -52,26 +52,26 @@ nsSMILCompositor::AddAnimationFunction(n
 void
 nsSMILCompositor::ComposeAttribute(bool& aMightHavePendingStyleUpdates)
 {
   if (!mKey.mElement)
     return;
 
   // If we might need to resolve base styles, grab a suitable style context
   // for initializing our nsISMILAttr with.
-  RefPtr<ComputedStyle> baseComputedStyle;
+  RefPtr<nsStyleContext> baseStyleContext;
   if (MightNeedBaseStyle()) {
-    baseComputedStyle =
-      nsComputedDOMStyle::GetUnanimatedComputedStyleNoFlush(mKey.mElement,
-                                                            nullptr);
+    baseStyleContext =
+      nsComputedDOMStyle::GetUnanimatedStyleContextNoFlush(mKey.mElement,
+                                                           nullptr);
   }
 
   // FIRST: Get the nsISMILAttr (to grab base value from, and to eventually
   // give animated value to)
-  UniquePtr<nsISMILAttr> smilAttr = CreateSMILAttr(baseComputedStyle);
+  UniquePtr<nsISMILAttr> smilAttr = CreateSMILAttr(baseStyleContext);
   if (!smilAttr) {
     // Target attribute not found (or, out of memory)
     return;
   }
   if (mAnimationFunctions.IsEmpty()) {
     // No active animation functions. (We can still have a nsSMILCompositor in
     // that case if an animation function has *just* become inactive)
     smilAttr->ClearAnimValue();
@@ -129,23 +129,23 @@ nsSMILCompositor::ClearAnimationEffects(
     return;
   }
   smilAttr->ClearAnimValue();
 }
 
 // Protected Helper Functions
 // --------------------------
 UniquePtr<nsISMILAttr>
-nsSMILCompositor::CreateSMILAttr(ComputedStyle* aBaseComputedStyle)
+nsSMILCompositor::CreateSMILAttr(nsStyleContext* aBaseStyleContext)
 {
   nsCSSPropertyID propID = GetCSSPropertyToAnimate();
 
   if (propID != eCSSProperty_UNKNOWN) {
     return MakeUnique<nsSMILCSSProperty>(propID, mKey.mElement.get(),
-                                         aBaseComputedStyle);
+                                         aBaseStyleContext);
   }
 
   return mKey.mElement->GetAnimatedAttr(mKey.mAttributeNamespaceID,
                                         mKey.mAttributeName);
 }
 
 nsCSSPropertyID
 nsSMILCompositor::GetCSSPropertyToAnimate() const
--- a/dom/smil/nsSMILCompositor.h
+++ b/dom/smil/nsSMILCompositor.h
@@ -70,20 +70,20 @@ public:
   // Transfers |aOther|'s mCachedBaseValue to |this|
   void StealCachedBaseValue(nsSMILCompositor* aOther) {
     mCachedBaseValue = mozilla::Move(aOther->mCachedBaseValue);
   }
 
  private:
   // Create a nsISMILAttr for my target, on the heap.
   //
-  // @param aBaseComputedStyle  An optional style context which, if set, will be
+  // @param aBaseStyleContext  An optional style context which, if set, will be
   //                           used when fetching the base style.
   mozilla::UniquePtr<nsISMILAttr>
-  CreateSMILAttr(mozilla::ComputedStyle* aBaseComputedStyle);
+  CreateSMILAttr(nsStyleContext* aBaseStyleContext);
 
   // Returns the CSS property this compositor should animate, or
   // eCSSProperty_UNKNOWN if this compositor does not animate a CSS property.
   nsCSSPropertyID GetCSSPropertyToAnimate() const;
 
   // Returns true if we might need to refer to base styles (i.e. we are
   // targeting a CSS property and have one or more animation functions that
   // don't just replace the underlying value).
--- a/dom/svg/SVGContentUtils.cpp
+++ b/dom/svg/SVGContentUtils.cpp
@@ -23,17 +23,17 @@
 #include "nsLayoutUtils.h"
 #include "nsMathUtils.h"
 #include "SVGAnimationElement.h"
 #include "SVGAnimatedPreserveAspectRatio.h"
 #include "nsContentUtils.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/gfx/Types.h"
 #include "mozilla/FloatingPoint.h"
-#include "mozilla/ComputedStyle.h"
+#include "nsStyleContext.h"
 #include "nsSVGPathDataParser.h"
 #include "SVGPathData.h"
 #include "SVGPathElement.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::dom::SVGPreserveAspectRatioBinding;
 using namespace mozilla::gfx;
@@ -166,26 +166,26 @@ GetStrokeDashData(SVGContentUtils::AutoS
   }
 
   return eDashedStroke;
 }
 
 void
 SVGContentUtils::GetStrokeOptions(AutoStrokeOptions* aStrokeOptions,
                                   nsSVGElement* aElement,
-                                  ComputedStyle* aComputedStyle,
+                                  nsStyleContext* aStyleContext,
                                   SVGContextPaint* aContextPaint,
                                   StrokeOptionFlags aFlags)
 {
-  RefPtr<ComputedStyle> styleContext;
-  if (aComputedStyle) {
-    styleContext = aComputedStyle;
+  RefPtr<nsStyleContext> styleContext;
+  if (aStyleContext) {
+    styleContext = aStyleContext;
   } else {
     styleContext =
-      nsComputedDOMStyle::GetComputedStyleNoFlush(aElement, nullptr);
+      nsComputedDOMStyle::GetStyleContextNoFlush(aElement, nullptr);
   }
 
   if (!styleContext) {
     return;
   }
 
   const nsStyleSVG* styleSVG = styleContext->StyleSVG();
 
@@ -240,25 +240,25 @@ SVGContentUtils::GetStrokeOptions(AutoSt
         aStrokeOptions->mLineCap = CapStyle::SQUARE;
         break;
     }
   }
 }
 
 Float
 SVGContentUtils::GetStrokeWidth(nsSVGElement* aElement,
-                                ComputedStyle* aComputedStyle,
+                                nsStyleContext* aStyleContext,
                                 SVGContextPaint* aContextPaint)
 {
-  RefPtr<ComputedStyle> styleContext;
-  if (aComputedStyle) {
-    styleContext = aComputedStyle;
+  RefPtr<nsStyleContext> styleContext;
+  if (aStyleContext) {
+    styleContext = aStyleContext;
   } else {
     styleContext =
-      nsComputedDOMStyle::GetComputedStyleNoFlush(aElement, nullptr);
+      nsComputedDOMStyle::GetStyleContextNoFlush(aElement, nullptr);
   }
 
   if (!styleContext) {
     return 0.0f;
   }
 
   const nsStyleSVG* styleSVG = styleContext->StyleSVG();
 
@@ -270,81 +270,81 @@ SVGContentUtils::GetStrokeWidth(nsSVGEle
 }
 
 float
 SVGContentUtils::GetFontSize(Element *aElement)
 {
   if (!aElement)
     return 1.0f;
 
-  RefPtr<ComputedStyle> styleContext =
-    nsComputedDOMStyle::GetComputedStyleNoFlush(aElement, nullptr);
+  RefPtr<nsStyleContext> styleContext =
+    nsComputedDOMStyle::GetStyleContextNoFlush(aElement, nullptr);
   if (!styleContext) {
     // ReportToConsole
     NS_WARNING("Couldn't get style context for content in GetFontStyle");
     return 1.0f;
   }
 
   return GetFontSize(styleContext);
 }
 
 float
 SVGContentUtils::GetFontSize(nsIFrame *aFrame)
 {
   MOZ_ASSERT(aFrame, "NULL frame in GetFontSize");
-  return GetFontSize(aFrame->Style());
+  return GetFontSize(aFrame->StyleContext());
 }
 
 float
-SVGContentUtils::GetFontSize(ComputedStyle *aComputedStyle)
+SVGContentUtils::GetFontSize(nsStyleContext *aStyleContext)
 {
-  MOZ_ASSERT(aComputedStyle, "NULL style context in GetFontSize");
+  MOZ_ASSERT(aStyleContext, "NULL style context in GetFontSize");
 
-  nsPresContext *presContext = aComputedStyle->PresContext();
+  nsPresContext *presContext = aStyleContext->PresContext();
   MOZ_ASSERT(presContext, "NULL pres context in GetFontSize");
 
-  nscoord fontSize = aComputedStyle->StyleFont()->mSize;
+  nscoord fontSize = aStyleContext->StyleFont()->mSize;
   return nsPresContext::AppUnitsToFloatCSSPixels(fontSize) /
          presContext->EffectiveTextZoom();
 }
 
 float
 SVGContentUtils::GetFontXHeight(Element *aElement)
 {
   if (!aElement)
     return 1.0f;
 
-  RefPtr<ComputedStyle> styleContext =
-    nsComputedDOMStyle::GetComputedStyleNoFlush(aElement, nullptr);
+  RefPtr<nsStyleContext> styleContext =
+    nsComputedDOMStyle::GetStyleContextNoFlush(aElement, nullptr);
   if (!styleContext) {
     // ReportToConsole
     NS_WARNING("Couldn't get style context for content in GetFontStyle");
     return 1.0f;
   }
 
   return GetFontXHeight(styleContext);
 }
 
 float
 SVGContentUtils::GetFontXHeight(nsIFrame *aFrame)
 {
   MOZ_ASSERT(aFrame, "NULL frame in GetFontXHeight");
-  return GetFontXHeight(aFrame->Style());
+  return GetFontXHeight(aFrame->StyleContext());
 }
 
 float
-SVGContentUtils::GetFontXHeight(ComputedStyle *aComputedStyle)
+SVGContentUtils::GetFontXHeight(nsStyleContext *aStyleContext)
 {
-  MOZ_ASSERT(aComputedStyle, "NULL style context in GetFontXHeight");
+  MOZ_ASSERT(aStyleContext, "NULL style context in GetFontXHeight");
 
-  nsPresContext *presContext = aComputedStyle->PresContext();
+  nsPresContext *presContext = aStyleContext->PresContext();
   MOZ_ASSERT(presContext, "NULL pres context in GetFontXHeight");
 
   RefPtr<nsFontMetrics> fontMetrics =
-    nsLayoutUtils::GetFontMetricsForComputedStyle(aComputedStyle);
+    nsLayoutUtils::GetFontMetricsForStyleContext(aStyleContext);
 
   if (!fontMetrics) {
     // ReportToConsole
     NS_WARNING("no FontMetrics in GetFontXHeight()");
     return 1.0f;
   }
 
   nscoord xHeight = fontMetrics->XHeight();
--- a/dom/svg/SVGContentUtils.h
+++ b/dom/svg/SVGContentUtils.h
@@ -15,21 +15,21 @@
 #include "mozilla/RangedPtr.h"
 #include "nsError.h"
 #include "nsStringFwd.h"
 #include "gfx2DGlue.h"
 
 class nsIContent;
 class nsIDocument;
 class nsIFrame;
+class nsStyleContext;
 class nsStyleCoord;
 class nsSVGElement;
 
 namespace mozilla {
-class ComputedStyle;
 class nsSVGAnimatedTransformList;
 class SVGAnimatedPreserveAspectRatio;
 class SVGContextPaint;
 class SVGPreserveAspectRatio;
 namespace dom {
 class Element;
 class SVGSVGElement;
 class SVGViewportElement;
@@ -70,17 +70,16 @@ enum SVGTransformTypes {
 
 /**
  * Functions generally used by SVG Content classes. Functions here
  * should not generally depend on layout methods/classes e.g. nsSVGUtils
  */
 class SVGContentUtils
 {
 public:
-  typedef mozilla::ComputedStyle ComputedStyle;
   typedef mozilla::gfx::Float Float;
   typedef mozilla::gfx::Matrix Matrix;
   typedef mozilla::gfx::Rect Rect;
   typedef mozilla::gfx::StrokeOptions StrokeOptions;
   typedef mozilla::SVGAnimatedPreserveAspectRatio SVGAnimatedPreserveAspectRatio;
   typedef mozilla::SVGPreserveAspectRatio SVGPreserveAspectRatio;
 
   /*
@@ -151,53 +150,53 @@ public:
   /**
    * Note: the linecap style returned in aStrokeOptions is not valid when
    * ShapeTypeHasNoCorners(aElement) == true && aFlags == eIgnoreStrokeDashing,
    * since when aElement has no corners the rendered linecap style depends on
    * whether or not the stroke is dashed.
    */
   static void GetStrokeOptions(AutoStrokeOptions* aStrokeOptions,
                                nsSVGElement* aElement,
-                               ComputedStyle* aComputedStyle,
+                               nsStyleContext* aStyleContext,
                                mozilla::SVGContextPaint* aContextPaint,
                                StrokeOptionFlags aFlags = eAllStrokeOptions);
 
   /**
    * Returns the current computed value of the CSS property 'stroke-width' for
-   * the given element. aComputedStyle may be provided as an optimization.
+   * the given element. aStyleContext may be provided as an optimization.
    * aContextPaint is also optional.
    *
    * Note that this function does NOT take account of the value of the 'stroke'
    * and 'stroke-opacity' properties to, say, return zero if they are "none" or
    * "0", respectively.
    */
   static Float GetStrokeWidth(nsSVGElement* aElement,
-                              ComputedStyle* aComputedStyle,
+                              nsStyleContext* aStyleContext,
                               mozilla::SVGContextPaint* aContextPaint);
 
   /*
    * Get the number of CSS px (user units) per em (i.e. the em-height in user
    * units) for an nsIContent
    *
    * XXX document the conditions under which these may fail, and what they
    * return in those cases.
    */
   static float GetFontSize(mozilla::dom::Element *aElement);
   static float GetFontSize(nsIFrame *aFrame);
-  static float GetFontSize(ComputedStyle *aComputedStyle);
+  static float GetFontSize(nsStyleContext *aStyleContext);
   /*
    * Get the number of CSS px (user units) per ex (i.e. the x-height in user
    * units) for an nsIContent
    *
    * XXX document the conditions under which these may fail, and what they
    * return in those cases.
    */
   static float GetFontXHeight(mozilla::dom::Element *aElement);
   static float GetFontXHeight(nsIFrame *aFrame);
-  static float GetFontXHeight(ComputedStyle *aComputedStyle);
+  static float GetFontXHeight(nsStyleContext *aStyleContext);
 
   /*
    * Report a localized error message to the error console.
    */
   static nsresult ReportToConsole(nsIDocument* doc,
                                   const char* aWarning,
                                   const char16_t **aParams,
                                   uint32_t aParamsLength);
--- a/dom/svg/SVGFEDropShadowElement.cpp
+++ b/dom/svg/SVGFEDropShadowElement.cpp
@@ -104,17 +104,17 @@ SVGFEDropShadowElement::GetPrimitiveDesc
                             SVGContentUtils::Y, &mNumberAttributes[DY])));
 
   FilterPrimitiveDescription descr(PrimitiveType::DropShadow);
   descr.Attributes().Set(eDropShadowStdDeviation, Size(stdX, stdY));
   descr.Attributes().Set(eDropShadowOffset, offset);
 
   nsIFrame* frame = GetPrimaryFrame();
   if (frame) {
-    ComputedStyle* style = frame->Style();
+    nsStyleContext* style = frame->StyleContext();
     Color color(Color::FromABGR(style->StyleSVGReset()->mFloodColor));
     color.a *= style->StyleSVGReset()->mFloodOpacity;
     descr.Attributes().Set(eDropShadowColor, color);
   } else {
     descr.Attributes().Set(eDropShadowColor, Color());
   }
   return descr;
 }
--- a/dom/svg/SVGFEFloodElement.cpp
+++ b/dom/svg/SVGFEFloodElement.cpp
@@ -38,17 +38,17 @@ FilterPrimitiveDescription
 SVGFEFloodElement::GetPrimitiveDescription(nsSVGFilterInstance* aInstance,
                                            const IntRect& aFilterSubregion,
                                            const nsTArray<bool>& aInputsAreTainted,
                                            nsTArray<RefPtr<SourceSurface>>& aInputImages)
 {
   FilterPrimitiveDescription descr(PrimitiveType::Flood);
   nsIFrame* frame = GetPrimaryFrame();
   if (frame) {
-    ComputedStyle* style = frame->Style();
+    nsStyleContext* style = frame->StyleContext();
     Color color(Color::FromABGR(style->StyleSVGReset()->mFloodColor));
     color.a *= style->StyleSVGReset()->mFloodOpacity;
     descr.Attributes().Set(eFloodColor, color);
   } else {
     descr.Attributes().Set(eFloodColor, Color());
   }
   return descr;
 }
--- a/dom/svg/SVGGeometryElement.cpp
+++ b/dom/svg/SVGGeometryElement.cpp
@@ -133,18 +133,18 @@ SVGGeometryElement::GetOrBuildPathForMea
   return GetOrBuildPath(drawTarget, fillRule);
 }
 
 FillRule
 SVGGeometryElement::GetFillRule()
 {
   FillRule fillRule = FillRule::FILL_WINDING; // Equivalent to StyleFillRule::Nonzero
 
-  RefPtr<ComputedStyle> styleContext =
-    nsComputedDOMStyle::GetComputedStyleNoFlush(this, nullptr);
+  RefPtr<nsStyleContext> styleContext =
+    nsComputedDOMStyle::GetStyleContextNoFlush(this, nullptr);
 
   if (styleContext) {
     MOZ_ASSERT(styleContext->StyleSVG()->mFillRule == StyleFillRule::Nonzero ||
                styleContext->StyleSVG()->mFillRule == StyleFillRule::Evenodd);
 
     if (styleContext->StyleSVG()->mFillRule == StyleFillRule::Evenodd) {
       fillRule = FillRule::FILL_EVEN_ODD;
     }
--- a/dom/svg/SVGPathElement.cpp
+++ b/dom/svg/SVGPathElement.cpp
@@ -293,18 +293,18 @@ SVGPathElement::BuildPath(PathBuilder* a
   // spec regarding zero length sub-paths when square line caps are in use,
   // SVGPathData needs to know our stroke-linecap style and, if "square", then
   // also our stroke width. See the comment for
   // ApproximateZeroLengthSubpathSquareCaps for more info.
 
   uint8_t strokeLineCap = NS_STYLE_STROKE_LINECAP_BUTT;
   Float strokeWidth = 0;
 
-  RefPtr<ComputedStyle> styleContext =
-    nsComputedDOMStyle::GetComputedStyleNoFlush(this, nullptr);
+  RefPtr<nsStyleContext> styleContext =
+    nsComputedDOMStyle::GetStyleContextNoFlush(this, nullptr);
   if (styleContext) {
     const nsStyleSVG* style = styleContext->StyleSVG();
     // Note: the path that we return may be used for hit-testing, and SVG
     // exposes hit-testing of strokes that are not actually painted. For that
     // reason we do not check for eStyleSVGPaintType_None or check the stroke
     // opacity here.
     if (style->mStrokeLinecap != NS_STYLE_STROKE_LINECAP_BUTT) {
       strokeLineCap = style->mStrokeLinecap;
--- a/dom/svg/nsSVGFilters.cpp
+++ b/dom/svg/nsSVGFilters.cpp
@@ -17,17 +17,17 @@
 #include "nsSVGFilterInstance.h"
 #include "nsSVGEnum.h"
 #include "SVGNumberList.h"
 #include "SVGAnimatedNumberList.h"
 #include "DOMSVGAnimatedNumberList.h"
 #include "nsSVGFilters.h"
 #include "nsLayoutUtils.h"
 #include "nsSVGUtils.h"
-#include "mozilla/ComputedStyle.h"
+#include "nsStyleContext.h"
 #include "nsIFrame.h"
 #include "imgIContainer.h"
 #include "mozilla/dom/SVGFilterElement.h"
 #include "nsSVGString.h"
 #include "SVGContentUtils.h"
 #include <algorithm>
 #include "mozilla/dom/SVGAnimatedLength.h"
 #include "mozilla/dom/SVGComponentTransferFunctionElement.h"
@@ -156,17 +156,17 @@ nsSVGFE::IsAttributeMapped(const nsAtom*
 
 
 bool
 nsSVGFE::StyleIsSetToSRGB()
 {
   nsIFrame* frame = GetPrimaryFrame();
   if (!frame) return false;
 
-  ComputedStyle* style = frame->Style();
+  nsStyleContext* style = frame->StyleContext();
   return style->StyleSVG()->mColorInterpolationFilters ==
            NS_STYLE_COLOR_INTERPOLATION_SRGB;
 }
 
 /* virtual */ bool
 nsSVGFE::HasValidDimensions() const
 {
   return (!mLengthAttributes[ATTR_WIDTH].IsExplicitlySet() ||
@@ -497,17 +497,17 @@ FilterPrimitiveDescription
 nsSVGFELightingElement::AddLightingAttributes(const FilterPrimitiveDescription& aDescription,
                                               nsSVGFilterInstance* aInstance)
 {
   nsIFrame* frame = GetPrimaryFrame();
   if (!frame) {
     return FilterPrimitiveDescription(PrimitiveType::Empty);
   }
 
-  ComputedStyle* style = frame->Style();
+  nsStyleContext* style = frame->StyleContext();
   Color color(Color::FromABGR(style->StyleSVGReset()->mLightingColor));
   color.a = 1.f;
   float surfaceScale = mNumberAttributes[SURFACE_SCALE].GetAnimValue();
   Size kernelUnitLength =
     GetKernelUnitLength(aInstance, &mNumberPairAttributes[KERNEL_UNIT_LENGTH]);
 
   if (kernelUnitLength.width <= 0 || kernelUnitLength.height <= 0) {
     // According to spec, A negative or zero value is an error. See link below for details.
--- a/dom/xbl/nsXBLResourceLoader.cpp
+++ b/dom/xbl/nsXBLResourceLoader.cpp
@@ -12,23 +12,23 @@
 #include "nsIPresShell.h"
 #include "nsXBLService.h"
 #include "nsIServiceManager.h"
 #include "nsXBLResourceLoader.h"
 #include "nsXBLPrototypeResources.h"
 #include "nsIDocumentObserver.h"
 #include "imgILoader.h"
 #include "imgRequestProxy.h"
-#include "mozilla/ComputedStyle.h"
 #include "mozilla/StyleSheet.h"
 #include "mozilla/StyleSheetInlines.h"
 #include "mozilla/css/Loader.h"
 #include "nsIURI.h"
 #include "nsNetUtil.h"
 #include "nsGkAtoms.h"
+#include "nsStyleContext.h"
 #include "nsXBLPrototypeBinding.h"
 #include "nsContentUtils.h"
 #include "nsIScriptSecurityManager.h"
 
 using namespace mozilla;
 
 NS_IMPL_CYCLE_COLLECTION(nsXBLResourceLoader, mBoundElements)
 
@@ -253,17 +253,17 @@ nsXBLResourceLoader::NotifyBoundElements
         // has a primary frame and whether it's in the undisplayed map
         // before sending a ContentInserted notification, or bad things
         // will happen.
         nsIPresShell *shell = doc->GetShell();
         if (shell) {
           nsIFrame* childFrame = content->GetPrimaryFrame();
           if (!childFrame) {
             // Check if it's in the display:none or display:contents maps.
-            ComputedStyle* sc =
+            nsStyleContext* sc =
               shell->FrameConstructor()->GetDisplayNoneStyleFor(content);
 
             if (!sc) {
               sc = shell->FrameConstructor()->GetDisplayContentsStyleFor(content);
             }
 
             if (!sc) {
               shell->PostRecreateFramesFor(content->AsElement());
--- a/dom/xbl/nsXBLService.cpp
+++ b/dom/xbl/nsXBLService.cpp
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/ArrayUtils.h"
-#include "mozilla/ComputedStyle.h"
 
 #include "nsCOMPtr.h"
 #include "nsNetUtil.h"
 #include "nsXBLService.h"
 #include "nsXBLWindowKeyHandler.h"
 #include "nsIInputStream.h"
 #include "nsNameSpaceManager.h"
 #include "nsIURI.h"
@@ -37,16 +36,17 @@
 #include "nsSyncLoadService.h"
 #include "nsContentPolicyUtils.h"
 #include "nsTArray.h"
 #include "nsError.h"
 
 #include "nsIPresShell.h"
 #include "nsIDocumentObserver.h"
 #include "nsFrameManager.h"
+#include "nsStyleContext.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsIScriptError.h"
 #include "nsXBLSerialize.h"
 
 #ifdef MOZ_XUL
 #include "nsXULPrototypeCache.h"
 #endif
 #include "nsIDOMEventListener.h"
--- a/editor/libeditor/EditorBase.cpp
+++ b/editor/libeditor/EditorBase.cpp
@@ -23,17 +23,16 @@
 #include "InsertNodeTransaction.h"      // for InsertNodeTransaction
 #include "InsertTextTransaction.h"      // for InsertTextTransaction
 #include "JoinNodeTransaction.h"        // for JoinNodeTransaction
 #include "PlaceholderTransaction.h"     // for PlaceholderTransaction
 #include "SplitNodeTransaction.h"       // for SplitNodeTransaction
 #include "StyleSheetTransactions.h"     // for AddStyleSheetTransaction, etc.
 #include "TextEditUtils.h"              // for TextEditUtils
 #include "mozilla/CheckedInt.h"         // for CheckedInt
-#include "mozilla/ComputedStyle.h"      // for ComputedStyle
 #include "mozilla/EditAction.h"         // for EditAction
 #include "mozilla/EditorDOMPoint.h"     // for EditorDOMPoint
 #include "mozilla/EditorSpellCheck.h"   // for EditorSpellCheck
 #include "mozilla/EditorUtils.h"        // for AutoRules, etc.
 #include "mozilla/EditTransactionBase.h" // for EditTransactionBase
 #include "mozilla/FlushType.h"          // for FlushType::Frames
 #include "mozilla/IMEContentObserver.h" // for IMEContentObserver
 #include "mozilla/IMEStateManager.h"    // for IMEStateManager
@@ -99,16 +98,17 @@
 #include "nsIWidget.h"                  // for nsIWidget, IMEState, etc.
 #include "nsPIDOMWindow.h"              // for nsPIDOMWindow
 #include "nsPresContext.h"              // for nsPresContext
 #include "nsRange.h"                    // for nsRange
 #include "nsReadableUtils.h"            // for EmptyString, ToNewCString
 #include "nsString.h"                   // for nsAutoString, nsString, etc.
 #include "nsStringFwd.h"                // for nsString
 #include "nsStyleConsts.h"              // for NS_STYLE_DIRECTION_RTL, etc.
+#include "nsStyleContext.h"             // for nsStyleContext
 #include "nsStyleStruct.h"              // for nsStyleDisplay, nsStyleText, etc.
 #include "nsStyleStructFwd.h"           // for nsIFrame::StyleUIReset, etc.
 #include "nsTextNode.h"                 // for nsTextNode
 #include "nsThreadUtils.h"              // for nsRunnable
 #include "nsTransactionManager.h"       // for nsTransactionManager
 #include "prtime.h"                     // for PR_Now
 
 class nsIOutputStream;
@@ -4104,23 +4104,23 @@ EditorBase::IsPreformatted(nsIDOMNode* a
   nsCOMPtr<nsIContent> content = do_QueryInterface(aNode);
 
   NS_ENSURE_TRUE(aResult && content, NS_ERROR_NULL_POINTER);
 
   nsCOMPtr<nsIPresShell> ps = GetPresShell();
   NS_ENSURE_TRUE(ps, NS_ERROR_NOT_INITIALIZED);
 
   // Look at the node (and its parent if it's not an element), and grab its style context
-  RefPtr<ComputedStyle> elementStyle;
+  RefPtr<nsStyleContext> elementStyle;
   if (!content->IsElement()) {
     content = content->GetParent();
   }
   if (content && content->IsElement()) {
     elementStyle =
-      nsComputedDOMStyle::GetComputedStyleNoFlush(content->AsElement(), nullptr);
+      nsComputedDOMStyle::GetStyleContextNoFlush(content->AsElement(), nullptr);
   }
 
   if (!elementStyle) {
     // Consider nodes without a style context to be NOT preformatted:
     // For instance, this is true of JS tags inside the body (which show
     // up as #text nodes but have no style context).
     *aResult = false;
     return NS_OK;
--- a/editor/libeditor/HTMLAbsPositionEditor.cpp
+++ b/editor/libeditor/HTMLAbsPositionEditor.cpp
@@ -616,18 +616,18 @@ HTMLEditor::GetTemporaryStyleForFocusedP
   rv =
     CSSEditUtils::GetComputedProperty(aElement, *nsGkAtoms::backgroundColor,
                                       bgColorStr);
   NS_ENSURE_SUCCESS(rv, rv);
   if (!bgColorStr.EqualsLiteral("rgba(0, 0, 0, 0)")) {
     return NS_OK;
   }
 
-  RefPtr<ComputedStyle> style =
-    nsComputedDOMStyle::GetComputedStyle(&aElement, nullptr);
+  RefPtr<nsStyleContext> style =
+    nsComputedDOMStyle::GetStyleContext(&aElement, nullptr);
   NS_ENSURE_STATE(style);
 
   const uint8_t kBlackBgTrigger = 0xd0;
 
   nscolor color = style->StyleColor()->mColor;
   if (NS_GET_R(color) >= kBlackBgTrigger &&
       NS_GET_G(color) >= kBlackBgTrigger &&
       NS_GET_B(color) >= kBlackBgTrigger) {
--- a/js/src/devtools/rootAnalysis/analyzeHeapWrites.js
+++ b/js/src/devtools/rootAnalysis/analyzeHeapWrites.js
@@ -471,17 +471,17 @@ function ignoreContents(entry)
 
         // These could probably be handled by treating the scope of PSAutoLock
         // aka BaseAutoLock<PSMutex> as threadsafe.
         /profiler_register_thread/,
         /profiler_unregister_thread/,
 
         // The analysis thinks we'll write to mBits in the DoGetStyleFoo<false>
         // call.  Maybe the template parameter confuses it?
-        /ComputedStyle::PeekStyle/,
+        /nsStyleContext::PeekStyle/,
 
         // The analysis can't cope with the indirection used for the objects
         // being initialized here, from nsCSSValue::Array::Create to the return
         // value of the Item(i) getter.
         /nsCSSValue::SetCalcValue/,
 
         // Unable to analyze safety of linked list initialization.
         "Gecko_NewCSSValueSharedList",
--- a/layout/base/ArenaRefPtrInlines.h
+++ b/layout/base/ArenaRefPtrInlines.h
@@ -8,31 +8,31 @@
 /* inline methods that belong in ArenaRefPtr.h, except that they require
    the inclusion of headers for all types that ArenaRefPtr can handle */
 
 #ifndef mozilla_ArenaRefPtrInlines_h
 #define mozilla_ArenaRefPtrInlines_h
 
 #include "mozilla/ArenaObjectID.h"
 #include "mozilla/Assertions.h"
-#include "mozilla/ComputedStyle.h"
 #include "nsStyleStruct.h"
+#include "nsStyleContext.h"
 
 namespace mozilla {
 
 template<typename T>
 void
 ArenaRefPtr<T>::AssertValidType()
 {
   // If adding new types, please update nsPresArena::ClearArenaRefPtrWithoutDeregistering
   // as well
-  static_assert(IsSame<T, ComputedStyle>::value,
-                "ArenaRefPtr<T> template parameter T must be declared in "
-                "nsPresArenaObjectList and explicitly handled in"
-                "nsPresArena.cpp");
+  static_assert(IsSame<T, GeckoStyleContext>::value || IsSame<T, nsStyleContext>::value,
+                 "ArenaRefPtr<T> template parameter T must be declared in "
+                 "nsPresArenaObjectList and explicitly handled in"
+                 "nsPresArena.cpp");
 }
 
 } // namespace mozilla
 
 template<typename T>
 void
 nsPresArena::RegisterArenaRefPtr(mozilla::ArenaRefPtr<T>* aPtr)
 {
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -1336,21 +1336,21 @@ PresShell::Destroy()
   // pointing to objects in the arena now.  This is done:
   //
   //   (a) before mFrameArena's destructor runs so that our
   //       mAllocatedPointers becomes empty and doesn't trip the assertion
   //       in ~PresShell,
   //   (b) before the mPresContext->DetachShell() below, so
   //       that when we clear the ArenaRefPtrs they'll still be able to
   //       get back to this PresShell to deregister themselves (e.g. note
-  //       how ComputedStyle::Arena returns the PresShell got from its
+  //       how nsStyleContext::Arena returns the PresShell got from its
   //       rule node's nsPresContext, which would return null if we'd already
   //       called mPresContext->DetachShell()), and
   //   (c) before the mStyleSet->BeginShutdown() call just below, so that
-  //       the ComputedStyles don't complain they're being destroyed later
+  //       the nsStyleContexts don't complain they're being destroyed later
   //       than the rule tree is.
   mFrameArena.ClearArenaRefPtrs();
 
   mStyleSet->BeginShutdown();
   nsRefreshDriver* rd = GetPresContext()->RefreshDriver();
 
   // This shell must be removed from the document before the frame
   // hierarchy is torn down to avoid finding deleted frames through
@@ -5358,17 +5358,17 @@ nscolor PresShell::GetDefaultBackgroundC
 
 void PresShell::UpdateCanvasBackground()
 {
   // If we have a frame tree and it has style information that
   // specifies the background color of the canvas, update our local
   // cache of that color.
   nsIFrame* rootStyleFrame = FrameConstructor()->GetRootElementStyleFrame();
   if (rootStyleFrame) {
-    ComputedStyle* bgStyle =
+    nsStyleContext* bgStyle =
       nsCSSRendering::FindRootFrameBackground(rootStyleFrame);
     // XXX We should really be passing the canvasframe, not the root element
     // style frame but we don't have access to the canvasframe here. It isn't
     // a problem because only a few frames can return something other than true
     // and none of them would be a canvas frame or root element style frame.
     bool drawBackgroundImage;
     bool drawBackgroundColor;
     mCanvasBackgroundColor =
@@ -9075,17 +9075,17 @@ PresShell::WindowSizeMoveDone()
   if (mPresContext) {
     EventStateManager::ClearGlobalActiveContent(nullptr);
     ClearMouseCapture(nullptr);
   }
 }
 
 #ifdef MOZ_XUL
 /*
- * It's better to add stuff to the |DidSetComputedStyle| method of the
+ * It's better to add stuff to the |DidSetStyleContext| method of the
  * relevant frames than adding it here.  These methods should (ideally,
  * anyway) go away.
  */
 
 // Return value says whether to walk children.
 typedef bool (*frameWalkerFn)(nsIFrame* aFrame);
 
 static bool
@@ -9712,29 +9712,29 @@ PresShell::VerifyIncrementalReflow()
     printf("Finished Verifying Reflow...\n");
   }
 
   return ok;
 }
 
 // Layout debugging hooks
 void
-PresShell::ListComputedStyles(FILE *out, int32_t aIndent)
+PresShell::ListStyleContexts(FILE *out, int32_t aIndent)
 {
   nsIFrame* rootFrame = GetRootFrame();
   if (rootFrame) {
-    rootFrame->Style()->List(out, aIndent);
+    rootFrame->StyleContext()->List(out, aIndent);
   }
 
   // The root element's frame's style context is the root of a separate tree.
   Element* rootElement = mDocument->GetRootElement();
   if (rootElement) {
     nsIFrame* rootElementFrame = rootElement->GetPrimaryFrame();
     if (rootElementFrame) {
-      rootElementFrame->Style()->List(out, aIndent);
+      rootElementFrame->StyleContext()->List(out, aIndent);
     }
   }
 }
 
 void
 PresShell::ListStyleSheets(FILE *out, int32_t aIndent)
 {
   int32_t sheetCount = mStyleSet->SheetCount(SheetType::Doc);
--- a/layout/base/PresShell.h
+++ b/layout/base/PresShell.h
@@ -312,17 +312,17 @@ public:
                   nsIFrame * aFrame,
                   const nsPoint& aOffset,
                   uint32_t aColor) override;
   void SetPaintFrameCount(bool aOn) override;
   bool IsPaintingFrameCounts() override;
 #endif
 
 #ifdef DEBUG
-  void ListComputedStyles(FILE *out, int32_t aIndent = 0) override;
+  void ListStyleContexts(FILE *out, int32_t aIndent = 0) override;
 
   void ListStyleSheets(FILE *out, int32_t aIndent = 0) override;
   void VerifyStyleTree() override;
 #endif
 
   static LazyLogModule gLog;
 
   void DisableNonTestMouseEvents(bool aDisable) override;
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -1141,17 +1141,17 @@ ApplyRenderingChangeToTree(nsIPresShell*
 // Trigger rendering updates by damaging this frame and any
 // continuations of this frame.
 #ifdef DEBUG
   gInApplyRenderingChangeToTree = true;
 #endif
   if (aChange & nsChangeHint_RepaintFrame) {
     // If the frame's background is propagated to an ancestor, walk up to
     // that ancestor and apply the RepaintFrame change hint to it.
-    ComputedStyle* bgSC;
+    nsStyleContext* bgSC;
     nsIFrame* propagatedFrame = aFrame;
     while (!nsCSSRendering::FindBackground(propagatedFrame, &bgSC)) {
       propagatedFrame = propagatedFrame->GetParent();
       NS_ASSERTION(aFrame, "root frame must paint");
     }
 
     if (propagatedFrame != aFrame) {
       DoApplyRenderingChangeToTree(propagatedFrame, nsChangeHint_RepaintFrame);
@@ -1777,18 +1777,18 @@ RestyleManager::AddLayerChangesForAnimat
   for (const LayerAnimationInfo::Record& layerInfo :
          LayerAnimationInfo::sRecords) {
     layers::Layer* layer =
       FrameLayerBuilder::GetDedicatedLayer(aFrame, layerInfo.mLayerType);
     if (layer && frameGeneration != layer->GetAnimationGeneration()) {
       // If we have a transform layer but don't have any transform style, we
       // probably just removed the transform but haven't destroyed the layer
       // yet. In this case we will add the appropriate change hint
-      // (nsChangeHint_UpdateContainingBlock) when we compare styles so we can
-      // skip adding any change hint here. (If we *were* to add
+      // (nsChangeHint_UpdateContainingBlock) when we compare style contexts
+      // so we can skip adding any change hint here. (If we *were* to add
       // nsChangeHint_UpdateTransformLayer, ApplyRenderingChangeToTree would
       // complain that we're updating a transform layer without a transform).
       if (layerInfo.mLayerType == DisplayItemType::TYPE_TRANSFORM &&
           !aFrame->StyleDisplay()->HasTransformStyle()) {
         continue;
       }
       hint |= layerInfo.mChangeHint;
     }
--- a/layout/base/RestyleManager.h
+++ b/layout/base/RestyleManager.h
@@ -97,19 +97,19 @@ public:
     // ensure that aRestyleManager lives at least as long as the
     // object.  (This is generally easy since the caller is typically a
     // method of RestyleManager.)
     explicit AnimationsWithDestroyedFrame(RestyleManager* aRestyleManager);
 
     // This method takes the content node for the generated content for
     // animation/transition on ::before and ::after, rather than the
     // content node for the real element.
-    void Put(nsIContent* aContent, ComputedStyle* aComputedStyle) {
+    void Put(nsIContent* aContent, nsStyleContext* aStyleContext) {
       MOZ_ASSERT(aContent);
-      CSSPseudoElementType pseudoType = aComputedStyle->GetPseudoType();
+      CSSPseudoElementType pseudoType = aStyleContext->GetPseudoType();
       if (pseudoType == CSSPseudoElementType::NotPseudo) {
         mContents.AppendElement(aContent);
       } else if (pseudoType == CSSPseudoElementType::before) {
         MOZ_ASSERT(aContent->NodeInfo()->NameAtom() ==
                      nsGkAtoms::mozgeneratedcontentbefore);
         mBeforeContents.AppendElement(aContent->GetParent());
       } else if (pseudoType == CSSPseudoElementType::after) {
         MOZ_ASSERT(aContent->NodeInfo()->NameAtom() ==
@@ -184,17 +184,17 @@ public:
                                   nsAtom* aAttribute,
                                   int32_t aModType,
                                   const nsAttrValue* aNewValue);
   inline void AttributeChanged(dom::Element* aElement,
                                int32_t aNameSpaceID,
                                nsAtom* aAttribute,
                                int32_t aModType,
                                const nsAttrValue* aOldValue);
-  inline nsresult ReparentComputedStyle(nsIFrame* aFrame);
+  inline nsresult ReparentStyleContext(nsIFrame* aFrame);
 
   inline void UpdateOnlyAnimationStyles();
 
   // Get a counter that increments on every style change, that we use to
   // track whether off-main-thread animations are up-to-date.
   uint64_t GetAnimationGeneration() const { return mAnimationGeneration; }
 
   static uint64_t GetAnimationGenerationForFrame(nsIFrame* aFrame);
--- a/layout/base/RestyleManagerInlines.h
+++ b/layout/base/RestyleManagerInlines.h
@@ -68,19 +68,19 @@ RestyleManager::AttributeChanged(dom::El
                                  int32_t aModType,
                                  const nsAttrValue* aOldValue)
 {
   MOZ_STYLO_FORWARD(AttributeChanged, (aElement, aNameSpaceID, aAttribute,
                                        aModType, aOldValue));
 }
 
 nsresult
-RestyleManager::ReparentComputedStyle(nsIFrame* aFrame)
+RestyleManager::ReparentStyleContext(nsIFrame* aFrame)
 {
-  MOZ_STYLO_FORWARD(ReparentComputedStyle, (aFrame));
+  MOZ_STYLO_FORWARD(ReparentStyleContext, (aFrame));
 }
 
 void
 RestyleManager::UpdateOnlyAnimationStyles()
 {
   MOZ_STYLO_FORWARD(UpdateOnlyAnimationStyles, ());
 }
 
--- a/layout/base/ServoRestyleManager.cpp
+++ b/layout/base/ServoRestyleManager.cpp
@@ -3,21 +3,21 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/ServoRestyleManager.h"
 
 #include "mozilla/AutoRestyleTimelineMarker.h"
 #include "mozilla/AutoTimelineMarker.h"
-#include "mozilla/ComputedStyle.h"
-#include "mozilla/ComputedStyleInlines.h"
 #include "mozilla/DocumentStyleRootIterator.h"
 #include "mozilla/ServoBindings.h"
 #include "mozilla/ServoStyleSet.h"
+#include "mozilla/ServoStyleContext.h"
+#include "mozilla/ServoStyleContextInlines.h"
 #include "mozilla/Unused.h"
 #include "mozilla/ViewportFrame.h"
 #include "mozilla/dom/ChildIterator.h"
 #include "mozilla/dom/ElementInlines.h"
 #include "nsBlockFrame.h"
 #include "nsBulletFrame.h"
 #include "nsIFrameInlines.h"
 #include "nsImageFrame.h"
@@ -35,17 +35,17 @@
 using namespace mozilla::dom;
 
 namespace mozilla {
 
 #ifdef DEBUG
 static bool
 IsAnonBox(const nsIFrame& aFrame)
 {
-  return aFrame.Style()->IsAnonBox();
+  return aFrame.StyleContext()->IsAnonBox();
 }
 
 static const nsIFrame*
 FirstContinuationOrPartOfIBSplit(const nsIFrame* aFrame)
 {
   if (!aFrame) {
     return nullptr;
   }
@@ -100,17 +100,17 @@ ExpectedOwnerForChild(const nsIFrame& aF
   }
 
   parent = FirstContinuationOrPartOfIBSplit(parent);
 
   // We've handled already anon boxes and bullet frames, so now we're looking at
   // a frame of a DOM element or pseudo. Hop through anon and line-boxes
   // generated by our DOM parent, and go find the owner frame for it.
   while (parent && (IsAnonBox(*parent) || parent->IsLineFrame())) {
-    auto* pseudo = parent->Style()->GetPseudo();
+    auto* pseudo = parent->StyleContext()->GetPseudo();
     if (pseudo == nsCSSAnonBoxes::tableWrapper) {
       const nsIFrame* tableFrame = parent->PrincipalChildList().FirstChild();
       MOZ_ASSERT(tableFrame->IsTableFrame());
       // Handle :-moz-table and :-moz-inline-table.
       parent = IsAnonBox(*tableFrame) ? parent->GetParent() : tableFrame;
     } else {
       // We get the in-flow parent here so that we can handle the OOF anonymous
       // boxed to get the correct parent.
@@ -162,26 +162,26 @@ ServoRestyleState::ChangesHandledFor(con
              "Missed some frame in the hierarchy?");
   return mChangesHandled;
 }
 #endif
 
 void
 ServoRestyleState::AddPendingWrapperRestyle(nsIFrame* aWrapperFrame)
 {
-  MOZ_ASSERT(aWrapperFrame->Style()->IsWrapperAnonBox(),
+  MOZ_ASSERT(aWrapperFrame->StyleContext()->IsWrapperAnonBox(),
              "All our wrappers are anon boxes, and why would we restyle "
              "non-inheriting ones?");
-  MOZ_ASSERT(aWrapperFrame->Style()->IsInheritingAnonBox(),
+  MOZ_ASSERT(aWrapperFrame->StyleContext()->IsInheritingAnonBox(),
              "All our wrappers are anon boxes, and why would we restyle "
              "non-inheriting ones?");
-  MOZ_ASSERT(aWrapperFrame->Style()->GetPseudo() !=
+  MOZ_ASSERT(aWrapperFrame->StyleContext()->GetPseudo() !=
              nsCSSAnonBoxes::cellContent,
              "Someone should be using TableAwareParentFor");
-  MOZ_ASSERT(aWrapperFrame->Style()->GetPseudo() !=
+  MOZ_ASSERT(aWrapperFrame->StyleContext()->GetPseudo() !=
              nsCSSAnonBoxes::tableWrapper,
              "Someone should be using TableAwareParentFor");
   // Make sure we only add first continuations.
   aWrapperFrame = aWrapperFrame->FirstContinuation();
   nsIFrame* last = mPendingWrapperRestyles.SafeLastElement(nullptr);
   if (last == aWrapperFrame) {
     // Already queued up, nothing to do.
     return;
@@ -216,17 +216,17 @@ size_t
 ServoRestyleState::ProcessMaybeNestedWrapperRestyle(nsIFrame* aParent,
                                                     size_t aIndex)
 {
   // The frame at index aIndex is something we should restyle ourselves, but
   // following frames may need separate ServoRestyleStates to restyle.
   MOZ_ASSERT(aIndex < mPendingWrapperRestyles.Length());
 
   nsIFrame* cur = mPendingWrapperRestyles[aIndex];
-  MOZ_ASSERT(cur->Style()->IsWrapperAnonBox());
+  MOZ_ASSERT(cur->StyleContext()->IsWrapperAnonBox());
 
   // Where is cur supposed to inherit from?  From its parent frame, except in
   // the case when cur is a table, in which case it should be its grandparent.
   // Also, not in the case when the resulting frame would be a first-line; in
   // that case we should be inheriting from the block, and the first-line will
   // do its fixup later if needed.
   //
   // Note that after we do all that fixup the parent we get might still not be
@@ -240,17 +240,17 @@ ServoRestyleState::ProcessMaybeNestedWra
   if (cur->IsTableFrame()) {
     MOZ_ASSERT(parent->IsTableWrapperFrame());
     parent = parent->GetParent();
   }
   if (parent->IsLineFrame()) {
     parent = parent->GetParent();
   }
   MOZ_ASSERT(FirstContinuationOrPartOfIBSplit(parent) == aParent ||
-             (parent->Style()->IsInheritingAnonBox() &&
+             (parent->StyleContext()->IsInheritingAnonBox() &&
               parent->GetContent() == aParent->GetContent()));
 
   // Now "this" is a ServoRestyleState for aParent, so if parent is not a next
   // continuation (possibly across ib splits) of aParent we need a new
   // ServoRestyleState for the kid.
   Maybe<ServoRestyleState> parentRestyleState;
   nsIFrame* parentForRestyle =
     nsLayoutUtils::FirstContinuationOrIBSplitSibling(parent);
@@ -300,17 +300,17 @@ ServoRestyleState::TableAwareParentFor(c
   // its table wrapper.
   if (aChild->IsTableFrame()) {
     aChild = aChild->GetParent();
     MOZ_ASSERT(aChild->IsTableWrapperFrame());
   }
 
   nsIFrame* parent = aChild->GetParent();
   // Now if parent is a cell-content frame, we actually want the cellframe.
-  if (parent->Style()->GetPseudo() == nsCSSAnonBoxes::cellContent) {
+  if (parent->StyleContext()->GetPseudo() == nsCSSAnonBoxes::cellContent) {
     parent = parent->GetParent();
   } else if (parent->IsTableWrapperFrame()) {
     // Must be a caption.  In that case we want the table here.
     MOZ_ASSERT(aChild->StyleDisplay()->mDisplay == StyleDisplay::TableCaption);
     parent = parent->PrincipalChildList().FirstChild();
   }
   return parent;
 }
@@ -476,52 +476,52 @@ ServoRestyleManager::ClearRestyleStateFr
  * This is currently used to properly compute change hints when the parent
  * element of this node is a display: contents node, and also to avoid computing
  * the style for text children more than once per element.
  */
 struct ServoRestyleManager::TextPostTraversalState
 {
 public:
   TextPostTraversalState(Element& aParentElement,
-                         ComputedStyle* aParentContext,
+                         ServoStyleContext* aParentContext,
                          bool aDisplayContentsParentStyleChanged,
                          ServoRestyleState& aParentRestyleState)
     : mParentElement(aParentElement)
     , mParentContext(aParentContext)
     , mParentRestyleState(aParentRestyleState)
     , mStyle(nullptr)
     , mShouldPostHints(aDisplayContentsParentStyleChanged)
     , mShouldComputeHints(aDisplayContentsParentStyleChanged)
     , mComputedHint(nsChangeHint_Empty)
   {}
 
   nsStyleChangeList& ChangeList() { return mParentRestyleState.ChangeList(); }
 
-  ComputedStyle& ComputeStyle(nsIContent* aTextNode)
+  nsStyleContext& ComputeStyle(nsIContent* aTextNode)
   {
     if (!mStyle) {
       mStyle = mParentRestyleState.StyleSet().ResolveStyleForText(
         aTextNode, &ParentStyle());
     }
     MOZ_ASSERT(mStyle);
     return *mStyle;
   }
 
   void ComputeHintIfNeeded(nsIContent* aContent,
                            nsIFrame* aTextFrame,
-                           ComputedStyle& aNewContext)
+                           nsStyleContext& aNewContext)
   {
     MOZ_ASSERT(aTextFrame);
     MOZ_ASSERT(aNewContext.GetPseudo() == nsCSSAnonBoxes::mozText);
 
     if (MOZ_LIKELY(!mShouldPostHints)) {
       return;
     }
 
-    ComputedStyle* oldContext = aTextFrame->Style()->AsServo();
+    ServoStyleContext* oldContext = aTextFrame->StyleContext()->AsServo();
     MOZ_ASSERT(oldContext->GetPseudo() == nsCSSAnonBoxes::mozText);
 
     // We rely on the fact that all the text children for the same element share
     // style to avoid recomputing style differences for all of them.
     //
     // TODO(emilio): The above may not be true for ::first-{line,letter}, but
     // we'll cross that bridge when we support those in stylo.
     if (mShouldComputeHints) {
@@ -537,41 +537,41 @@ public:
 
     if (mComputedHint) {
       mParentRestyleState.ChangeList().AppendChange(
         aTextFrame, aContent, mComputedHint);
     }
   }
 
 private:
-  ComputedStyle& ParentStyle() {
+  ServoStyleContext& ParentStyle() {
     if (!mParentContext) {
       mLazilyResolvedParentContext =
         mParentRestyleState.StyleSet().ResolveServoStyle(&mParentElement);
       mParentContext = mLazilyResolvedParentContext;
     }
     return *mParentContext;
   }
 
   Element& mParentElement;
-  ComputedStyle* mParentContext;
-  RefPtr<ComputedStyle> mLazilyResolvedParentContext;
+  ServoStyleContext* mParentContext;
+  RefPtr<ServoStyleContext> mLazilyResolvedParentContext;
   ServoRestyleState& mParentRestyleState;
-  RefPtr<ComputedStyle> mStyle;
+  RefPtr<nsStyleContext> mStyle;
   bool mShouldPostHints;
   bool mShouldComputeHints;
   nsChangeHint mComputedHint;
 };
 
 static void
 UpdateBackdropIfNeeded(nsIFrame* aFrame,
                        ServoStyleSet& aStyleSet,
                        nsStyleChangeList& aChangeList)
 {
-  const nsStyleDisplay* display = aFrame->Style()->StyleDisplay();
+  const nsStyleDisplay* display = aFrame->StyleContext()->StyleDisplay();
   if (display->mTopLayer != NS_STYLE_TOP_LAYER_TOP) {
     return;
   }
 
   // Elements in the top layer are guaranteed to have absolute or fixed
   // position per https://fullscreen.spec.whatwg.org/#new-stacking-layer.
   MOZ_ASSERT(display->IsAbsolutelyPositionedStyle());
 
@@ -580,23 +580,23 @@ UpdateBackdropIfNeeded(nsIFrame* aFrame,
   if (!backdropPlaceholder) {
     return;
   }
 
   MOZ_ASSERT(backdropPlaceholder->IsPlaceholderFrame());
   nsIFrame* backdropFrame =
     nsPlaceholderFrame::GetRealFrameForPlaceholder(backdropPlaceholder);
   MOZ_ASSERT(backdropFrame->IsBackdropFrame());
-  MOZ_ASSERT(backdropFrame->Style()->GetPseudoType() ==
+  MOZ_ASSERT(backdropFrame->StyleContext()->GetPseudoType() ==
              CSSPseudoElementType::backdrop);
 
-  RefPtr<ComputedStyle> newContext =
+  RefPtr<nsStyleContext> newContext =
     aStyleSet.ResolvePseudoElementStyle(aFrame->GetContent()->AsElement(),
                                         CSSPseudoElementType::backdrop,
-                                        aFrame->Style()->AsServo(),
+                                        aFrame->StyleContext()->AsServo(),
                                         /* aPseudoElement = */ nullptr);
 
   // NOTE(emilio): We can't use the changes handled for the owner of the
   // backdrop frame, since it's out of flow, and parented to the viewport or
   // canvas frame (depending on the `position` value).
   MOZ_ASSERT(backdropFrame->GetParent()->IsViewportFrame() ||
              backdropFrame->GetParent()->IsCanvasFrame());
   nsTArray<nsIFrame*> wrappersToRestyle;
@@ -621,31 +621,31 @@ UpdateFirstLetterIfNeeded(nsIFrame* aFra
     block = block->GetParent();
   }
 
   static_cast<nsBlockFrame*>(block->FirstContinuation())->
     UpdateFirstLetterStyle(aRestyleState);
 }
 
 static void
-UpdateOneAdditionalComputedStyle(nsIFrame* aFrame,
+UpdateOneAdditionalStyleContext(nsIFrame* aFrame,
                                 uint32_t aIndex,
-                                ComputedStyle& aOldContext,
+                                ServoStyleContext& aOldContext,
                                 ServoRestyleState& aRestyleState)
 {
   auto pseudoType = aOldContext.GetPseudoType();
   MOZ_ASSERT(pseudoType != CSSPseudoElementType::NotPseudo);
   MOZ_ASSERT(
       !nsCSSPseudoElements::PseudoElementSupportsUserActionState(pseudoType));
 
-  RefPtr<ComputedStyle> newContext =
+  RefPtr<ServoStyleContext> newContext =
     aRestyleState.StyleSet().ResolvePseudoElementStyle(
         aFrame->GetContent()->AsElement(),
         pseudoType,
-        aFrame->Style()->AsServo(),
+        aFrame->StyleContext()->AsServo(),
         /* aPseudoElement = */ nullptr);
 
   uint32_t equalStructs, samePointerStructs; // Not used, actually.
   nsChangeHint childHint = aOldContext.CalcStyleDifference(
     newContext,
     &equalStructs,
     &samePointerStructs);
   if (!aFrame->HasAnyStateBits(NS_FRAME_OUT_OF_FLOW)) {
@@ -658,31 +658,31 @@ UpdateOneAdditionalComputedStyle(nsIFram
       // If we generate a reconstruct here, remove any non-reconstruct hints we
       // may have already generated for this content.
       aRestyleState.ChangeList().PopChangesForContent(aFrame->GetContent());
     }
     aRestyleState.ChangeList().AppendChange(
         aFrame, aFrame->GetContent(), childHint);
   }
 
-  aFrame->SetAdditionalComputedStyle(aIndex, newContext);
+  aFrame->SetAdditionalStyleContext(aIndex, newContext);
 }
 
 static void
-UpdateAdditionalComputedStyles(nsIFrame* aFrame,
+UpdateAdditionalStyleContexts(nsIFrame* aFrame,
                               ServoRestyleState& aRestyleState)
 {
   MOZ_ASSERT(aFrame);
   MOZ_ASSERT(aFrame->GetContent() && aFrame->GetContent()->IsElement());
 
   // FIXME(emilio): Consider adding a bit or something to avoid the initial
   // virtual call?
   uint32_t index = 0;
-  while (auto* oldContext = aFrame->GetAdditionalComputedStyle(index)) {
-    UpdateOneAdditionalComputedStyle(
+  while (auto* oldContext = aFrame->GetAdditionalStyleContext(index)) {
+    UpdateOneAdditionalStyleContext(
         aFrame, index++, *oldContext->AsServo(), aRestyleState);
   }
 }
 
 static void
 UpdateFramePseudoElementStyles(nsIFrame* aFrame,
                                ServoRestyleState& aRestyleState)
 {
@@ -710,18 +710,18 @@ enum class ServoPostTraversalFlags : uin
 
 MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(ServoPostTraversalFlags)
 
 // Send proper accessibility notifications and return post traversal
 // flags for kids.
 static ServoPostTraversalFlags
 SendA11yNotifications(nsPresContext* aPresContext,
                       Element* aElement,
-                      ComputedStyle* aOldComputedStyle,
-                      ComputedStyle* aNewComputedStyle,
+                      nsStyleContext* aOldStyleContext,
+                      nsStyleContext* aNewStyleContext,
                       ServoPostTraversalFlags aFlags)
 {
   using Flags = ServoPostTraversalFlags;
   MOZ_ASSERT(!(aFlags & Flags::SkipA11yNotifications) ||
              !(aFlags & Flags::SendA11yNotificationsIfShown),
              "The two a11y flags should never be set together");
 
 #ifdef ACCESSIBILITY
@@ -732,30 +732,30 @@ SendA11yNotifications(nsPresContext* aPr
     return Flags::Empty;
   }
   if (aFlags & Flags::SkipA11yNotifications) {
     // Propogate the skipping flag to descendants.
     return Flags::SkipA11yNotifications;
   }
 
   bool needsNotify = false;
-  bool isVisible = aNewComputedStyle->StyleVisibility()->IsVisible();
+  bool isVisible = aNewStyleContext->StyleVisibility()->IsVisible();
   if (aFlags & Flags::SendA11yNotificationsIfShown) {
     if (!isVisible) {
       // Propagate the sending-if-shown flag to descendants.
       return Flags::SendA11yNotificationsIfShown;
     }
     // We have asked accessibility service to remove the whole subtree
     // of element which becomes invisible from the accessible tree, but
     // this element is visible, so we need to add it back.
     needsNotify = true;
   } else {
     // If we shouldn't skip in any case, we need to check whether our
     // own visibility has changed.
-    bool wasVisible = aOldComputedStyle->StyleVisibility()->IsVisible();
+    bool wasVisible = aOldStyleContext->StyleVisibility()->IsVisible();
     needsNotify = wasVisible != isVisible;
   }
 
   if (needsNotify) {
     nsIPresShell* presShell = aPresContext->PresShell();
     if (isVisible) {
       accService->ContentRangeInserted(presShell, aElement->GetParent(),
                                        aElement, aElement->GetNextSibling());
@@ -771,17 +771,17 @@ SendA11yNotifications(nsPresContext* aPr
 #endif
 
   return Flags::Empty;
 }
 
 bool
 ServoRestyleManager::ProcessPostTraversal(
   Element* aElement,
-  ComputedStyle* aParentContext,
+  ServoStyleContext* aParentContext,
   ServoRestyleState& aRestyleState,
   ServoPostTraversalFlags aFlags)
 {
   nsIFrame* styleFrame = nsLayoutUtils::GetStyleFrame(aElement);
   nsIFrame* primaryFrame = aElement->GetPrimaryFrame();
 
   // NOTE(emilio): This is needed because for table frames the bit is set on the
   // table wrapper (which is the primary frame), not on the table itself.
@@ -843,32 +843,32 @@ ServoRestyleManager::ProcessPostTraversa
   // XXXbholley: We should teach the frame constructor how to clear the dirty
   // descendants bit to avoid the traversal here.
   if (changeHint & nsChangeHint_ReconstructFrame) {
     ClearRestyleStateFromSubtree(aElement);
     return true;
   }
 
   // TODO(emilio): We could avoid some refcount traffic here, specially in the
-  // ComputedStyle case, which uses atomic refcounting.
+  // ServoStyleContext case, which uses atomic refcounting.
   //
-  // Hold the ComputedStyle alive, because it could become a dangling pointer
-  // during the replacement. In practice it's not a huge deal, but better not
-  // playing with dangling pointers if not needed.
-  RefPtr<ComputedStyle> oldComputedStyle =
-    styleFrame ? styleFrame->Style()->AsServo() : nullptr;
+  // Hold the old style context alive, because it could become a dangling
+  // pointer during the replacement. In practice it's not a huge deal, but
+  // better not playing with dangling pointers if not needed.
+  RefPtr<ServoStyleContext> oldStyleContext =
+    styleFrame ? styleFrame->StyleContext()->AsServo() : nullptr;
 
-  ComputedStyle* displayContentsStyle = nullptr;
+  nsStyleContext* displayContentsStyle = nullptr;
   // FIXME(emilio, bug 1303605): This can be simpler for Servo.
   // Note that we intentionally don't check for display: none content.
-  if (!oldComputedStyle) {
+  if (!oldStyleContext) {
     displayContentsStyle =
       PresContext()->FrameConstructor()->GetDisplayContentsStyleFor(aElement);
     if (displayContentsStyle) {
-      oldComputedStyle = displayContentsStyle->AsServo();
+      oldStyleContext = displayContentsStyle->AsServo();
     }
   }
 
   Maybe<ServoRestyleState> thisFrameRestyleState;
   if (styleFrame) {
     auto type = isOutOfFlow
       ? ServoRestyleState::Type::OutOfFlow
       : ServoRestyleState::Type::InFlow;
@@ -876,54 +876,54 @@ ServoRestyleManager::ProcessPostTraversa
     thisFrameRestyleState.emplace(*styleFrame, aRestyleState, changeHint, type);
   }
 
   // We can't really assume as used changes from display: contents elements (or
   // other elements without frames).
   ServoRestyleState& childrenRestyleState =
     thisFrameRestyleState ? *thisFrameRestyleState : aRestyleState;
 
-  RefPtr<ComputedStyle> upToDateContext =
+  RefPtr<ServoStyleContext> upToDateContext =
     wasRestyled
       ? aRestyleState.StyleSet().ResolveServoStyle(aElement)
-      : oldComputedStyle;
+      : oldStyleContext;
 
   ServoPostTraversalFlags childrenFlags =
     wasRestyled ? ServoPostTraversalFlags::ParentWasRestyled
                 : ServoPostTraversalFlags::Empty;
 
-  if (wasRestyled && oldComputedStyle) {
+  if (wasRestyled && oldStyleContext) {
     MOZ_ASSERT(styleFrame || displayContentsStyle);
-    MOZ_ASSERT(oldComputedStyle->ComputedData() != upToDateContext->ComputedData());
+    MOZ_ASSERT(oldStyleContext->ComputedData() != upToDateContext->ComputedData());
 
-    upToDateContext->ResolveSameStructsAs(oldComputedStyle);
+    upToDateContext->ResolveSameStructsAs(oldStyleContext);
 
     // We want to walk all the continuations here, even the ones with different
     // styles.  In practice, the only reason we get continuations with different
     // styles here is ::first-line (::first-letter never affects element
     // styles).  But in that case, newContext is the right context for the
     // _later_ continuations anyway (the ones not affected by ::first-line), not
     // the earlier ones, so there is no point stopping right at the point when
-    // we'd actually be setting the right ComputedStyle.
+    // we'd actually be setting the right style context.
     //
-    // This does mean that we may be setting the wrong ComputedStyle on our
+    // This does mean that we may be setting the wrong style context on our
     // initial continuations; ::first-line fixes that up after the fact.
     for (nsIFrame* f = styleFrame; f; f = f->GetNextContinuation()) {
-      MOZ_ASSERT_IF(f != styleFrame, !f->GetAdditionalComputedStyle(0));
-      f->SetComputedStyle(upToDateContext);
+      MOZ_ASSERT_IF(f != styleFrame, !f->GetAdditionalStyleContext(0));
+      f->SetStyleContext(upToDateContext);
     }
 
     if (MOZ_UNLIKELY(displayContentsStyle)) {
       MOZ_ASSERT(!styleFrame);
       PresContext()->FrameConstructor()->
         ChangeRegisteredDisplayContentsStyleFor(aElement, upToDateContext);
     }
 
     if (styleFrame) {
-      UpdateAdditionalComputedStyles(styleFrame, aRestyleState);
+      UpdateAdditionalStyleContexts(styleFrame, aRestyleState);
     }
 
     if (!aElement->GetParent()) {
       // This is the root.  Update styles on the viewport as needed.
       ViewportFrame* viewport =
         do_QueryFrame(mPresContext->PresShell()->GetRootFrame());
       if (viewport) {
         // NB: The root restyle state, not the one for our children!
@@ -939,17 +939,17 @@ ServoRestyleManager::ProcessPostTraversa
     // We can sometimes reach this when the animated style is being removed.
     // Since AddLayerChangesForAnimation checks if |styleFrame| has a transform
     // style or not, we need to call it *after* setting |newContext| to
     // |styleFrame| to ensure the animated transform has been removed first.
     AddLayerChangesForAnimation(
       styleFrame, aElement, aRestyleState.ChangeList());
 
     childrenFlags |= SendA11yNotifications(mPresContext, aElement,
-                                           oldComputedStyle,
+                                           oldStyleContext,
                                            upToDateContext, aFlags);
   }
 
   const bool traverseElementChildren =
     aElement->HasAnyOfFlags(Element::kAllServoDescendantBits);
   const bool traverseTextChildren =
     wasRestyled || aElement->HasFlag(NODE_DESCENDANTS_NEED_FRAMES);
   bool recreatedAnyContext = wasRestyled;
@@ -1002,17 +1002,17 @@ ServoRestyleManager::ProcessPostTraversa
       // IsFrameOfType() and digging about for the first-line frame if not?
       // Could we keep track of whether the element children we actually restyle
       // are affected by first-line?  Something else?  Bug 1385443 tracks making
       // this better.
       nsIFrame* firstLineFrame =
         static_cast<nsBlockFrame*>(styleFrame)->GetFirstLineFrame();
       if (firstLineFrame) {
         for (nsIFrame* kid : firstLineFrame->PrincipalChildList()) {
-          ReparentComputedStyle(kid);
+          ReparentStyleContext(kid);
         }
       }
     }
   }
 
   aElement->UnsetFlags(Element::kAllServoDescendantBits);
   return recreatedAnyContext;
 }
@@ -1040,32 +1040,32 @@ ServoRestyleManager::ProcessPostTraversa
   // If the parent wasn't restyled, the styles of our anon box parents won't
   // change either.
   if ((aFlags & ServoPostTraversalFlags::ParentWasRestyled) &&
       primaryFrame->ParentIsWrapperAnonBox()) {
     aRestyleState.AddPendingWrapperRestyle(
       ServoRestyleState::TableAwareParentFor(primaryFrame));
   }
 
-  ComputedStyle& newContext = aPostTraversalState.ComputeStyle(aTextNode);
+  nsStyleContext& newContext = aPostTraversalState.ComputeStyle(aTextNode);
   aPostTraversalState.ComputeHintIfNeeded(aTextNode, primaryFrame, newContext);
 
   // We want to walk all the continuations here, even the ones with different
   // styles.  In practice, the only reasons we get continuations with different
   // styles are ::first-line and ::first-letter.  But in those cases,
   // newContext is the right context for the _later_ continuations anyway (the
   // ones not affected by ::first-line/::first-letter), not the earlier ones,
   // so there is no point stopping right at the point when we'd actually be
-  // setting the right ComputedStyle.
+  // setting the right style context.
   //
-  // This does mean that we may be setting the wrong ComputedStyle on our
+  // This does mean that we may be setting the wrong style context on our
   // initial continuations; ::first-line/::first-letter fix that up after the
   // fact.
   for (nsIFrame* f = primaryFrame; f; f = f->GetNextContinuation()) {
-    f->SetComputedStyle(&newContext);
+    f->SetStyleContext(&newContext);
   }
 
   return true;
 }
 
 void
 ServoRestyleManager::ClearSnapshots()
 {
@@ -1154,18 +1154,18 @@ ServoRestyleManager::DoProcessPendingRes
   }
 
   while (styleSet->StyleDocument(aFlags)) {
     ClearSnapshots();
 
     nsStyleChangeList currentChanges(StyleBackendType::Servo);
     bool anyStyleChanged = false;
 
-    // Recreate styles , and queue up change hints (which also handle lazy frame
-    // construction).
+    // Recreate style contexts, and queue up change hints (which also handle
+    // lazy frame construction).
     {
       AutoRestyleTimelineMarker marker(presContext->GetDocShell(), false);
       DocumentStyleRootIterator iter(doc->GetServoRestyleRoot());
       while (Element* root = iter.GetNextStyleRoot()) {
         nsTArray<nsIFrame*> wrappersToRestyle;
         ServoRestyleState state(*styleSet, currentChanges, wrappersToRestyle);
         ServoPostTraversalFlags flags = ServoPostTraversalFlags::Empty;
         anyStyleChanged |= ProcessPostTraversal(root, nullptr, state, flags);
@@ -1520,17 +1520,17 @@ ServoRestyleManager::AttributeChanged(El
 
     // If we change attributes, we have to mark this to be true, so we will
     // increase the animation generation for the new created transition if any.
     mHaveNonAnimationRestyles = true;
   }
 }
 
 nsresult
-ServoRestyleManager::ReparentComputedStyle(nsIFrame* aFrame)
+ServoRestyleManager::ReparentStyleContext(nsIFrame* aFrame)
 {
   // This is only called when moving frames in or out of the first-line
   // pseudo-element (or one of its descendants).  We can't say much about
   // aFrame's ancestors, unfortunately (e.g. during a dynamic insert into
   // something inside an inline-block on the first line the ancestors could be
   // totally arbitrary), but we will definitely find a line frame on the
   // ancestor chain.  Note that the lineframe may not actually be the one that
   // corresponds to ::first-line; when we're moving _out_ of the ::first-line it
@@ -1540,28 +1540,28 @@ ServoRestyleManager::ReparentComputedSty
     nsIFrame* f = aFrame->GetParent();
     while (f && !f->IsLineFrame()) {
       f = f->GetParent();
     }
     MOZ_ASSERT(f, "Must have found a first-line frame");
   }
 #endif
 
-  DoReparentComputedStyle(aFrame, *StyleSet());
+  DoReparentStyleContext(aFrame, *StyleSet());
 
   return NS_OK;
 }
 
 void
-ServoRestyleManager::DoReparentComputedStyle(nsIFrame* aFrame,
+ServoRestyleManager::DoReparentStyleContext(nsIFrame* aFrame,
                                             ServoStyleSet& aStyleSet)
 {
   if (aFrame->IsBackdropFrame()) {
-    // Style context of backdrop frame has no parent style, and thus we do not
-    // need to reparent it.
+    // Style context of backdrop frame has no parent style context, and
+    // thus we do not need to reparent it.
     return;
   }
 
   if (aFrame->IsPlaceholderFrame()) {
     // Also reparent the out-of-flow and all its continuations.  We're doing
     // this to match Gecko for now, but it's not clear that this behavior is
     // correct per spec.  It's certainly pretty odd for out-of-flows whose
     // containing block is not within the first line.
@@ -1581,122 +1581,122 @@ ServoRestyleManager::DoReparentComputedS
     //
     // We make the first float orange and the second float blue.  On the other
     // hand, if the float were within an inline-block that was on the first
     // line, arguably it _should_ inherit from the ::first-line...
     nsIFrame* outOfFlow =
       nsPlaceholderFrame::GetRealFrameForPlaceholder(aFrame);
     MOZ_ASSERT(outOfFlow, "no out-of-flow frame");
     for (; outOfFlow; outOfFlow = outOfFlow->GetNextContinuation()) {
-      DoReparentComputedStyle(outOfFlow, aStyleSet);
+      DoReparentStyleContext(outOfFlow, aStyleSet);
     }
   }
 
   nsIFrame* providerFrame;
-  ComputedStyle* newParentContext =
-    aFrame->GetParentComputedStyle(&providerFrame);
+  nsStyleContext* newParentContext =
+    aFrame->GetParentStyleContext(&providerFrame);
   // If our provider is our child, we want to reparent it first, because we
   // inherit style from it.
   bool isChild = providerFrame && providerFrame->GetParent() == aFrame;
   nsIFrame* providerChild = nullptr;
   if (isChild) {
-    DoReparentComputedStyle(providerFrame, aStyleSet);
-    // Get the style again after ReparentComputedStyle() which might have
+    DoReparentStyleContext(providerFrame, aStyleSet);
+    // Get the style context again after ReparentStyleContext() which might have
     // changed it.
-    newParentContext = providerFrame->Style();
+    newParentContext = providerFrame->StyleContext();
     providerChild = providerFrame;
     MOZ_ASSERT(!providerFrame->HasAnyStateBits(NS_FRAME_OUT_OF_FLOW),
                "Out of flow provider?");
   }
 
   if (!newParentContext) {
     // No need to do anything here for this frame, but we should still reparent
     // its descendants, because those may have styles that inherit from the
     // parent of this frame (e.g. non-anonymous columns in an anonymous
     // colgroup).
-    MOZ_ASSERT(aFrame->Style()->IsNonInheritingAnonBox(),
+    MOZ_ASSERT(aFrame->StyleContext()->IsNonInheritingAnonBox(),
                "Why did this frame not end up with a parent context?");
     ReparentFrameDescendants(aFrame, providerChild, aStyleSet);
     return;
   }
 
   bool isElement = aFrame->GetContent()->IsElement();
 
   // We probably don't want to initiate transitions from
-  // ReparentComputedStyle, since we call it during frame
+  // ReparentStyleContext, since we call it during frame
   // construction rather than in response to dynamic changes.
   // Also see the comment at the start of
   // nsTransitionManager::ConsiderInitiatingTransition.
   //
   // We don't try to do the fancy copying from previous continuations that
   // GeckoRestyleManager does here, because that relies on knowing the parents
-  // of ComputedStyles, and we don't know those.
-  ComputedStyle* oldContext = aFrame->Style()->AsServo();
+  // of style contexts, and we don't know those.
+  ServoStyleContext* oldContext = aFrame->StyleContext()->AsServo();
   Element* ourElement =
     oldContext->GetPseudoType() == CSSPseudoElementType::NotPseudo &&
     isElement ?
       aFrame->GetContent()->AsElement() :
       nullptr;
-  ComputedStyle* newParent = newParentContext->AsServo();
+  ServoStyleContext* newParent = newParentContext->AsServo();
 
-  ComputedStyle* newParentIgnoringFirstLine;
+  ServoStyleContext* newParentIgnoringFirstLine;
   if (newParent->GetPseudoType() == CSSPseudoElementType::firstLine) {
     MOZ_ASSERT(providerFrame && providerFrame->GetParent()->
                IsFrameOfType(nsIFrame::eBlockFrame),
                "How could we get a ::first-line parent style without having "
                "a ::first-line provider frame?");
     // If newParent is a ::first-line style, get the parent blockframe, and then
     // correct it for our pseudo as needed (e.g. stepping out of anon boxes).
     // Use the resulting style for the "parent style ignoring ::first-line".
     nsIFrame* blockFrame = providerFrame->GetParent();
     nsIFrame* correctedFrame =
       nsFrame::CorrectStyleParentFrame(blockFrame, oldContext->GetPseudo());
-    newParentIgnoringFirstLine = correctedFrame->Style()->AsServo();
+    newParentIgnoringFirstLine = correctedFrame->StyleContext()->AsServo();
   } else {
     newParentIgnoringFirstLine = newParent;
   }
 
   if (!providerFrame) {
     // No providerFrame means we inherited from a display:contents thing.  Our
     // layout parent style is the style of our nearest ancestor frame.  But we have
     // to be careful to do that with our placeholder, not with us, if we're out of
     // flow.
     if (aFrame->HasAnyStateBits(NS_FRAME_OUT_OF_FLOW)) {
       aFrame->GetPlaceholderFrame()->GetLayoutParentStyleForOutOfFlow(&providerFrame);
     } else {
       providerFrame = nsFrame::CorrectStyleParentFrame(aFrame->GetParent(),
                                                        oldContext->GetPseudo());
     }
   }
-  ComputedStyle* layoutParent = providerFrame->Style()->AsServo();
+  ServoStyleContext* layoutParent = providerFrame->StyleContext()->AsServo();
 
-  RefPtr<ComputedStyle> newContext =
-    aStyleSet.ReparentComputedStyle(oldContext,
+  RefPtr<ServoStyleContext> newContext =
+    aStyleSet.ReparentStyleContext(oldContext,
                                    newParent,
                                    newParentIgnoringFirstLine,
                                    layoutParent,
                                    ourElement);
-  aFrame->SetComputedStyle(newContext);
+  aFrame->SetStyleContext(newContext);
 
   // This logic somewhat mirrors the logic in
   // ServoRestyleManager::ProcessPostTraversal.
   if (isElement) {
-    // We can't use UpdateAdditionalComputedStyles as-is because it needs a
+    // We can't use UpdateAdditionalStyleContexts as-is because it needs a
     // ServoRestyleState and maintaining one of those during a _frametree_
     // traversal is basically impossible.
     uint32_t index = 0;
-    while (ComputedStyle* oldAdditionalContext =
-             aFrame->GetAdditionalComputedStyle(index)) {
-      RefPtr<ComputedStyle> newAdditionalContext =
-        aStyleSet.ReparentComputedStyle(oldAdditionalContext->AsServo(),
+    while (nsStyleContext* oldAdditionalContext =
+             aFrame->GetAdditionalStyleContext(index)) {
+      RefPtr<ServoStyleContext> newAdditionalContext =
+        aStyleSet.ReparentStyleContext(oldAdditionalContext->AsServo(),
                                        newContext,
                                        newContext,
                                        newContext,
                                        nullptr);
-      aFrame->SetAdditionalComputedStyle(index, newAdditionalContext);
+      aFrame->SetAdditionalStyleContext(index, newAdditionalContext);
       ++index;
     }
   }
 
   // Generally, owned anon boxes are our descendants.  The only exceptions are
   // tables (for the table wrapper) and inline frames (for the block part of the
   // block-in-inline split).  We're going to update our descendants when looping
   // over kids, and we don't want to update the block part of a block-in-inline
@@ -1719,15 +1719,15 @@ ServoRestyleManager::ReparentFrameDescen
                                               ServoStyleSet& aStyleSet)
 {
   nsIFrame::ChildListIterator lists(aFrame);
   for (; !lists.IsDone(); lists.Next()) {
     for (nsIFrame* child : lists.CurrentList()) {
       // only do frames that are in flow
       if (!(child->GetStateBits() & NS_FRAME_OUT_OF_FLOW) &&
           child != aProviderChild) {
-        DoReparentComputedStyle(child, aStyleSet);
+        DoReparentStyleContext(child, aStyleSet);
       }
     }
   }
 }
 
 } // namespace mozilla
--- a/layout/base/ServoRestyleManager.h
+++ b/layout/base/ServoRestyleManager.h
@@ -31,18 +31,17 @@ namespace mozilla {
 /**
  * A stack class used to pass some common restyle state in a slightly more
  * comfortable way than a bunch of individual arguments, and that also checks
  * that the change hint used for optimization is correctly used in debug mode.
  */
 class ServoRestyleState
 {
 public:
-  ServoRestyleState(ServoStyleSet& aStyleSet,
-                    nsStyleChangeList& aChangeList,
+  ServoRestyleState(ServoStyleSet& aStyleSet, nsStyleChangeList& aChangeList,
                     nsTArray<nsIFrame*>& aPendingWrapperRestyles)
     : mStyleSet(aStyleSet)
     , mChangeList(aChangeList)
     , mPendingWrapperRestyles(aPendingWrapperRestyles)
     , mPendingWrapperRestyleOffset(aPendingWrapperRestyles.Length())
     , mChangesHandled(nsChangeHint(0))
 #ifdef DEBUG
     // If !mOwner, then we wouldn't have processed our wrapper restyles, because
@@ -224,22 +223,22 @@ public:
   void ClassAttributeWillBeChangedBySMIL(dom::Element* aElement);
 
   void AttributeChanged(dom::Element* aElement, int32_t aNameSpaceID,
                         nsAtom* aAttribute, int32_t aModType,
                         const nsAttrValue* aOldValue);
 
   // This is only used to reparent things when moving them in/out of the
   // ::first-line.  Once we get rid of the Gecko style system, we should rename
-  // this method accordingly (e.g. to ReparentComputedStyleForFirstLine).
-  nsresult ReparentComputedStyle(nsIFrame* aFrame);
+  // this method accordingly (e.g. to ReparentStyleContextForFirstLine).
+  nsresult ReparentStyleContext(nsIFrame* aFrame);
 
 private:
   /**
-   * Reparent the descendants of aFrame.  This is used by ReparentComputedStyle
+   * Reparent the descendants of aFrame.  This is used by ReparentStyleContext
    * and shouldn't be called by anyone else.  aProviderChild, if non-null, is a
    * child that was the style parent for aFrame and hence shouldn't be
    * reparented.
    */
   void ReparentFrameDescendants(nsIFrame* aFrame, nsIFrame* aProviderChild,
                                 ServoStyleSet& aStyleSet);
 
 public:
@@ -288,17 +287,17 @@ private:
    * descendants.
    *
    * Returns whether any style did actually change. There may be cases where we
    * didn't need to change any style after all, for example, when a content
    * attribute changes that happens not to have any effect on the style of that
    * element or any descendant or sibling.
    */
   bool ProcessPostTraversal(Element* aElement,
-                            ComputedStyle* aParentContext,
+                            ServoStyleContext* aParentContext,
                             ServoRestyleState& aRestyleState,
                             ServoPostTraversalFlags aFlags);
 
   struct TextPostTraversalState;
   bool ProcessPostTraversalForText(nsIContent* aTextNode,
                                    TextPostTraversalState& aState,
                                    ServoRestyleState& aRestyleState,
                                    ServoPostTraversalFlags aFlags);
@@ -315,19 +314,20 @@ private:
   void ClearSnapshots();
   ServoElementSnapshot& SnapshotFor(mozilla::dom::Element* aElement);
   void TakeSnapshotForAttributeChange(mozilla::dom::Element* aElement,
                                       int32_t aNameSpaceID,
                                       nsAtom* aAttribute);
 
   void DoProcessPendingRestyles(ServoTraversalFlags aFlags);
 
-  // Function to do the actual (recursive) work of ReparentComputedStyle, once we
+  // Function to do the actual (recursive) work of ReparentStyleContext, once we
   // have asserted the invariants that only hold on the initial call.
-  void DoReparentComputedStyle(nsIFrame* aFrame, ServoStyleSet& aStyleSet);
+  void DoReparentStyleContext(nsIFrame* aFrame,
+                              ServoStyleSet& aStyleSet);
 
   // We use a separate data structure from nsStyleChangeList because we need a
   // frame to create nsStyleChangeList entries, and the primary frame may not be
   // attached yet.
   struct ReentrantChange {
     nsCOMPtr<nsIContent> mContent;
     nsChangeHint mHint;
   };
--- a/layout/base/UndisplayedNode.h
+++ b/layout/base/UndisplayedNode.h
@@ -5,34 +5,34 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* Linked list node for undisplayed element */
 
 #ifndef mozilla_UndisplayedNode_h
 #define mozilla_UndisplayedNode_h
 
 #include "nsIContent.h"
-#include "mozilla/ComputedStyle.h"
+#include "nsStyleContext.h"
 
 namespace mozilla {
 
 /**
  * Node in a linked list, containing the style for an element that
  * does not have a frame but whose parent does have a frame.
  */
 struct UndisplayedNode : public LinkedListElement<UndisplayedNode>
 {
-  UndisplayedNode(nsIContent* aContent, ComputedStyle* aStyle)
+  UndisplayedNode(nsIContent* aContent, nsStyleContext* aStyle)
     : mContent(aContent)
     , mStyle(aStyle)
   {
     MOZ_COUNT_CTOR(mozilla::UndisplayedNode);
   }
 
   ~UndisplayedNode() { MOZ_COUNT_DTOR(mozilla::UndisplayedNode); }
 
   nsCOMPtr<nsIContent> mContent;
-  RefPtr<ComputedStyle> mStyle;
+  RefPtr<nsStyleContext> mStyle;
 };
 
 } // namespace mozilla
 
 #endif // mozilla_UndisplayedNode_h
--- a/layout/base/nsBidiPresUtils.cpp
+++ b/layout/base/nsBidiPresUtils.cpp
@@ -69,53 +69,53 @@ static const char16_t kSeparators[] = {
 #define NS_BIDI_CONTROL_FRAME ((nsIFrame*)0xfffb1d1)
 
 static bool
 IsIsolateControl(char16_t aChar)
 {
   return aChar == kLRI || aChar == kRLI || aChar == kFSI;
 }
 
-// Given a ComputedStyle, return any bidi control character necessary to
+// Given a style context, return any bidi control character necessary to
 // implement style properties that override directionality (i.e. if it has
 // unicode-bidi:bidi-override, or text-orientation:upright in vertical
 // writing mode) when applying the bidi algorithm.
 //
 // Returns 0 if no override control character is implied by this style.
 static char16_t
-GetBidiOverride(ComputedStyle* aComputedStyle)
+GetBidiOverride(nsStyleContext* aStyleContext)
 {
-  const nsStyleVisibility* vis = aComputedStyle->StyleVisibility();
+  const nsStyleVisibility* vis = aStyleContext->StyleVisibility();
   if ((vis->mWritingMode == NS_STYLE_WRITING_MODE_VERTICAL_RL ||
        vis->mWritingMode == NS_STYLE_WRITING_MODE_VERTICAL_LR) &&
       vis->mTextOrientation == NS_STYLE_TEXT_ORIENTATION_UPRIGHT) {
     return kLRO;
   }
-  const nsStyleTextReset* text = aComputedStyle->StyleTextReset();
+  const nsStyleTextReset* text = aStyleContext->StyleTextReset();
   if (text->mUnicodeBidi & NS_STYLE_UNICODE_BIDI_BIDI_OVERRIDE) {
     return NS_STYLE_DIRECTION_RTL == vis->mDirection ? kRLO : kLRO;
   }
   return 0;
 }
 
-// Given a ComputedStyle, return any bidi control character necessary to
+// Given a style context, return any bidi control character necessary to
 // implement style properties that affect bidi resolution (i.e. if it
 // has unicode-bidiembed, isolate, or plaintext) when applying the bidi
 // algorithm.
 //
 // Returns 0 if no control character is implied by the style.
 //
 // Note that GetBidiOverride and GetBidiControl need to be separate
 // because in the case of unicode-bidi:isolate-override we need both
 // FSI and LRO/RLO.
 static char16_t
-GetBidiControl(ComputedStyle* aComputedStyle)
+GetBidiControl(nsStyleContext* aStyleContext)
 {
-  const nsStyleVisibility* vis = aComputedStyle->StyleVisibility();
-  const nsStyleTextReset* text = aComputedStyle->StyleTextReset();
+  const nsStyleVisibility* vis = aStyleContext->StyleVisibility();
+  const nsStyleTextReset* text = aStyleContext->StyleTextReset();
   if (text->mUnicodeBidi & NS_STYLE_UNICODE_BIDI_EMBED) {
     return NS_STYLE_DIRECTION_RTL == vis->mDirection ? kRLE : kLRE;
   }
   if (text->mUnicodeBidi & NS_STYLE_UNICODE_BIDI_ISOLATE) {
     if (text->mUnicodeBidi & NS_STYLE_UNICODE_BIDI_BIDI_OVERRIDE) {
       // isolate-override
       return kFSI;
     }
@@ -148,17 +148,17 @@ struct MOZ_STACK_CLASS BidiParagraphData
   // Only used for NOISY debug output.
   nsBlockFrame*       mCurrentBlock;
 #endif
 
   explicit BidiParagraphData(nsBlockFrame* aBlockFrame)
     : mPresContext(aBlockFrame->PresContext())
     , mIsVisual(mPresContext->IsVisualMode())
     , mRequiresBidi(false)
-    , mParaLevel(nsBidiPresUtils::BidiLevelFromStyle(aBlockFrame->Style()))
+    , mParaLevel(nsBidiPresUtils::BidiLevelFromStyle(aBlockFrame->StyleContext()))
     , mPrevContent(nullptr)
 #ifdef DEBUG
     , mCurrentBlock(aBlockFrame)
 #endif
   {
     if (mParaLevel > 0) {
       mRequiresBidi = true;
     }
@@ -705,17 +705,17 @@ nsBidiPresUtils::Resolve(nsBlockFrame* a
   BidiParagraphData bpd(aBlockFrame);
 
   // Handle bidi-override being set on the block itself before calling
   // TraverseFrames.
   // No need to call GetBidiControl as well, because isolate and embed
   // values of unicode-bidi property are redundant on block elements.
   // unicode-bidi:plaintext on a block element is handled by block frame
   // via using nsIFrame::GetWritingMode(nsIFrame*).
-  char16_t ch = GetBidiOverride(aBlockFrame->Style());
+  char16_t ch = GetBidiOverride(aBlockFrame->StyleContext());
   if (ch != 0) {
     bpd.PushBidiControl(ch);
     bpd.mRequiresBidi = true;
   } else {
     // If there are no unicode-bidi properties and no RTL characters in the
     // block's content, then it is pure LTR and we can skip the rest of bidi
     // resolution.
     nsIContent* currContent = nullptr;
@@ -1075,23 +1075,23 @@ nsBidiPresUtils::TraverseFrames(nsBlockI
     if (childFrame->IsPlaceholderFrame()) {
       nsIFrame* realFrame =
         nsPlaceholderFrame::GetRealFrameForPlaceholder(childFrame);
       if (realFrame->IsLetterFrame()) {
         frame = realFrame;
       }
     }
 
-    auto DifferentBidiValues = [](ComputedStyle* aSC1, nsIFrame* aFrame2) {
-      ComputedStyle* sc2 = aFrame2->Style();
+    auto DifferentBidiValues = [](nsStyleContext* aSC1, nsIFrame* aFrame2) {
+      nsStyleContext* sc2 = aFrame2->StyleContext();
       return GetBidiControl(aSC1) != GetBidiControl(sc2) ||
              GetBidiOverride(aSC1) != GetBidiOverride(sc2);
     };
 
-    ComputedStyle* sc = frame->Style();
+    nsStyleContext* sc = frame->StyleContext();
     nsIFrame* nextContinuation = frame->GetNextContinuation();
     nsIFrame* prevContinuation = frame->GetPrevContinuation();
     bool isLastFrame = !nextContinuation ||
                        DifferentBidiValues(sc, nextContinuation);
     bool isFirstFrame = !prevContinuation ||
                         DifferentBidiValues(sc, prevContinuation);
 
     char16_t controlChar = 0;
@@ -1308,17 +1308,17 @@ nsBidiPresUtils::ChildListMayRequireBidi
       nsIFrame* realFrame =
         nsPlaceholderFrame::GetRealFrameForPlaceholder(childFrame);
       if (realFrame->IsLetterFrame()) {
         frame = realFrame;
       }
     }
 
     // If unicode-bidi properties are present, we should do bidi resolution.
-    ComputedStyle* sc = frame->Style();
+    nsStyleContext* sc = frame->StyleContext();
     if (GetBidiControl(sc) || GetBidiOverride(sc)) {
       return true;
     }
 
     if (IsBidiLeaf(frame)) {
       if (frame->IsTextFrame()) {
         // If the frame already has a BidiDataProperty, we know we need to
         // perform bidi resolution (even if no bidi content is NOW present --
@@ -2372,21 +2372,21 @@ nsresult nsBidiPresUtils::ProcessTextFor
                                              nsPoint(aX, aY));
   return ProcessText(aText, aLength, aBaseLevel, aPresContext, processor,
                      aMode, aPosResolve, aPosResolveCount, aWidth,
                      &aPresContext->GetBidiEngine());
 }
 
 /* static */
 nsBidiLevel
-nsBidiPresUtils::BidiLevelFromStyle(ComputedStyle* aComputedStyle)
+nsBidiPresUtils::BidiLevelFromStyle(nsStyleContext* aStyleContext)
 {
-  if (aComputedStyle->StyleTextReset()->mUnicodeBidi &
+  if (aStyleContext->StyleTextReset()->mUnicodeBidi &
       NS_STYLE_UNICODE_BIDI_PLAINTEXT) {
     return NSBIDI_DEFAULT_LTR;
   }
 
-  if (aComputedStyle->StyleVisibility()->mDirection == NS_STYLE_DIRECTION_RTL) {
+  if (aStyleContext->StyleVisibility()->mDirection == NS_STYLE_DIRECTION_RTL) {
     return NSBIDI_RTL;
   }
 
   return NSBIDI_LTR;
 }
--- a/layout/base/nsBidiPresUtils.h
+++ b/layout/base/nsBidiPresUtils.h
@@ -20,22 +20,22 @@
 struct BidiParagraphData;
 struct BidiLineData;
 class gfxContext;
 class nsFontMetrics;
 class nsIFrame;
 class nsBlockFrame;
 class nsPresContext;
 class nsBlockInFlowLineIterator;
+class nsStyleContext;
 struct nsSize;
 template<class T> class nsTHashtable;
 namespace mozilla {
-class ComputedStyle;
-class LogicalMargin;
-class WritingMode;
+  class WritingMode;
+  class LogicalMargin;
 } // namespace mozilla
 
 /**
  * A structure representing some continuation state for each frame on the line,
  * used to determine the first and the last continuation frame for each
  * continuation chain on the line.
  */
 struct nsFrameContinuationState : public nsVoidPtrHashKey
@@ -366,17 +366,17 @@ public:
    * If |unicode-bidi| is set to "[-moz-]plaintext", returns NSBIDI_DEFAULT_LTR,
    * in other words the direction is determined from the first strong character
    * in the text according to rules P2 and P3 of the bidi algorithm, or LTR if
    * there is no strong character.
    *
    * Otherwise returns NSBIDI_LTR or NSBIDI_RTL depending on the value of
    * |direction|
    */
-  static nsBidiLevel BidiLevelFromStyle(mozilla::ComputedStyle* aComputedStyle);
+  static nsBidiLevel BidiLevelFromStyle(nsStyleContext* aStyleContext);
 
 private:
   static nsresult
   ProcessTextForRenderingContext(const char16_t*       aText,
                                  int32_t                aLength,
                                  nsBidiLevel            aBaseLevel,
                                  nsPresContext*         aPresContext,
                                  gfxContext&            aRenderingContext,
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -7,17 +7,16 @@
 /*
  * construction of a frame tree that is nearly isomorphic to the content
  * tree and updating of that tree in response to dynamic changes
  */
 
 #include "nsCSSFrameConstructor.h"
 
 #include "mozilla/AutoRestore.h"
-#include "mozilla/ComputedStyleInlines.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/ErrorResult.h"
 #include "mozilla/dom/HTMLDetailsElement.h"
 #include "mozilla/dom/HTMLSelectElement.h"
 #include "mozilla/dom/HTMLSummaryElement.h"
 #include "mozilla/EventStates.h"
 #include "mozilla/Likely.h"
 #include "mozilla/LinkedList.h"
@@ -81,16 +80,17 @@
 #include "nsRubyTextContainerFrame.h"
 #include "nsImageFrame.h"
 #include "nsIObjectLoadingContent.h"
 #include "nsTArray.h"
 #include "mozilla/dom/CharacterData.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/ElementInlines.h"
 #include "nsAutoLayoutPhase.h"
+#include "nsStyleContextInlines.h"
 #include "nsStyleStructInlines.h"
 #include "nsPageContentFrame.h"
 #include "mozilla/RestyleManager.h"
 #include "mozilla/RestyleManagerInlines.h"
 #include "mozilla/StylePrefs.h"
 #include "StickyScrollContainer.h"
 #include "nsFieldSetFrame.h"
 #include "nsInlineFrame.h"
@@ -129,77 +129,77 @@
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 // An alias for convenience.
 static const nsIFrame::ChildListID kPrincipalList = nsIFrame::kPrincipalList;
 
 nsIFrame*
-NS_NewHTMLCanvasFrame (nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewHTMLCanvasFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 nsIFrame*
-NS_NewHTMLVideoFrame (nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewHTMLVideoFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 nsContainerFrame*
-NS_NewSVGOuterSVGFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewSVGOuterSVGFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 nsContainerFrame*
-NS_NewSVGOuterSVGAnonChildFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewSVGOuterSVGAnonChildFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 nsIFrame*
-NS_NewSVGInnerSVGFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewSVGInnerSVGFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 nsIFrame*
-NS_NewSVGGeometryFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewSVGGeometryFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 nsIFrame*
-NS_NewSVGGFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewSVGGFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 nsIFrame*
-NS_NewSVGGenericContainerFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewSVGGenericContainerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 nsContainerFrame*
-NS_NewSVGForeignObjectFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewSVGForeignObjectFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 nsIFrame*
-NS_NewSVGAFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewSVGAFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 nsIFrame*
-NS_NewSVGSwitchFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewSVGSwitchFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 nsIFrame*
-NS_NewSVGSymbolFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewSVGSymbolFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 nsIFrame*
-NS_NewSVGTextFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewSVGTextFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 nsIFrame*
-NS_NewSVGContainerFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewSVGContainerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 nsIFrame*
-NS_NewSVGUseFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewSVGUseFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 nsIFrame*
-NS_NewSVGViewFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewSVGViewFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 extern nsIFrame*
-NS_NewSVGLinearGradientFrame(nsIPresShell *aPresShell, ComputedStyle* aStyle);
+NS_NewSVGLinearGradientFrame(nsIPresShell *aPresShell, nsStyleContext* aContext);
 extern nsIFrame*
-NS_NewSVGRadialGradientFrame(nsIPresShell *aPresShell, ComputedStyle* aStyle);
+NS_NewSVGRadialGradientFrame(nsIPresShell *aPresShell, nsStyleContext* aContext);
 extern nsIFrame*
-NS_NewSVGStopFrame(nsIPresShell *aPresShell, ComputedStyle* aStyle);
+NS_NewSVGStopFrame(nsIPresShell *aPresShell, nsStyleContext* aContext);
 nsContainerFrame*
-NS_NewSVGMarkerFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewSVGMarkerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 nsContainerFrame*
-NS_NewSVGMarkerAnonChildFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewSVGMarkerAnonChildFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 extern nsIFrame*
-NS_NewSVGImageFrame(nsIPresShell *aPresShell, ComputedStyle* aStyle);
+NS_NewSVGImageFrame(nsIPresShell *aPresShell, nsStyleContext* aContext);
 nsIFrame*
-NS_NewSVGClipPathFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewSVGClipPathFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 nsIFrame*
-NS_NewSVGFilterFrame(nsIPresShell *aPresShell, ComputedStyle* aStyle);
+NS_NewSVGFilterFrame(nsIPresShell *aPresShell, nsStyleContext* aContext);
 nsIFrame*
-NS_NewSVGPatternFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewSVGPatternFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 nsIFrame*
-NS_NewSVGMaskFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewSVGMaskFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 nsIFrame*
-NS_NewSVGFEContainerFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewSVGFEContainerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 nsIFrame*
-NS_NewSVGFELeafFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewSVGFELeafFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 nsIFrame*
-NS_NewSVGFEImageFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewSVGFEImageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 nsIFrame*
-NS_NewSVGFEUnstyledLeafFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewSVGFEUnstyledLeafFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 #include "mozilla/dom/NodeInfo.h"
 #include "prenv.h"
 #include "nsNodeInfoManager.h"
 #include "nsContentCreatorFunctions.h"
 
 #ifdef DEBUG
 // Set the environment variable GECKO_FRAMECTOR_DEBUG_FLAGS to one or
@@ -232,119 +232,119 @@ static FrameCtorDebugFlags gFlags[] = {
 #include "nsPIListBoxObject.h"
 #include "nsListBoxBodyFrame.h"
 #include "nsListItemFrame.h"
 #include "nsXULLabelFrame.h"
 
 //------------------------------------------------------------------
 
 nsIFrame*
-NS_NewAutoRepeatBoxFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewAutoRepeatBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 nsContainerFrame*
-NS_NewRootBoxFrame (nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewRootBoxFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 nsContainerFrame*
-NS_NewDocElementBoxFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewDocElementBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 nsIFrame*
-NS_NewDeckFrame (nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewDeckFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 nsIFrame*
-NS_NewLeafBoxFrame (nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewLeafBoxFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 nsIFrame*
-NS_NewStackFrame (nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewStackFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 nsIFrame*
-NS_NewProgressMeterFrame (nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewProgressMeterFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 nsIFrame*
-NS_NewRangeFrame (nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewRangeFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 nsIFrame*
-NS_NewImageBoxFrame (nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewImageBoxFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 nsIFrame*
-NS_NewTextBoxFrame (nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewTextBoxFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 nsIFrame*
-NS_NewGroupBoxFrame (nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewGroupBoxFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 nsIFrame*
-NS_NewButtonBoxFrame (nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewButtonBoxFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 nsIFrame*
-NS_NewSplitterFrame (nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewSplitterFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 nsIFrame*
-NS_NewMenuPopupFrame (nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewMenuPopupFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 nsIFrame*
-NS_NewPopupSetFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewPopupSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 nsIFrame*
-NS_NewMenuFrame (nsIPresShell* aPresShell, ComputedStyle* aStyle, uint32_t aFlags);
+NS_NewMenuFrame (nsIPresShell* aPresShell, nsStyleContext* aContext, uint32_t aFlags);
 
 nsIFrame*
-NS_NewMenuBarFrame (nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewMenuBarFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 nsIFrame*
-NS_NewTreeBodyFrame (nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewTreeBodyFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 // grid
 nsresult
 NS_NewGridLayout2 ( nsIPresShell* aPresShell, nsBoxLayout** aNewLayout );
 nsIFrame*
-NS_NewGridRowLeafFrame (nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewGridRowLeafFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
 nsIFrame*
-NS_NewGridRowGroupFrame (nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewGridRowGroupFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 // end grid
 
 nsIFrame*
-NS_NewTitleBarFrame (nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewTitleBarFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 nsIFrame*
-NS_NewResizerFrame (nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewResizerFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 
 #endif
 
 nsHTMLScrollFrame*
-NS_NewHTMLScrollFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle, bool aIsRoot);
+NS_NewHTMLScrollFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, bool aIsRoot);
 
 nsXULScrollFrame*
-NS_NewXULScrollFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle,
+NS_NewXULScrollFrame(nsIPresShell* aPresShell, nsStyleContext* aContext,
                      bool aIsRoot, bool aClipAllDescendants);
 
 nsIFrame*
-NS_NewSliderFrame (nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewSliderFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 nsIFrame*
-NS_NewScrollbarFrame (nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewScrollbarFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 nsIFrame*
-NS_NewScrollbarButtonFrame (nsIPresShell* aPresShell, ComputedStyle* aStyle);
+NS_NewScrollbarButtonFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 
 #ifdef NOISY_FINDFRAME
 static int32_t FFWC_totalCount=0;
 static int32_t FFWC_doLoop=0;
 static int32_t FFWC_doSibling=0;
 static int32_t FFWC_recursions=0;
 static int32_t FFWC_nextInFlows=0;
 #endif
 
 
 // Returns true if aFrame is an anonymous flex/grid item.
 static inline bool
 IsAnonymousFlexOrGridItem(const nsIFrame* aFrame)
 {
-  const nsAtom* pseudoType = aFrame->Style()->GetPseudo();
+  const nsAtom* pseudoType = aFrame->StyleContext()->GetPseudo();
   return pseudoType == nsCSSAnonBoxes::anonymousFlexItem ||
          pseudoType == nsCSSAnonBoxes::anonymousGridItem;
 }
 
 // Returns true if aFrame is a flex/grid container.
 static inline bool
 IsFlexOrGridContainer(const nsIFrame* aFrame)
 {
@@ -365,17 +365,17 @@ IsFlexContainerForLegacyBox(const nsIFra
 #if DEBUG
 static void
 AssertAnonymousFlexOrGridItemParent(const nsIFrame* aChild,
                                     const nsIFrame* aParent)
 {
   MOZ_ASSERT(IsAnonymousFlexOrGridItem(aChild),
              "expected an anonymous flex or grid item child frame");
   MOZ_ASSERT(aParent, "expected a parent frame");
-  const nsAtom* pseudoType = aChild->Style()->GetPseudo();
+  const nsAtom* pseudoType = aChild->StyleContext()->GetPseudo();
   if (pseudoType == nsCSSAnonBoxes::anonymousFlexItem) {
     MOZ_ASSERT(aParent->IsFlexContainerFrame(),
                "anonymous flex items should only exist as children "
                "of flex container frames");
   } else {
     MOZ_ASSERT(aParent->IsGridContainerFrame(),
                "anonymous grid items should only exist as children "
                "of grid container frames");
@@ -468,21 +468,20 @@ ReparentFrame(RestyleManager* aRestyleMa
               nsIFrame* aFrame,
               bool aForceStyleReparent)
 {
   aFrame->SetParent(aNewParentFrame);
   // We reparent frames for two reasons: to put them inside ::first-line, and to
   // put them inside some wrapper anonymous boxes.
   //
   // The latter shouldn't affect any styles in practice, so only needs style
-  // context reparenting in the Gecko backend.
-  //
-  // FIXME(emilio): Remove old Gecko stuff.
+  // context reparenting in the Gecko backend, to make our style context tree
+  // assertions happy.  The former passes aForceStyleReparent == true.
   if (aForceStyleReparent || aRestyleManager->IsGecko()) {
-    aRestyleManager->ReparentComputedStyle(aFrame);
+    aRestyleManager->ReparentStyleContext(aFrame);
   }
 }
 
 static void
 ReparentFrames(nsCSSFrameConstructor* aFrameConstructor,
                nsContainerFrame* aNewParentFrame,
                const nsFrameList& aFrameList,
                bool aForceStyleReparent)
@@ -581,20 +580,20 @@ GetIBContainingBlockFor(nsIFrame* aFrame
     parentFrame = aFrame->GetParent();
 
     if (! parentFrame) {
       NS_ERROR("no unsplit block frame in IB hierarchy");
       return aFrame;
     }
 
     // Note that we ignore non-ib-split frames which have a pseudo on their
-    // ComputedStyle -- they're not the frames we're looking for!  In
+    // style context -- they're not the frames we're looking for!  In
     // particular, they may be hiding a real parent that _is_ in an ib-split.
     if (!IsFramePartOfIBSplit(parentFrame) &&
-        !parentFrame->Style()->GetPseudo())
+        !parentFrame->StyleContext()->GetPseudo())
       break;
 
     aFrame = parentFrame;
   } while (1);
 
   // post-conditions
   NS_ASSERTION(parentFrame, "no normal ancestor found for ib-split frame "
                             "in GetIBContainingBlockFor");
@@ -603,22 +602,22 @@ GetIBContainingBlockFor(nsIFrame* aFrame
   return parentFrame;
 }
 
 // This is a bit slow, but sometimes we need it.
 static bool
 ParentIsWrapperAnonBox(nsIFrame* aParent)
 {
   nsIFrame* maybeAnonBox = aParent;
-  if (maybeAnonBox->Style()->GetPseudo() ==
+  if (maybeAnonBox->StyleContext()->GetPseudo() ==
         nsCSSAnonBoxes::cellContent) {
     // The thing that would maybe be a wrapper anon box is the cell.
     maybeAnonBox = maybeAnonBox->GetParent();
   }
-  return maybeAnonBox->Style()->IsWrapperAnonBox();
+  return maybeAnonBox->StyleContext()->IsWrapperAnonBox();
 }
 
 //----------------------------------------------------------------------
 
 // Block/inline frame construction logic. We maintain a few invariants here:
 //
 // 1. Block frames contain block and inline frames.
 //
@@ -1236,20 +1235,20 @@ nsFrameConstructorState::ConstructBackdr
 {
   MOZ_ASSERT(aFrame->StyleDisplay()->mTopLayer == NS_STYLE_TOP_LAYER_TOP);
   nsContainerFrame* frame = do_QueryFrame(aFrame);
   if (!frame) {
     NS_WARNING("Cannot create backdrop frame for non-container frame");
     return;
   }
 
-  RefPtr<ComputedStyle> style = mPresShell->StyleSet()->
+  RefPtr<nsStyleContext> style = mPresShell->StyleSet()->
     ResolvePseudoElementStyle(aContent->AsElement(),
                               CSSPseudoElementType::backdrop,
-                              /* aParentComputedStyle */ nullptr,
+                              /* aParentStyleContext */ nullptr,
                               /* aPseudoElement */ nullptr);
   MOZ_ASSERT(style->StyleDisplay()->mTopLayer == NS_STYLE_TOP_LAYER_TOP);
   nsContainerFrame* parentFrame =
     GetGeometricParent(style->StyleDisplay(), nullptr);
 
   nsBackdropFrame* backdropFrame = new (mPresShell) nsBackdropFrame(style);
   backdropFrame->Init(aContent, parentFrame, nullptr);
 
@@ -1515,17 +1514,17 @@ nsFrameConstructorSaveState::~nsFrameCon
 /**
  * Moves aFrameList from aOldParent to aNewParent.  This updates the parent
  * pointer of the frames in the list, and reparents their views as needed.
  * nsFrame::SetParent sets the NS_FRAME_HAS_VIEW bit on aNewParent and its
  * ancestors as needed. Then it sets the list as the initial child list
  * on aNewParent, unless aNewParent either already has kids or has been
  * reflowed; in that case it appends the new frames.  Note that this
  * method differs from ReparentFrames in that it doesn't change the kids'
- * style.
+ * style contexts.
  */
 // XXXbz Since this is only used for {ib} splits, could we just copy the view
 // bits from aOldParent to aNewParent and then use the
 // nsFrameList::ApplySetParent?  That would still leave us doing two passes
 // over the list, of course; if we really wanted to we could factor out the
 // relevant part of ReparentFrameViewList, I suppose...  Or just get rid of
 // views, which would make most of this function go away.
 static void
@@ -1670,22 +1669,22 @@ nsCSSFrameConstructor::CreateGenConTextN
     aState.mGeneratedTextNodesWithInitializer.AppendObject(content);
   }
   return content.forget();
 }
 
 already_AddRefed<nsIContent>
 nsCSSFrameConstructor::CreateGeneratedContent(nsFrameConstructorState& aState,
                                               Element* aParentContent,
-                                              ComputedStyle* aComputedStyle,
+                                              nsStyleContext* aStyleContext,
                                               uint32_t        aContentIndex)
 {
   // Get the content value
   const nsStyleContentData &data =
-    aComputedStyle->StyleContent()->ContentAt(aContentIndex);
+    aStyleContext->StyleContent()->ContentAt(aContentIndex);
   nsStyleContentType type = data.GetType();
 
   switch (type) {
     case eStyleContentType_Image: {
       imgRequestProxy* image = data.GetImage();
       if (!image) {
         // CSS had something specified that couldn't be converted to an
         // image object
@@ -1822,32 +1821,32 @@ nsCSSFrameConstructor::CreateGeneratedCo
  * the XML element as if it were a regular child of
  * aParentFrame/aParentContent, giving the XML element the ::before or
  * ::after style.
  */
 void
 nsCSSFrameConstructor::CreateGeneratedContentItem(nsFrameConstructorState& aState,
                                                   nsContainerFrame* aParentFrame,
                                                   Element* aParentContent,
-                                                  ComputedStyle*  aComputedStyle,
+                                                  nsStyleContext*  aStyleContext,
                                                   CSSPseudoElementType aPseudoElement,
                                                   FrameConstructionItemList& aItems)
 {
   MOZ_ASSERT(aPseudoElement == CSSPseudoElementType::before ||
              aPseudoElement == CSSPseudoElementType::after,
              "unexpected aPseudoElement");
 
   StyleSetHandle styleSet = mPresShell->StyleSet();
 
   // Probe for the existence of the pseudo-element
-  RefPtr<ComputedStyle> pseudoComputedStyle;
-  pseudoComputedStyle =
+  RefPtr<nsStyleContext> pseudoStyleContext;
+  pseudoStyleContext =
     styleSet->ProbePseudoElementStyle(aParentContent, aPseudoElement,
-                                      aComputedStyle);
-  if (!pseudoComputedStyle)
+                                      aStyleContext);
+  if (!pseudoStyleContext)
     return;
 
   bool isBefore = aPseudoElement == CSSPseudoElementType::before;
 
   // |ProbePseudoStyleFor| checked the 'display' property and the
   // |ContentCount()| of the 'content' property for us.
   RefPtr<NodeInfo> nodeInfo;
   nsAtom* elemName = isBefore ?
@@ -1880,47 +1879,52 @@ nsCSSFrameConstructor::CreateGeneratedCo
     return;
   }
 
   // Servo has already eagerly computed the style for the container, so we can
   // just stick the style on the element and avoid an additional traversal.
   //
   // We don't do this for pseudos that may trigger animations or transitions,
   // since those need to be kicked off by the traversal machinery.
-  bool hasServoAnimations =
-    Servo_ComputedValues_SpecifiesAnimationsOrTransitions(pseudoComputedStyle);
-  if (!hasServoAnimations) {
-    Servo_SetExplicitStyle(container, pseudoComputedStyle);
+  auto* servoStyle = pseudoStyleContext->GetAsServo();
+  if (servoStyle) {
+    bool hasServoAnimations =
+      Servo_ComputedValues_SpecifiesAnimationsOrTransitions(servoStyle);
+    if (!hasServoAnimations) {
+      Servo_SetExplicitStyle(container, servoStyle);
+    } else {
+      // If animations are involved, we avoid the SetExplicitStyle optimization
+      // above. We need to grab style with animations from the pseudo element
+      // and replace old one.
+      mPresShell->StyleSet()->AsServo()->StyleNewSubtree(container);
+      pseudoStyleContext =
+        styleSet->AsServo()->ResolveServoStyle(container);
+    }
   } else {
-    // If animations are involved, we avoid the SetExplicitStyle optimization
-    // above. We need to grab style with animations from the pseudo element
-    // and replace old one.
-    mPresShell->StyleSet()->AsServo()->StyleNewSubtree(container);
-    pseudoComputedStyle =
-      styleSet->AsServo()->ResolveServoStyle(container);
-  }
-
-  uint32_t contentCount = pseudoComputedStyle->StyleContent()->ContentCount();
+    MOZ_CRASH("old style system disabled");
+  }
+
+  uint32_t contentCount = pseudoStyleContext->StyleContent()->ContentCount();
   for (uint32_t contentIndex = 0; contentIndex < contentCount; contentIndex++) {
     nsCOMPtr<nsIContent> content =
-      CreateGeneratedContent(aState, aParentContent, pseudoComputedStyle,
+      CreateGeneratedContent(aState, aParentContent, pseudoStyleContext,
                              contentIndex);
     if (content) {
       container->AppendChildTo(content, false);
-      if (content->IsElement()) {
+      if (content->IsElement() && servoStyle) {
         // If we created any children elements, Servo needs to traverse them, but
         // the root is already set up.
         mPresShell->StyleSet()->AsServo()->StyleNewSubtree(content->AsElement());
       }
     }
   }
 
   AddFrameConstructionItemsInternal(aState, container, aParentFrame, elemName,
                                     kNameSpaceID_None, true,
-                                    pseudoComputedStyle,
+                                    pseudoStyleContext,
                                     ITEM_IS_GENERATED_CONTENT, nullptr,
                                     aItems);
 }
 
 /****************************************************
  **  BEGIN TABLE SECTION
  ****************************************************/
 
@@ -1932,38 +1936,38 @@ nsCSSFrameConstructor::CreateGeneratedCo
 // created, even for non-anonymous cells and tables respectively.  So for those
 // we have to examine the cell or table frame to see whether it's a pseudo
 // frame. In particular, a lone table caption will have a table wrapper as its
 // parent, but will also trigger construction of an empty inner table, which
 // will be the one we can examine to see whether the wrapper was a pseudo-frame.
 static bool
 IsTablePseudo(nsIFrame* aFrame)
 {
-  nsAtom* pseudoType = aFrame->Style()->GetPseudo();
+  nsAtom* pseudoType = aFrame->StyleContext()->GetPseudo();
   return pseudoType &&
     (pseudoType == nsCSSAnonBoxes::table ||
      pseudoType == nsCSSAnonBoxes::inlineTable ||
      pseudoType == nsCSSAnonBoxes::tableColGroup ||
      pseudoType == nsCSSAnonBoxes::tableRowGroup ||
      pseudoType == nsCSSAnonBoxes::tableRow ||
      pseudoType == nsCSSAnonBoxes::tableCell ||
      (pseudoType == nsCSSAnonBoxes::cellContent &&
-      aFrame->GetParent()->Style()->GetPseudo() ==
+      aFrame->GetParent()->StyleContext()->GetPseudo() ==
         nsCSSAnonBoxes::tableCell) ||
      (pseudoType == nsCSSAnonBoxes::tableWrapper &&
-      (aFrame->PrincipalChildList().FirstChild()->Style()->GetPseudo() ==
+      (aFrame->PrincipalChildList().FirstChild()->StyleContext()->GetPseudo() ==
          nsCSSAnonBoxes::table ||
-       aFrame->PrincipalChildList().FirstChild()->Style()->GetPseudo() ==
+       aFrame->PrincipalChildList().FirstChild()->StyleContext()->GetPseudo() ==
          nsCSSAnonBoxes::inlineTable)));
 }
 
 static bool
 IsRubyPseudo(nsIFrame* aFrame)
 {
-  return RubyUtils::IsRubyPseudo(aFrame->Style()->GetPseudo());
+  return RubyUtils::IsRubyPseudo(aFrame->StyleContext()->GetPseudo());
 }
 
 static bool
 IsTableOrRubyPseudo(nsIFrame* aFrame)
 {
   return IsTablePseudo(aFrame) || IsRubyPseudo(aFrame);
 }
 
@@ -2024,24 +2028,24 @@ GetCaptionAdjustedParent(nsContainerFram
     *aAdjParentFrame = ::AdjustCaptionParentFrame(aParentFrame);
   }
   return haveCaption;
 }
 
 void
 nsCSSFrameConstructor::AdjustParentFrame(nsContainerFrame**           aParentFrame,
                                          const FrameConstructionData* aFCData,
-                                         ComputedStyle*              aComputedStyle)
-{
-  NS_PRECONDITION(aComputedStyle, "Must have child's style");
+                                         nsStyleContext*              aStyleContext)
+{
+  NS_PRECONDITION(aStyleContext, "Must have child's style context");
   NS_PRECONDITION(aFCData, "Must have frame construction data");
 
   bool tablePart = ((aFCData->mBits & FCDATA_IS_TABLE_PART) != 0);
 
-  if (tablePart && aComputedStyle->StyleDisplay()->mDisplay ==
+  if (tablePart && aStyleContext->StyleDisplay()->mDisplay ==
       StyleDisplay::TableCaption) {
     *aParentFrame = ::AdjustCaptionParentFrame(*aParentFrame);
   }
 }
 
 // Pull all the captions present in aItems out  into aCaptions
 static void
 PullOutCaptionFrames(nsFrameItems& aItems, nsFrameItems& aCaptions)
@@ -2069,34 +2073,34 @@ nsCSSFrameConstructor::ConstructTable(ns
                                       const nsStyleDisplay*    aDisplay,
                                       nsFrameItems&            aFrameItems)
 {
   NS_PRECONDITION(aDisplay->mDisplay == StyleDisplay::Table ||
                   aDisplay->mDisplay == StyleDisplay::InlineTable,
                   "Unexpected call");
 
   nsIContent* const content = aItem.mContent;
-  ComputedStyle* const styleContext = aItem.mComputedStyle;
+  nsStyleContext* const styleContext = aItem.mStyleContext;
   const uint32_t nameSpaceID = aItem.mNameSpaceID;
 
   // create the pseudo SC for the table wrapper as a child of the inner SC
-  RefPtr<ComputedStyle> outerComputedStyle;
-  outerComputedStyle = mPresShell->StyleSet()->
+  RefPtr<nsStyleContext> outerStyleContext;
+  outerStyleContext = mPresShell->StyleSet()->
     ResolveInheritingAnonymousBoxStyle(nsCSSAnonBoxes::tableWrapper,
                                        styleContext);
 
   // Create the table wrapper frame which holds the caption and inner table frame
   nsContainerFrame* newFrame;
   if (kNameSpaceID_MathML == nameSpaceID)
-    newFrame = NS_NewMathMLmtableOuterFrame(mPresShell, outerComputedStyle);
+    newFrame = NS_NewMathMLmtableOuterFrame(mPresShell, outerStyleContext);
   else
-    newFrame = NS_NewTableWrapperFrame(mPresShell, outerComputedStyle);
+    newFrame = NS_NewTableWrapperFrame(mPresShell, outerStyleContext);
 
   nsContainerFrame* geometricParent =
-    aState.GetGeometricParent(outerComputedStyle->StyleDisplay(),
+    aState.GetGeometricParent(outerStyleContext->StyleDisplay(),
                               aParentFrame);
 
   // Init the table wrapper frame
   InitAndRestoreFrame(aState, content, geometricParent, newFrame);
 
   // Create the inner table frame
   nsContainerFrame* innerFrame;
   if (kNameSpaceID_MathML == nameSpaceID)
@@ -2117,17 +2121,17 @@ nsCSSFrameConstructor::ConstructTable(ns
     // Set mRootElementFrame before processing children.
     mRootElementFrame = newFrame;
   }
 
   nsFrameItems childItems;
 
   // Process children
   nsFrameConstructorSaveState absoluteSaveState;
-  const nsStyleDisplay* display = outerComputedStyle->StyleDisplay();
+  const nsStyleDisplay* display = outerStyleContext->StyleDisplay();
 
   // Mark the table frame as an absolute container if needed
   newFrame->AddStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN);
   if (display->IsAbsPosContainingBlock(newFrame)) {
     aState.PushAbsoluteContainingBlock(newFrame, newFrame, absoluteSaveState);
   }
   NS_ASSERTION(aItem.mAnonChildren.IsEmpty(),
                "nsIAnonymousContentCreator::CreateAnonymousContent "
@@ -2185,20 +2189,20 @@ nsCSSFrameConstructor::ConstructTableRow
                                                    const nsStyleDisplay*    aDisplay,
                                                    nsFrameItems&            aFrameItems)
 {
   MOZ_ASSERT(aDisplay->mDisplay == StyleDisplay::TableRow ||
              aDisplay->mDisplay == StyleDisplay::TableRowGroup ||
              aDisplay->mDisplay == StyleDisplay::TableFooterGroup ||
              aDisplay->mDisplay == StyleDisplay::TableHeaderGroup,
              "Not a row or row group");
-  MOZ_ASSERT(aItem.mComputedStyle->StyleDisplay() == aDisplay,
-             "Display style doesn't match style");
+  MOZ_ASSERT(aItem.mStyleContext->StyleDisplay() == aDisplay,
+             "Display style doesn't match style context");
   nsIContent* const content = aItem.mContent;
-  ComputedStyle* const styleContext = aItem.mComputedStyle;
+  nsStyleContext* const styleContext = aItem.mStyleContext;
   const uint32_t nameSpaceID = aItem.mNameSpaceID;
 
   nsContainerFrame* newFrame;
   if (aDisplay->mDisplay == StyleDisplay::TableRow) {
     if (kNameSpaceID_MathML == nameSpaceID)
       newFrame = NS_NewMathMLmtrFrame(mPresShell, styleContext);
     else
       newFrame = NS_NewTableRowFrame(mPresShell, styleContext);
@@ -2235,22 +2239,23 @@ nsCSSFrameConstructor::ConstructTableRow
 nsIFrame*
 nsCSSFrameConstructor::ConstructTableCol(nsFrameConstructorState& aState,
                                          FrameConstructionItem&   aItem,
                                          nsContainerFrame*        aParentFrame,
                                          const nsStyleDisplay*    aStyleDisplay,
                                          nsFrameItems&            aFrameItems)
 {
   nsIContent* const content = aItem.mContent;
-  ComputedStyle* const styleContext = aItem.mComputedStyle;
+  nsStyleContext* const styleContext = aItem.mStyleContext;
 
   nsTableColFrame* colFrame = NS_NewTableColFrame(mPresShell, styleContext);
   InitAndRestoreFrame(aState, content, aParentFrame, colFrame);
 
-  NS_ASSERTION(colFrame->Style() == styleContext, "Unexpected style");
+  NS_ASSERTION(colFrame->StyleContext() == styleContext,
+               "Unexpected style context");
 
   aFrameItems.AddChild(colFrame);
 
   // construct additional col frames if the col frame has a span > 1
   int32_t span = colFrame->GetSpan();
   for (int32_t spanX = 1; spanX < span; spanX++) {
     nsTableColFrame* newCol = NS_NewTableColFrame(mPresShell, styleContext);
     InitAndRestoreFrame(aState, content, aParentFrame, newCol, false);
@@ -2269,17 +2274,17 @@ nsCSSFrameConstructor::ConstructTableCel
                                           nsContainerFrame*        aParentFrame,
                                           const nsStyleDisplay*    aDisplay,
                                           nsFrameItems&            aFrameItems)
 {
   MOZ_ASSERT(aDisplay->mDisplay == StyleDisplay::TableCell,
              "Unexpected call");
 
   nsIContent* const content = aItem.mContent;
-  ComputedStyle* const styleContext = aItem.mComputedStyle;
+  nsStyleContext* const styleContext = aItem.mStyleContext;
   const uint32_t nameSpaceID = aItem.mNameSpaceID;
 
   nsTableFrame* tableFrame =
     static_cast<nsTableRowFrame*>(aParentFrame)->GetTableFrame();
   nsContainerFrame* newFrame;
   // <mtable> is border separate in mathml.css and the MathML code doesn't implement
   // border collapse. For those users who style <mtable> with border collapse,
   // give them the default non-MathML table frames that understand border collapse.
@@ -2296,17 +2301,17 @@ nsCSSFrameConstructor::ConstructTableCel
     newFrame = NS_NewTableCellFrame(mPresShell, styleContext, tableFrame);
   }
 
   // Initialize the table cell frame
   InitAndRestoreFrame(aState, content, aParentFrame, newFrame);
   newFrame->AddStateBits(NS_FRAME_OWNS_ANON_BOXES);
 
   // Resolve pseudo style and initialize the body cell frame
-  RefPtr<ComputedStyle> innerPseudoStyle;
+  RefPtr<nsStyleContext> innerPseudoStyle;
   innerPseudoStyle = mPresShell->StyleSet()->
     ResolveInheritingAnonymousBoxStyle(nsCSSAnonBoxes::cellContent,
                                        styleContext);
 
   // Create a block frame that will format the cell's content
   bool isBlock;
   nsContainerFrame* cellInnerFrame;
   if (kNameSpaceID_MathML == nameSpaceID) {
@@ -2401,24 +2406,23 @@ nsIFrame*
 nsCSSFrameConstructor::ConstructDocElementFrame(Element*                 aDocElement,
                                                 nsILayoutHistoryState*   aFrameState)
 {
   MOZ_ASSERT(GetRootFrame(),
              "No viewport?  Someone forgot to call ConstructRootFrame!");
   MOZ_ASSERT(!mDocElementContainingBlock,
              "Shouldn't have a doc element containing block here");
 
-  // Resolve a new style for the viewport since it may be affected by a new root
-  // element style (e.g. a propagated 'direction').
-  //
-  // @see ComputedStyle::ApplyStyleFixups
+  // Resolve a new style context for the viewport since it may be affected
+  // by a new root element style (e.g. a propagated 'direction').
+  // @see nsStyleContext::ApplyStyleFixups
   {
-    RefPtr<ComputedStyle> sc = mPresShell->StyleSet()->
+    RefPtr<nsStyleContext> sc = mPresShell->StyleSet()->
       ResolveInheritingAnonymousBoxStyle(nsCSSAnonBoxes::viewport, nullptr);
-    GetRootFrame()->SetComputedStyleWithoutNotification(sc);
+    GetRootFrame()->SetStyleContextWithoutNotification(sc);
   }
 
   // Make sure to call UpdateViewportScrollbarStylesOverride before
   // SetUpDocElementContainingBlock, since it sets up our scrollbar state
   // properly.
   DebugOnly<nsIContent*> propagatedScrollFrom;
   if (nsPresContext* presContext = mPresShell->GetPresContext()) {
     propagatedScrollFrom = presContext->UpdateViewportScrollbarStylesOverride();
@@ -2450,17 +2454,17 @@ nsCSSFrameConstructor::ConstructDocEleme
     if (!aDocElement->HasServoData()) {
       // NOTE(emilio): If the root has a non-null binding, we'll stop at the
       // document element and won't process any children, loading the bindings
       // (or failing to do so) will take care of the rest.
       set->StyleNewSubtree(aDocElement);
     }
   }
 
-  RefPtr<ComputedStyle> styleContext =
+  RefPtr<nsStyleContext> styleContext =
     mPresShell->StyleSet()->AsServo()->ResolveServoStyle(aDocElement);
 
   const nsStyleDisplay* display = styleContext->StyleDisplay();
 
   // Ensure that our XBL bindings are installed.
   if (display->mBinding) {
     // Get the XBL loader.
     nsresult rv;
@@ -2554,18 +2558,18 @@ nsCSSFrameConstructor::ConstructDocEleme
     // function to this FrameConstructionData.
 
     // XXXbz on the other hand, if we converted this whole function to
     // FrameConstructionData/Item, then we'd need the right function
     // here... but would probably be able to get away with less code in this
     // function in general.
     // Use a null PendingBinding, since our binding is not in fact pending.
     static const FrameConstructionData rootSVGData = FCDATA_DECL(0, nullptr);
-    already_AddRefed<ComputedStyle> extraRef =
-      RefPtr<ComputedStyle>(styleContext).forget();
+    already_AddRefed<nsStyleContext> extraRef =
+      RefPtr<nsStyleContext>(styleContext).forget();
     AutoFrameConstructionItem item(this, &rootSVGData, aDocElement,
                                    aDocElement->NodeInfo()->NameAtom(),
                                    kNameSpaceID_SVG, nullptr, extraRef, true,
                                    nullptr);
 
     nsFrameItems frameItems;
     contentFrame = static_cast<nsContainerFrame*>(
       ConstructOuterSVG(state, item, mDocElementContainingBlock,
@@ -2606,18 +2610,18 @@ nsCSSFrameConstructor::ConstructDocEleme
     // function to this FrameConstructionData.
 
     // XXXbz on the other hand, if we converted this whole function to
     // FrameConstructionData/Item, then we'd need the right function
     // here... but would probably be able to get away with less code in this
     // function in general.
     // Use a null PendingBinding, since our binding is not in fact pending.
     static const FrameConstructionData rootTableData = FCDATA_DECL(0, nullptr);
-    already_AddRefed<ComputedStyle> extraRef =
-      RefPtr<ComputedStyle>(styleContext).forget();
+    already_AddRefed<nsStyleContext> extraRef =
+      RefPtr<nsStyleContext>(styleContext).forget();
     AutoFrameConstructionItem item(this, &rootTableData, aDocElement,
                                    aDocElement->NodeInfo()->NameAtom(),
                                    kNameSpaceID_None, nullptr, extraRef, true,
                                    nullptr);
 
     nsFrameItems frameItems;
     // if the document is a table then just populate it.
     contentFrame = static_cast<nsContainerFrame*>(
@@ -2650,17 +2654,17 @@ nsCSSFrameConstructor::ConstructDocEleme
   NS_ASSERTION(processChildren ? !mRootElementFrame :
                  mRootElementFrame == contentFrame,
                "unexpected mRootElementFrame");
   mRootElementFrame = contentFrame;
 
   // Figure out which frame has the main style for the document element,
   // assigning it to mRootElementStyleFrame.
   // Backgrounds should be propagated from that frame to the viewport.
-  contentFrame->GetParentComputedStyle(&mRootElementStyleFrame);
+  contentFrame->GetParentStyleContext(&mRootElementStyleFrame);
   bool isChild = mRootElementStyleFrame &&
                  mRootElementStyleFrame->GetParent() == contentFrame;
   if (!isChild) {
     mRootElementStyleFrame = mRootElementFrame;
   }
 
   if (processChildren) {
     // Still need to process the child content
@@ -2695,17 +2699,17 @@ nsCSSFrameConstructor::ConstructDocEleme
 nsIFrame*
 nsCSSFrameConstructor::ConstructRootFrame()
 {
   AUTO_LAYOUT_PHASE_ENTRY_POINT(mPresShell->GetPresContext(), FrameC);
 
   StyleSetHandle styleSet = mPresShell->StyleSet();
 
   // --------- BUILD VIEWPORT -----------
-  RefPtr<ComputedStyle> viewportPseudoStyle =
+  RefPtr<nsStyleContext> viewportPseudoStyle =
     styleSet->ResolveInheritingAnonymousBoxStyle(nsCSSAnonBoxes::viewport,
                                                  nullptr);
   ViewportFrame* viewportFrame =
     NS_NewViewportFrame(mPresShell, viewportPseudoStyle);
 
   // XXXbz do we _have_ to pass a null content pointer to that frame?
   // Would it really kill us to pass in the root element or something?
   // What would that break?
@@ -2797,17 +2801,17 @@ nsCSSFrameConstructor::SetUpDocElementCo
   // The root frame serves two purposes:
   // - reserves space for any margins needed for the document element's frame
   // - renders the document element's background. This ensures the background covers
   //   the entire canvas as specified by the CSS2 spec
 
   nsPresContext* presContext = mPresShell->GetPresContext();
   bool isPaginated = presContext->IsRootPaginatedDocument();
   nsContainerFrame* viewportFrame = static_cast<nsContainerFrame*>(GetRootFrame());
-  ComputedStyle* viewportPseudoStyle = viewportFrame->Style();
+  nsStyleContext* viewportPseudoStyle = viewportFrame->StyleContext();
 
   nsContainerFrame* rootFrame = nullptr;
   nsAtom* rootPseudo;
 
   if (!isPaginated) {
 #ifdef MOZ_XUL
     if (aDocElement->IsXULElement())
     {
@@ -2851,17 +2855,17 @@ nsCSSFrameConstructor::SetUpDocElementCo
 
   // We no longer need to do overflow propagation here. It's taken care of
   // when we construct frames for the element whose overflow might be
   // propagated
   NS_ASSERTION(!isScrollable || !isXUL,
                "XUL documents should never be scrollable - see above");
 
   nsContainerFrame* newFrame = rootFrame;
-  RefPtr<ComputedStyle> rootPseudoStyle;
+  RefPtr<nsStyleContext> rootPseudoStyle;
   // we must create a state because if the scrollbars are GFX it needs the
   // state to build the scrollbar frames.
   nsFrameConstructorState state(mPresShell, nullptr, nullptr, nullptr);
 
   // Start off with the viewport as parent; we'll adjust it as needed.
   nsContainerFrame* parentFrame = viewportFrame;
 
   StyleSetHandle styleSet = mPresShell->StyleSet();
@@ -2880,17 +2884,17 @@ nsCSSFrameConstructor::SetUpDocElementCo
       }
 
       // Build the frame. We give it the content we are wrapping which is the
       // document element, the root frame, the parent view port frame, and we
       // should get back the new frame and the scrollable view if one was
       // created.
 
       // resolve a context for the scrollframe
-      RefPtr<ComputedStyle>  styleContext;
+      RefPtr<nsStyleContext>  styleContext;
       styleContext =
         styleSet->ResolveInheritingAnonymousBoxStyle(nsCSSAnonBoxes::viewportScroll,
                                                      viewportPseudoStyle);
 
       // Note that the viewport scrollframe is always built with
       // overflow:auto style. This forces the scroll frame to create
       // anonymous content for both scrollbars. This is necessary even
       // if the HTML or BODY elements are overriding the viewport
@@ -2903,17 +2907,17 @@ nsCSSFrameConstructor::SetUpDocElementCo
                                                   styleContext,
                                                   viewportFrame,
                                                   rootPseudo,
                                                   true,
                                                   newFrame);
       parentFrame = newFrame;
   }
 
-  rootFrame->SetComputedStyleWithoutNotification(rootPseudoStyle);
+  rootFrame->SetStyleContextWithoutNotification(rootPseudoStyle);
   rootFrame->Init(aDocElement, parentFrame, nullptr);
 
   if (isScrollable) {
     FinishBuildingScrollFrame(parentFrame, rootFrame);
   }
 
   if (isPaginated) {
     // Create the first page
@@ -2963,31 +2967,31 @@ nsCSSFrameConstructor::ConstructAnonymou
 }
 
 nsContainerFrame*
 nsCSSFrameConstructor::ConstructPageFrame(nsIPresShell*  aPresShell,
                                           nsContainerFrame* aParentFrame,
                                           nsIFrame*      aPrevPageFrame,
                                           nsContainerFrame*& aCanvasFrame)
 {
-  ComputedStyle* parentComputedStyle = aParentFrame->Style();
+  nsStyleContext* parentStyleContext = aParentFrame->StyleContext();
   StyleSetHandle styleSet = aPresShell->StyleSet();
 
-  RefPtr<ComputedStyle> pagePseudoStyle;
+  RefPtr<nsStyleContext> pagePseudoStyle;
   pagePseudoStyle =
     styleSet->ResolveInheritingAnonymousBoxStyle(nsCSSAnonBoxes::page,
-                                                 parentComputedStyle);
+                                                 parentStyleContext);
 
   nsContainerFrame* pageFrame = NS_NewPageFrame(aPresShell, pagePseudoStyle);
 
   // Initialize the page frame and force it to have a view. This makes printing of
   // the pages easier and faster.
   pageFrame->Init(nullptr, aParentFrame, aPrevPageFrame);
 
-  RefPtr<ComputedStyle> pageContentPseudoStyle;
+  RefPtr<nsStyleContext> pageContentPseudoStyle;
   pageContentPseudoStyle =
     styleSet->ResolveInheritingAnonymousBoxStyle(nsCSSAnonBoxes::pageContent,
                                                  pagePseudoStyle);
 
   nsContainerFrame* pageContentFrame =
     NS_NewPageContentFrame(aPresShell, pageContentPseudoStyle);
 
   // Initialize the page content frame and force it to have a view. Also make it the
@@ -3001,17 +3005,17 @@ nsCSSFrameConstructor::ConstructPageFram
   if (!prevPageContentFrame) {
     pageContentFrame->AddStateBits(NS_FRAME_OWNS_ANON_BOXES);
   }
   SetInitialSingleChild(pageFrame, pageContentFrame);
   // Make it an absolute container for fixed-pos elements
   pageContentFrame->AddStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN);
   pageContentFrame->MarkAsAbsoluteContainingBlock();
 
-  RefPtr<ComputedStyle> canvasPseudoStyle;
+  RefPtr<nsStyleContext> canvasPseudoStyle;
   canvasPseudoStyle =
     styleSet->ResolveInheritingAnonymousBoxStyle(nsCSSAnonBoxes::canvas,
                                                  pageContentPseudoStyle);
 
   aCanvasFrame = NS_NewCanvasFrame(aPresShell, canvasPseudoStyle);
 
   nsIFrame* prevCanvasFrame = nullptr;
   if (prevPageContentFrame) {
@@ -3027,20 +3031,20 @@ nsCSSFrameConstructor::ConstructPageFram
 nsIFrame*
 nsCSSFrameConstructor::CreatePlaceholderFrameFor(nsIPresShell*     aPresShell,
                                                  nsIContent*       aContent,
                                                  nsIFrame*         aFrame,
                                                  nsContainerFrame* aParentFrame,
                                                  nsIFrame*         aPrevInFlow,
                                                  nsFrameState      aTypeBit)
 {
-  RefPtr<ComputedStyle> placeholderStyle = aPresShell->StyleSet()->
+  RefPtr<nsStyleContext> placeholderStyle = aPresShell->StyleSet()->
     ResolveStyleForPlaceholder();
 
-  // The placeholder frame gets a pseudo style.
+  // The placeholder frame gets a pseudo style context
   nsPlaceholderFrame* placeholderFrame =
     (nsPlaceholderFrame*)NS_NewPlaceholderFrame(aPresShell, placeholderStyle,
                                                 aTypeBit);
 
   placeholderFrame->Init(aContent, aParentFrame, aPrevInFlow);
 
   // Associate the placeholder/out-of-flow with each other.
   placeholderFrame->SetOutOfFlowFrame(aFrame);
@@ -3071,17 +3075,17 @@ ClearLazyBits(nsIContent* aStartContent,
 nsIFrame*
 nsCSSFrameConstructor::ConstructSelectFrame(nsFrameConstructorState& aState,
                                             FrameConstructionItem&   aItem,
                                             nsContainerFrame*        aParentFrame,
                                             const nsStyleDisplay*    aStyleDisplay,
                                             nsFrameItems&            aFrameItems)
 {
   nsIContent* const content = aItem.mContent;
-  ComputedStyle* const styleContext = aItem.mComputedStyle;
+  nsStyleContext* const styleContext = aItem.mStyleContext;
 
   // Construct a frame-based listbox or combobox
   dom::HTMLSelectElement* sel = dom::HTMLSelectElement::FromNode(content);
   MOZ_ASSERT(sel);
   if (sel->IsCombobox()) {
     // Construct a frame-based combo box.
     // The frame-based combo box is built out of three parts. A display area, a button and
     // a dropdown list. The display area and button are created through anonymous content.
@@ -3100,17 +3104,17 @@ nsCSSFrameConstructor::ConstructSelectFr
                         aState.GetGeometricParent(aStyleDisplay, aParentFrame),
                         comboboxFrame);
 
     comboboxFrame->AddStateBits(NS_FRAME_OWNS_ANON_BOXES);
 
     aState.AddChild(comboboxFrame, aFrameItems, content, aParentFrame);
 
     // Resolve pseudo element style for the dropdown list
-    RefPtr<ComputedStyle> listStyle;
+    RefPtr<nsStyleContext> listStyle;
     listStyle = mPresShell->StyleSet()->
       ResolveInheritingAnonymousBoxStyle(nsCSSAnonBoxes::dropDownList,
                                          styleContext);
 
     // Create a listbox
     nsContainerFrame* listFrame = NS_NewListControlFrame(mPresShell, listStyle);
 
     // Notify the listbox that it is being used as a dropdown list.
@@ -3215,74 +3219,74 @@ nsCSSFrameConstructor::ConstructSelectFr
  * be create with BuildScrollFrame.
  */
 void
 nsCSSFrameConstructor::InitializeSelectFrame(nsFrameConstructorState& aState,
                                              nsContainerFrame*        scrollFrame,
                                              nsContainerFrame*        scrolledFrame,
                                              nsIContent*              aContent,
                                              nsContainerFrame*        aParentFrame,
-                                             ComputedStyle*          aComputedStyle,
+                                             nsStyleContext*          aStyleContext,
                                              bool                     aBuildCombobox,
                                              PendingBinding*          aPendingBinding,
                                              nsFrameItems&            aFrameItems)
 {
   // Initialize it
   nsContainerFrame* geometricParent =
-    aState.GetGeometricParent(aComputedStyle->StyleDisplay(), aParentFrame);
+    aState.GetGeometricParent(aStyleContext->StyleDisplay(), aParentFrame);
 
   // We don't call InitAndRestoreFrame for scrollFrame because we can only
   // restore the frame state after its parts have been created (in particular,
   // the scrollable view). So we have to split Init and Restore.
 
   scrollFrame->Init(aContent, geometricParent, nullptr);
 
   if (!aBuildCombobox || nsLayoutUtils::IsContentSelectEnabled()) {
     aState.AddChild(scrollFrame, aFrameItems, aContent, aParentFrame);
   }
 
-  BuildScrollFrame(aState, aContent, aComputedStyle, scrolledFrame,
+  BuildScrollFrame(aState, aContent, aStyleContext, scrolledFrame,
                    geometricParent, scrollFrame);
 
   if (aState.mFrameState) {
     // Restore frame state for the scroll frame
     RestoreFrameStateFor(scrollFrame, aState.mFrameState);
   }
 
   // Process children
   nsFrameItems                childItems;
 
-  ProcessChildren(aState, aContent, aComputedStyle, scrolledFrame, false,
+  ProcessChildren(aState, aContent, aStyleContext, scrolledFrame, false,
                   childItems, false, aPendingBinding);
 
   // Set the scrolled frame's initial child lists
   scrolledFrame->SetInitialChildList(kPrincipalList, childItems);
 }
 
 nsIFrame*
 nsCSSFrameConstructor::ConstructFieldSetFrame(nsFrameConstructorState& aState,
                                               FrameConstructionItem&   aItem,
                                               nsContainerFrame*        aParentFrame,
                                               const nsStyleDisplay*    aStyleDisplay,
                                               nsFrameItems&            aFrameItems)
 {
   nsIContent* const content = aItem.mContent;
-  ComputedStyle* const styleContext = aItem.mComputedStyle;
+  nsStyleContext* const styleContext = aItem.mStyleContext;
 
   nsContainerFrame* fieldsetFrame = NS_NewFieldSetFrame(mPresShell, styleContext);
 
   // Initialize it
   InitAndRestoreFrame(aState, content,
                       aState.GetGeometricParent(aStyleDisplay, aParentFrame),
                       fieldsetFrame);
 
   fieldsetFrame->AddStateBits(NS_FRAME_OWNS_ANON_BOXES);
 
   // Resolve style and initialize the frame
-  RefPtr<ComputedStyle> fieldsetContentStyle;
+  RefPtr<nsStyleContext> fieldsetContentStyle;
   fieldsetContentStyle = mPresShell->StyleSet()->
     ResolveInheritingAnonymousBoxStyle(nsCSSAnonBoxes::fieldsetContent,
                                        styleContext);
 
   const nsStyleDisplay* fieldsetContentDisplay = fieldsetContentStyle->StyleDisplay();
   bool isScrollable = fieldsetContentDisplay->IsScrollableOverflow();
   nsContainerFrame* scrollFrame = nullptr;
   if (isScrollable) {
@@ -3312,17 +3316,17 @@ nsCSSFrameConstructor::ConstructFieldSet
       InitAndRestoreFrame(aState, content, parent, contentFrame);
       contentFrameTop = contentFrame;
       break;
     default: {
       MOZ_ASSERT(fieldsetContentDisplay->mDisplay == StyleDisplay::Block,
                  "bug in nsRuleNode::ComputeDisplayData?");
 
       nsContainerFrame* columnSetFrame = nullptr;
-      RefPtr<ComputedStyle> innerSC = fieldsetContentStyle;
+      RefPtr<nsStyleContext> innerSC = fieldsetContentStyle;
       const nsStyleColumn* columns = fieldsetContentStyle->StyleColumn();
       if (columns->mColumnCount != NS_STYLE_COLUMN_COUNT_AUTO ||
           columns->mColumnWidth.GetUnit() != eStyleUnit_Auto) {
         columnSetFrame =
           NS_NewColumnSetFrame(mPresShell, fieldsetContentStyle,
                                nsFrameState(NS_FRAME_OWNS_ANON_BOXES));
         InitAndRestoreFrame(aState, content, parent, columnSetFrame);
         innerSC = mPresShell->StyleSet()->
@@ -3418,17 +3422,17 @@ nsCSSFrameConstructor::ConstructDetailsF
 }
 
 static nsIFrame*
 FindAncestorWithGeneratedContentPseudo(nsIFrame* aFrame)
 {
   for (nsIFrame* f = aFrame->GetParent(); f; f = f->GetParent()) {
     NS_ASSERTION(f->IsGeneratedContentFrame(),
                  "should not have exited generated content");
-    nsAtom* pseudo = f->Style()->GetPseudo();
+    nsAtom* pseudo = f->StyleContext()->GetPseudo();
     if (pseudo == nsCSSPseudoElements::before ||
         pseudo == nsCSSPseudoElements::after)
       return f;
   }
   return nullptr;
 }
 
 #define SIMPLE_FCDATA(_func) FCDATA_DECL(0, _func)
@@ -3458,22 +3462,22 @@ nsCSSFrameConstructor::FindTextData(nsIF
   return &sTextData;
 }
 
 void
 nsCSSFrameConstructor::ConstructTextFrame(const FrameConstructionData* aData,
                                           nsFrameConstructorState& aState,
                                           nsIContent*              aContent,
                                           nsContainerFrame*        aParentFrame,
-                                          ComputedStyle*          aComputedStyle,
+                                          nsStyleContext*          aStyleContext,
                                           nsFrameItems&            aFrameItems)
 {
   NS_PRECONDITION(aData, "Must have frame construction data");
 
-  nsIFrame* newFrame = (*aData->mFunc.mCreationFunc)(mPresShell, aComputedStyle);
+  nsIFrame* newFrame = (*aData->mFunc.mCreationFunc)(mPresShell, aStyleContext);
 
   InitAndRestoreFrame(aState, aContent, aParentFrame, newFrame);
 
   // We never need to create a view for a text frame.
 
   if (newFrame->IsGeneratedContentFrame()) {
     nsAutoPtr<nsGenConInitializer> initializer;
     initializer =
@@ -3494,42 +3498,42 @@ nsCSSFrameConstructor::ConstructTextFram
   if (!aState.mCreatingExtraFrames)
     aContent->SetPrimaryFrame(newFrame);
 }
 
 /* static */
 const nsCSSFrameConstructor::FrameConstructionData*
 nsCSSFrameConstructor::FindDataByInt(int32_t aInt,
                                      Element* aElement,
-                                     ComputedStyle* aComputedStyle,
+                                     nsStyleContext* aStyleContext,
                                      const FrameConstructionDataByInt* aDataPtr,
                                      uint32_t aDataLength)
 {
   for (const FrameConstructionDataByInt *curData = aDataPtr,
          *endData = aDataPtr + aDataLength;
        curData != endData;
        ++curData) {
     if (curData->mInt == aInt) {
       const FrameConstructionData* data = &curData->mData;
       if (data->mBits & FCDATA_FUNC_IS_DATA_GETTER) {
-        return data->mFunc.mDataGetter(aElement, aComputedStyle);
+        return data->mFunc.mDataGetter(aElement, aStyleContext);
       }
 
       return data;
     }
   }
 
   return nullptr;
 }
 
 /* static */
 const nsCSSFrameConstructor::FrameConstructionData*
 nsCSSFrameConstructor::FindDataByTag(nsAtom* aTag,
                                      Element* aElement,
-                                     ComputedStyle* aComputedStyle,
+                                     nsStyleContext* aStyleContext,
                                      const FrameConstructionDataByTag* aDataPtr,
                                      uint32_t aDataLength,
                                      bool* aTagFound)
 {
   if (aTagFound) {
     *aTagFound = false;
   }
   for (const FrameConstructionDataByTag *curData = aDataPtr,
@@ -3537,17 +3541,17 @@ nsCSSFrameConstructor::FindDataByTag(nsA
        curData != endData;
        ++curData) {
     if (*curData->mTag == aTag) {
       if (aTagFound) {
         *aTagFound = true;
       }
       const FrameConstructionData* data = &curData->mData;
       if (data->mBits & FCDATA_FUNC_IS_DATA_GETTER) {
-        return data->mFunc.mDataGetter(aElement, aComputedStyle);
+        return data->mFunc.mDataGetter(aElement, aStyleContext);
       }
 
       return data;
     }
   }
 
   return nullptr;
 }
@@ -3564,49 +3568,49 @@ nsCSSFrameConstructor::FindDataByTag(nsA
 #define SIMPLE_TAG_CHAIN(_tag, _func)                                   \
   { &nsGkAtoms::_tag, FCDATA_DECL(FCDATA_FUNC_IS_DATA_GETTER,  _func) }
 #define COMPLEX_TAG_CREATE(_tag, _func)             \
   { &nsGkAtoms::_tag, FULL_CTOR_FCDATA(0, _func) }
 
 static bool
 IsFrameForFieldSet(nsIFrame* aFrame)
 {
-  nsAtom* pseudo = aFrame->Style()->GetPseudo();
+  nsAtom* pseudo = aFrame->StyleContext()->GetPseudo();
   if (pseudo == nsCSSAnonBoxes::fieldsetContent ||
       pseudo == nsCSSAnonBoxes::scrolledContent ||
       pseudo == nsCSSAnonBoxes::columnContent) {
     return IsFrameForFieldSet(aFrame->GetParent());
   }
   return aFrame->IsFieldSetFrame();
 }
 
 /* static */
 const nsCSSFrameConstructor::FrameConstructionData*
 nsCSSFrameConstructor::FindHTMLData(Element* aElement,
                                     nsAtom* aTag,
                                     int32_t aNameSpaceID,
                                     nsIFrame* aParentFrame,
-                                    ComputedStyle* aComputedStyle)
+                                    nsStyleContext* aStyleContext)
 {
   // Ignore the tag if it's not HTML content and if it doesn't extend (via XBL)
   // a valid HTML namespace.  This check must match the one in
   // ShouldHaveFirstLineStyle.
   if (aNameSpaceID != kNameSpaceID_XHTML) {
     return nullptr;
   }
 
   NS_ASSERTION(!aParentFrame ||
-               aParentFrame->Style()->GetPseudo() !=
+               aParentFrame->StyleContext()->GetPseudo() !=
                  nsCSSAnonBoxes::fieldsetContent ||
                aParentFrame->GetParent()->IsFieldSetFrame(),
                "Unexpected parent for fieldset content anon box");
   if (aTag == nsGkAtoms::legend &&
       (!aParentFrame || !IsFrameForFieldSet(aParentFrame) ||
-       aComputedStyle->StyleDisplay()->IsFloatingStyle() ||
-       aComputedStyle->StyleDisplay()->IsAbsolutelyPositionedStyle())) {
+       aStyleContext->StyleDisplay()->IsFloatingStyle() ||
+       aStyleContext->StyleDisplay()->IsAbsolutelyPositionedStyle())) {
     // <legend> is only special inside fieldset, we only check the frame tree
     // parent because the content tree parent may not be a <fieldset> due to
     // display:contents, Shadow DOM, or XBL. For floated or absolutely
     // positioned legends we want to construct by display type and
     // not do special legend stuff.
     return nullptr;
   }
 
@@ -3640,22 +3644,22 @@ nsCSSFrameConstructor::FindHTMLData(Elem
     SIMPLE_TAG_CREATE(audio, NS_NewHTMLVideoFrame),
     SIMPLE_TAG_CREATE(progress, NS_NewProgressFrame),
     SIMPLE_TAG_CREATE(meter, NS_NewMeterFrame),
     COMPLEX_TAG_CREATE(details, &nsCSSFrameConstructor::ConstructDetailsFrame)
   };
 
   bool tagFound;
   const FrameConstructionData* data =
-    FindDataByTag(aTag, aElement, aComputedStyle, sHTMLData,
+    FindDataByTag(aTag, aElement, aStyleContext, sHTMLData,
                   ArrayLength(sHTMLData), &tagFound);
 
   // https://drafts.csswg.org/css-display/#unbox-html
   if (tagFound &&
-      MOZ_UNLIKELY(aComputedStyle->StyleDisplay()->mDisplay ==
+      MOZ_UNLIKELY(aStyleContext->StyleDisplay()->mDisplay ==
                    StyleDisplay::Contents)) {
     // <button>, <legend>, <details> and <fieldset> don’t have any special
     // behavior; display: contents simply removes their principal box, and their
     // contents render as normal.
     if (aTag != nsGkAtoms::button &&
         aTag != nsGkAtoms::legend &&
         aTag != nsGkAtoms::details &&
         aTag != nsGkAtoms::fieldset) {
@@ -3666,44 +3670,44 @@ nsCSSFrameConstructor::FindHTMLData(Elem
   }
 
   return data;
 }
 
 /* static */
 const nsCSSFrameConstructor::FrameConstructionData*
 nsCSSFrameConstructor::FindImgData(Element* aElement,
-                                   ComputedStyle* aComputedStyle)
-{
-  if (!nsImageFrame::ShouldCreateImageFrameFor(aElement, aComputedStyle)) {
+                                   nsStyleContext* aStyleContext)
+{
+  if (!nsImageFrame::ShouldCreateImageFrameFor(aElement, aStyleContext)) {
     return nullptr;
   }
 
   static const FrameConstructionData sImgData = SIMPLE_FCDATA(NS_NewImageFrame);
   return &sImgData;
 }
 
 /* static */
 const nsCSSFrameConstructor::FrameConstructionData*
 nsCSSFrameConstructor::FindImgControlData(Element* aElement,
-                                          ComputedStyle* aComputedStyle)
-{
-  if (!nsImageFrame::ShouldCreateImageFrameFor(aElement, aComputedStyle)) {
+                                          nsStyleContext* aStyleContext)
+{
+  if (!nsImageFrame::ShouldCreateImageFrameFor(aElement, aStyleContext)) {
     return nullptr;
   }
 
   static const FrameConstructionData sImgControlData =
     SIMPLE_FCDATA(NS_NewImageControlFrame);
   return &sImgControlData;
 }
 
 /* static */
 const nsCSSFrameConstructor::FrameConstructionData*
 nsCSSFrameConstructor::FindInputData(Element* aElement,
-                                     ComputedStyle* aComputedStyle)
+                                     nsStyleContext* aStyleContext)
 {
   static const FrameConstructionDataByInt sInputData[] = {
     SIMPLE_INT_CREATE(NS_FORM_INPUT_CHECKBOX, NS_NewCheckboxRadioFrame),
     SIMPLE_INT_CREATE(NS_FORM_INPUT_RADIO, NS_NewCheckboxRadioFrame),
     SIMPLE_INT_CREATE(NS_FORM_INPUT_FILE, NS_NewFileControlFrame),
     SIMPLE_INT_CHAIN(NS_FORM_INPUT_IMAGE,
                      nsCSSFrameConstructor::FindImgControlData),
     SIMPLE_INT_CREATE(NS_FORM_INPUT_EMAIL, NS_NewTextControlFrame),
@@ -3744,28 +3748,28 @@ nsCSSFrameConstructor::FindInputData(Ele
 
   auto controlType = control->ControlType();
 
   // radio and checkbox inputs with appearance:none should be constructed
   // by display type.  (Note that we're not checking that appearance is
   // not (respectively) NS_THEME_RADIO and NS_THEME_CHECKBOX.)
   if ((controlType == NS_FORM_INPUT_CHECKBOX ||
        controlType == NS_FORM_INPUT_RADIO) &&
-      aComputedStyle->StyleDisplay()->mAppearance == NS_THEME_NONE) {
+      aStyleContext->StyleDisplay()->mAppearance == NS_THEME_NONE) {
     return nullptr;
   }
 
-  return FindDataByInt(controlType, aElement, aComputedStyle,
+  return FindDataByInt(controlType, aElement, aStyleContext,
                        sInputData, ArrayLength(sInputData));
 }
 
 /* static */
 const nsCSSFrameConstructor::FrameConstructionData*
 nsCSSFrameConstructor::FindObjectData(Element* aElement,
-                                      ComputedStyle* aComputedStyle)
+                                      nsStyleContext* aStyleContext)
 {
   // GetDisplayedType isn't necessarily nsIObjectLoadingContent::TYPE_NULL for
   // cases when the object is broken/suppressed/etc (e.g. a broken image), but
   // we want to treat those cases as TYPE_NULL
   uint32_t type;
   if (aElement->State().HasAtLeastOneOfStates(NS_EVENT_STATE_BROKEN |
                                               NS_EVENT_STATE_USERDISABLED |
                                               NS_EVENT_STATE_SUPPRESSED)) {
@@ -3789,24 +3793,24 @@ nsCSSFrameConstructor::FindObjectData(El
     SIMPLE_INT_CREATE(nsIObjectLoadingContent::TYPE_DOCUMENT,
                       NS_NewSubDocumentFrame),
     // Fake plugin handlers load as documents
     SIMPLE_INT_CREATE(nsIObjectLoadingContent::TYPE_FAKE_PLUGIN,
                       NS_NewSubDocumentFrame)
     // Nothing for TYPE_NULL so we'll construct frames by display there
   };
 
-  return FindDataByInt((int32_t)type, aElement, aComputedStyle,
+  return FindDataByInt((int32_t)type, aElement, aStyleContext,
                        sObjectData, ArrayLength(sObjectData));
 }
 
 /* static */
 const nsCSSFrameConstructor::FrameConstructionData*
 nsCSSFrameConstructor::FindCanvasData(Element* aElement,
-                                      ComputedStyle* aComputedStyle)
+                                      nsStyleContext* aStyleContext)
 {
   // We want to check whether script is enabled on the document that
   // could be painting to the canvas.  That's the owner document of
   // the canvas, except when the owner document is a static document,
   // in which case it's the original document it was cloned from.
   nsIDocument* doc = aElement->OwnerDoc();
   if (doc->IsStaticDocument()) {
     doc = doc->GetOriginalDocument();
@@ -3866,17 +3870,17 @@ nsCSSFrameConstructor::ConstructFrameFro
       aItem.mContent->IsHTMLElement(nsGkAtoms::iframe))
   {
     return;
   }
 
   nsIContent* const content = aItem.mContent;
   nsIFrame* newFrame;
   nsIFrame* primaryFrame;
-  ComputedStyle* const styleContext = aItem.mComputedStyle;
+  nsStyleContext* const styleContext = aItem.mStyleContext;
   const nsStyleDisplay* display = styleContext->StyleDisplay();
   if (bits & FCDATA_FUNC_IS_FULL_CTOR) {
     newFrame =
       (this->*(data->mFullConstructor))(aState, aItem, aParentFrame,
                                         display, aFrameItems);
     MOZ_ASSERT(newFrame, "Full constructor failed");
     primaryFrame = newFrame;
   } else {
@@ -3916,17 +3920,17 @@ nsCSSFrameConstructor::ConstructFrameFro
 
     // If we need to create a block formatting context to wrap our
     // kids, do it now.
     const nsStyleDisplay* maybeAbsoluteContainingBlockDisplay = display;
     nsIFrame* maybeAbsoluteContainingBlockStyleFrame = primaryFrame;
     nsIFrame* maybeAbsoluteContainingBlock = newFrame;
     nsIFrame* possiblyLeafFrame = newFrame;
     if (bits & FCDATA_CREATE_BLOCK_WRAPPER_FOR_ALL_KIDS) {
-      RefPtr<ComputedStyle> outerSC = mPresShell->StyleSet()->
+      RefPtr<nsStyleContext> outerSC = mPresShell->StyleSet()->
         ResolveInheritingAnonymousBoxStyle(*data->mAnonBoxPseudo,
                                            styleContext);
 #ifdef DEBUG
       nsContainerFrame* containerFrame = do_QueryFrame(newFrame);
       MOZ_ASSERT(containerFrame);
 #endif
       nsContainerFrame* container = static_cast<nsContainerFrame*>(newFrame);
       nsContainerFrame* outerFrame;
@@ -3942,17 +3946,17 @@ nsCSSFrameConstructor::ConstructFrameFro
           case StyleDisplay::Grid:
           case StyleDisplay::InlineGrid:
             outerFrame = NS_NewGridContainerFrame(mPresShell, outerSC);
             InitAndRestoreFrame(aState, content, container, outerFrame);
             innerFrame = outerFrame;
             break;
           default: {
             nsContainerFrame* columnSetFrame = nullptr;
-            RefPtr<ComputedStyle> innerSC = outerSC;
+            RefPtr<nsStyleContext> innerSC = outerSC;
             const nsStyleColumn* columns = outerSC->StyleColumn();
             if (columns->mColumnCount != NS_STYLE_COLUMN_COUNT_AUTO ||
                 columns->mColumnWidth.GetUnit() != eStyleUnit_Auto) {
               columnSetFrame =
                 NS_NewColumnSetFrame(mPresShell, outerSC,
                                      nsFrameState(NS_FRAME_OWNS_ANON_BOXES));
               InitAndRestoreFrame(aState, content, container, columnSetFrame);
               innerSC = mPresShell->StyleSet()->
@@ -4310,29 +4314,29 @@ bool IsXULDisplayType(const nsStyleDispl
   FCDATA_FOR_DISPLAY(_display, SIMPLE_XUL_FCDATA(_func))
 #define SCROLLABLE_XUL_DISPLAY_CREATE(_display, _func)                          \
   FCDATA_FOR_DISPLAY(_display, SCROLLABLE_XUL_FCDATA(_func))
 #define SCROLLABLE_ABSPOS_CONTAINER_XUL_DISPLAY_CREATE(_display, _func)         \
   FCDATA_FOR_DISPLAY(_display, SCROLLABLE_ABSPOS_CONTAINER_XUL_FCDATA(_func))
 
 static
 nsIFrame* NS_NewGridBoxFrame(nsIPresShell* aPresShell,
-                             ComputedStyle* aComputedStyle)
+                             nsStyleContext* aStyleContext)
 {
   nsCOMPtr<nsBoxLayout> layout;
   NS_NewGridLayout2(aPresShell, getter_AddRefs(layout));
-  return NS_NewBoxFrame(aPresShell, aComputedStyle, false, layout);
+  return NS_NewBoxFrame(aPresShell, aStyleContext, false, layout);
 }
 
 /* static */
 const nsCSSFrameConstructor::FrameConstructionData*
 nsCSSFrameConstructor::FindXULTagData(Element* aElement,
                                       nsAtom* aTag,
                                       int32_t aNameSpaceID,
-                                      ComputedStyle* aComputedStyle)
+                                      nsStyleContext* aStyleContext)
 {
   if (aNameSpaceID != kNameSpaceID_XUL) {
     return nullptr;
   }
 
   static const FrameConstructionDataByTag sXULTagData[] = {
 #ifdef MOZ_XUL
     SCROLLABLE_XUL_CREATE(button, NS_NewButtonBoxFrame),
@@ -4370,37 +4374,37 @@ nsCSSFrameConstructor::FindXULTagData(El
 #endif /* MOZ_XUL */
     SIMPLE_XUL_CREATE(slider, NS_NewSliderFrame),
     SIMPLE_XUL_CREATE(scrollbar, NS_NewScrollbarFrame),
     SIMPLE_XUL_CREATE(scrollbarbutton, NS_NewScrollbarButtonFrame)
 };
 
   bool tagFound;
   const FrameConstructionData* data =
-    FindDataByTag(aTag, aElement, aComputedStyle, sXULTagData,
+    FindDataByTag(aTag, aElement, aStyleContext, sXULTagData,
                   ArrayLength(sXULTagData), &tagFound);
 
   // There's no spec that says what display: contents means for special XUL
   // elements, but we do the same as for HTML "Unusual Elements", i.e. treat it
   // as display:none.
   if (tagFound &&
-      MOZ_UNLIKELY(aComputedStyle->StyleDisplay()->mDisplay ==
+      MOZ_UNLIKELY(aStyleContext->StyleDisplay()->mDisplay ==
                    StyleDisplay::Contents)) {
     static const FrameConstructionData sSuppressData = SUPPRESS_FCDATA();
     return &sSuppressData;
   }
 
   return data;
 }
 
 #ifdef MOZ_XUL
 /* static */
 const nsCSSFrameConstructor::FrameConstructionData*
 nsCSSFrameConstructor::FindPopupGroupData(Element* aElement,
-                                          ComputedStyle* /* unused */)
+                                          nsStyleContext* /* unused */)
 {
   if (!aElement->IsRootOfNativeAnonymousSubtree()) {
     return nullptr;
   }
 
   static const FrameConstructionData sPopupSetData =
     SIMPLE_XUL_FCDATA(NS_NewPopupSetFrame);
   return &sPopupSetData;
@@ -4408,57 +4412,57 @@ nsCSSFrameConstructor::FindPopupGroupDat
 
 /* static */
 const nsCSSFrameConstructor::FrameConstructionData
 nsCSSFrameConstructor::sXULTextBoxData = SIMPLE_XUL_FCDATA(NS_NewTextBoxFrame);
 
 /* static */
 const nsCSSFrameConstructor::FrameConstructionData*
 nsCSSFrameConstructor::FindXULLabelData(Element* aElement,
-                                        ComputedStyle* /* unused */)
+                                        nsStyleContext* /* unused */)
 {
   if (aElement->HasAttr(kNameSpaceID_None, nsGkAtoms::value)) {
     return &sXULTextBoxData;
   }
 
   static const FrameConstructionData sLabelData =
     SIMPLE_XUL_FCDATA(NS_NewXULLabelFrame);
   return &sLabelData;
 }
 
 static nsIFrame*
-NS_NewXULDescriptionFrame(nsIPresShell* aPresShell, ComputedStyle *aContext)
+NS_NewXULDescriptionFrame(nsIPresShell* aPresShell, nsStyleContext *aContext)
 {
   // XXXbz do we really need to set up the block formatting context root? If the
   // parent is not a block we'll get it anyway, and if it is, do we want it?
   return NS_NewBlockFormattingContext(aPresShell, aContext);
 }
 
 /* static */
 const nsCSSFrameConstructor::FrameConstructionData*
 nsCSSFrameConstructor::FindXULDescriptionData(Element* aElement,
-                                              ComputedStyle* /* unused */)
+                                              nsStyleContext* /* unused */)
 {
   if (aElement->HasAttr(kNameSpaceID_None, nsGkAtoms::value)) {
     return &sXULTextBoxData;
   }
 
   static const FrameConstructionData sDescriptionData =
     SIMPLE_XUL_FCDATA(NS_NewXULDescriptionFrame);
   return &sDescriptionData;
 }
 
 #ifdef XP_MACOSX
 /* static */
 const nsCSSFrameConstructor::FrameConstructionData*
 nsCSSFrameConstructor::FindXULMenubarData(Element* aElement,
-                                          ComputedStyle* aComputedStyle)
+                                          nsStyleContext* aStyleContext)
 {
   nsCOMPtr<nsIDocShell> treeItem =
-    aComputedStyle->PresContext()->GetDocShell();
+    aStyleContext->PresContext()->GetDocShell();
   if (treeItem && nsIDocShellTreeItem::typeChrome == treeItem->ItemType()) {
     nsCOMPtr<nsIDocShellTreeItem> parent;
     treeItem->GetParent(getter_AddRefs(parent));
     if (!parent) {
       // This is the root.  Suppress the menubar, since on Mac
       // window menus are not attached to the window.
       static const FrameConstructionData sSuppressData = SUPPRESS_FCDATA();
       return &sSuppressData;
@@ -4469,49 +4473,49 @@ nsCSSFrameConstructor::FindXULMenubarDat
     SIMPLE_XUL_FCDATA(NS_NewMenuBarFrame);
   return &sMenubarData;
 }
 #endif /* XP_MACOSX */
 
 /* static */
 const nsCSSFrameConstructor::FrameConstructionData*
 nsCSSFrameConstructor::FindXULListBoxBodyData(Element* aElement,
-                                              ComputedStyle* aComputedStyle)
-{
-  if (aComputedStyle->StyleDisplay()->mDisplay !=
+                                              nsStyleContext* aStyleContext)
+{
+  if (aStyleContext->StyleDisplay()->mDisplay !=
         StyleDisplay::MozGridGroup) {
     return nullptr;
   }
 
   static const FrameConstructionData sListBoxBodyData =
     SCROLLABLE_XUL_FCDATA(NS_NewListBoxBodyFrame);
   return &sListBoxBodyData;
 }
 
 /* static */
 const nsCSSFrameConstructor::FrameConstructionData*
 nsCSSFrameConstructor::FindXULListItemData(Element* aElement,
-                                           ComputedStyle* aComputedStyle)
-{
-  if (aComputedStyle->StyleDisplay()->mDisplay != StyleDisplay::MozGridLine) {
+                                           nsStyleContext* aStyleContext)
+{
+  if (aStyleContext->StyleDisplay()->mDisplay != StyleDisplay::MozGridLine) {
     return nullptr;
   }
 
   static const FrameConstructionData sListItemData =
     SCROLLABLE_XUL_FCDATA(NS_NewListItemFrame);
   return &sListItemData;
 }
 
 #endif /* MOZ_XUL */
 
 /* static */
 const nsCSSFrameConstructor::FrameConstructionData*
 nsCSSFrameConstructor::FindXULDisplayData(const nsStyleDisplay* aDisplay,
                                           Element* aElement,
-                                          ComputedStyle* aComputedStyle)
+                                          nsStyleContext* aStyleContext)
 {
   static const FrameConstructionDataByDisplay sXULDisplayData[] = {
     SCROLLABLE_ABSPOS_CONTAINER_XUL_DISPLAY_CREATE(StyleDisplay::MozBox,
                                                    NS_NewBoxFrame),
     SCROLLABLE_ABSPOS_CONTAINER_XUL_DISPLAY_CREATE(StyleDisplay::MozInlineBox,
                                                    NS_NewBoxFrame),
 #ifdef MOZ_XUL
     SCROLLABLE_XUL_DISPLAY_CREATE(StyleDisplay::MozGrid, NS_NewGridBoxFrame),
@@ -4551,30 +4555,30 @@ nsCSSFrameConstructor::FindXULDisplayDat
   const FrameConstructionDataByDisplay& data =
     sXULDisplayData[size_t(aDisplay->mDisplay) - size_t(StyleDisplay::MozBox)];
   MOZ_ASSERT(aDisplay->mDisplay == data.mDisplay,
              "Did someone mess with the order?");
 
   return &data.mData;
 }
 
-already_AddRefed<ComputedStyle>
+already_AddRefed<nsStyleContext>
 nsCSSFrameConstructor::BeginBuildingScrollFrame(nsFrameConstructorState& aState,
                                                 nsIContent*              aContent,
-                                                ComputedStyle*           aContentStyle,
+                                                nsStyleContext*          aContentStyle,
                                                 nsContainerFrame*        aParentFrame,
-                                                nsAtom*                  aScrolledPseudo,
+                                                nsAtom*                 aScrolledPseudo,
                                                 bool                     aIsRoot,
                                                 nsContainerFrame*&       aNewFrame)
 {
   nsContainerFrame* gfxScrollFrame = aNewFrame;
 
   nsFrameItems anonymousItems;
 
-  RefPtr<ComputedStyle> contentStyle = aContentStyle;
+  RefPtr<nsStyleContext> contentStyle = aContentStyle;
 
   if (!gfxScrollFrame) {
     // Build a XULScrollFrame when the child is a box, otherwise an
     // HTMLScrollFrame
     // XXXbz this is the lone remaining consumer of IsXULDisplayType.
     // I wonder whether we can eliminate that somehow.
     const nsStyleDisplay* displayStyle = aContentStyle->StyleDisplay();
     if (IsXULDisplayType(displayStyle)) {
@@ -4605,17 +4609,17 @@ nsCSSFrameConstructor::BeginBuildingScro
                                 anonymousItems);
   }
 
   aNewFrame = gfxScrollFrame;
   gfxScrollFrame->AddStateBits(NS_FRAME_OWNS_ANON_BOXES);
 
   // we used the style that was passed in. So resolve another one.
   StyleSetHandle styleSet = mPresShell->StyleSet();
-  RefPtr<ComputedStyle> scrolledChildStyle =
+  RefPtr<nsStyleContext> scrolledChildStyle =
     styleSet->ResolveInheritingAnonymousBoxStyle(aScrolledPseudo, contentStyle);
 
   if (gfxScrollFrame) {
      gfxScrollFrame->SetInitialChildList(kPrincipalList, anonymousItems);
   }
 
   return scrolledChildStyle.forget();
 }
@@ -4645,49 +4649,48 @@ nsCSSFrameConstructor::FinishBuildingScr
  *
  * ScrollFrame: This is a frame that manages gfx cross platform frame based scrollbars.
  *
  * @param aContent the content node of the child to wrap.
  * @param aScrolledFrame The frame of the content to wrap. This should not be
  *                    Initialized. This method will initialize it with a scrolled pseudo
  *                    and no nsIContent. The content will be attached to the scrollframe
  *                    returned.
- * @param aContentStyle the style that has already been resolved for the content
- *                      being passed in.
+ * @param aContentStyle the style context that has already been resolved for the content being passed in.
  *
  * @param aParentFrame The parent to attach the scroll frame to
  *
  * @param aNewFrame The new scrollframe or gfx scrollframe that we create. It will contain the
  *                  scrolled frame you passed in. (returned)
  *                  If this is not null, we'll just use it
  * @param aScrolledContentStyle the style that was resolved for the scrolled frame. (returned)
  */
 void
 nsCSSFrameConstructor::BuildScrollFrame(nsFrameConstructorState& aState,
                                         nsIContent*              aContent,
-                                        ComputedStyle*           aContentStyle,
+                                        nsStyleContext*          aContentStyle,
                                         nsIFrame*                aScrolledFrame,
                                         nsContainerFrame*        aParentFrame,
                                         nsContainerFrame*&       aNewFrame)
 {
-  RefPtr<ComputedStyle> scrolledContentStyle =
+  RefPtr<nsStyleContext> scrolledContentStyle =
     BeginBuildingScrollFrame(aState, aContent, aContentStyle, aParentFrame,
                              nsCSSAnonBoxes::scrolledContent,
                              false, aNewFrame);
 
-  aScrolledFrame->SetComputedStyleWithoutNotification(scrolledContentStyle);
+  aScrolledFrame->SetStyleContextWithoutNotification(scrolledContentStyle);
   InitAndRestoreFrame(aState, aContent, aNewFrame, aScrolledFrame);
 
   FinishBuildingScrollFrame(aNewFrame, aScrolledFrame);
 }
 
 const nsCSSFrameConstructor::FrameConstructionData*
 nsCSSFrameConstructor::FindDisplayData(const nsStyleDisplay* aDisplay,
                                        Element* aElement,
-                                       ComputedStyle* aComputedStyle)
+                                       nsStyleContext* aStyleContext)
 {
   static_assert(eParentTypeCount < (1 << (32 - FCDATA_PARENT_TYPE_OFFSET)),
                 "Check eParentTypeCount should not overflow");
 
   // The style system ensures that floated and positioned frames are
   // block-level.
   NS_ASSERTION(!(aDisplay->IsFloatingStyle() ||
                  aDisplay->IsAbsolutelyPositionedStyle()) ||
@@ -4794,17 +4797,17 @@ nsCSSFrameConstructor::FindDisplayData(c
     FCDATA_FOR_DISPLAY(StyleDisplay::InlineBlock, UNREACHABLE_FCDATA()),
     FCDATA_FOR_DISPLAY(StyleDisplay::ListItem, UNREACHABLE_FCDATA()),
     FCDATA_FOR_DISPLAY(StyleDisplay::Table,
       FULL_CTOR_FCDATA(0, &nsCSSFrameConstructor::ConstructTable)),
     FCDATA_FOR_DISPLAY(StyleDisplay::InlineTable,
       FULL_CTOR_FCDATA(0, &nsCSSFrameConstructor::ConstructTable)),
     // NOTE: In the unlikely event that we add another table-part here that has
     // a desired-parent-type (& hence triggers table fixup), we'll need to also
-    // update the flexbox chunk in ComputedStyle::ApplyStyleFixups().
+    // update the flexbox chunk in nsStyleContext::ApplyStyleFixups().
     FCDATA_FOR_DISPLAY(StyleDisplay::TableRowGroup,
       FULL_CTOR_FCDATA(FCDATA_IS_TABLE_PART |
                        FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable),
                        &nsCSSFrameConstructor::ConstructTableRowOrRowGroup)),
     FCDATA_FOR_DISPLAY(StyleDisplay::TableColumn,
       FULL_CTOR_FCDATA(FCDATA_IS_TABLE_PART |
                        FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeColGroup),
                        &nsCSSFrameConstructor::ConstructTableCol)),
@@ -4905,20 +4908,20 @@ nsCSSFrameConstructor::ConstructScrollab
   nsFrameConstructorState& aState,
   FrameConstructionItem& aItem,
   nsContainerFrame* aParentFrame,
   const nsStyleDisplay* aDisplay,
   nsFrameItems& aFrameItems,
   BlockFrameCreationFunc aConstructor)
 {
   nsIContent* const content = aItem.mContent;
-  ComputedStyle* const styleContext = aItem.mComputedStyle;
+  nsStyleContext* const styleContext = aItem.mStyleContext;
 
   nsContainerFrame* newFrame = nullptr;
-  RefPtr<ComputedStyle> scrolledContentStyle
+  RefPtr<nsStyleContext> scrolledContentStyle
     = BeginBuildingScrollFrame(aState, content, styleContext,
                                aState.GetGeometricParent(aDisplay, aParentFrame),
                                nsCSSAnonBoxes::scrolledContent,
                                false, newFrame);
 
   // Create our block frame
   // pass a temporary stylecontext, the correct one will be set later
   nsContainerFrame* scrolledFrame = aConstructor(mPresShell, styleContext);
@@ -4956,17 +4959,17 @@ nsIFrame*
 nsCSSFrameConstructor::ConstructNonScrollableBlockWithConstructor(
   nsFrameConstructorState& aState,
   FrameConstructionItem& aItem,
   nsContainerFrame* aParentFrame,
   const nsStyleDisplay* aDisplay,
   nsFrameItems& aFrameItems,
   BlockFrameCreationFunc aConstructor)
 {
-  ComputedStyle* const styleContext = aItem.mComputedStyle;
+  nsStyleContext* const styleContext = aItem.mStyleContext;
 
   // We want a block formatting context root in paginated contexts for
   // every block that would be scrollable in a non-paginated context.
   // We mark our blocks with a bit here if this condition is true, so
   // we can check it later in nsFrame::ApplyPaginatedOverflowClipping.
   bool clipPaginatedOverflow =
     (aItem.mFCData->mBits & FCDATA_FORCED_NON_SCROLLABLE_BLOCK) != 0;
   nsFrameState flags = nsFrameState(0);
@@ -5012,43 +5015,43 @@ nsCSSFrameConstructor::InitAndRestoreFra
   }
 
   if (aAllowCounters &&
       mCounterManager.AddCounterResetsAndIncrements(aNewFrame)) {
     CountersDirty();
   }
 }
 
-already_AddRefed<ComputedStyle>
-nsCSSFrameConstructor::ResolveComputedStyle(nsIContent* aContent)
+already_AddRefed<nsStyleContext>
+nsCSSFrameConstructor::ResolveStyleContext(nsIContent* aContent)
 {
   ServoStyleSet* styleSet = mPresShell->StyleSet()->AsServo();
 
   if (aContent->IsElement()) {
     return styleSet->ResolveServoStyle(aContent->AsElement());
   }
 
   MOZ_ASSERT(aContent->IsNodeOfType(nsINode::eTEXT),
-             "shouldn't waste time creating ComputedStyles for "
+             "shouldn't waste time creating style contexts for "
              "comments and processing instructions");
 
   Element* parent = aContent->GetFlattenedTreeParentElement();
   MOZ_ASSERT(parent, "Text out of the flattened tree?");
 
   // FIXME(emilio): We can't use ResolveServoStyle properly because this text
   // node can come from non-lazy frame construction, in which case the style we
   // inherit from can indeed be out-of-date. After an eventual XBL removal, this
   // can go. Note that this is not a correctness issue, since we'll restyle
   // later in any case.
   //
   // Also, this probably doesn't need to be a strong ref...
   //
   // Do NOT add new callers to this function in this file, ever, or I'll find
   // out.
-  RefPtr<ComputedStyle> parentStyle =
+  RefPtr<ServoStyleContext> parentStyle =
     Servo_Element_GetPrimaryComputedValues(parent).Consume();
   return styleSet->ResolveStyleForText(aContent, parentStyle);
 }
 
 // MathML Mod - RBS
 void
 nsCSSFrameConstructor::FlushAccumulatedBlock(nsFrameConstructorState& aState,
                                              nsIContent* aContent,
@@ -5058,21 +5061,21 @@ nsCSSFrameConstructor::FlushAccumulatedB
 {
   if (aBlockItems.IsEmpty()) {
     // Nothing to do
     return;
   }
 
   nsAtom* anonPseudo = nsCSSAnonBoxes::mozMathMLAnonymousBlock;
 
-  ComputedStyle* parentContext =
+  nsStyleContext* parentContext =
     nsFrame::CorrectStyleParentFrame(aParentFrame,
-                                     anonPseudo)->Style();
+                                     anonPseudo)->StyleContext();
   StyleSetHandle styleSet = mPresShell->StyleSet();
-  RefPtr<ComputedStyle> blockContext;
+  RefPtr<nsStyleContext> blockContext;
   blockContext = styleSet->
     ResolveInheritingAnonymousBoxStyle(anonPseudo, parentContext);
 
   // then, create a block frame that will wrap the child frames. Make it a
   // MathML frame so that Get(Absolute/Float)ContainingBlockFor know that this
   // is not a suitable block.
   nsContainerFrame* blockFrame =
     NS_NewMathMLmathBlockFrame(mPresShell, blockContext);
@@ -5099,28 +5102,28 @@ nsCSSFrameConstructor::FlushAccumulatedB
                   FCDATA_FORCE_NULL_ABSPOS_CONTAINER |                  \
                   FCDATA_WRAP_KIDS_IN_BLOCKS, _func) }
 
 /* static */
 const nsCSSFrameConstructor::FrameConstructionData*
 nsCSSFrameConstructor::FindMathMLData(Element* aElement,
                                       nsAtom* aTag,
                                       int32_t aNameSpaceID,
-                                      ComputedStyle* aComputedStyle)
+                                      nsStyleContext* aStyleContext)
 {
   // Make sure that we remain confined in the MathML world
   if (aNameSpaceID != kNameSpaceID_MathML)
     return nullptr;
 
   // Handle <math> specially, because it sometimes produces inlines
   if (aTag == nsGkAtoms::math) {
     // This needs to match the test in EnsureBlockDisplay in
     // nsRuleNode.cpp.  Though the behavior here for the display:table
     // case is pretty weird...
-    if (aComputedStyle->StyleDisplay()->IsBlockOutsideStyle()) {
+    if (aStyleContext->StyleDisplay()->IsBlockOutsideStyle()) {
       static const FrameConstructionData sBlockMathData =
         FCDATA_DECL(FCDATA_FORCE_NULL_ABSPOS_CONTAINER |
                     FCDATA_WRAP_KIDS_IN_BLOCKS,
                     NS_NewMathMLmathBlockFrame);
       return &sBlockMathData;
     }
 
     static const FrameConstructionData sInlineMathData =
@@ -5159,48 +5162,48 @@ nsCSSFrameConstructor::FindMathMLData(El
     SIMPLE_MATHML_CREATE(mroot_, NS_NewMathMLmrootFrame),
     SIMPLE_MATHML_CREATE(maction_, NS_NewMathMLmactionFrame),
     SIMPLE_MATHML_CREATE(mrow_, NS_NewMathMLmrowFrame),
     SIMPLE_MATHML_CREATE(merror_, NS_NewMathMLmrowFrame),
     SIMPLE_MATHML_CREATE(menclose_, NS_NewMathMLmencloseFrame),
     SIMPLE_MATHML_CREATE(semantics_, NS_NewMathMLsemanticsFrame)
   };
 
-  return FindDataByTag(aTag, aElement, aComputedStyle, sMathMLData,
+  return FindDataByTag(aTag, aElement, aStyleContext, sMathMLData,
                        ArrayLength(sMathMLData));
 }
 
 
 nsContainerFrame*
 nsCSSFrameConstructor::ConstructFrameWithAnonymousChild(
                                    nsFrameConstructorState& aState,
                                    FrameConstructionItem&   aItem,
                                    nsContainerFrame*        aParentFrame,
                                    nsFrameItems&            aFrameItems,
                                    ContainerFrameCreationFunc aConstructor,
                                    ContainerFrameCreationFunc aInnerConstructor,
                                    nsICSSAnonBoxPseudo*     aInnerPseudo,
                                    bool                     aCandidateRootFrame)
 {
   nsIContent* const content = aItem.mContent;
-  ComputedStyle* const styleContext = aItem.mComputedStyle;
+  nsStyleContext* const styleContext = aItem.mStyleContext;
 
   // Create the outer frame:
   nsContainerFrame* newFrame = aConstructor(mPresShell, styleContext);
 
   InitAndRestoreFrame(aState, content,
                       aCandidateRootFrame ?
                         aState.GetGeometricParent(styleContext->StyleDisplay(),
                                                   aParentFrame) :
                         aParentFrame,
                       newFrame);
   newFrame->AddStateBits(NS_FRAME_OWNS_ANON_BOXES);
 
   // Create the pseudo SC for the anonymous wrapper child as a child of the SC:
-  RefPtr<ComputedStyle> scForAnon;
+  RefPtr<nsStyleContext> scForAnon;
   scForAnon = mPresShell->StyleSet()->
     ResolveInheritingAnonymousBoxStyle(aInnerPseudo, styleContext);
 
   // Create the anonymous inner wrapper frame
   nsContainerFrame* innerFrame = aInnerConstructor(mPresShell, scForAnon);
 
   InitAndRestoreFrame(aState, content, newFrame, innerFrame);
 
@@ -5290,17 +5293,17 @@ IsFilterPrimitiveChildTag(const nsAtom* 
 /* static */
 const nsCSSFrameConstructor::FrameConstructionData*
 nsCSSFrameConstructor::FindSVGData(Element* aElement,
                                    nsAtom* aTag,
                                    int32_t aNameSpaceID,
                                    nsIFrame* aParentFrame,
                                    bool aIsWithinSVGText,
                                    bool aAllowsTextPathChild,
-                                   ComputedStyle* aComputedStyle)
+                                   nsStyleContext* aStyleContext)
 {
   if (aNameSpaceID != kNameSpaceID_SVG) {
     return nullptr;
   }
 
   static const FrameConstructionData sSuppressData = SUPPRESS_FCDATA();
   static const FrameConstructionData sContainerData =
     SIMPLE_SVG_FCDATA(NS_NewSVGContainerFrame);
@@ -5343,17 +5346,17 @@ nsCSSFrameConstructor::FindSVGData(Eleme
   }
 
   // We don't need frames for animation elements
   if (aElement->IsNodeOfType(nsINode::eANIMATION)) {
     return &sSuppressData;
   }
 
   // https://drafts.csswg.org/css-display/#unbox-svg
-  if (aComputedStyle->StyleDisplay()->mDisplay == StyleDisplay::Contents) {
+  if (aStyleContext->StyleDisplay()->mDisplay == StyleDisplay::Contents) {
     // For root <svg> elements, display: contents behaves as display: none.
     if (aTag == nsGkAtoms::svg && !parentIsSVG) {
       return &sSuppressData;
     }
 
     // For nested <svg>, <g>, <use> and <tspan> behave normally, but any other
     // element behaves as display: none as well.
     if (aTag != nsGkAtoms::g &&
@@ -5521,31 +5524,31 @@ nsCSSFrameConstructor::FindSVGData(Eleme
     SIMPLE_SVG_CREATE(feMorphology, NS_NewSVGFELeafFrame),
     SIMPLE_SVG_CREATE(feOffset, NS_NewSVGFELeafFrame),
     SIMPLE_SVG_CREATE(feSpecularLighting, NS_NewSVGFEContainerFrame),
     SIMPLE_SVG_CREATE(feTile, NS_NewSVGFELeafFrame),
     SIMPLE_SVG_CREATE(feTurbulence, NS_NewSVGFELeafFrame)
   };
 
   const FrameConstructionData* data =
-    FindDataByTag(aTag, aElement, aComputedStyle, sSVGData,
+    FindDataByTag(aTag, aElement, aStyleContext, sSVGData,
                   ArrayLength(sSVGData));
 
   if (!data) {
     data = &sContainerData;
   }
 
   return data;
 }
 
 void
 nsCSSFrameConstructor::AddPageBreakItem(nsIContent* aContent,
                                         FrameConstructionItemList& aItems)
 {
-  RefPtr<ComputedStyle> pseudoStyle =
+  RefPtr<nsStyleContext> pseudoStyle =
     mPresShell->StyleSet()->
       ResolveNonInheritingAnonymousBoxStyle(nsCSSAnonBoxes::pageBreak);
 
   MOZ_ASSERT(pseudoStyle->StyleDisplay()->mDisplay == StyleDisplay::Block,
              "Unexpected display");
 
   static const FrameConstructionData sPageBreakData =
     FCDATA_DECL(FCDATA_SKIP_FRAMESET, NS_NewPageBreakFrame);
@@ -5596,17 +5599,17 @@ nsCSSFrameConstructor::ShouldCreateItems
   }
 
   return true;
 }
 
 void
 nsCSSFrameConstructor::DoAddFrameConstructionItems(nsFrameConstructorState& aState,
                                                    nsIContent* aContent,
-                                                   ComputedStyle* aComputedStyle,
+                                                   nsStyleContext* aStyleContext,
                                                    bool aSuppressWhiteSpaceOptimizations,
                                                    nsContainerFrame* aParentFrame,
                                                    nsTArray<nsIAnonymousContentCreator::ContentInfo>* aAnonChildren,
                                                    FrameConstructionItemList& aItems)
 {
   uint32_t flags = ITEM_ALLOW_XBL_BASE | ITEM_ALLOW_PAGE_BREAK;
   if (aParentFrame) {
     if (nsSVGUtils::IsInSVGTextSubtree(aParentFrame)) {
@@ -5616,85 +5619,85 @@ nsCSSFrameConstructor::DoAddFrameConstru
         aParentFrame->GetParent()->IsSVGTextFrame()) {
       flags |= ITEM_ALLOWS_TEXT_PATH_CHILD;
     }
   }
   AddFrameConstructionItemsInternal(aState, aContent, aParentFrame,
                                     aContent->NodeInfo()->NameAtom(),
                                     aContent->GetNameSpaceID(),
                                     aSuppressWhiteSpaceOptimizations,
-                                    aComputedStyle,
+                                    aStyleContext,
                                     flags, aAnonChildren,
                                     aItems);
 }
 
 void
 nsCSSFrameConstructor::AddFrameConstructionItems(nsFrameConstructorState& aState,
                                                  nsIContent* aContent,
                                                  bool aSuppressWhiteSpaceOptimizations,
                                                  const InsertionPoint& aInsertion,
                                                  FrameConstructionItemList& aItems)
 {
   nsContainerFrame* parentFrame = aInsertion.mParentFrame;
   if (!ShouldCreateItemsForChild(aState, aContent, parentFrame)) {
     return;
   }
-  RefPtr<ComputedStyle> styleContext = ResolveComputedStyle(aContent);
+  RefPtr<nsStyleContext> styleContext = ResolveStyleContext(aContent);
   DoAddFrameConstructionItems(aState, aContent, styleContext,
                               aSuppressWhiteSpaceOptimizations, parentFrame,
                               nullptr, aItems);
 }
 
 void
 nsCSSFrameConstructor::SetAsUndisplayedContent(nsFrameConstructorState& aState,
                                                FrameConstructionItemList& aList,
                                                nsIContent* aContent,
-                                               ComputedStyle* aComputedStyle,
+                                               nsStyleContext* aStyleContext,
                                                bool aIsGeneratedContent)
 {
-  if (aComputedStyle->GetPseudo()) {
+  if (aStyleContext->GetPseudo()) {
     if (aIsGeneratedContent) {
       aContent->UnbindFromTree();
     }
     return;
   }
   NS_ASSERTION(!aIsGeneratedContent, "Should have had pseudo type");
 
   if (aState.mCreatingExtraFrames) {
     MOZ_ASSERT(GetDisplayNoneStyleFor(aContent),
                "should have called RegisterDisplayNoneStyleFor earlier");
     return;
   }
-  aList.AppendUndisplayedItem(aContent, aComputedStyle);
+  aList.AppendUndisplayedItem(aContent, aStyleContext);
 }
 
 void
 nsCSSFrameConstructor::AddFrameConstructionItemsInternal(nsFrameConstructorState& aState,
                                                          nsIContent* aContent,
                                                          nsContainerFrame* aParentFrame,
                                                          nsAtom* aTag,
                                                          int32_t aNameSpaceID,
                                                          bool aSuppressWhiteSpaceOptimizations,
-                                                         ComputedStyle* aComputedStyle,
+                                                         nsStyleContext* aStyleContext,
                                                          uint32_t aFlags,
                                                          nsTArray<nsIAnonymousContentCreator::ContentInfo>* aAnonChildren,
                                                          FrameConstructionItemList& aItems)
 {
   NS_PRECONDITION(aContent->IsNodeOfType(nsINode::eTEXT) ||
                   aContent->IsElement(),
                   "Shouldn't get anything else here!");
   MOZ_ASSERT(aContent->IsInComposedDoc());
   MOZ_ASSERT(!aContent->GetPrimaryFrame() || aState.mCreatingExtraFrames ||
              aContent->NodeInfo()->NameAtom() == nsGkAtoms::area);
 
   // The following code allows the user to specify the base tag
   // of an element using XBL.  XUL and HTML objects (like boxes, menus, etc.)
   // can then be extended arbitrarily.
-  const nsStyleDisplay* display = aComputedStyle->StyleDisplay();
-  RefPtr<ComputedStyle> styleContext(aComputedStyle);
+  const nsStyleDisplay* display = aStyleContext->StyleDisplay();
+  RefPtr<nsStyleContext> styleContext(aStyleContext);
   PendingBinding* pendingBinding = nullptr;
   if (aFlags & ITEM_ALLOW_XBL_BASE) {
     if (display->mBinding) {
       // Ensure that our XBL bindings are installed.
 
       nsXBLService* xblService = nsXBLService::GetInstance();
       if (!xblService)
         return;
@@ -5712,22 +5715,29 @@ nsCSSFrameConstructor::AddFrameConstruct
 
       if (newPendingBinding->mBinding) {
         pendingBinding = newPendingBinding;
         // aState takes over owning newPendingBinding
         aState.AddPendingBinding(newPendingBinding.forget());
       }
 
       if (resolveStyle) {
-        styleContext =
-          mPresShell->StyleSet()->AsServo()->ResolveServoStyle(aContent->AsElement());
+        // Need to take a different path (Servo directly grabs the style from
+        // the element, Gecko needs to actually re-resolve it using the parent
+        // style context).
+        if (styleContext->IsServo()) {
+          styleContext =
+            mPresShell->StyleSet()->AsServo()->ResolveServoStyle(aContent->AsElement());
+        } else {
+          MOZ_CRASH("old style system disabled");
+        }
       }
 
       display = styleContext->StyleDisplay();
-      aComputedStyle = styleContext;
+      aStyleContext = styleContext;
       aTag = mDocument->BindingManager()->ResolveTag(aContent, &aNameSpaceID);
     }
   }
 
   const bool isGeneratedContent = !!(aFlags & ITEM_IS_GENERATED_CONTENT);
 
   // Pre-check for display "none" - if we find that, don't create
   // any frame at all
@@ -5895,17 +5905,17 @@ nsCSSFrameConstructor::AddFrameConstruct
                                aItems);
 
     FlattenedChildIterator iter(aContent);
     for (nsIContent* child = iter.GetNextChild(); child; child = iter.GetNextChild()) {
       if (!ShouldCreateItemsForChild(aState, child, aParentFrame)) {
         continue;
       }
 
-      RefPtr<ComputedStyle> childContext = ResolveComputedStyle(child);
+      RefPtr<nsStyleContext> childContext = ResolveStyleContext(child);
       DoAddFrameConstructionItems(aState, child, childContext,
                                   aSuppressWhiteSpaceOptimizations,
                                   aParentFrame, aAnonChildren, aItems);
     }
     aItems.SetParentHasNoXBLChildren(!iter.XBLInvolved());
 
     CreateGeneratedContentItem(aState, aParentFrame, aContent->AsElement(),
                                styleContext, CSSPseudoElementType::after,
@@ -6076,17 +6086,17 @@ nsCSSFrameConstructor::AtLineBoundary(FC
 void
 nsCSSFrameConstructor::ConstructFramesFromItem(nsFrameConstructorState& aState,
                                                FCItemIterator& aIter,
                                                nsContainerFrame* aParentFrame,
                                                nsFrameItems& aFrameItems)
 {
   nsContainerFrame* adjParentFrame = aParentFrame;
   FrameConstructionItem& item = aIter.item();
-  ComputedStyle* styleContext = item.mComputedStyle;
+  nsStyleContext* styleContext = item.mStyleContext;
   AdjustParentFrame(&adjParentFrame, item.mFCData, styleContext);
 
   if (item.mIsText) {
     // If this is collapsible whitespace next to a line boundary,
     // don't create a frame. item.IsWhitespace() also sets the
     // NS_CREATE_FRAME_IF_NON_WHITESPACE flag in the text node. (If we
     // end up creating a frame, nsTextFrame::Init will clear the flag.)
     // We don't do this for generated content, because some generated
@@ -6436,27 +6446,26 @@ nsCSSFrameConstructor::IsValidSibling(ns
   StyleDisplay siblingDisplay = aSibling->GetDisplay();
   if (StyleDisplay::TableColumnGroup == siblingDisplay ||
       StyleDisplay::TableColumn      == siblingDisplay ||
       StyleDisplay::TableCaption     == siblingDisplay ||
       StyleDisplay::TableHeaderGroup == siblingDisplay ||
       StyleDisplay::TableRowGroup    == siblingDisplay ||
       StyleDisplay::TableFooterGroup == siblingDisplay ||
       LayoutFrameType::Menu == parentType) {
-    // if we haven't already, resolve a style to find the display type of
-    // aContent.
+    // if we haven't already, construct a style context to find the display type of aContent
     if (UNSET_DISPLAY == aDisplay) {
       if (aContent->IsNodeOfType(nsINode::eCOMMENT) ||
           aContent->IsNodeOfType(nsINode::ePROCESSING_INSTRUCTION)) {
-        // Comments and processing instructions never have frames, so we should
-        // not try to generate styles for them.
+        // Comments and processing instructions never have frames, so we
+        // should not try to generate style contexts for them.
         return false;
       }
       // FIXME(emilio): This is buggy some times, see bug 1424656.
-      RefPtr<ComputedStyle> styleContext = ResolveComputedStyle(aContent);
+      RefPtr<nsStyleContext> styleContext = ResolveStyleContext(aContent);
       const nsStyleDisplay* display = styleContext->StyleDisplay();
       aDisplay = display->mDisplay;
     }
     if (LayoutFrameType::Menu == parentType) {
       return
         (StyleDisplay::MozPopup == aDisplay) ==
         (StyleDisplay::MozPopup == siblingDisplay);
     }
@@ -6874,17 +6883,17 @@ nsCSSFrameConstructor::CheckBitsForLazyF
   bool needsFrameBitSet = false;
   nsIContent* content = aParent;
   while (content &&
          !content->HasFlag(NODE_DESCENDANTS_NEED_FRAMES)) {
     if (content->GetPrimaryFrame() && content->GetPrimaryFrame()->IsLeaf()) {
       noPrimaryFrame = needsFrameBitSet = false;
     }
     if (!noPrimaryFrame && !content->GetPrimaryFrame()) {
-      ComputedStyle* sc = GetDisplayNoneStyleFor(content);
+      nsStyleContext* sc = GetDisplayNoneStyleFor(content);
       noPrimaryFrame = !GetDisplayContentsStyleFor(content) &&
         (sc && !sc->IsInDisplayNoneSubtree());
     }
     if (!needsFrameBitSet && content->HasFlag(NODE_NEEDS_FRAME)) {
       needsFrameBitSet = true;
     }
 
     content = content->GetFlattenedTreeParent();
@@ -7274,17 +7283,17 @@ nsCSSFrameConstructor::ContentAppended(n
 
   // See if the containing block has :first-letter style applied.
   const bool haveFirstLetterStyle =
     containingBlock && HasFirstLetterStyle(containingBlock);
 
   const bool haveFirstLineStyle =
     containingBlock &&
     ShouldHaveFirstLineStyle(containingBlock->GetContent(),
-                             containingBlock->Style());
+                             containingBlock->StyleContext());
 
   if (haveFirstLetterStyle) {
     AutoWeakFrame wf(nextSibling);
 
     // Before we get going, remove the current letter frames
     RemoveLetterFrames(mPresShell, containingBlock);
 
     // Reget nextSibling, since we may have killed it.
@@ -7401,17 +7410,17 @@ nsCSSFrameConstructor::ContentAppended(n
 
   if (haveFirstLineStyle && parentFrame == containingBlock) {
     // It's possible that some of the new frames go into a
     // first-line frame. Look at them and see...
     AppendFirstLineFrames(state, containingBlock->GetContent(),
                           containingBlock, frameItems);
     // That moved things into line frames as needed, reparenting their
     // styles.  Nothing else needs to be done.
-  } else if (parentFrame->Style()->HasPseudoElementData()) {
+  } else if (parentFrame->StyleContext()->HasPseudoElementData()) {
     // parentFrame might be inside a ::first-line frame.  Check whether it is,
     // and if so fix up our styles.
     CheckForFirstLineInsertion(parentFrame, frameItems);
     CheckForFirstLineInsertion(parentFrame, captionItems);
   }
 
   // Notify the parent frame passing it the list of new frames
   // Append the flowed frames to the principal child list; captions
@@ -7794,17 +7803,17 @@ nsCSSFrameConstructor::ContentRangeInser
       (StyleDisplay::ListItem == parentDisplay) ||
       (StyleDisplay::Inline == parentDisplay) ||
       (StyleDisplay::InlineBlock == parentDisplay)) {
     // Recover the special style flags for the containing block
     if (containingBlock) {
       haveFirstLetterStyle = HasFirstLetterStyle(containingBlock);
       haveFirstLineStyle =
         ShouldHaveFirstLineStyle(containingBlock->GetContent(),
-                                 containingBlock->Style());
+                                 containingBlock->StyleContext());
     }
 
     if (haveFirstLetterStyle) {
       // If our current insertion.mParentFrame is a Letter frame, use its parent as our
       // new parent hint
       if (insertion.mParentFrame->IsLetterFrame()) {
         // If insertion.mParentFrame is out of flow, then we actually want the parent of
         // the placeholder frame.
@@ -7913,17 +7922,17 @@ nsCSSFrameConstructor::ContentRangeInser
     }
   }
 
   if (haveFirstLineStyle && insertion.mParentFrame == containingBlock && isAppend) {
     // It's possible that the new frame goes into a first-line
     // frame. Look at it and see...
     AppendFirstLineFrames(state, containingBlock->GetContent(),
                           containingBlock, frameItems);
-  } else if (insertion.mParentFrame->Style()->HasPseudoElementData()) {
+  } else if (insertion.mParentFrame->StyleContext()->HasPseudoElementData()) {
     CheckForFirstLineInsertion(insertion.mParentFrame, frameItems);
     CheckForFirstLineInsertion(insertion.mParentFrame, captionItems);
   }
 
   // We might have captions; put them into the caption list of the
   // table wrapper frame.
   if (captionItems.NotEmpty()) {
     NS_ASSERTION(LayoutFrameType::Table == frameType ||
@@ -8531,19 +8540,19 @@ nsCSSFrameConstructor::GetAlternateTextF
 }
 
 nsIFrame*
 nsCSSFrameConstructor::CreateContinuingOuterTableFrame(nsIPresShell*     aPresShell,
                                                        nsPresContext*    aPresContext,
                                                        nsIFrame*         aFrame,
                                                        nsContainerFrame* aParentFrame,
                                                        nsIContent*       aContent,
-                                                       ComputedStyle*   aComputedStyle)
-{
-  nsTableWrapperFrame* newFrame = NS_NewTableWrapperFrame(aPresShell, aComputedStyle);
+                                                       nsStyleContext*   aStyleContext)
+{
+  nsTableWrapperFrame* newFrame = NS_NewTableWrapperFrame(aPresShell, aStyleContext);
 
   newFrame->Init(aContent, aParentFrame, aFrame);
 
   // Create a continuing inner table frame, and if there's a caption then
   // replicate the caption
   nsFrameItems  newChildFrames;
 
   nsIFrame* childFrame = aFrame->PrincipalChildList().FirstChild();
@@ -8561,19 +8570,19 @@ nsCSSFrameConstructor::CreateContinuingO
   return newFrame;
 }
 
 nsIFrame*
 nsCSSFrameConstructor::CreateContinuingTableFrame(nsIPresShell*     aPresShell,
                                                   nsIFrame*         aFrame,
                                                   nsContainerFrame* aParentFrame,
                                                   nsIContent*       aContent,
-                                                  ComputedStyle*   aComputedStyle)
-{
-  nsTableFrame* newFrame = NS_NewTableFrame(aPresShell, aComputedStyle);
+                                                  nsStyleContext*   aStyleContext)
+{
+  nsTableFrame* newFrame = NS_NewTableFrame(aPresShell, aStyleContext);
 
   newFrame->Init(aContent, aParentFrame, aFrame);
 
   // Replicate any header/footer frames
   nsFrameItems  childFrames;
   for (nsIFrame* childFrame : aFrame->PrincipalChildList()) {
     // See if it's a header/footer, possibly wrapped in a scroll frame.
     nsTableRowGroupFrame* rowGroupFrame =
@@ -8589,30 +8598,30 @@ nsCSSFrameConstructor::CreateContinuingT
       nsFrameItems            childItems;
 
       nsFrameConstructorState state(mPresShell,
                                     GetAbsoluteContainingBlock(newFrame, FIXED_POS),
                                     GetAbsoluteContainingBlock(newFrame, ABS_POS),
                                     nullptr);
       state.mCreatingExtraFrames = true;
 
-      ComputedStyle* const headerFooterComputedStyle = rowGroupFrame->Style();
+      nsStyleContext* const headerFooterStyleContext = rowGroupFrame->StyleContext();
       headerFooterFrame = static_cast<nsTableRowGroupFrame*>
-                                     (NS_NewTableRowGroupFrame(aPresShell, headerFooterComputedStyle));
+                                     (NS_NewTableRowGroupFrame(aPresShell, headerFooterStyleContext));
 
       nsIContent* headerFooter = rowGroupFrame->GetContent();
       headerFooterFrame->Init(headerFooter, newFrame, nullptr);
 
       nsFrameConstructorSaveState absoluteSaveState;
       MakeTablePartAbsoluteContainingBlockIfNeeded(state,
-                                                   headerFooterComputedStyle->StyleDisplay(),
+                                                   headerFooterStyleContext->StyleDisplay(),
                                                    absoluteSaveState,
                                                    headerFooterFrame);
 
-      ProcessChildren(state, headerFooter, rowGroupFrame->Style(),
+      ProcessChildren(state, headerFooter, rowGroupFrame->StyleContext(),
                       headerFooterFrame, true, childItems, false,
                       nullptr);
       NS_ASSERTION(state.mFloatedItems.IsEmpty(), "unexpected floated element");
       headerFooterFrame->SetInitialChildList(kPrincipalList, childItems);
       headerFooterFrame->SetRepeatable(true);
 
       // Table specific initialization
       headerFooterFrame->InitRepeatedFrame(rowGroupFrame);
@@ -8630,17 +8639,17 @@ nsCSSFrameConstructor::CreateContinuingT
 
 nsIFrame*
 nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext*    aPresContext,
                                              nsIFrame*         aFrame,
                                              nsContainerFrame* aParentFrame,
                                              bool              aIsFluid)
 {
   nsIPresShell*              shell = aPresContext->PresShell();
-  ComputedStyle*             styleContext = aFrame->Style();
+  nsStyleContext*            styleContext = aFrame->StyleContext();
   nsIFrame*                  newFrame = nullptr;
   nsIFrame*                  nextContinuation = aFrame->GetNextContinuation();
   nsIFrame*                  nextInFlow = aFrame->GetNextInFlow();
 
   // Use the frame type to determine what type of frame to create
   LayoutFrameType frameType = aFrame->Type();
   nsIContent* content = aFrame->GetContent();
 
@@ -8878,18 +8887,18 @@ nsCSSFrameConstructor::ReplicateFixedFra
   // page - bug 389619)
   for (nsIFrame* fixed = firstFixed; fixed; fixed = fixed->GetNextSibling()) {
     nsIFrame* prevPlaceholder = fixed->GetPlaceholderFrame();
     if (prevPlaceholder &&
         nsLayoutUtils::IsProperAncestorFrame(prevCanvasFrame, prevPlaceholder)) {
       // We want to use the same style as the primary style frame for
       // our content
       nsIContent* content = fixed->GetContent();
-      ComputedStyle* styleContext =
-        nsLayoutUtils::GetStyleFrame(content)->Style();
+      nsStyleContext* styleContext =
+        nsLayoutUtils::GetStyleFrame(content)->StyleContext();
       AutoFrameConstructionItemList items(this);
       AddFrameConstructionItemsInternal(state, content, canvasFrame,
                                         content->NodeInfo()->NameAtom(),
                                         content->GetNameSpaceID(),
                                         true,
                                         styleContext,
                                         ITEM_ALLOW_XBL_BASE |
                                           ITEM_ALLOW_PAGE_BREAK,
@@ -9259,17 +9268,17 @@ nsCSSFrameConstructor::RecreateFramesFor
     nsIFrame* nonGeneratedAncestor = nsLayoutUtils::GetNonGeneratedAncestor(frame);
     if (nonGeneratedAncestor->GetContent() != aContent) {
       return RecreateFramesForContent(nonGeneratedAncestor->GetContent(),
                                       InsertionKind::Async);
     }
 
     if (frame->GetStateBits() & NS_FRAME_ANONYMOUSCONTENTCREATOR_CONTENT) {
       // Recreate the frames for the entire nsIAnonymousContentCreator tree
-      // since |frame| or one of its descendants may need an ComputedStyle
+      // since |frame| or one of its descendants may need an nsStyleContext
       // that associates it to a CSS pseudo-element, and only the
       // nsIAnonymousContentCreator that created this content knows how to make
       // that happen.
       nsIAnonymousContentCreator* acc = nullptr;
       nsIFrame* ancestor = nsLayoutUtils::GetParentOrPlaceholderFor(frame);
       while (!(acc = do_QueryFrame(ancestor))) {
         ancestor = nsLayoutUtils::GetParentOrPlaceholderFor(ancestor);
       }
@@ -9355,71 +9364,71 @@ nsCSSFrameConstructor::DestroyFramesFor(
                         nextSibling,
                         REMOVE_FOR_RECONSTRUCTION);
 }
 
 //////////////////////////////////////////////////////////////////////
 
 // Block frame construction code
 
-already_AddRefed<ComputedStyle>
+already_AddRefed<nsStyleContext>
 nsCSSFrameConstructor::GetFirstLetterStyle(nsIContent* aContent,
-                                           ComputedStyle* aComputedStyle)
+                                           nsStyleContext* aStyleContext)
 {
   if (aContent) {
     return mPresShell->StyleSet()->
       ResolvePseudoElementStyle(aContent->AsElement(),
                                 CSSPseudoElementType::firstLetter,
-                                aComputedStyle,
+                                aStyleContext,
                                 nullptr);
   }
   return nullptr;
 }
 
-already_AddRefed<ComputedStyle>
+already_AddRefed<nsStyleContext>
 nsCSSFrameConstructor::GetFirstLineStyle(nsIContent* aContent,
-                                         ComputedStyle* aComputedStyle)
+                                         nsStyleContext* aStyleContext)
 {
   if (aContent) {
     return mPresShell->StyleSet()->
       ResolvePseudoElementStyle(aContent->AsElement(),
                                 CSSPseudoElementType::firstLine,
-                                aComputedStyle,
+                                aStyleContext,
                                 nullptr);
   }
   return nullptr;
 }
 
 // Predicate to see if a given content (block element) has
 // first-letter style applied to it.
 bool
 nsCSSFrameConstructor::ShouldHaveFirstLetterStyle(nsIContent* aContent,
-                                                  ComputedStyle* aComputedStyle)
-{
-  return nsLayoutUtils::HasPseudoStyle(aContent, aComputedStyle,
+                                                  nsStyleContext* aStyleContext)
+{
+  return nsLayoutUtils::HasPseudoStyle(aContent, aStyleContext,
                                        CSSPseudoElementType::firstLetter,
                                        mPresShell->GetPresContext());
 }
 
 bool
 nsCSSFrameConstructor::HasFirstLetterStyle(nsIFrame* aBlockFrame)
 {
   NS_PRECONDITION(aBlockFrame, "Need a frame");
   NS_ASSERTION(nsLayoutUtils::GetAsBlock(aBlockFrame),
                "Not a block frame?");
 
   return (aBlockFrame->GetStateBits() & NS_BLOCK_HAS_FIRST_LETTER_STYLE) != 0;
 }
 
 bool
 nsCSSFrameConstructor::ShouldHaveFirstLineStyle(nsIContent* aContent,
-                                                ComputedStyle* aComputedStyle)
+                                                nsStyleContext* aStyleContext)
 {
   bool hasFirstLine =
-    nsLayoutUtils::HasPseudoStyle(aContent, aComputedStyle,
+    nsLayoutUtils::HasPseudoStyle(aContent, aStyleContext,
                                   CSSPseudoElementType::firstLine,
                                   mPresShell->GetPresContext());
   if (hasFirstLine) {
     // But disable for fieldsets
     int32_t namespaceID;
     nsAtom* tag = mDocument->BindingManager()->ResolveTag(aContent,
                                                            &namespaceID);
     // This check must match the one in FindHTMLData.
@@ -9427,24 +9436,24 @@ nsCSSFrameConstructor::ShouldHaveFirstLi
       namespaceID != kNameSpaceID_XHTML;
   }
 
   return hasFirstLine;
 }
 
 void
 nsCSSFrameConstructor::ShouldHaveSpecialBlockStyle(nsIContent* aContent,
-                                                   ComputedStyle* aComputedStyle,
+                                                   nsStyleContext* aStyleContext,
                                                    bool* aHaveFirstLetterStyle,
                                                    bool* aHaveFirstLineStyle)
 {
   *aHaveFirstLetterStyle =
-    ShouldHaveFirstLetterStyle(aContent, aComputedStyle);
+    ShouldHaveFirstLetterStyle(aContent, aStyleContext);
   *aHaveFirstLineStyle =
-    ShouldHaveFirstLineStyle(aContent, aComputedStyle);
+    ShouldHaveFirstLineStyle(aContent, aStyleContext);
 }
 
 /* static */
 const nsCSSFrameConstructor::PseudoParentData
 nsCSSFrameConstructor::sPseudoParentData[eParentTypeCount] = {
   { // Cell
     FULL_CTOR_FCDATA(FCDATA_IS_TABLE_PART | FCDATA_SKIP_FRAMESET |
                      FCDATA_USE_CHILD_ITEMS |
@@ -9469,17 +9478,17 @@ nsCSSFrameConstructor::sPseudoParentData
                      &nsCSSFrameConstructor::ConstructTableRowOrRowGroup),
     &nsCSSAnonBoxes::tableRowGroup
   },
   { // Column group
     FCDATA_DECL(FCDATA_IS_TABLE_PART | FCDATA_SKIP_FRAMESET |
                 FCDATA_DISALLOW_OUT_OF_FLOW | FCDATA_USE_CHILD_ITEMS |
                 FCDATA_SKIP_ABSPOS_PUSH |
                 // Not FCDATA_IS_WRAPPER_ANON_BOX, because we don't need to
-                // restyle these: they have non-inheriting styles.
+                // restyle these: they have non-inheriting style contexts.
                 FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable),
                 NS_NewTableColGroupFrame),
     &nsCSSAnonBoxes::tableColGroup
   },
   { // Table
     FULL_CTOR_FCDATA(FCDATA_SKIP_FRAMESET | FCDATA_USE_CHILD_ITEMS |
                      FCDATA_IS_WRAPPER_ANON_BOX,
                      &nsCSSFrameConstructor::ConstructTable),
@@ -9596,19 +9605,19 @@ nsCSSFrameConstructor::CreateNeededAnonF
     NS_ASSERTION(iter != endIter,
                  "Should've had at least one wrappable child to seek past");
 
     // Now, we create the anonymous flex or grid item to contain the children
     // between |iter| and |endIter|.
     nsAtom* pseudoType = (aParentFrame->IsFlexContainerFrame())
                             ? nsCSSAnonBoxes::anonymousFlexItem
                             : nsCSSAnonBoxes::anonymousGridItem;
-    ComputedStyle* parentStyle = aParentFrame->Style();
+    nsStyleContext* parentStyle = aParentFrame->StyleContext();
     nsIContent* parentContent = aParentFrame->GetContent();
-    already_AddRefed<ComputedStyle> wrapperStyle =
+    already_AddRefed<nsStyleContext> wrapperStyle =
       mPresShell->StyleSet()->ResolveInheritingAnonymousBoxStyle(pseudoType,
                                                                  parentStyle);
 
     static const FrameConstructionData sBlockFormattingContextFCData =
       FCDATA_DECL(FCDATA_SKIP_FRAMESET |
                   FCDATA_USE_CHILD_ITEMS |
                   FCDATA_IS_WRAPPER_ANON_BOX,
                   NS_NewBlockFormattingContext);
@@ -9621,17 +9630,17 @@ nsCSSFrameConstructor::CreateNeededAnonF
                                 pseudoType,
                                 iter.item().mNameSpaceID,
                                 // no pending binding
                                 nullptr,
                                 wrapperStyle,
                                 true, nullptr);
 
     newItem->mIsAllInline = newItem->mHasInlineEnds =
-      newItem->mComputedStyle->StyleDisplay()->IsInlineOutsideStyle();
+      newItem->mStyleContext->StyleDisplay()->IsInlineOutsideStyle();
     newItem->mIsBlock = !newItem->mIsAllInline;
 
     MOZ_ASSERT(!newItem->mIsAllInline && newItem->mIsBlock,
                "expecting anonymous flex/grid items to be block-level "
                "(this will make a difference when we encounter "
                "'align-items: baseline')");
 
     // Anonymous flex and grid items induce line boundaries around their
@@ -9692,30 +9701,30 @@ nsCSSFrameConstructor::InterpretRubyWhit
 
   // Any leading or trailing whitespace in non-pseudo ruby box
   // should have been trimmed, hence there should not be any
   // whitespace at the start or the end.
   MOZ_ASSERT(!aStartIter.AtStart() && !aEndIter.IsDone());
   FCItemIterator prevIter(aStartIter);
   prevIter.Prev();
   return ComputeRubyWhitespaceType(
-      prevIter.item().mComputedStyle->StyleDisplay()->mDisplay,
-      aEndIter.item().mComputedStyle->StyleDisplay()->mDisplay);
+      prevIter.item().mStyleContext->StyleDisplay()->mDisplay,
+      aEndIter.item().mStyleContext->StyleDisplay()->mDisplay);
 }
 
 
 /**
  * This function eats up consecutive items which do not want the current
  * parent into either a ruby base box or a ruby text box.  When it
  * returns, |aIter| points to the first item it doesn't wrap.
  */
 void
 nsCSSFrameConstructor::WrapItemsInPseudoRubyLeafBox(
   FCItemIterator& aIter,
-  ComputedStyle* aParentStyle, nsIContent* aParentContent)
+  nsStyleContext* aParentStyle, nsIContent* aParentContent)
 {
   StyleDisplay parentDisplay = aParentStyle->StyleDisplay()->mDisplay;
   ParentType parentType, wrapperType;
   if (parentDisplay == StyleDisplay::RubyTextContainer) {
     parentType = eTypeRubyTextContainer;
     wrapperType = eTypeRubyText;
   } else {
     MOZ_ASSERT(parentDisplay == StyleDisplay::RubyBaseContainer);
@@ -9736,17 +9745,17 @@ nsCSSFrameConstructor::WrapItemsInPseudo
 /**
  * This function eats up consecutive items into a ruby level container.
  * It may create zero or one level container. When it returns, |aIter|
  * points to the first item it doesn't wrap.
  */
 void
 nsCSSFrameConstructor::WrapItemsInPseudoRubyLevelContainer(
   nsFrameConstructorState& aState, FCItemIterator& aIter,
-  ComputedStyle* aParentStyle, nsIContent* aParentContent)
+  nsStyleContext* aParentStyle, nsIContent* aParentContent)
 {
   MOZ_ASSERT(aIter.item().DesiredParentType() != eTypeRuby,
              "Pointing to a level container?");
 
   FrameConstructionItem& firstItem = aIter.item();
   ParentType wrapperType = firstItem.DesiredParentType();
   if (wrapperType != eTypeRubyTextContainer) {
     // If the first item is not ruby text,
@@ -9875,17 +9884,17 @@ nsCSSFrameConstructor::CreateNeededPseud
     //    content, which is not pure whitespace, but includes some.
     // In either case, the whitespaces are not the leading or trailing
     // whitespaces defined in the spec, and thus should not be trimmed.
     TrimLeadingAndTrailingWhitespaces(aState, aItems);
   }
 
   FCItemIterator iter(aItems);
   nsIContent* parentContent = aParentFrame->GetContent();
-  ComputedStyle* parentStyle = aParentFrame->Style();
+  nsStyleContext* parentStyle = aParentFrame->StyleContext();
   while (!iter.IsDone()) {
     if (!iter.SkipItemsWantingParentType(ourParentType)) {
       if (ourParentType == eTypeRuby) {
         WrapItemsInPseudoRubyLevelContainer(aState, iter, parentStyle,
                                             parentContent);
       } else {
         WrapItemsInPseudoRubyLeafBox(iter, parentStyle, parentContent);
       }
@@ -10070,50 +10079,50 @@ nsCSSFrameConstructor::CreateNeededPseud
           wrapperType = eTypeRuby;
         } else {
           NS_ASSERTION(IsTableParentType(groupingParentType),
                        "groupingParentType should be either Ruby or table");
           wrapperType = eTypeTable;
         }
     }
 
-    ComputedStyle* parentStyle = aParentFrame->Style();
+    nsStyleContext* parentStyle = aParentFrame->StyleContext();
     WrapItemsInPseudoParent(aParentFrame->GetContent(), parentStyle,
                             wrapperType, iter, endIter);
 
     // Now |iter| points to the item that was the first one we didn't wrap;
     // loop and see whether we need to skip it or wrap it in something
     // different.
   } while (!iter.IsDone());
 }
 
 /**
  * This method wraps frame construction item from |aIter| to
  * |aEndIter|. After it returns, aIter points to the first item
  * after the wrapper.
  */
 void
 nsCSSFrameConstructor::WrapItemsInPseudoParent(nsIContent* aParentContent,
-                                               ComputedStyle* aParentStyle,
+                                               nsStyleContext* aParentStyle,
                                                ParentType aWrapperType,
                                                FCItemIterator& aIter,
                                                const FCItemIterator& aEndIter)
 {
   const PseudoParentData& pseudoData = sPseudoParentData[aWrapperType];
   nsAtom* pseudoType = *pseudoData.mPseudoType;
   StyleDisplay parentDisplay = aParentStyle->StyleDisplay()->mDisplay;
 
   if (pseudoType == nsCSSAnonBoxes::table &&
       (parentDisplay == StyleDisplay::Inline ||
        parentDisplay == StyleDisplay::RubyBase ||
        parentDisplay == StyleDisplay::RubyText)) {
     pseudoType = nsCSSAnonBoxes::inlineTable;
   }
 
-  already_AddRefed<ComputedStyle> wrapperStyle;
+  already_AddRefed<nsStyleContext> wrapperStyle;
   if (pseudoData.mFCData.mBits & FCDATA_IS_WRAPPER_ANON_BOX) {
     wrapperStyle =
       mPresShell->StyleSet()->ResolveInheritingAnonymousBoxStyle(pseudoType,
                                                                  aParentStyle);
   } else {
     wrapperStyle =
       mPresShell->StyleSet()->ResolveNonInheritingAnonymousBoxStyle(pseudoType);
   }
@@ -10128,17 +10137,17 @@ nsCSSFrameConstructor::WrapItemsInPseudo
                               // to match that of our first child item to
                               // match the old behavior
                               aIter.item().mNameSpaceID,
                               // no pending binding
                               nullptr,
                               wrapperStyle,
                               true, nullptr);
 
-  const nsStyleDisplay* disp = newItem->mComputedStyle->StyleDisplay();
+  const nsStyleDisplay* disp = newItem->mStyleContext->StyleDisplay();
   // Here we're cheating a tad... technically, table-internal items should be
   // inline if aParentFrame is inline, but they'll get wrapped in an
   // inline-table in the end, so it'll all work out.  In any case, arguably
   // we don't need to maintain this state at this point... but it's better
   // to, I guess.
   newItem->mIsAllInline = newItem->mHasInlineEnds =
     disp->IsInlineOutsideStyle();
 
@@ -10172,28 +10181,28 @@ nsCSSFrameConstructor::CreateNeededPseud
     nsIFrame* aParentFrame)
 {
   if (aItems.IsEmpty() ||
       GetParentType(aParentFrame) != eTypeRuby) {
     return;
   }
 
   FCItemIterator iter(aItems);
-  StyleDisplay firstDisplay = iter.item().mComputedStyle->StyleDisplay()->mDisplay;
+  StyleDisplay firstDisplay = iter.item().mStyleContext->StyleDisplay()->mDisplay;
   if (firstDisplay == StyleDisplay::RubyBaseContainer) {
     return;
   }
   NS_ASSERTION(firstDisplay == StyleDisplay::RubyTextContainer,
                "Child of ruby frame should either a rbc or a rtc");
 
   const PseudoParentData& pseudoData =
     sPseudoParentData[eTypeRubyBaseContainer];
-  already_AddRefed<ComputedStyle> pseudoStyle = mPresShell->StyleSet()->
+  already_AddRefed<nsStyleContext> pseudoStyle = mPresShell->StyleSet()->
     ResolveInheritingAnonymousBoxStyle(*pseudoData.mPseudoType,
-                                       aParentFrame->Style());