Remove REM units.

The code to make them dynamically update was already removed when
Document::inheritHtmlAndBodyElementStyles was removed. We might want
to add them back later, but probably in a different way, so lets
remove the code for now to make refactoring the style system easier.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/788883005
diff --git a/sky/engine/core/animation/DeferredLegacyStyleInterpolation.cpp b/sky/engine/core/animation/DeferredLegacyStyleInterpolation.cpp
index 83839ea..ccafb0b 100644
--- a/sky/engine/core/animation/DeferredLegacyStyleInterpolation.cpp
+++ b/sky/engine/core/animation/DeferredLegacyStyleInterpolation.cpp
@@ -66,7 +66,6 @@
         primitiveValue.accumulateLengthArray(lengthArray);
         return lengthArray[CSSPrimitiveValue::UnitTypeFontSize] != 0
             || lengthArray[CSSPrimitiveValue::UnitTypeFontXSize] != 0
-            || lengthArray[CSSPrimitiveValue::UnitTypeRootFontSize] != 0
             || lengthArray[CSSPrimitiveValue::UnitTypeZeroCharacterWidth] != 0
             || lengthArray[CSSPrimitiveValue::UnitTypeViewportWidth] != 0
             || lengthArray[CSSPrimitiveValue::UnitTypeViewportHeight] != 0
diff --git a/sky/engine/core/css/CSSCalculationValue.cpp b/sky/engine/core/css/CSSCalculationValue.cpp
index e2c6526..efb54bd 100644
--- a/sky/engine/core/css/CSSCalculationValue.cpp
+++ b/sky/engine/core/css/CSSCalculationValue.cpp
@@ -62,7 +62,6 @@
     case CSSPrimitiveValue::CSS_IN:
     case CSSPrimitiveValue::CSS_PT:
     case CSSPrimitiveValue::CSS_PC:
-    case CSSPrimitiveValue::CSS_REMS:
     case CSSPrimitiveValue::CSS_CHS:
     case CSSPrimitiveValue::CSS_VW:
     case CSSPrimitiveValue::CSS_VH:
@@ -93,7 +92,6 @@
     case CSSPrimitiveValue::CSS_EMS:
     case CSSPrimitiveValue::CSS_EXS:
     case CSSPrimitiveValue::CSS_CHS:
-    case CSSPrimitiveValue::CSS_REMS:
     case CSSPrimitiveValue::CSS_PX:
     case CSSPrimitiveValue::CSS_CM:
     case CSSPrimitiveValue::CSS_MM:
diff --git a/sky/engine/core/css/CSSGradientValue.cpp b/sky/engine/core/css/CSSGradientValue.cpp
index 850c33f..f4f2d0e 100644
--- a/sky/engine/core/css/CSSGradientValue.cpp
+++ b/sky/engine/core/css/CSSGradientValue.cpp
@@ -61,8 +61,7 @@
     // We need to create an image.
     RefPtr<Gradient> gradient;
 
-    RenderStyle* rootStyle = renderer->document().documentElement()->renderStyle();
-    CSSToLengthConversionData conversionData(renderer->style(), rootStyle, renderer->view());
+    CSSToLengthConversionData conversionData(renderer->style(), renderer->view());
     if (isLinearGradientValue())
         gradient = toCSSLinearGradientValue(this)->createGradient(conversionData, size);
     else
diff --git a/sky/engine/core/css/CSSMatrix.cpp b/sky/engine/core/css/CSSMatrix.cpp
index 41333fa..bb0cb42 100644
--- a/sky/engine/core/css/CSSMatrix.cpp
+++ b/sky/engine/core/css/CSSMatrix.cpp
@@ -68,7 +68,7 @@
 
         DEFINE_STATIC_REF(RenderStyle, defaultStyle, RenderStyle::createDefaultStyle());
         TransformOperations operations;
-        if (!TransformBuilder::createTransformOperations(value.get(), CSSToLengthConversionData(defaultStyle, defaultStyle, 0), operations)) {
+        if (!TransformBuilder::createTransformOperations(value.get(), CSSToLengthConversionData(defaultStyle, 0), operations)) {
             exceptionState.throwDOMException(SyntaxError, "Failed to interpret '" + string + "' as a transformation operation.");
             return;
         }
diff --git a/sky/engine/core/css/CSSPrimitiveValue.cpp b/sky/engine/core/css/CSSPrimitiveValue.cpp
index 982c544..d087be4 100644
--- a/sky/engine/core/css/CSSPrimitiveValue.cpp
+++ b/sky/engine/core/css/CSSPrimitiveValue.cpp
@@ -76,7 +76,6 @@
     case CSSPrimitiveValue::CSS_PT:
     case CSSPrimitiveValue::CSS_PX:
     case CSSPrimitiveValue::CSS_RAD:
-    case CSSPrimitiveValue::CSS_REMS:
     case CSSPrimitiveValue::CSS_CHS:
     case CSSPrimitiveValue::CSS_S:
     case CSSPrimitiveValue::CSS_TURN:
@@ -134,7 +133,6 @@
     table.set(String("vh"), CSSPrimitiveValue::CSS_VH);
     table.set(String("vmax"), CSSPrimitiveValue::CSS_VMIN);
     table.set(String("vmin"), CSSPrimitiveValue::CSS_VMAX);
-    table.set(String("rem"), CSSPrimitiveValue::CSS_REMS);
     table.set(String("fr"), CSSPrimitiveValue::CSS_FR);
     table.set(String("turn"), CSSPrimitiveValue::CSS_TURN);
     table.set(String("ch"), CSSPrimitiveValue::CSS_CHS);
@@ -460,7 +458,6 @@
     case CSS_PERCENTAGE:
     case CSS_EMS:
     case CSS_EXS:
-    case CSS_REMS:
     case CSS_CHS:
     case CSS_PX:
     case CSS_CM:
@@ -575,7 +572,6 @@
         return m_value.calc->computeLengthPx(conversionData);
 
     const RenderStyle& style = conversionData.style();
-    const RenderStyle* rootStyle = conversionData.rootStyle();
     bool computingFontSize = conversionData.computingFontSize();
 
     double factor;
@@ -593,12 +589,6 @@
             else
                 factor = (computingFontSize ? style.fontDescription().specifiedSize() : style.fontDescription().computedSize()) / 2.0;
             break;
-        case CSS_REMS:
-            if (rootStyle)
-                factor = computingFontSize ? rootStyle->fontDescription().specifiedSize() : rootStyle->fontDescription().computedSize();
-            else
-                factor = 1.0;
-            break;
         case CSS_CHS:
             factor = style.fontMetrics().zeroWidth();
             break;
@@ -840,9 +830,6 @@
     case CSSPrimitiveValue::CSS_EXS:
         lengthType = UnitTypeFontXSize;
         return true;
-    case CSSPrimitiveValue::CSS_REMS:
-        lengthType = UnitTypeRootFontSize;
-        return true;
     case CSSPrimitiveValue::CSS_CHS:
         lengthType = UnitTypeZeroCharacterWidth;
         return true;
@@ -875,8 +862,6 @@
         return CSSPrimitiveValue::CSS_EMS;
     case UnitTypeFontXSize:
         return CSSPrimitiveValue::CSS_EXS;
-    case UnitTypeRootFontSize:
-        return CSSPrimitiveValue::CSS_REMS;
     case UnitTypeZeroCharacterWidth:
         return CSSPrimitiveValue::CSS_CHS;
     case UnitTypePercentage:
@@ -1012,8 +997,6 @@
         return "em";
     case CSS_EXS:
         return "ex";
-    case CSS_REMS:
-        return "rem";
     case CSS_CHS:
         return "ch";
     case CSS_PX:
@@ -1103,7 +1086,6 @@
         case CSS_PERCENTAGE:
         case CSS_EMS:
         case CSS_EXS:
-        case CSS_REMS:
         case CSS_CHS:
         case CSS_PX:
         case CSS_CM:
@@ -1218,7 +1200,6 @@
     case CSS_PERCENTAGE:
     case CSS_EMS:
     case CSS_EXS:
-    case CSS_REMS:
     case CSS_CHS:
     case CSS_PX:
     case CSS_CM:
@@ -1277,7 +1258,6 @@
     case CSS_PERCENTAGE:
     case CSS_EMS:
     case CSS_EXS:
-    case CSS_REMS:
     case CSS_PX:
     case CSS_CM:
     case CSS_DPPX:
diff --git a/sky/engine/core/css/CSSPrimitiveValue.h b/sky/engine/core/css/CSSPrimitiveValue.h
index e81ba10..7390a7e 100644
--- a/sky/engine/core/css/CSSPrimitiveValue.h
+++ b/sky/engine/core/css/CSSPrimitiveValue.h
@@ -113,7 +113,7 @@
 
         // These are from CSS3 Values and Units, but that isn't a finished standard yet
         CSS_TURN = 107,
-        CSS_REMS = 108,
+        // CSS_REMS = 108,
         CSS_CHS = 109,
 
         // This is used by the CSS Shapes draft
@@ -135,7 +135,6 @@
         UnitTypePercentage,
         UnitTypeFontSize,
         UnitTypeFontXSize,
-        UnitTypeRootFontSize,
         UnitTypeZeroCharacterWidth,
         UnitTypeViewportWidth,
         UnitTypeViewportHeight,
@@ -177,14 +176,13 @@
     {
         return m_primitiveUnitType == CSS_EMS
             || m_primitiveUnitType == CSS_EXS
-            || m_primitiveUnitType == CSS_REMS
             || m_primitiveUnitType == CSS_CHS;
     }
     bool isViewportPercentageLength() const { return isViewportPercentageLength(static_cast<UnitType>(m_primitiveUnitType)); }
     static bool isViewportPercentageLength(UnitType type) { return type >= CSS_VW && type <= CSS_VMAX; }
     static bool isLength(UnitType type)
     {
-        return (type >= CSS_EMS && type <= CSS_PC) || type == CSS_REMS || type == CSS_CHS || isViewportPercentageLength(type);
+        return (type >= CSS_EMS && type <= CSS_PC) || type == CSS_CHS || isViewportPercentageLength(type);
     }
     bool isLength() const { return isLength(primitiveType()); }
     bool isNumber() const { return primitiveType() == CSS_NUMBER; }
diff --git a/sky/engine/core/css/CSSToLengthConversionData.cpp b/sky/engine/core/css/CSSToLengthConversionData.cpp
index 5b1d7c4..ea0e42b 100644
--- a/sky/engine/core/css/CSSToLengthConversionData.cpp
+++ b/sky/engine/core/css/CSSToLengthConversionData.cpp
@@ -36,9 +36,8 @@
 
 namespace blink {
 
-CSSToLengthConversionData::CSSToLengthConversionData(const RenderStyle* style, const RenderStyle* rootStyle, const RenderView* renderView, bool computingFontSize)
+CSSToLengthConversionData::CSSToLengthConversionData(const RenderStyle* style, const RenderView* renderView, bool computingFontSize)
     : m_style(style)
-    , m_rootStyle(rootStyle)
     , m_viewportWidth(renderView ? renderView->layoutViewportWidth() : 0)
     , m_viewportHeight(renderView ? renderView->layoutViewportHeight() : 0)
     , m_computingFontSize(computingFontSize)
diff --git a/sky/engine/core/css/CSSToLengthConversionData.h b/sky/engine/core/css/CSSToLengthConversionData.h
index 7b71e68..2e52af6 100644
--- a/sky/engine/core/css/CSSToLengthConversionData.h
+++ b/sky/engine/core/css/CSSToLengthConversionData.h
@@ -41,10 +41,9 @@
 
 class CSSToLengthConversionData {
 public:
-    CSSToLengthConversionData(const RenderStyle* currStyle, const RenderStyle* rootStyle, const RenderView*, bool computingFontSize = false);
+    CSSToLengthConversionData(const RenderStyle* currStyle, const RenderView*, bool computingFontSize = false);
 
     const RenderStyle& style() const { return *m_style; }
-    const RenderStyle* rootStyle() const { return m_rootStyle; }
     bool computingFontSize() const { return m_computingFontSize; }
 
     // Accessing these marks the style as having viewport units
@@ -54,11 +53,9 @@
     double viewportMaxPercent() const;
 
     void setStyle(const RenderStyle* style) { m_style = style; }
-    void setRootStyle(const RenderStyle* rootStyle) { m_rootStyle = rootStyle; }
 
 private:
     const RenderStyle* m_style;
-    const RenderStyle* m_rootStyle;
     float m_viewportWidth;
     float m_viewportHeight;
     bool m_computingFontSize;
diff --git a/sky/engine/core/css/MediaQueryExp.cpp b/sky/engine/core/css/MediaQueryExp.cpp
index 51d6c48..d04a123 100644
--- a/sky/engine/core/css/MediaQueryExp.cpp
+++ b/sky/engine/core/css/MediaQueryExp.cpp
@@ -86,7 +86,6 @@
     case CSSPrimitiveValue::CSS_IN:
     case CSSPrimitiveValue::CSS_PT:
     case CSSPrimitiveValue::CSS_PC:
-    case CSSPrimitiveValue::CSS_REMS:
     case CSSPrimitiveValue::CSS_CHS:
         return true;
     }
diff --git a/sky/engine/core/css/MediaValues.cpp b/sky/engine/core/css/MediaValues.cpp
index cc7b42d..d317b41 100644
--- a/sky/engine/core/css/MediaValues.cpp
+++ b/sky/engine/core/css/MediaValues.cpp
@@ -136,7 +136,6 @@
     double factor = 0;
     switch (type) {
     case CSSPrimitiveValue::CSS_EMS:
-    case CSSPrimitiveValue::CSS_REMS:
         factor = defaultFontSize;
         break;
     case CSSPrimitiveValue::CSS_PX:
diff --git a/sky/engine/core/css/MediaValuesTest.cpp b/sky/engine/core/css/MediaValuesTest.cpp
index 9210695..62d2033 100644
--- a/sky/engine/core/css/MediaValuesTest.cpp
+++ b/sky/engine/core/css/MediaValuesTest.cpp
@@ -27,7 +27,6 @@
     TestCase testCases[] = {
         { 40.0, CSSPrimitiveValue::CSS_PX, 16, 300, 300, true, 40 },
         { 40.0, CSSPrimitiveValue::CSS_EMS, 16, 300, 300, true, 640 },
-        { 40.0, CSSPrimitiveValue::CSS_REMS, 16, 300, 300, true, 640 },
         { 40.0, CSSPrimitiveValue::CSS_EXS, 16, 300, 300, true, 320 },
         { 40.0, CSSPrimitiveValue::CSS_CHS, 16, 300, 300, true, 320 },
         { 43.0, CSSPrimitiveValue::CSS_VW, 16, 848, 976, true, 364 },
diff --git a/sky/engine/core/css/StyleSheetContents.cpp b/sky/engine/core/css/StyleSheetContents.cpp
index 5b38d0f..77fd669 100644
--- a/sky/engine/core/css/StyleSheetContents.cpp
+++ b/sky/engine/core/css/StyleSheetContents.cpp
@@ -36,8 +36,7 @@
 namespace blink {
 
 StyleSheetContents::StyleSheetContents(const CSSParserContext& context)
-    : m_usesRemUnits(false)
-    , m_hasMediaQueries(false)
+    : m_hasMediaQueries(false)
     , m_parserContext(context)
 {
 }
diff --git a/sky/engine/core/css/StyleSheetContents.h b/sky/engine/core/css/StyleSheetContents.h
index 5419f26..85d4521 100644
--- a/sky/engine/core/css/StyleSheetContents.h
+++ b/sky/engine/core/css/StyleSheetContents.h
@@ -55,12 +55,9 @@
     bool parseString(const String&);
 
     void parserAppendRule(PassRefPtr<StyleRuleBase>);
-    void parserSetUsesRemUnits(bool b) { m_usesRemUnits = b; }
 
     const Vector<RefPtr<StyleRuleBase> >& childRules() const { return m_childRules; }
 
-    bool usesRemUnits() const { return m_usesRemUnits; }
-
     void registerClient(CSSStyleSheet*);
     void unregisterClient(CSSStyleSheet*);
 
@@ -75,7 +72,6 @@
 private:
     explicit StyleSheetContents(const CSSParserContext&);
 
-    bool m_usesRemUnits : 1;
     bool m_hasMediaQueries : 1;
 
     OwnPtr<RuleSet> m_ruleSet;
diff --git a/sky/engine/core/css/parser/CSSGrammar.y b/sky/engine/core/css/parser/CSSGrammar.y
index 3c35fbd..ac7cedf 100644
--- a/sky/engine/core/css/parser/CSSGrammar.y
+++ b/sky/engine/core/css/parser/CSSGrammar.y
@@ -200,7 +200,6 @@
 %token SUPPORTS_AND
 %token SUPPORTS_OR
 
-%token <number> REMS
 %token <number> CHS
 %token <number> EMS
 %token <number> EXS
@@ -1302,11 +1301,6 @@
   | KHERTZ { $$.setFromNumber($1, CSSPrimitiveValue::CSS_KHZ); }
   | EMS { $$.setFromNumber($1, CSSPrimitiveValue::CSS_EMS); }
   | EXS { $$.setFromNumber($1, CSSPrimitiveValue::CSS_EXS); }
-  | REMS {
-      $$.setFromNumber($1, CSSPrimitiveValue::CSS_REMS);
-      if (parser->m_styleSheet)
-          parser->m_styleSheet->parserSetUsesRemUnits(true);
-  }
   | CHS { $$.setFromNumber($1, CSSPrimitiveValue::CSS_CHS); }
   | VW { $$.setFromNumber($1, CSSPrimitiveValue::CSS_VW); }
   | VH { $$.setFromNumber($1, CSSPrimitiveValue::CSS_VH); }
diff --git a/sky/engine/core/css/parser/CSSPropertyParser.cpp b/sky/engine/core/css/parser/CSSPropertyParser.cpp
index 6833f73..c142baf 100644
--- a/sky/engine/core/css/parser/CSSPropertyParser.cpp
+++ b/sky/engine/core/css/parser/CSSPropertyParser.cpp
@@ -248,7 +248,6 @@
         b = (unitflags & FPercent);
         break;
     case CSSPrimitiveValue::CSS_EMS:
-    case CSSPrimitiveValue::CSS_REMS:
     case CSSPrimitiveValue::CSS_CHS:
     case CSSPrimitiveValue::CSS_EXS:
     case CSSPrimitiveValue::CSS_PX:
diff --git a/sky/engine/core/css/parser/CSSTokenizer-in.cpp b/sky/engine/core/css/parser/CSSTokenizer-in.cpp
index b4e47e5..246d25a 100644
--- a/sky/engine/core/css/parser/CSSTokenizer-in.cpp
+++ b/sky/engine/core/css/parser/CSSTokenizer-in.cpp
@@ -843,9 +843,6 @@
         CASE("rad") {
             m_token = RADS;
         }
-        CASE("rem") {
-            m_token = REMS;
-        }
         CASE("s") {
             m_token = SECS;
         }
diff --git a/sky/engine/core/css/resolver/ElementResolveContext.cpp b/sky/engine/core/css/resolver/ElementResolveContext.cpp
index b3e85b2..fe7a790 100644
--- a/sky/engine/core/css/resolver/ElementResolveContext.cpp
+++ b/sky/engine/core/css/resolver/ElementResolveContext.cpp
@@ -31,7 +31,6 @@
 ElementResolveContext::ElementResolveContext(const Document& document)
     : m_element(nullptr)
     , m_parentNode(nullptr)
-    , m_rootElementStyle(document.documentElement() ? document.documentElement()->renderStyle() : document.renderStyle())
     , m_distributedToInsertionPoint(false)
 {
 }
@@ -43,13 +42,6 @@
     NodeRenderingTraversal::ParentDetails parentDetails;
     m_parentNode = NodeRenderingTraversal::parent(&element, &parentDetails);
     m_distributedToInsertionPoint = parentDetails.insertionPoint();
-
-    const Document& document = element.document();
-    Node* documentElement = document.documentElement();
-    RenderStyle* documentStyle = document.renderStyle();
-    m_rootElementStyle = documentElement && element != documentElement ? documentElement->renderStyle() : documentStyle;
-    if (!m_rootElementStyle)
-        m_rootElementStyle = documentStyle;
 }
 
 } // namespace blink
diff --git a/sky/engine/core/css/resolver/ElementResolveContext.h b/sky/engine/core/css/resolver/ElementResolveContext.h
index da475c8..0e360c8 100644
--- a/sky/engine/core/css/resolver/ElementResolveContext.h
+++ b/sky/engine/core/css/resolver/ElementResolveContext.h
@@ -42,13 +42,11 @@
 
     Element* element() const { return m_element; }
     const ContainerNode* parentNode() const { return m_parentNode; }
-    const RenderStyle* rootElementStyle() const { return m_rootElementStyle; }
     bool distributedToInsertionPoint() const { return m_distributedToInsertionPoint; }
 
 private:
     RawPtr<Element> m_element;
     RawPtr<ContainerNode> m_parentNode;
-    RenderStyle* m_rootElementStyle;
     bool m_distributedToInsertionPoint;
 };
 
diff --git a/sky/engine/core/css/resolver/FontBuilder.cpp b/sky/engine/core/css/resolver/FontBuilder.cpp
index 47df2c7..de3960a 100644
--- a/sky/engine/core/css/resolver/FontBuilder.cpp
+++ b/sky/engine/core/css/resolver/FontBuilder.cpp
@@ -276,7 +276,7 @@
 }
 
 // FIXME: Have to pass RenderStyles here for calc/computed values. This shouldn't be neecessary.
-void FontBuilder::setFontSizeValue(CSSValue* value, RenderStyle* parentStyle, const RenderStyle* rootElementStyle)
+void FontBuilder::setFontSizeValue(CSSValue* value, RenderStyle* parentStyle)
 {
     if (!value->isPrimitiveValue())
         return;
@@ -328,7 +328,7 @@
             // If we have viewport units the conversion will mark the parent style as having viewport units.
             bool parentHasViewportUnits = parentStyle->hasViewportUnits();
             parentStyle->setHasViewportUnits(false);
-            CSSToLengthConversionData conversionData(parentStyle, rootElementStyle, m_document->renderView(), true);
+            CSSToLengthConversionData conversionData(parentStyle, m_document->renderView(), true);
             if (primitiveValue->isLength())
                 size = primitiveValue->computeLength<float>(conversionData);
             else if (primitiveValue->isCalculatedPercentageWithLength())
diff --git a/sky/engine/core/css/resolver/FontBuilder.h b/sky/engine/core/css/resolver/FontBuilder.h
index 290e0c4..811b246 100644
--- a/sky/engine/core/css/resolver/FontBuilder.h
+++ b/sky/engine/core/css/resolver/FontBuilder.h
@@ -59,7 +59,7 @@
 
     void setFontSizeInitial();
     void setFontSizeInherit(const FontDescription&);
-    void setFontSizeValue(CSSValue*, RenderStyle* parentStyle, const RenderStyle* rootElementStyle);
+    void setFontSizeValue(CSSValue*, RenderStyle* parentStyle);
 
     void setWeight(FontWeight);
     void setStretch(FontStretch);
diff --git a/sky/engine/core/css/resolver/StyleBuilderCustom.cpp b/sky/engine/core/css/resolver/StyleBuilderCustom.cpp
index ec3494c..495d0f3 100644
--- a/sky/engine/core/css/resolver/StyleBuilderCustom.cpp
+++ b/sky/engine/core/css/resolver/StyleBuilderCustom.cpp
@@ -186,7 +186,7 @@
 
 void StyleBuilderFunctions::applyValueCSSPropertyFontSize(StyleResolverState& state, CSSValue* value)
 {
-    state.fontBuilder().setFontSizeValue(value, state.parentStyle(), state.rootElementStyle());
+    state.fontBuilder().setFontSizeValue(value, state.parentStyle());
 }
 
 void StyleBuilderFunctions::applyValueCSSPropertyLineHeight(StyleResolverState& state, CSSValue* value)
diff --git a/sky/engine/core/css/resolver/StyleResolverState.cpp b/sky/engine/core/css/resolver/StyleResolverState.cpp
index d087471..fed37ea 100644
--- a/sky/engine/core/css/resolver/StyleResolverState.cpp
+++ b/sky/engine/core/css/resolver/StyleResolverState.cpp
@@ -33,7 +33,7 @@
     : m_elementContext(element ? ElementResolveContext(*element) : ElementResolveContext(document))
     , m_document(document)
     , m_style(nullptr)
-    , m_cssToLengthConversionData(0, rootElementStyle(), document.renderView())
+    , m_cssToLengthConversionData(0, document.renderView())
     , m_parentStyle(parentStyle)
     , m_lineHeightValue(nullptr)
     , m_styleMap(*this, m_elementStyleResources)
diff --git a/sky/engine/core/css/resolver/StyleResolverState.h b/sky/engine/core/css/resolver/StyleResolverState.h
index ea9061c..ab81f27 100644
--- a/sky/engine/core/css/resolver/StyleResolverState.h
+++ b/sky/engine/core/css/resolver/StyleResolverState.h
@@ -53,7 +53,6 @@
     // These are all just pass-through methods to ElementResolveContext.
     Element* element() const { return m_elementContext.element(); }
     const ContainerNode* parentNode() const { return m_elementContext.parentNode(); }
-    const RenderStyle* rootElementStyle() const { return m_elementContext.rootElementStyle(); }
 
     bool distributedToInsertionPoint() const { return m_elementContext.distributedToInsertionPoint(); }
 
diff --git a/sky/engine/core/dom/Document.cpp b/sky/engine/core/dom/Document.cpp
index bef4928..05f9916 100644
--- a/sky/engine/core/dom/Document.cpp
+++ b/sky/engine/core/dom/Document.cpp
@@ -1078,9 +1078,6 @@
     // re-attaching our containing iframe, which when asked HTMLFrameElementBase::isURLAllowed
     // hits a null-dereference due to security code always assuming the document has a SecurityOrigin.
 
-    if (m_elemSheet && m_elemSheet->contents()->usesRemUnits())
-        m_styleEngine->setUsesRemUnit(true);
-
     updateStyle(change);
 
     // As a result of the style recalculation, the currently hovered element might have been
@@ -1573,15 +1570,6 @@
 
     if (!m_baseURL.isValid())
         m_baseURL = KURL();
-
-    // FIXME(sky): remove?
-    if (m_elemSheet) {
-        // Element sheet is silly. It never contains anything.
-        bool usesRemUnits = m_elemSheet->contents()->usesRemUnits();
-        m_elemSheet = CSSStyleSheet::create(this, m_baseURL);
-        // FIXME: So we are not really the parser. The right fix is to eliminate the element sheet completely.
-        m_elemSheet->contents()->parserSetUsesRemUnits(usesRemUnits);
-    }
 }
 
 void Document::didLoadAllImports()
diff --git a/sky/engine/core/dom/DocumentStyleSheetCollection.cpp b/sky/engine/core/dom/DocumentStyleSheetCollection.cpp
index f0ff039..3d4526a 100644
--- a/sky/engine/core/dom/DocumentStyleSheetCollection.cpp
+++ b/sky/engine/core/dom/DocumentStyleSheetCollection.cpp
@@ -76,8 +76,6 @@
     document().setNeedsStyleRecalc(SubtreeStyleChange);
 
     collection.swap(*this);
-
-    updateUsesRemUnits();
 }
 
 }
diff --git a/sky/engine/core/dom/ShadowTreeStyleSheetCollection.cpp b/sky/engine/core/dom/ShadowTreeStyleSheetCollection.cpp
index 37b359c..8d73870 100644
--- a/sky/engine/core/dom/ShadowTreeStyleSheetCollection.cpp
+++ b/sky/engine/core/dom/ShadowTreeStyleSheetCollection.cpp
@@ -70,7 +70,6 @@
     toShadowRoot(treeScope().rootNode()).host()->setNeedsStyleRecalc(SubtreeStyleChange);
 
     collection.swap(*this);
-    updateUsesRemUnits();
 }
 
 }
diff --git a/sky/engine/core/dom/StyleEngine.cpp b/sky/engine/core/dom/StyleEngine.cpp
index 0f4d91a..0dcf201 100644
--- a/sky/engine/core/dom/StyleEngine.cpp
+++ b/sky/engine/core/dom/StyleEngine.cpp
@@ -47,7 +47,6 @@
     , m_isMaster(!document.importsController() || document.importsController()->master() == &document)
     , m_documentStyleSheetCollection(DocumentStyleSheetCollection::create(document))
     , m_documentScopeDirty(true)
-    , m_usesRemUnits(false)
     , m_ignorePendingStylesheets(false)
     // We don't need to create CSSFontSelector for imported document or
     // HTMLTemplateElement's document, because those documents have no frame.
@@ -236,8 +235,6 @@
     }
     m_activeTreeScopes.removeAll(treeScopesRemoved);
 
-    m_usesRemUnits = documentStyleSheetCollection()->usesRemUnits();
-
     m_dirtyTreeScopes.clear();
     m_documentScopeDirty = false;
 }
diff --git a/sky/engine/core/dom/StyleEngine.h b/sky/engine/core/dom/StyleEngine.h
index 1a2912b..0cdb362 100644
--- a/sky/engine/core/dom/StyleEngine.h
+++ b/sky/engine/core/dom/StyleEngine.h
@@ -88,9 +88,6 @@
     // FIXME(sky): Remove this and ::first-line.
     bool usesFirstLineRules() const { return false; }
 
-    bool usesRemUnits() const { return m_usesRemUnits; }
-    void setUsesRemUnit(bool b) { m_usesRemUnits = b; }
-
     void didRemoveShadowRoot(ShadowRoot*);
     void appendActiveAuthorStyleSheets();
 
@@ -181,8 +178,6 @@
     TreeScopeSet m_dirtyTreeScopes;
     TreeScopeSet m_activeTreeScopes;
 
-    bool m_usesRemUnits;
-
     bool m_ignorePendingStylesheets;
     OwnPtr<StyleResolver> m_resolver;
 
diff --git a/sky/engine/core/dom/TreeScopeStyleSheetCollection.cpp b/sky/engine/core/dom/TreeScopeStyleSheetCollection.cpp
index 0d0c392..d11a655 100644
--- a/sky/engine/core/dom/TreeScopeStyleSheetCollection.cpp
+++ b/sky/engine/core/dom/TreeScopeStyleSheetCollection.cpp
@@ -38,7 +38,6 @@
 
 TreeScopeStyleSheetCollection::TreeScopeStyleSheetCollection(TreeScope& treeScope)
     : m_treeScope(treeScope)
-    , m_usesRemUnits(false)
 {
 }
 
@@ -68,18 +67,4 @@
     }
 }
 
-static bool styleSheetsUseRemUnits(const Vector<RefPtr<CSSStyleSheet> >& sheets)
-{
-    for (unsigned i = 0; i < sheets.size(); ++i) {
-        if (sheets[i]->contents()->usesRemUnits())
-            return true;
-    }
-    return false;
-}
-
-void TreeScopeStyleSheetCollection::updateUsesRemUnits()
-{
-    m_usesRemUnits = styleSheetsUseRemUnits(m_activeAuthorStyleSheets);
-}
-
 }
diff --git a/sky/engine/core/dom/TreeScopeStyleSheetCollection.h b/sky/engine/core/dom/TreeScopeStyleSheetCollection.h
index 5909ac0..c078237 100644
--- a/sky/engine/core/dom/TreeScopeStyleSheetCollection.h
+++ b/sky/engine/core/dom/TreeScopeStyleSheetCollection.h
@@ -52,8 +52,6 @@
     void removeStyleSheetCandidateNode(Node*, ContainerNode* scopingNode);
     bool hasStyleSheetCandidateNodes() const { return !m_styleSheetCandidateNodes.isEmpty(); }
 
-    bool usesRemUnits() const { return m_usesRemUnits; }
-
     DocumentOrderedList& styleSheetCandidateNodes() { return m_styleSheetCandidateNodes; }
 
     void clearMediaQueryRuleSetStyleSheets();
@@ -70,11 +68,8 @@
         Additive
     };
 
-    void updateUsesRemUnits();
-
 protected:
     RawPtr<TreeScope> m_treeScope;
-    bool m_usesRemUnits;
 
     DocumentOrderedList m_styleSheetCandidateNodes;
 };