Bug 1383296 Part 1: Remove all uses of the nsCSSValue::Serialization enum, now that it no longer has multiple values. draft
authorBrad Werth <bwerth@mozilla.com>
Fri, 21 Jul 2017 17:26:35 -0700
changeset 613470 d12a58f58aa72792629e3872fa19a26d1c1c37e7
parent 613469 9e1ff9ae4d42c9029210c1b3a450a7243b4af326
child 638687 15b5ded97f849df8a48e82ed5eb556c66a75347e
push id69814
push userbwerth@mozilla.com
push dateSat, 22 Jul 2017 01:08:51 +0000
bugs1383296
milestone56.0a1
Bug 1383296 Part 1: Remove all uses of the nsCSSValue::Serialization enum, now that it no longer has multiple values. MozReview-Commit-ID: n6px5hNHtB
dom/animation/KeyframeEffectReadOnly.cpp
dom/base/DOMIntersectionObserver.cpp
layout/style/Declaration.cpp
layout/style/Declaration.h
layout/style/FontFace.cpp
layout/style/StyleAnimationValue.cpp
layout/style/nsCSSRules.cpp
layout/style/nsCSSValue.cpp
layout/style/nsCSSValue.h
layout/style/nsMediaList.cpp
--- a/dom/animation/KeyframeEffectReadOnly.cpp
+++ b/dom/animation/KeyframeEffectReadOnly.cpp
@@ -1251,17 +1251,17 @@ KeyframeEffectReadOnly::GetKeyframes(JSC
                                            &stringValue);
           }
         }
       } else if (nsCSSProps::IsShorthand(propertyValue.mProperty)) {
          // nsCSSValue::AppendToString does not accept shorthands properties but
          // works with token stream values if we pass eCSSProperty_UNKNOWN as
          // the property.
          propertyValue.mValue.AppendToString(
-           eCSSProperty_UNKNOWN, stringValue, nsCSSValue::eNormalized);
+           eCSSProperty_UNKNOWN, stringValue);
       } else {
         nsCSSValue cssValue = propertyValue.mValue;
         if (cssValue.GetUnit() == eCSSUnit_Null) {
           // We use an uninitialized nsCSSValue to represent the
           // "neutral value". We currently only do this for keyframes generated
           // from CSS animations with missing 0%/100% keyframes. Furthermore,
           // currently (at least until bug 1339334) keyframes generated from
           // CSS animations only contain longhand properties so we only need to
@@ -1272,18 +1272,17 @@ KeyframeEffectReadOnly::GetKeyframes(JSC
               Move(BaseStyle(propertyValue.mProperty).mGecko),
               cssValue);
 
           MOZ_ASSERT(uncomputeResult,
                      "Unable to get specified value from computed value");
           MOZ_ASSERT(cssValue.GetUnit() != eCSSUnit_Null,
                      "Got null computed value");
         }
-        cssValue.AppendToString(propertyValue.mProperty,
-                                stringValue, nsCSSValue::eNormalized);
+        cssValue.AppendToString(propertyValue.mProperty, stringValue);
       }
 
       const char* name = nsCSSProps::PropertyIDLName(propertyValue.mProperty);
       JS::Rooted<JS::Value> value(aCx);
       if (!ToJSValue(aCx, stringValue, &value) ||
           !JS_DefineProperty(aCx, keyframeObject, name, value,
                              JSPROP_ENUMERATE)) {
         aRv.Throw(NS_ERROR_FAILURE);
--- a/dom/base/DOMIntersectionObserver.cpp
+++ b/dom/base/DOMIntersectionObserver.cpp
@@ -133,17 +133,17 @@ DOMIntersectionObserver::SetRootMargin(c
   }
 
   return true;
 }
 
 void
 DOMIntersectionObserver::GetRootMargin(mozilla::dom::DOMString& aRetVal)
 {
-  mRootMargin.AppendToString(eCSSProperty_DOM, aRetVal, nsCSSValue::eNormalized);
+  mRootMargin.AppendToString(eCSSProperty_DOM, aRetVal);
 }
 
 void
 DOMIntersectionObserver::GetThresholds(nsTArray<double>& aRetVal)
 {
   aRetVal = mThresholds;
 }
 
--- a/layout/style/Declaration.cpp
+++ b/layout/style/Declaration.cpp
@@ -178,17 +178,17 @@ Declaration::GetPropertyValue(const nsAS
     [&](nsCSSPropertyID propID) { GetPropertyValueByID(propID, aValue); },
     [&](const nsAString& name) { GetVariableValue(name, aValue); });
 }
 
 void
 Declaration::GetPropertyValueByID(nsCSSPropertyID aPropID,
                                   nsAString& aValue) const
 {
-  GetPropertyValueInternal(aPropID, aValue, nsCSSValue::eNormalized);
+  GetPropertyValueInternal(aPropID, aValue);
 }
 
 bool
 Declaration::GetPropertyIsImportant(const nsAString& aProperty) const
 {
   bool r = false;
   DispatchPropertyOperation(aProperty,
     [&](nsCSSPropertyID propID) { r = GetPropertyIsImportantByID(propID); },
@@ -237,42 +237,40 @@ Declaration::HasProperty(nsCSSPropertyID
                                       ? mImportantData : mData;
   const nsCSSValue *val = data->ValueFor(aProperty);
   return !!val;
 }
 
 bool
 Declaration::AppendValueToString(nsCSSPropertyID aProperty,
                                  nsAString& aResult,
-                                 nsCSSValue::Serialization aSerialization,
                                  bool* aIsTokenStream) const
 {
   MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT_no_shorthands,
              "property ID out of range");
 
   nsCSSCompressedDataBlock *data = GetPropertyIsImportantByID(aProperty)
                                       ? mImportantData : mData;
   const nsCSSValue *val = data->ValueFor(aProperty);
   if (!val) {
     return false;
   }
 
   if (aIsTokenStream) {
     *aIsTokenStream = val->GetUnit() == eCSSUnit_TokenStream;
   }
-  val->AppendToString(aProperty, aResult, aSerialization);
+  val->AppendToString(aProperty, aResult);
   return true;
 }
 
 static void
 AppendSingleImageLayerPositionValue(const nsCSSValue& aPositionX,
                                     const nsCSSValue& aPositionY,
                                     const nsCSSPropertyID aTable[],
-                                    nsAString& aValue,
-                                    nsCSSValue::Serialization aSerialization)
+                                    nsAString& aValue)
 {
   // We need to make sure that we don't serialize to an invalid 3-value form.
   // The 3-value form is only valid if both edges are present.
   const nsCSSValue &xEdge = aPositionX.GetArrayValue()->Item(0);
   const nsCSSValue &xOffset = aPositionX.GetArrayValue()->Item(1);
   const nsCSSValue &yEdge = aPositionY.GetArrayValue()->Item(0);
   const nsCSSValue &yOffset = aPositionY.GetArrayValue()->Item(1);
   bool xHasEdge = (eCSSUnit_Enumerated == xEdge.GetUnit());
@@ -280,33 +278,32 @@ AppendSingleImageLayerPositionValue(cons
   bool yHasEdge = (eCSSUnit_Enumerated == yEdge.GetUnit());
   bool yHasBoth = yHasEdge && (eCSSUnit_Null != yOffset.GetUnit());
 
   if (yHasBoth && !xHasEdge) {
     // Output 4-value form by adding the x edge.
     aValue.AppendLiteral("left ");
   }
   aPositionX.AppendToString(aTable[nsStyleImageLayers::positionX],
-                            aValue, aSerialization);
+                            aValue);
 
   aValue.Append(char16_t(' '));
 
   if (xHasBoth && !yHasEdge) {
     // Output 4-value form by adding the y edge.
     aValue.AppendLiteral("top ");
   }
   aPositionY.AppendToString(aTable[nsStyleImageLayers::positionY],
-                            aValue, aSerialization);
+                            aValue);
 }
 
 void
 Declaration::GetImageLayerValue(
                    nsCSSCompressedDataBlock *data,
                    nsAString& aValue,
-                   nsCSSValue::Serialization aSerialization,
                    const nsCSSPropertyID aTable[]) const
 {
   // We know from our caller that all subproperties were specified.
   // However, we still can't represent that in the shorthand unless
   // they're all lists of the same length.  So if they're different
   // lengths, we need to bail out.
   // We also need to bail out if an item has background-clip and
   // background-origin that are different and not the default
@@ -343,53 +340,47 @@ Declaration::GetImageLayerValue(
     (aTable[nsStyleImageLayers::maskMode] ==  eCSSProperty_UNKNOWN)?
       nullptr :
       data->ValueFor(aTable[nsStyleImageLayers::maskMode])->GetListValue();
 
   for (;;) {
     // Serialize background-color at the beginning of the last item.
     if (!image->mNext) {
       if (aTable[nsStyleImageLayers::color] != eCSSProperty_UNKNOWN) {
-        AppendValueToString(aTable[nsStyleImageLayers::color], aValue,
-                            aSerialization);
+        AppendValueToString(aTable[nsStyleImageLayers::color], aValue);
         aValue.Append(char16_t(' '));
       }
     }
 
-    image->mValue.AppendToString(aTable[nsStyleImageLayers::image], aValue,
-                                 aSerialization);
+    image->mValue.AppendToString(aTable[nsStyleImageLayers::image], aValue);
 
     aValue.Append(char16_t(' '));
-    repeat->mXValue.AppendToString(aTable[nsStyleImageLayers::repeat], aValue,
-                                   aSerialization);
+    repeat->mXValue.AppendToString(aTable[nsStyleImageLayers::repeat], aValue);
     if (repeat->mYValue.GetUnit() != eCSSUnit_Null) {
-      repeat->mYValue.AppendToString(aTable[nsStyleImageLayers::repeat], aValue,
-                                     aSerialization);
+      repeat->mYValue.AppendToString(aTable[nsStyleImageLayers::repeat], aValue);
     }
 
     if (attachment) {
       aValue.Append(char16_t(' '));
           attachment->mValue.AppendToString(aTable[nsStyleImageLayers::attachment],
-                                            aValue, aSerialization);
+                                            aValue);
     }
 
     aValue.Append(char16_t(' '));
     AppendSingleImageLayerPositionValue(positionX->mValue, positionY->mValue,
-                                        aTable, aValue, aSerialization);
+                                        aTable, aValue);
 
     if (size->mXValue.GetUnit() != eCSSUnit_Auto ||
         size->mYValue.GetUnit() != eCSSUnit_Auto) {
       aValue.Append(char16_t(' '));
       aValue.Append(char16_t('/'));
       aValue.Append(char16_t(' '));
-      size->mXValue.AppendToString(aTable[nsStyleImageLayers::size], aValue,
-                                   aSerialization);
+      size->mXValue.AppendToString(aTable[nsStyleImageLayers::size], aValue);
       aValue.Append(char16_t(' '));
-      size->mYValue.AppendToString(aTable[nsStyleImageLayers::size], aValue,
-                                   aSerialization);
+      size->mYValue.AppendToString(aTable[nsStyleImageLayers::size], aValue);
     }
 
     MOZ_ASSERT(clip->mValue.GetUnit() == eCSSUnit_Enumerated &&
                origin->mValue.GetUnit() == eCSSUnit_Enumerated,
                "should not have inherit/initial within list");
 
     StyleGeometryBox originDefaultValue =
       (aTable == nsStyleImageLayers::kBackgroundLayerTable)
@@ -404,36 +395,33 @@ Declaration::GetImageLayerValue(
       for (size_t i = 0; originTable[i].mValue != -1; i++) {
         // For each keyword & value in kOriginKTable, ensure that
         // kBackgroundKTable has a matching entry at the same position.
         MOZ_ASSERT(originTable[i].mKeyword == clipTable[i].mKeyword);
         MOZ_ASSERT(originTable[i].mValue == clipTable[i].mValue);
       }
 #endif
       aValue.Append(char16_t(' '));
-      origin->mValue.AppendToString(aTable[nsStyleImageLayers::origin], aValue,
-                                    aSerialization);
+      origin->mValue.AppendToString(aTable[nsStyleImageLayers::origin], aValue);
 
       if (clip->mValue != origin->mValue) {
         aValue.Append(char16_t(' '));
-        clip->mValue.AppendToString(aTable[nsStyleImageLayers::clip], aValue,
-                                    aSerialization);
+        clip->mValue.AppendToString(aTable[nsStyleImageLayers::clip], aValue);
       }
     }
 
     if (composite) {
       aValue.Append(char16_t(' '));
       composite->mValue.AppendToString(aTable[nsStyleImageLayers::composite],
-                                       aValue, aSerialization);
+                                       aValue);
     }
 
     if (mode) {
       aValue.Append(char16_t(' '));
-      mode->mValue.AppendToString(aTable[nsStyleImageLayers::maskMode],
-                                  aValue, aSerialization);
+      mode->mValue.AppendToString(aTable[nsStyleImageLayers::maskMode], aValue);
     }
 
     image = image->mNext;
     repeat = repeat->mNext;
     positionX = positionX->mNext;
     positionY = positionY->mNext;
     clip = clip->mNext;
     origin = origin->mNext;
@@ -494,30 +482,29 @@ Declaration::GetImageLayerValue(
     aValue.Append(char16_t(' '));
   }
 }
 
 void
 Declaration::GetImageLayerPositionValue(
                    nsCSSCompressedDataBlock *data,
                    nsAString& aValue,
-                   nsCSSValue::Serialization aSerialization,
                    const nsCSSPropertyID aTable[]) const
 {
   // We know from above that all subproperties were specified.
   // However, we still can't represent that in the shorthand unless
   // they're all lists of the same length.  So if they're different
   // lengths, we need to bail out.
   const nsCSSValueList *positionX =
     data->ValueFor(aTable[nsStyleImageLayers::positionX])->GetListValue();
   const nsCSSValueList *positionY =
     data->ValueFor(aTable[nsStyleImageLayers::positionY])->GetListValue();
   for (;;) {
     AppendSingleImageLayerPositionValue(positionX->mValue, positionY->mValue,
-                                        aTable, aValue, aSerialization);
+                                        aTable, aValue);
     positionX = positionX->mNext;
     positionY = positionY->mNext;
 
     if (!positionX || !positionY) {
       if (positionX || positionY) {
         // Uneven length lists, so can't be serialized as shorthand.
         aValue.Truncate();
       }
@@ -526,26 +513,26 @@ Declaration::GetImageLayerPositionValue(
     aValue.Append(char16_t(','));
     aValue.Append(char16_t(' '));
   }
 }
 
 void
 Declaration::GetPropertyValueInternal(
     nsCSSPropertyID aProperty, nsAString& aValue,
-    nsCSSValue::Serialization aSerialization, bool* aIsTokenStream) const
+    bool* aIsTokenStream) const
 {
   aValue.Truncate(0);
   if (aIsTokenStream) {
     *aIsTokenStream = false;
   }
 
   // simple properties are easy.
   if (!nsCSSProps::IsShorthand(aProperty)) {
-    AppendValueToString(aProperty, aValue, aSerialization, aIsTokenStream);
+    AppendValueToString(aProperty, aValue, aIsTokenStream);
     return;
   }
 
   // DOM Level 2 Style says (when describing CSS2Properties, although
   // not CSSStyleDeclaration.getPropertyValue):
   //   However, if there is no shorthand declaration that could be added
   //   to the ruleset without changing in any way the rules already
   //   declared in the ruleset (i.e., by adding longhand rules that were
@@ -608,30 +595,27 @@ Declaration::GetPropertyValueInternal(
     }
   }
   if (importantCount != 0 && importantCount != totalCount) {
     // Case (3), no consistent importance.
     return;
   }
   if (initialCount == totalCount) {
     // Simplify serialization below by serializing initial up-front.
-    nsCSSValue(eCSSUnit_Initial).AppendToString(eCSSProperty_UNKNOWN, aValue,
-                                                nsCSSValue::eNormalized);
+    nsCSSValue(eCSSUnit_Initial).AppendToString(eCSSProperty_UNKNOWN, aValue);
     return;
   }
   if (inheritCount == totalCount) {
     // Simplify serialization below by serializing inherit up-front.
-    nsCSSValue(eCSSUnit_Inherit).AppendToString(eCSSProperty_UNKNOWN, aValue,
-                                                nsCSSValue::eNormalized);
+    nsCSSValue(eCSSUnit_Inherit).AppendToString(eCSSProperty_UNKNOWN, aValue);
     return;
   }
   if (unsetCount == totalCount) {
     // Simplify serialization below by serializing unset up-front.
-    nsCSSValue(eCSSUnit_Unset).AppendToString(eCSSProperty_UNKNOWN, aValue,
-                                              nsCSSValue::eNormalized);
+    nsCSSValue(eCSSUnit_Unset).AppendToString(eCSSProperty_UNKNOWN, aValue);
     return;
   }
   if (initialCount != 0 || inheritCount != 0 ||
       unsetCount != 0 || nonMatchingTokenStreamCount != 0) {
     // Case (2): partially initial, inherit, unset or token stream.
     return;
   }
   if (tokenStream) {
@@ -666,70 +650,63 @@ Declaration::GetPropertyValueInternal(
       MOZ_ASSERT(nsCSSProps::GetStringValue(subprops[3]).Find("-left") !=
                  kNotFound, "fourth subprop must be left");
       const nsCSSValue* vals[4] = {
         data->ValueFor(subprops[0]),
         data->ValueFor(subprops[1]),
         data->ValueFor(subprops[2]),
         data->ValueFor(subprops[3])
       };
-      nsCSSValue::AppendSidesShorthandToString(subprops, vals, aValue,
-                                               aSerialization);
+      nsCSSValue::AppendSidesShorthandToString(subprops, vals, aValue);
       break;
     }
     case eCSSProperty_border_radius:
     case eCSSProperty__moz_outline_radius: {
       const nsCSSPropertyID* subprops =
         nsCSSProps::SubpropertyEntryFor(aProperty);
       const nsCSSValue* vals[4] = {
         data->ValueFor(subprops[0]),
         data->ValueFor(subprops[1]),
         data->ValueFor(subprops[2]),
         data->ValueFor(subprops[3])
       };
-      nsCSSValue::AppendBasicShapeRadiusToString(subprops, vals, aValue,
-                                                 aSerialization);
+      nsCSSValue::AppendBasicShapeRadiusToString(subprops, vals, aValue);
       break;
     }
     case eCSSProperty_border_image: {
       // Even though there are some cases where we could omit
       // 'border-image-source' (when it's none), it's probably not a
       // good idea since it's likely to be confusing.  It would also
       // require adding the extra check that we serialize *something*.
-      AppendValueToString(eCSSProperty_border_image_source, aValue,
-                          aSerialization);
+      AppendValueToString(eCSSProperty_border_image_source, aValue);
 
       bool sliceDefault = data->HasDefaultBorderImageSlice();
       bool widthDefault = data->HasDefaultBorderImageWidth();
       bool outsetDefault = data->HasDefaultBorderImageOutset();
 
       if (!sliceDefault || !widthDefault || !outsetDefault) {
         aValue.Append(char16_t(' '));
-        AppendValueToString(eCSSProperty_border_image_slice, aValue,
-                            aSerialization);
+        AppendValueToString(eCSSProperty_border_image_slice, aValue);
         if (!widthDefault || !outsetDefault) {
           aValue.AppendLiteral(" /");
           if (!widthDefault) {
             aValue.Append(char16_t(' '));
-            AppendValueToString(eCSSProperty_border_image_width, aValue,
-                                aSerialization);
+            AppendValueToString(eCSSProperty_border_image_width, aValue);
           }
           if (!outsetDefault) {
             aValue.AppendLiteral(" / ");
-            AppendValueToString(eCSSProperty_border_image_outset, aValue,
-                                aSerialization);
+            AppendValueToString(eCSSProperty_border_image_outset, aValue);
           }
         }
       }
 
       bool repeatDefault = data->HasDefaultBorderImageRepeat();
       if (!repeatDefault) {
         aValue.Append(char16_t(' '));
-        AppendValueToString(eCSSProperty_border_image_repeat, aValue,
-                            aSerialization);
+        AppendValueToString(eCSSProperty_border_image_repeat, aValue);
       }
       break;
     }
     case eCSSProperty_border: {
       // If we have a non-default value for any of the properties that
       // this shorthand sets but cannot specify, we have to return the
       // empty string.
       if (data->ValueFor(eCSSProperty_border_image_source)->GetUnit() !=
@@ -785,57 +762,56 @@ Declaration::GetPropertyValueInternal(
     case eCSSProperty_column_rule:
     case eCSSProperty_outline: {
       const nsCSSPropertyID* subprops =
         nsCSSProps::SubpropertyEntryFor(aProperty);
       MOZ_ASSERT(StringEndsWith(nsCSSProps::GetStringValue(subprops[2]),
                                 NS_LITERAL_CSTRING("-color")),
                  "third subprop must be the color property");
 
-      bool ok = AppendValueToString(subprops[0], aValue, aSerialization);
+      bool ok = AppendValueToString(subprops[0], aValue);
       if (ok) {
         aValue.Append(u' ');
-        ok = AppendValueToString(subprops[1], aValue, aSerialization);
+        ok = AppendValueToString(subprops[1], aValue);
         if (ok) {
           const nsCSSValue *colorValue = data->ValueFor(subprops[2]);
           bool isCurrentColor =
             colorValue->GetUnit() == eCSSUnit_EnumColor &&
             colorValue->GetIntValue() == NS_COLOR_CURRENTCOLOR;
 
           // Don't output a third value when it's currentcolor.
           if (!isCurrentColor) {
             aValue.Append(u' ');
-            ok = AppendValueToString(subprops[2], aValue, aSerialization);
+            ok = AppendValueToString(subprops[2], aValue);
           }
         }
       }
 
       if (!ok) {
         aValue.Truncate();
       }
       break;
     }
     case eCSSProperty_background: {
-      GetImageLayerValue(data, aValue, aSerialization,
+      GetImageLayerValue(data, aValue,
                          nsStyleImageLayers::kBackgroundLayerTable);
       break;
     }
     case eCSSProperty_background_position: {
-      GetImageLayerPositionValue(data, aValue, aSerialization,
+      GetImageLayerPositionValue(data, aValue,
                                  nsStyleImageLayers::kBackgroundLayerTable);
       break;
     }
 #ifdef MOZ_ENABLE_MASK_AS_SHORTHAND
     case eCSSProperty_mask: {
-      GetImageLayerValue(data, aValue, aSerialization,
-                         nsStyleImageLayers::kMaskLayerTable);
+      GetImageLayerValue(data, aValue, nsStyleImageLayers::kMaskLayerTable);
       break;
     }
     case eCSSProperty_mask_position: {
-      GetImageLayerPositionValue(data, aValue, aSerialization,
+      GetImageLayerPositionValue(data, aValue,
                                  nsStyleImageLayers::kMaskLayerTable);
       break;
     }
 #endif
     case eCSSProperty_font: {
       // systemFont might not be present; other values are guaranteed to be
       // available based on the shorthand check at the beginning of the
       // function, as long as the prop is enabled
@@ -891,18 +867,17 @@ Declaration::GetPropertyValueInternal(
             fontVariantCaps->GetUnit() != eCSSUnit_System_Font ||
             fontVariantEastAsian->GetUnit() != eCSSUnit_System_Font ||
             fontVariantLigatures->GetUnit() != eCSSUnit_System_Font ||
             fontVariantNumeric->GetUnit() != eCSSUnit_System_Font ||
             fontVariantPosition->GetUnit() != eCSSUnit_System_Font) {
           // This can't be represented as a shorthand.
           return;
         }
-        systemFont->AppendToString(eCSSProperty__x_system_font, aValue,
-                                   aSerialization);
+        systemFont->AppendToString(eCSSProperty__x_system_font, aValue);
       } else {
         // properties reset by this shorthand property to their
         // initial values but not represented in its syntax
         if (sizeAdjust->GetUnit() != eCSSUnit_None ||
             featureSettings->GetUnit() != eCSSUnit_Normal ||
             languageOverride->GetUnit() != eCSSUnit_Normal ||
             fontKerning->GetIntValue() != NS_FONT_KERNING_AUTO ||
             fontVariantAlternates->GetUnit() != eCSSUnit_Normal ||
@@ -918,45 +893,41 @@ Declaration::GetPropertyValueInternal(
         if (fontVariantCaps->GetUnit() != eCSSUnit_Normal &&
             (fontVariantCaps->GetUnit() != eCSSUnit_Enumerated ||
              fontVariantCaps->GetIntValue() != NS_FONT_VARIANT_CAPS_SMALLCAPS)) {
           return;
         }
 
         if (style->GetUnit() != eCSSUnit_Enumerated ||
             style->GetIntValue() != NS_FONT_STYLE_NORMAL) {
-          style->AppendToString(eCSSProperty_font_style, aValue,
-                                aSerialization);
+          style->AppendToString(eCSSProperty_font_style, aValue);
           aValue.Append(char16_t(' '));
         }
         if (fontVariantCaps->GetUnit() != eCSSUnit_Normal) {
-          fontVariantCaps->AppendToString(eCSSProperty_font_variant_caps, aValue,
-                                  aSerialization);
+          fontVariantCaps->AppendToString(eCSSProperty_font_variant_caps,
+                                          aValue);
           aValue.Append(char16_t(' '));
         }
         if (weight->GetUnit() != eCSSUnit_Enumerated ||
             weight->GetIntValue() != NS_FONT_WEIGHT_NORMAL) {
-          weight->AppendToString(eCSSProperty_font_weight, aValue,
-                                 aSerialization);
+          weight->AppendToString(eCSSProperty_font_weight, aValue);
           aValue.Append(char16_t(' '));
         }
         if (stretch->GetUnit() != eCSSUnit_Enumerated ||
             stretch->GetIntValue() != NS_FONT_STRETCH_NORMAL) {
-          stretch->AppendToString(eCSSProperty_font_stretch, aValue,
-                                  aSerialization);
+          stretch->AppendToString(eCSSProperty_font_stretch, aValue);
           aValue.Append(char16_t(' '));
         }
-        size->AppendToString(eCSSProperty_font_size, aValue, aSerialization);
+        size->AppendToString(eCSSProperty_font_size, aValue);
         if (lh->GetUnit() != eCSSUnit_Normal) {
           aValue.Append(char16_t('/'));
-          lh->AppendToString(eCSSProperty_line_height, aValue, aSerialization);
+          lh->AppendToString(eCSSProperty_line_height, aValue);
         }
         aValue.Append(char16_t(' '));
-        family->AppendToString(eCSSProperty_font_family, aValue,
-                               aSerialization);
+        family->AppendToString(eCSSProperty_font_family, aValue);
       }
       break;
     }
     case eCSSProperty_font_variant: {
       const nsCSSPropertyID *subprops =
         nsCSSProps::SubpropertyEntryFor(aProperty);
       const nsCSSValue *fontVariantLigatures =
         data->ValueFor(eCSSProperty_font_variant_ligatures);
@@ -980,83 +951,76 @@ Declaration::GetPropertyValueInternal(
       bool ligsNone =
         fontVariantLigatures->GetUnit() == eCSSUnit_None;
 
       // normal, none, or system font ==> single value
       if ((normalLigs && normalNonLigs) ||
           (normalNonLigs && ligsNone) ||
           systemFont) {
         fontVariantLigatures->AppendToString(eCSSProperty_font_variant_ligatures,
-                                             aValue,
-                                             aSerialization);
+                                             aValue);
       } else if (ligsNone || hasSystem) {
         // ligatures none but other values are non-normal ==> empty
         // at least one but not all values are system font ==> empty
         return;
       } else {
         // iterate over and append non-normal values
         bool appendSpace = false;
         for (const nsCSSPropertyID *sp = subprops;
              *sp != eCSSProperty_UNKNOWN; sp++) {
           const nsCSSValue *spVal = data->ValueFor(*sp);
           if (spVal && spVal->GetUnit() != eCSSUnit_Normal) {
             if (appendSpace) {
               aValue.Append(char16_t(' '));
             } else {
               appendSpace = true;
             }
-            spVal->AppendToString(*sp, aValue, aSerialization);
+            spVal->AppendToString(*sp, aValue);
           }
         }
       }
       break;
     }
     case eCSSProperty_list_style:
-      if (AppendValueToString(eCSSProperty_list_style_position, aValue,
-                              aSerialization)) {
+      if (AppendValueToString(eCSSProperty_list_style_position, aValue)) {
         aValue.Append(char16_t(' '));
       }
-      if (AppendValueToString(eCSSProperty_list_style_image, aValue,
-                              aSerialization)) {
+      if (AppendValueToString(eCSSProperty_list_style_image, aValue)) {
         aValue.Append(char16_t(' '));
       }
-      AppendValueToString(eCSSProperty_list_style_type, aValue,
-                          aSerialization);
+      AppendValueToString(eCSSProperty_list_style_type, aValue);
       break;
     case eCSSProperty_overflow: {
       const nsCSSValue &xValue =
         *data->ValueFor(eCSSProperty_overflow_x);
       const nsCSSValue &yValue =
         *data->ValueFor(eCSSProperty_overflow_y);
       if (xValue == yValue)
-        xValue.AppendToString(eCSSProperty_overflow_x, aValue, aSerialization);
+        xValue.AppendToString(eCSSProperty_overflow_x, aValue);
       break;
     }
     case eCSSProperty_text_decoration: {
       const nsCSSValue *decorationColor =
         data->ValueFor(eCSSProperty_text_decoration_color);
       const nsCSSValue *decorationStyle =
         data->ValueFor(eCSSProperty_text_decoration_style);
 
       MOZ_ASSERT(decorationStyle->GetUnit() == eCSSUnit_Enumerated,
                  "bad text-decoration-style unit");
 
-      AppendValueToString(eCSSProperty_text_decoration_line, aValue,
-                          aSerialization);
+      AppendValueToString(eCSSProperty_text_decoration_line, aValue);
       if (decorationStyle->GetIntValue() !=
             NS_STYLE_TEXT_DECORATION_STYLE_SOLID) {
         aValue.Append(char16_t(' '));
-        AppendValueToString(eCSSProperty_text_decoration_style, aValue,
-                            aSerialization);
+        AppendValueToString(eCSSProperty_text_decoration_style, aValue);
       }
       if (decorationColor->GetUnit() != eCSSUnit_EnumColor ||
           decorationColor->GetIntValue() != NS_COLOR_CURRENTCOLOR) {
         aValue.Append(char16_t(' '));
-        AppendValueToString(eCSSProperty_text_decoration_color, aValue,
-                            aSerialization);
+        AppendValueToString(eCSSProperty_text_decoration_color, aValue);
       }
       break;
     }
     case eCSSProperty_transition: {
       const nsCSSValue *transProp =
         data->ValueFor(eCSSProperty_transition_property);
       const nsCSSValue *transDuration =
         data->ValueFor(eCSSProperty_transition_duration);
@@ -1079,48 +1043,43 @@ Declaration::GetPropertyValueInternal(
       const nsCSSValueList* tim = transTiming->GetListValue();
       const nsCSSValueList* del = transDelay->GetListValue();
 
       if (transProp->GetUnit() == eCSSUnit_None ||
           transProp->GetUnit() == eCSSUnit_All) {
         // If any of the other three lists has more than one element,
         // we can't use the shorthand.
         if (!dur->mNext && !tim->mNext && !del->mNext) {
-          transProp->AppendToString(eCSSProperty_transition_property, aValue,
-                                    aSerialization);
+          transProp->AppendToString(eCSSProperty_transition_property, aValue);
           aValue.Append(char16_t(' '));
-          dur->mValue.AppendToString(eCSSProperty_transition_duration,aValue,
-                                     aSerialization);
+          dur->mValue.AppendToString(eCSSProperty_transition_duration, aValue);
           aValue.Append(char16_t(' '));
           tim->mValue.AppendToString(eCSSProperty_transition_timing_function,
-                                     aValue, aSerialization);
+                                     aValue);
           aValue.Append(char16_t(' '));
-          del->mValue.AppendToString(eCSSProperty_transition_delay, aValue,
-                                     aSerialization);
+          del->mValue.AppendToString(eCSSProperty_transition_delay, aValue);
           aValue.Append(char16_t(' '));
         } else {
           aValue.Truncate();
         }
       } else {
         MOZ_ASSERT(transProp->GetUnit() == eCSSUnit_List ||
                    transProp->GetUnit() == eCSSUnit_ListDep,
                    "bad t-prop unit");
         const nsCSSValueList* pro = transProp->GetListValue();
         for (;;) {
-          pro->mValue.AppendToString(eCSSProperty_transition_property,
-                                        aValue, aSerialization);
+          pro->mValue.AppendToString(eCSSProperty_transition_property, aValue);
           aValue.Append(char16_t(' '));
-          dur->mValue.AppendToString(eCSSProperty_transition_duration,
-                                        aValue, aSerialization);
+          dur->mValue.AppendToString(eCSSProperty_transition_duration, aValue);
           aValue.Append(char16_t(' '));
           tim->mValue.AppendToString(eCSSProperty_transition_timing_function,
-                                        aValue, aSerialization);
+                                     aValue);
           aValue.Append(char16_t(' '));
           del->mValue.AppendToString(eCSSProperty_transition_delay,
-                                        aValue, aSerialization);
+                                     aValue);
           pro = pro->mNext;
           dur = dur->mNext;
           tim = tim->mNext;
           del = del->mNext;
           if (!pro || !dur || !tim || !del) {
             break;
           }
           aValue.AppendLiteral(", ");
@@ -1151,17 +1110,17 @@ Declaration::GetPropertyValueInternal(
 
       for (;;) {
         // We must serialize 'animation-name' last in case it has
         // a value that conflicts with one of the other keyword properties.
         MOZ_ASSERT(subprops[numProps - 1] == eCSSProperty_animation_name,
                    "animation-name must be last");
         bool done = false;
         for (uint32_t i = 0;;) {
-          lists[i]->mValue.AppendToString(subprops[i], aValue, aSerialization);
+          lists[i]->mValue.AppendToString(subprops[i], aValue);
           lists[i] = lists[i]->mNext;
           if (!lists[i]) {
             done = true;
           }
           if (++i == numProps) {
             break;
           }
           aValue.Append(char16_t(' '));
@@ -1183,80 +1142,80 @@ Declaration::GetPropertyValueInternal(
     case eCSSProperty_marker: {
       const nsCSSValue &endValue =
         *data->ValueFor(eCSSProperty_marker_end);
       const nsCSSValue &midValue =
         *data->ValueFor(eCSSProperty_marker_mid);
       const nsCSSValue &startValue =
         *data->ValueFor(eCSSProperty_marker_start);
       if (endValue == midValue && midValue == startValue)
-        AppendValueToString(eCSSProperty_marker_end, aValue, aSerialization);
+        AppendValueToString(eCSSProperty_marker_end, aValue);
       break;
     }
     case eCSSProperty_columns: {
       // Two values, column-count and column-width, separated by a space.
       const nsCSSPropertyID* subprops =
         nsCSSProps::SubpropertyEntryFor(aProperty);
-      AppendValueToString(subprops[0], aValue, aSerialization);
+      AppendValueToString(subprops[0], aValue);
       aValue.Append(char16_t(' '));
-      AppendValueToString(subprops[1], aValue, aSerialization);
+      AppendValueToString(subprops[1], aValue);
       break;
     }
     case eCSSProperty_flex: {
       // flex-grow, flex-shrink, flex-basis, separated by single space
       const nsCSSPropertyID* subprops =
         nsCSSProps::SubpropertyEntryFor(aProperty);
 
-      AppendValueToString(subprops[0], aValue, aSerialization);
+      AppendValueToString(subprops[0], aValue);
       aValue.Append(char16_t(' '));
-      AppendValueToString(subprops[1], aValue, aSerialization);
+      AppendValueToString(subprops[1], aValue);
       aValue.Append(char16_t(' '));
-      AppendValueToString(subprops[2], aValue, aSerialization);
+      AppendValueToString(subprops[2], aValue);
       break;
     }
     case eCSSProperty_flex_flow: {
       // flex-direction, flex-wrap, separated by single space
       const nsCSSPropertyID* subprops =
         nsCSSProps::SubpropertyEntryFor(aProperty);
       MOZ_ASSERT(subprops[2] == eCSSProperty_UNKNOWN,
                  "must have exactly two subproperties");
 
-      AppendValueToString(subprops[0], aValue, aSerialization);
+      AppendValueToString(subprops[0], aValue);
       aValue.Append(char16_t(' '));
-      AppendValueToString(subprops[1], aValue, aSerialization);
+      AppendValueToString(subprops[1], aValue);
       break;
     }
     case eCSSProperty_grid_row:
     case eCSSProperty_grid_column: {
       // grid-{row,column}-start, grid-{row,column}-end, separated by a slash
       const nsCSSPropertyID* subprops =
         nsCSSProps::SubpropertyEntryFor(aProperty);
       MOZ_ASSERT(subprops[2] == eCSSProperty_UNKNOWN,
                  "must have exactly two subproperties");
 
       // TODO: should we simplify when possible?
-      AppendValueToString(subprops[0], aValue, aSerialization);
+      AppendValueToString(subprops[0], aValue);
       aValue.AppendLiteral(" / ");
-      AppendValueToString(subprops[1], aValue, aSerialization);
+      AppendValueToString(subprops[1], aValue);
       break;
     }
     case eCSSProperty_grid_area: {
       const nsCSSPropertyID* subprops =
         nsCSSProps::SubpropertyEntryFor(aProperty);
       MOZ_ASSERT(subprops[4] == eCSSProperty_UNKNOWN,
                  "must have exactly four subproperties");
 
       // TODO: should we simplify when possible?
-      AppendValueToString(subprops[0], aValue, aSerialization);
+      AppendValueToString(subprops[0], aValue);
       aValue.AppendLiteral(" / ");
-      AppendValueToString(subprops[1], aValue, aSerialization);
+      AppendValueToString(subprops[1], aValue);
       aValue.AppendLiteral(" / ");
-      AppendValueToString(subprops[2], aValue, aSerialization);
+      AppendValueToString(subprops[2], aValue);
       aValue.AppendLiteral(" / ");
-      AppendValueToString(subprops[3], aValue, aSerialization);
+      AppendValueToString(subprops[3], aValue);
       break;
     }
 
     // The 'grid' shorthand has 3 different possibilities for syntax:
     // #1 <'grid-template'>
     // #2 <'grid-template-rows'> / [ auto-flow && dense? ] <'grid-auto-columns'>?
     // #3 [ auto-flow && dense? ] <'grid-auto-rows'>? / <'grid-template-columns'>
     case eCSSProperty_grid: {
@@ -1299,41 +1258,37 @@ Declaration::GetPropertyValueInternal(
           (autoFlowValue.GetIntValue() != NS_STYLE_GRID_AUTO_FLOW_ROW ||
            autoRowsValue.GetUnit() != eCSSUnit_Auto)) {
         aValue.AppendLiteral("auto-flow");
         if (autoFlowValue.GetIntValue() & NS_STYLE_GRID_AUTO_FLOW_DENSE) {
           aValue.AppendLiteral(" dense");
         }
         if (autoRowsValue.GetUnit() != eCSSUnit_Auto) {
           aValue.Append(' ');
-          AppendValueToString(eCSSProperty_grid_auto_rows,
-                              aValue, aSerialization);
+          AppendValueToString(eCSSProperty_grid_auto_rows, aValue);
         }
         aValue.AppendLiteral(" / ");
-        AppendValueToString(eCSSProperty_grid_template_columns,
-                            aValue, aSerialization);
+        AppendValueToString(eCSSProperty_grid_template_columns, aValue);
         break;
       }
 
       // grid-template-columns/areas:none + column grid-auto-flow +
       // default grid-auto-rows.
       // --> serialize as 'grid' syntax #2.
       if (columnsValue.GetUnit() == eCSSUnit_None &&
           areasValue.GetUnit() == eCSSUnit_None &&
           autoRowsValue.GetUnit() == eCSSUnit_Auto &&
           autoFlowValue.GetUnit() == eCSSUnit_Enumerated &&
           (autoFlowValue.GetIntValue() & NS_STYLE_GRID_AUTO_FLOW_COLUMN)) {
-        AppendValueToString(eCSSProperty_grid_template_rows,
-                            aValue, aSerialization);
+        AppendValueToString(eCSSProperty_grid_template_rows, aValue);
         aValue.AppendLiteral(" / auto-flow ");
         if (autoFlowValue.GetIntValue() & NS_STYLE_GRID_AUTO_FLOW_DENSE) {
           aValue.AppendLiteral("dense ");
         }
-        AppendValueToString(eCSSProperty_grid_auto_columns,
-                            aValue, aSerialization);
+        AppendValueToString(eCSSProperty_grid_auto_columns, aValue);
         break;
       }
 
       if (!(autoFlowValue.GetUnit() == eCSSUnit_Enumerated &&
             autoFlowValue.GetIntValue() == NS_STYLE_GRID_AUTO_FLOW_ROW &&
             autoColumnsValue.GetUnit() == eCSSUnit_Auto &&
             autoRowsValue.GetUnit() == eCSSUnit_Auto)) {
         // Not serializable, bail.
@@ -1345,21 +1300,19 @@ Declaration::GetPropertyValueInternal(
     case eCSSProperty_grid_template: {
       const nsCSSValue& areasValue =
         *data->ValueFor(eCSSProperty_grid_template_areas);
       const nsCSSValue& columnsValue =
         *data->ValueFor(eCSSProperty_grid_template_columns);
       const nsCSSValue& rowsValue =
         *data->ValueFor(eCSSProperty_grid_template_rows);
       if (areasValue.GetUnit() == eCSSUnit_None) {
-        AppendValueToString(eCSSProperty_grid_template_rows,
-                            aValue, aSerialization);
+        AppendValueToString(eCSSProperty_grid_template_rows, aValue);
         aValue.AppendLiteral(" / ");
-        AppendValueToString(eCSSProperty_grid_template_columns,
-                            aValue, aSerialization);
+        AppendValueToString(eCSSProperty_grid_template_columns, aValue);
         break;
       }
       if (columnsValue.GetUnit() == eCSSUnit_List ||
           columnsValue.GetUnit() == eCSSUnit_ListDep) {
         const nsCSSValueList* columnsItem = columnsValue.GetListValue();
         if (columnsItem->mValue.GetUnit() == eCSSUnit_Enumerated &&
             columnsItem->mValue.GetIntValue() == NS_STYLE_GRID_TEMPLATE_SUBGRID) {
           // We have "grid-template-areas:[something]; grid-template-columns:subgrid"
@@ -1400,31 +1353,31 @@ Declaration::GetPropertyValueInternal(
         if (unit == eCSSUnit_Null) {
           // Empty or omitted <line-names>. Serializes to nothing.
           addSpaceSeparator = false;  // Avoid a double space.
 
         } else if (unit == eCSSUnit_List || unit == eCSSUnit_ListDep) {
           // Non-empty <line-names>
           aValue.Append('[');
           rowsItem->mValue.AppendToString(eCSSProperty_grid_template_rows,
-                                          aValue, aSerialization);
+                                          aValue);
           aValue.Append(']');
 
         } else {
           nsStyleUtil::AppendEscapedCSSString(areas->mTemplates[row++], aValue);
           aValue.Append(char16_t(' '));
 
           // <track-size>
           if (unit == eCSSUnit_Pair) {
             // 'repeat()' isn't allowed with non-default 'grid-template-areas'.
             aValue.Truncate();
             return;
           }
           rowsItem->mValue.AppendToString(eCSSProperty_grid_template_rows,
-                                          aValue, aSerialization);
+                                          aValue);
           if (rowsItem->mNext &&
               rowsItem->mNext->mValue.GetUnit() == eCSSUnit_Null &&
               !rowsItem->mNext->mNext) {
             // Break out of the loop early to avoid a trailing space.
             break;
           }
         }
 
@@ -1444,18 +1397,17 @@ Declaration::GetPropertyValueInternal(
           if (colsItem->mValue.GetUnit() == eCSSUnit_Pair) {
             // 'repeat()' isn't allowed with non-default 'grid-template-areas'.
             aValue.Truncate();
             return;
           }
           colsItem = colsItem->mNext; // skip <line-names>
         }
         aValue.AppendLiteral(" / ");
-        AppendValueToString(eCSSProperty_grid_template_columns,
-                            aValue, aSerialization);
+        AppendValueToString(eCSSProperty_grid_template_columns, aValue);
       }
       break;
     }
     case eCSSProperty_place_content:
     case eCSSProperty_place_items:
     case eCSSProperty_place_self: {
       const nsCSSPropertyID* subprops =
         nsCSSProps::SubpropertyEntryFor(aProperty);
@@ -1489,18 +1441,18 @@ Declaration::GetPropertyValueInternal(
     }
     case eCSSProperty_grid_gap: {
       const nsCSSPropertyID* subprops =
         nsCSSProps::SubpropertyEntryFor(aProperty);
       MOZ_ASSERT(subprops[2] == eCSSProperty_UNKNOWN,
                  "must have exactly two subproperties");
 
       nsAutoString val1, val2;
-      AppendValueToString(subprops[0], val1, aSerialization);
-      AppendValueToString(subprops[1], val2, aSerialization);
+      AppendValueToString(subprops[0], val1);
+      AppendValueToString(subprops[1], val2);
       if (val1 == val2) {
         aValue.Append(val1);
       } else {
         aValue.Append(val1);
         aValue.Append(' ');
         aValue.Append(val2);
       }
       break;
@@ -1509,69 +1461,64 @@ Declaration::GetPropertyValueInternal(
       const nsCSSValue* emphasisStyle =
         data->ValueFor(eCSSProperty_text_emphasis_style);
       const nsCSSValue* emphasisColor =
         data->ValueFor(eCSSProperty_text_emphasis_color);
       bool isDefaultColor = emphasisColor->GetUnit() == eCSSUnit_EnumColor &&
         emphasisColor->GetIntValue() == NS_COLOR_CURRENTCOLOR;
 
       if (emphasisStyle->GetUnit() != eCSSUnit_None || isDefaultColor) {
-        AppendValueToString(eCSSProperty_text_emphasis_style,
-                            aValue, aSerialization);
+        AppendValueToString(eCSSProperty_text_emphasis_style, aValue);
         if (!isDefaultColor) {
           aValue.Append(char16_t(' '));
         }
       }
       if (!isDefaultColor) {
-        AppendValueToString(eCSSProperty_text_emphasis_color,
-                            aValue, aSerialization);
+        AppendValueToString(eCSSProperty_text_emphasis_color, aValue);
       }
       break;
     }
     case eCSSProperty__moz_transform: {
       // shorthands that are just aliases with different parsing rules
       const nsCSSPropertyID* subprops =
         nsCSSProps::SubpropertyEntryFor(aProperty);
       MOZ_ASSERT(subprops[1] == eCSSProperty_UNKNOWN,
                  "must have exactly one subproperty");
-      AppendValueToString(subprops[0], aValue, aSerialization);
+      AppendValueToString(subprops[0], aValue);
       break;
     }
     case eCSSProperty_scroll_snap_type: {
       const nsCSSValue& xValue =
         *data->ValueFor(eCSSProperty_scroll_snap_type_x);
       const nsCSSValue& yValue =
         *data->ValueFor(eCSSProperty_scroll_snap_type_y);
       if (xValue == yValue) {
-        AppendValueToString(eCSSProperty_scroll_snap_type_x, aValue,
-                            aSerialization);
+        AppendValueToString(eCSSProperty_scroll_snap_type_x, aValue);
       }
       // If scroll-snap-type-x and scroll-snap-type-y are not equal,
       // we don't have a shorthand that can express. Bail.
       break;
     }
     case eCSSProperty__webkit_text_stroke: {
       const nsCSSValue* strokeWidth =
         data->ValueFor(eCSSProperty__webkit_text_stroke_width);
       const nsCSSValue* strokeColor =
         data->ValueFor(eCSSProperty__webkit_text_stroke_color);
       bool isDefaultColor = strokeColor->GetUnit() == eCSSUnit_EnumColor &&
         strokeColor->GetIntValue() == NS_COLOR_CURRENTCOLOR;
 
       if (strokeWidth->GetUnit() != eCSSUnit_Integer ||
           strokeWidth->GetIntValue() != 0 || isDefaultColor) {
-        AppendValueToString(eCSSProperty__webkit_text_stroke_width,
-                            aValue, aSerialization);
+        AppendValueToString(eCSSProperty__webkit_text_stroke_width, aValue);
         if (!isDefaultColor) {
           aValue.Append(char16_t(' '));
         }
       }
       if (!isDefaultColor) {
-        AppendValueToString(eCSSProperty__webkit_text_stroke_color,
-                            aValue, aSerialization);
+        AppendValueToString(eCSSProperty__webkit_text_stroke_color, aValue);
       }
       break;
     }
     case eCSSProperty_all:
       // If we got here, then we didn't have all "inherit" or "initial" or
       // "unset" values for all of the longhand property components of 'all'.
       // There is no other possible value that is valid for all properties,
       // so serialize as the empty string.
@@ -1614,18 +1561,17 @@ Declaration::AppendPropertyAndValueToStr
                                             bool aValueIsTokenStream) const
 {
   MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT,
              "property enum out of range");
   MOZ_ASSERT((aProperty < eCSSProperty_COUNT_no_shorthands) == aValue.IsEmpty(),
              "aValue should be given for shorthands but not longhands");
   AppendASCIItoUTF16(nsCSSProps::GetStringValue(aProperty), aResult);
   if (aValue.IsEmpty()) {
-    AppendValueToString(aProperty, aValue,
-                        nsCSSValue::eNormalized, &aValueIsTokenStream);
+    AppendValueToString(aProperty, aValue, &aValueIsTokenStream);
   }
   aResult.Append(':');
   if (!aValueIsTokenStream) {
     aResult.Append(' ');
   }
   aResult.Append(aValue);
   if (GetPropertyIsImportantByID(aProperty)) {
     if (!aValueIsTokenStream) {
@@ -1746,18 +1692,17 @@ Declaration::ToString(nsAString& aString
            nsCSSProps::ShorthandsContaining(property);
          *shorthands != eCSSProperty_UNKNOWN; ++shorthands) {
       // ShorthandsContaining returns the shorthands in order from those
       // that contain the most subproperties to those that contain the
       // least, which is exactly the order we want to test them.
       nsCSSPropertyID shorthand = *shorthands;
 
       bool isTokenStream;
-      GetPropertyValueInternal(shorthand, value,
-                               nsCSSValue::eNormalized, &isTokenStream);
+      GetPropertyValueInternal(shorthand, value, &isTokenStream);
 
       // in the system font case, skip over font-variant shorthand, since all
       // subproperties are already dealt with via the font shorthand
       if (shorthand == eCSSProperty_font_variant &&
           value.EqualsLiteral("-moz-use-system-font")) {
         continue;
       }
 
@@ -1771,18 +1716,17 @@ Declaration::ToString(nsAString& aString
         break;
       }
 
       if (shorthand == eCSSProperty_font) {
         if (haveSystemFont && !didSystemFont) {
           // Output the shorthand font declaration that we will
           // partially override later.  But don't add it to
           // |shorthandsUsed|, since we will have to override it.
-          systemFont->AppendToString(eCSSProperty__x_system_font, value,
-                                     nsCSSValue::eNormalized);
+          systemFont->AppendToString(eCSSProperty__x_system_font, value);
           isTokenStream = systemFont->GetUnit() == eCSSUnit_TokenStream;
           AppendPropertyAndValueToString(eCSSProperty_font, aString,
                                          value, isTokenStream);
           value.Truncate();
           didSystemFont = true;
         }
 
         // That we output the system font is enough for this property if:
--- a/layout/style/Declaration.h
+++ b/layout/style/Declaration.h
@@ -305,44 +305,39 @@ public:
     return nullptr;
   }
 
 private:
   Declaration& operator=(const Declaration& aCopy) = delete;
   bool operator==(const Declaration& aCopy) const = delete;
 
   void GetPropertyValueInternal(nsCSSPropertyID aProperty, nsAString& aValue,
-                                nsCSSValue::Serialization aValueSerialization,
                                 bool* aIsTokenStream = nullptr) const;
   bool GetPropertyIsImportantByID(nsCSSPropertyID aProperty) const;
 
   static void AppendImportanceToString(bool aIsImportant, nsAString& aString);
   // return whether there was a value in |aValue| (i.e., it had a non-null unit)
-  bool AppendValueToString(nsCSSPropertyID aProperty, nsAString& aResult) const;
   bool AppendValueToString(nsCSSPropertyID aProperty, nsAString& aResult,
-                           nsCSSValue::Serialization aValueSerialization,
                            bool* aIsTokenStream = nullptr) const;
   // Helper for ToString with strange semantics regarding aValue.
   void AppendPropertyAndValueToString(nsCSSPropertyID aProperty,
                                       nsAString& aResult,
                                       nsAutoString& aValue,
                                       bool aValueIsTokenStream) const;
   // helper for ToString that serializes a custom property declaration for
   // a variable with the specified name
   void AppendVariableAndValueToString(const nsAString& aName,
                                       nsAString& aResult) const;
 
   void GetImageLayerValue(nsCSSCompressedDataBlock *data,
                           nsAString& aValue,
-                          nsCSSValue::Serialization aSerialization,
                           const nsCSSPropertyID aTable[]) const;
 
   void GetImageLayerPositionValue(nsCSSCompressedDataBlock *data,
                                   nsAString& aValue,
-                                  nsCSSValue::Serialization aSerialization,
                                   const nsCSSPropertyID aTable[]) const;
 
 public:
   /**
    * Returns the property at the given index in the ordered list of
    * declarations.  For custom properties, eCSSPropertyExtra_variable
    * is returned.
    */
--- a/layout/style/FontFace.cpp
+++ b/layout/style/FontFace.cpp
@@ -652,17 +652,17 @@ FontFace::GetDesc(nsCSSFontDesc aDescID,
     // Since there's no unicode-range property, we can't use
     // nsCSSValue::AppendToString to serialize this descriptor.
     nsStyleUtil::AppendUnicodeRange(value, aResult);
   } else if (aDescID == eCSSFontDesc_Display) {
     AppendASCIItoUTF16(nsCSSProps::ValueToKeyword(value.GetIntValue(),
                                                   nsCSSProps::kFontDisplayKTable),
                        aResult);
   } else {
-    value.AppendToString(aPropID, aResult, nsCSSValue::eNormalized);
+    value.AppendToString(aPropID, aResult);
   }
 }
 
 void
 FontFace::SetUserFontEntry(gfxUserFontEntry* aEntry)
 {
   if (mUserFontEntry) {
     mUserFontEntry->mFontFaces.RemoveElement(this);
--- a/layout/style/StyleAnimationValue.cpp
+++ b/layout/style/StyleAnimationValue.cpp
@@ -3847,17 +3847,17 @@ StyleAnimationValue::UncomputeValue(nsCS
     aComputedValue.GetStringValue(aSpecifiedValue);
     return true;
   }
   nsCSSValue val;
   if (!StyleAnimationValue::UncomputeValue(aProperty, aComputedValue, val)) {
     return false;
   }
 
-  val.AppendToString(aProperty, aSpecifiedValue, nsCSSValue::eNormalized);
+  val.AppendToString(aProperty, aSpecifiedValue);
   return true;
 }
 
 template<typename T>
 inline const T&
 StyleDataAtOffset(const void* aStyleStruct, ptrdiff_t aOffset)
 {
   return *reinterpret_cast<const T*>(
--- a/layout/style/nsCSSRules.cpp
+++ b/layout/style/nsCSSRules.cpp
@@ -857,37 +857,33 @@ nsCSSFontFaceStyleDecl::GetPropertyValue
       // we know we have eCSSUnit_String
       NS_ASSERTION(val.GetUnit() == eCSSUnit_String, "unexpected unit");
       nsDependentString family(val.GetStringBufferValue());
       nsStyleUtil::AppendEscapedCSSString(family, aResult);
       return NS_OK;
     }
 
   case eCSSFontDesc_Style:
-    val.AppendToString(eCSSProperty_font_style, aResult,
-                        nsCSSValue::eNormalized);
+    val.AppendToString(eCSSProperty_font_style, aResult);
     return NS_OK;
 
   case eCSSFontDesc_Weight:
-    val.AppendToString(eCSSProperty_font_weight, aResult,
-                       nsCSSValue::eNormalized);
+    val.AppendToString(eCSSProperty_font_weight, aResult);
     return NS_OK;
 
   case eCSSFontDesc_Stretch:
-    val.AppendToString(eCSSProperty_font_stretch, aResult,
-                       nsCSSValue::eNormalized);
+    val.AppendToString(eCSSProperty_font_stretch, aResult);
     return NS_OK;
 
   case eCSSFontDesc_FontFeatureSettings:
     nsStyleUtil::AppendFontFeatureSettings(val, aResult);
     return NS_OK;
 
   case eCSSFontDesc_FontLanguageOverride:
-    val.AppendToString(eCSSProperty_font_language_override, aResult,
-                       nsCSSValue::eNormalized);
+    val.AppendToString(eCSSProperty_font_language_override, aResult);
     return NS_OK;
 
   case eCSSFontDesc_Display:
     NS_ASSERTION(val.GetUnit() == eCSSUnit_Enumerated,
                  "unknown unit for font-display descriptor");
     AppendASCIItoUTF16(nsCSSProps::ValueToKeyword(val.GetIntValue(),
                                        nsCSSProps::kFontDisplayKTable), aResult);
     return NS_OK;
@@ -2398,34 +2394,31 @@ nsCSSCounterStyleRule::GetSystem(nsAStri
     aSystem.Truncate();
     return NS_OK;
   }
 
   aSystem = NS_ConvertASCIItoUTF16(nsCSSProps::ValueToKeyword(
           GetSystem(), nsCSSProps::kCounterSystemKTable));
   if (value.GetUnit() == eCSSUnit_Pair) {
     aSystem.Append(' ');
-    GetSystemArgument().AppendToString(
-        eCSSProperty_UNKNOWN, aSystem, nsCSSValue::eNormalized);
+    GetSystemArgument().AppendToString(eCSSProperty_UNKNOWN, aSystem);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsCSSCounterStyleRule::GetSymbols(nsAString& aSymbols)
 {
   const nsCSSValue& value = GetDesc(eCSSCounterDesc_Symbols);
 
   aSymbols.Truncate();
   if (value.GetUnit() == eCSSUnit_List) {
     for (const nsCSSValueList* item = value.GetListValue();
          item; item = item->mNext) {
-      item->mValue.AppendToString(eCSSProperty_UNKNOWN,
-                                  aSymbols,
-                                  nsCSSValue::eNormalized);
+      item->mValue.AppendToString(eCSSProperty_UNKNOWN, aSymbols);
       if (item->mNext) {
         aSymbols.Append(' ');
       }
     }
   }
   return NS_OK;
 }
 
@@ -2433,21 +2426,19 @@ NS_IMETHODIMP
 nsCSSCounterStyleRule::GetAdditiveSymbols(nsAString& aSymbols)
 {
   const nsCSSValue& value = GetDesc(eCSSCounterDesc_AdditiveSymbols);
 
   aSymbols.Truncate();
   if (value.GetUnit() == eCSSUnit_PairList) {
     for (const nsCSSValuePairList* item = value.GetPairListValue();
          item; item = item->mNext) {
-      item->mXValue.AppendToString(eCSSProperty_UNKNOWN,
-                                   aSymbols, nsCSSValue::eNormalized);
+      item->mXValue.AppendToString(eCSSProperty_UNKNOWN, aSymbols);
       aSymbols.Append(' ');
-      item->mYValue.AppendToString(eCSSProperty_UNKNOWN,
-                                   aSymbols, nsCSSValue::eNormalized);
+      item->mYValue.AppendToString(eCSSProperty_UNKNOWN, aSymbols);
       if (item->mNext) {
         aSymbols.AppendLiteral(", ");
       }
     }
   }
   return NS_OK;
 }
 
@@ -2519,18 +2510,17 @@ nsCSSCounterStyleRule::GetSpeakAs(nsAStr
         default:
           NS_NOTREACHED("Unknown speech synthesis");
       }
       break;
 
     case eCSSUnit_Auto:
     case eCSSUnit_AtomIdent:
       aSpeakAs.Truncate();
-      value.AppendToString(eCSSProperty_UNKNOWN,
-                           aSpeakAs, nsCSSValue::eNormalized);
+      value.AppendToString(eCSSProperty_UNKNOWN, aSpeakAs);
       break;
 
     case eCSSUnit_Null:
       aSpeakAs.Truncate();
       break;
 
     default:
       NS_NOTREACHED("Unknown speech synthesis");
@@ -2547,18 +2537,17 @@ nsCSSCounterStyleRule::GetDescriptor(nsC
                aDescID == eCSSCounterDesc_Prefix ||
                aDescID == eCSSCounterDesc_Suffix ||
                aDescID == eCSSCounterDesc_Pad ||
                aDescID == eCSSCounterDesc_Fallback,
                "Unexpected descriptor");
   const nsCSSValue& value = GetDesc(aDescID);
   aValue.Truncate();
   if (value.GetUnit() != eCSSUnit_Null) {
-    value.AppendToString(
-        eCSSProperty_UNKNOWN, aValue, nsCSSValue::eNormalized);
+    value.AppendToString(eCSSProperty_UNKNOWN, aValue);
   }
   return NS_OK;
 }
 
 #define CSS_COUNTER_DESC_GETTER(name_)                    \
 NS_IMETHODIMP                                             \
 nsCSSCounterStyleRule::Get##name_(nsAString& a##name_)    \
 {                                                         \
--- a/layout/style/nsCSSValue.cpp
+++ b/layout/style/nsCSSValue.cpp
@@ -993,21 +993,19 @@ nsCSSValue::AtomizeIdentValue()
   Reset();
   mUnit = eCSSUnit_AtomIdent;
   mValue.mAtom = atom.forget().take();
 }
 
 namespace {
 
 struct CSSValueSerializeCalcOps {
-  CSSValueSerializeCalcOps(nsCSSPropertyID aProperty, nsAString& aResult,
-                           nsCSSValue::Serialization aSerialization)
+  CSSValueSerializeCalcOps(nsCSSPropertyID aProperty, nsAString& aResult)
     : mProperty(aProperty),
-      mResult(aResult),
-      mValueSerialization(aSerialization)
+      mResult(aResult)
   {
   }
 
   typedef nsCSSValue input_type;
   typedef nsCSSValue::Array input_array_type;
 
   static nsCSSUnit GetUnit(const input_type& aValue) {
     return aValue.GetUnit();
@@ -1019,36 +1017,35 @@ struct CSSValueSerializeCalcOps {
   }
 
   void AppendLeafValue(const input_type& aValue)
   {
     MOZ_ASSERT(aValue.GetUnit() == eCSSUnit_Percent ||
                aValue.IsLengthUnit() ||
                aValue.GetUnit() == eCSSUnit_Number,
                "unexpected unit");
-    aValue.AppendToString(mProperty, mResult, mValueSerialization);
+    aValue.AppendToString(mProperty, mResult);
   }
 
   void AppendCoefficient(const input_type& aValue)
   {
     MOZ_ASSERT(aValue.GetUnit() == eCSSUnit_Number, "unexpected unit");
-    aValue.AppendToString(mProperty, mResult, mValueSerialization);
+    aValue.AppendToString(mProperty, mResult);
   }
 
 private:
   nsCSSPropertyID mProperty;
   nsAString &mResult;
-  nsCSSValue::Serialization mValueSerialization;
 };
 
 } // namespace
 
 void
-nsCSSValue::AppendPolygonToString(nsCSSPropertyID aProperty, nsAString& aResult,
-                                  Serialization aSerialization) const
+nsCSSValue::AppendPolygonToString(nsCSSPropertyID aProperty,
+                                  nsAString& aResult) const
 {
   const nsCSSValue::Array* array = GetArrayValue();
   MOZ_ASSERT(array->Count() > 1 && array->Count() <= 3,
              "Polygons must have name and at least one more value.");
   // When the array has 2 elements, the item on index 1 is the coordinate
   // pair list.
   // When the array has 3 elements, the item on index 1 is a fill-rule
   // and item on index 2 is the coordinate pair list.
@@ -1059,61 +1056,58 @@ nsCSSValue::AppendPolygonToString(nsCSSP
                "Expected polygon fill rule.");
     int32_t fillRule = fillRuleValue.GetIntValue();
     AppendASCIItoUTF16(nsCSSProps::ValueToKeyword(fillRule,
                                                   nsCSSProps::kFillRuleKTable),
                        aResult);
     aResult.AppendLiteral(", ");
     ++index;
   }
-  array->Item(index).AppendToString(aProperty, aResult, aSerialization);
+  array->Item(index).AppendToString(aProperty, aResult);
 }
 
 inline void
 nsCSSValue::AppendPositionCoordinateToString(
                 const nsCSSValue& aValue, nsCSSPropertyID aProperty,
-                nsAString& aResult, Serialization aSerialization) const
+                nsAString& aResult) const
 {
   if (aValue.GetUnit() == eCSSUnit_Enumerated) {
     int32_t intValue = aValue.GetIntValue();
     AppendASCIItoUTF16(nsCSSProps::ValueToKeyword(intValue,
                           nsCSSProps::kShapeRadiusKTable), aResult);
   } else {
-    aValue.AppendToString(aProperty, aResult, aSerialization);
+    aValue.AppendToString(aProperty, aResult);
   }
 }
 
 void
 nsCSSValue::AppendCircleOrEllipseToString(nsCSSKeyword aFunctionId,
                                           nsCSSPropertyID aProperty,
-                                          nsAString& aResult,
-                                          Serialization aSerialization) const
+                                          nsAString& aResult) const
 {
   const nsCSSValue::Array* array = GetArrayValue();
   size_t count = aFunctionId == eCSSKeyword_circle ? 2 : 3;
   MOZ_ASSERT(array->Count() == count + 1, "wrong number of arguments");
 
   bool hasRadii = array->Item(1).GetUnit() != eCSSUnit_Null;
 
   // closest-side is the default, so we don't need to
   // output it if all values are closest-side.
   if (array->Item(1).GetUnit() == eCSSUnit_Enumerated &&
       StyleShapeRadius(array->Item(1).GetIntValue()) == StyleShapeRadius::ClosestSide &&
       (aFunctionId == eCSSKeyword_circle ||
        (array->Item(2).GetUnit() == eCSSUnit_Enumerated &&
         StyleShapeRadius(array->Item(2).GetIntValue()) == StyleShapeRadius::ClosestSide))) {
     hasRadii = false;
   } else {
-    AppendPositionCoordinateToString(array->Item(1), aProperty,
-                                     aResult, aSerialization);
+    AppendPositionCoordinateToString(array->Item(1), aProperty, aResult);
 
     if (hasRadii && aFunctionId == eCSSKeyword_ellipse) {
       aResult.Append(' ');
-      AppendPositionCoordinateToString(array->Item(2), aProperty,
-                                       aResult, aSerialization);
+      AppendPositionCoordinateToString(array->Item(2), aProperty, aResult);
     }
   }
 
   if (hasRadii) {
     aResult.Append(' ');
   }
 
   // Any position specified?
@@ -1123,27 +1117,26 @@ nsCSSValue::AppendCircleOrEllipseToStrin
     // We only serialize to the 2 or 4 value form
     // |circle()| is valid, but should be expanded
     // to |circle(at 50% 50%)|
     aResult.AppendLiteral("at 50% 50%");
     return;
   }
 
   aResult.AppendLiteral("at ");
-  array->Item(count).AppendBasicShapePositionToString(aResult, aSerialization);
+  array->Item(count).AppendBasicShapePositionToString(aResult);
 }
 
 // https://drafts.csswg.org/css-shapes/#basic-shape-serialization
 // basic-shape asks us to omit a lot of redundant things whilst serializing
 // position values. Other specs are not clear about this
 // (https://github.com/w3c/csswg-drafts/issues/368), so for now we special-case
 // basic shapes only
 void
-nsCSSValue::AppendBasicShapePositionToString(nsAString& aResult,
-                                             Serialization aSerialization) const
+nsCSSValue::AppendBasicShapePositionToString(nsAString& aResult) const
 {
   const nsCSSValue::Array* array = GetArrayValue();
   // We always parse these into an array of four elements
   MOZ_ASSERT(array->Count() == 4,
              "basic-shape position value doesn't have enough elements");
 
   const nsCSSValue &xEdge   = array->Item(0);
   const nsCSSValue &xOffset = array->Item(1);
@@ -1156,108 +1149,105 @@ nsCSSValue::AppendBasicShapePositionToSt
              yOffset.IsLengthPercentCalcUnit() &&
              xEdge.GetIntValue() != NS_STYLE_IMAGELAYER_POSITION_CENTER &&
              yEdge.GetIntValue() != NS_STYLE_IMAGELAYER_POSITION_CENTER,
              "Ensure invariants from ParsePositionValueBasicShape "
              "haven't been modified");
   if (xEdge.GetIntValue() == NS_STYLE_IMAGELAYER_POSITION_LEFT &&
       yEdge.GetIntValue() == NS_STYLE_IMAGELAYER_POSITION_TOP) {
     // We can omit these defaults
-    xOffset.AppendToString(eCSSProperty_UNKNOWN, aResult, aSerialization);
+    xOffset.AppendToString(eCSSProperty_UNKNOWN, aResult);
     aResult.Append(' ');
-    yOffset.AppendToString(eCSSProperty_UNKNOWN, aResult, aSerialization);
+    yOffset.AppendToString(eCSSProperty_UNKNOWN, aResult);
   } else {
     // We only serialize to the two or four valued form
-    xEdge.AppendToString(eCSSProperty_object_position, aResult, aSerialization);
+    xEdge.AppendToString(eCSSProperty_object_position, aResult);
     aResult.Append(' ');
-    xOffset.AppendToString(eCSSProperty_UNKNOWN, aResult, aSerialization);
+    xOffset.AppendToString(eCSSProperty_UNKNOWN, aResult);
     aResult.Append(' ');
-    yEdge.AppendToString(eCSSProperty_object_position, aResult, aSerialization);
+    yEdge.AppendToString(eCSSProperty_object_position, aResult);
     aResult.Append(' ');
-    yOffset.AppendToString(eCSSProperty_UNKNOWN, aResult, aSerialization);
+    yOffset.AppendToString(eCSSProperty_UNKNOWN, aResult);
   }
 }
 
 // Helper to append |aString| with the shorthand sides notation used in e.g.
 // 'padding'. |aProperties| and |aValues| are expected to have 4 elements.
 /*static*/ void
 nsCSSValue::AppendSidesShorthandToString(const nsCSSPropertyID aProperties[],
                                          const nsCSSValue* aValues[],
-                                         nsAString& aString,
-                                         nsCSSValue::Serialization
-                                            aSerialization)
+                                         nsAString& aString)
 {
   const nsCSSValue& value1 = *aValues[0];
   const nsCSSValue& value2 = *aValues[1];
   const nsCSSValue& value3 = *aValues[2];
   const nsCSSValue& value4 = *aValues[3];
 
   MOZ_ASSERT(value1.GetUnit() != eCSSUnit_Null, "null value 1");
-  value1.AppendToString(aProperties[0], aString, aSerialization);
+  value1.AppendToString(aProperties[0], aString);
   if (value1 != value2 || value1 != value3 || value1 != value4) {
     aString.Append(char16_t(' '));
     MOZ_ASSERT(value2.GetUnit() != eCSSUnit_Null, "null value 2");
-    value2.AppendToString(aProperties[1], aString, aSerialization);
+    value2.AppendToString(aProperties[1], aString);
     if (value1 != value3 || value2 != value4) {
       aString.Append(char16_t(' '));
       MOZ_ASSERT(value3.GetUnit() != eCSSUnit_Null, "null value 3");
-      value3.AppendToString(aProperties[2], aString, aSerialization);
+      value3.AppendToString(aProperties[2], aString);
       if (value2 != value4) {
         aString.Append(char16_t(' '));
         MOZ_ASSERT(value4.GetUnit() != eCSSUnit_Null, "null value 4");
-        value4.AppendToString(aProperties[3], aString, aSerialization);
+        value4.AppendToString(aProperties[3], aString);
       }
     }
   }
 }
 
 /*static*/ void
 nsCSSValue::AppendBasicShapeRadiusToString(const nsCSSPropertyID aProperties[],
                                            const nsCSSValue* aValues[],
-                                           nsAString& aResult,
-                                           Serialization aSerialization)
+                                           nsAString& aResult)
 {
   bool needY = false;
   const nsCSSValue* xVals[4];
   const nsCSSValue* yVals[4];
   for (int i = 0; i < 4; i++) {
     if (aValues[i]->GetUnit() == eCSSUnit_Pair) {
       needY = true;
       xVals[i] = &aValues[i]->GetPairValue().mXValue;
       yVals[i] = &aValues[i]->GetPairValue().mYValue;
     } else {
       xVals[i] = yVals[i] = aValues[i];
     }
   }
 
-  AppendSidesShorthandToString(aProperties, xVals, aResult, aSerialization);
+  AppendSidesShorthandToString(aProperties, xVals, aResult);
   if (needY) {
     aResult.AppendLiteral(" / ");
-    AppendSidesShorthandToString(aProperties, yVals, aResult, aSerialization);
+    AppendSidesShorthandToString(aProperties, yVals, aResult);
   }
 }
 
 void
-nsCSSValue::AppendInsetToString(nsCSSPropertyID aProperty, nsAString& aResult,
-                                Serialization aSerialization) const
+nsCSSValue::AppendInsetToString(nsCSSPropertyID aProperty,
+                                nsAString& aResult) const
 {
   const nsCSSValue::Array* array = GetArrayValue();
   MOZ_ASSERT(array->Count() == 6,
              "inset function has wrong number of arguments");
   if (array->Item(1).GetUnit() != eCSSUnit_Null) {
-    array->Item(1).AppendToString(aProperty, aResult, aSerialization);
+    array->Item(1).AppendToString(aProperty, aResult);
     if (array->Item(2).GetUnit() != eCSSUnit_Null) {
       aResult.Append(' ');
-      array->Item(2).AppendToString(aProperty, aResult, aSerialization);
+      array->Item(2).AppendToString(aProperty, aResult);
       if (array->Item(3).GetUnit() != eCSSUnit_Null) {
         aResult.Append(' ');
-        array->Item(3).AppendToString(aProperty, aResult, aSerialization);
+        array->Item(3).AppendToString(aProperty, aResult);
         if (array->Item(4).GetUnit() != eCSSUnit_Null) {
           aResult.Append(' ');
-          array->Item(4).AppendToString(aProperty, aResult, aSerialization);
+          array->Item(4).AppendToString(aProperty, aResult);
         }
       }
     }
   }
 
   if (array->Item(5).GetUnit() == eCSSUnit_Array) {
     const nsCSSPropertyID* subprops =
       nsCSSProps::SubpropertyEntryFor(eCSSProperty_border_radius);
@@ -1265,18 +1255,17 @@ nsCSSValue::AppendInsetToString(nsCSSPro
     MOZ_ASSERT(radius->Count() == 4, "expected 4 radii values");
     const nsCSSValue* vals[4] = {
       &(radius->Item(0)),
       &(radius->Item(1)),
       &(radius->Item(2)),
       &(radius->Item(3))
     };
     aResult.AppendLiteral(" round ");
-    AppendBasicShapeRadiusToString(subprops, vals, aResult,
-                                   aSerialization);
+    AppendBasicShapeRadiusToString(subprops, vals, aResult);
   } else {
     MOZ_ASSERT(array->Item(5).GetUnit() == eCSSUnit_Null,
                "unexpected value");
   }
 }
 
 /* static */ void
 nsCSSValue::AppendAlignJustifyValueToString(int32_t aValue, nsAString& aResult)
@@ -1308,18 +1297,18 @@ nsCSSValue::AppendAlignJustifyValueToStr
   if (MOZ_UNLIKELY(overflowPos == NS_STYLE_ALIGN_SAFE)) {
     aResult.Append(' ');
     AppendASCIItoUTF16(nsCSSProps::ValueToKeyword(overflowPos, kwtable),
                        aResult);
   }
 }
 
 void
-nsCSSValue::AppendToString(nsCSSPropertyID aProperty, nsAString& aResult,
-                           Serialization aSerialization) const
+nsCSSValue::AppendToString(nsCSSPropertyID aProperty,
+                           nsAString& aResult) const
 {
   // eCSSProperty_UNKNOWN gets used for some recursive calls below.
   MOZ_ASSERT((0 <= aProperty &&
               aProperty <= eCSSProperty_COUNT_no_shorthands) ||
              aProperty == eCSSProperty_UNKNOWN ||
              aProperty == eCSSProperty_DOM,
              "property ID out of range");
 
@@ -1387,17 +1376,17 @@ nsCSSValue::AppendToString(nsCSSProperty
         }
         continue;
       }
       nsCSSPropertyID prop =
         ((eCSSUnit_Counter <= unit && unit <= eCSSUnit_Counters) &&
          i == array->Count() - 1)
         ? eCSSProperty_list_style_type : aProperty;
       if (array->Item(i).GetUnit() != eCSSUnit_Null) {
-        array->Item(i).AppendToString(prop, aResult, aSerialization);
+        array->Item(i).AppendToString(prop, aResult);
         mark = true;
       }
     }
     if (eCSSUnit_Array == unit &&
         aProperty == eCSSProperty_transition_timing_function) {
       aResult.Append(')');
     }
   }
@@ -1416,17 +1405,17 @@ nsCSSValue::AppendToString(nsCSSProperty
     const nsCSSKeyword functionId = functionName.GetKeywordValue();
 
     // minmax(auto, <flex>) is equivalent to (and is our internal representation
     // of) <flex>, and both are serialized as <flex>
     if (functionId == eCSSKeyword_minmax &&
         array->Count() == 3 &&
         array->Item(1).GetUnit() == eCSSUnit_Auto &&
         array->Item(2).GetUnit() == eCSSUnit_FlexFraction) {
-      array->Item(2).AppendToString(aProperty, aResult, aSerialization);
+      array->Item(2).AppendToString(aProperty, aResult);
       MOZ_ASSERT(aProperty == eCSSProperty_grid_template_columns ||
                  aProperty == eCSSProperty_grid_template_rows ||
                  aProperty == eCSSProperty_grid_auto_columns ||
                  aProperty == eCSSProperty_grid_auto_rows);
       return;
     }
 
     /* Append the function name. */
@@ -1458,49 +1447,47 @@ nsCSSValue::AppendToString(nsCSSProperty
       default:
         break;
     }
     nsStyleUtil::AppendEscapedCSSIdent(ident, aResult);
     aResult.Append('(');
 
     switch (functionId) {
       case eCSSKeyword_polygon:
-        AppendPolygonToString(aProperty, aResult, aSerialization);
+        AppendPolygonToString(aProperty, aResult);
         break;
 
       case eCSSKeyword_circle:
       case eCSSKeyword_ellipse:
-        AppendCircleOrEllipseToString(functionId, aProperty, aResult,
-                                      aSerialization);
+        AppendCircleOrEllipseToString(functionId, aProperty, aResult);
         break;
 
       case eCSSKeyword_inset:
-        AppendInsetToString(aProperty, aResult, aSerialization);
+        AppendInsetToString(aProperty, aResult);
         break;
 
       default: {
         // Now, step through the function contents, writing each of
         // them as we go.
         for (size_t index = 1; index < array->Count(); ++index) {
-          array->Item(index).AppendToString(aProperty, aResult,
-                                            aSerialization);
+          array->Item(index).AppendToString(aProperty, aResult);
 
           /* If we're not at the final element, append a comma. */
           if (index + 1 != array->Count())
             aResult.AppendLiteral(", ");
         }
       }
     }
 
     /* Finally, append the closing parenthesis. */
     aResult.Append(')');
   }
   else if (IsCalcUnit()) {
     MOZ_ASSERT(GetUnit() == eCSSUnit_Calc, "unexpected unit");
-    CSSValueSerializeCalcOps ops(aProperty, aResult, aSerialization);
+    CSSValueSerializeCalcOps ops(aProperty, aResult);
     css::SerializeCalc(*this, ops);
   }
   else if (eCSSUnit_Integer == unit) {
     aResult.AppendInt(GetIntValue(), 10);
   }
   else if (eCSSUnit_Enumerated == unit) {
     int32_t intValue = GetIntValue();
     switch(aProperty) {
@@ -1712,17 +1699,17 @@ nsCSSValue::AppendToString(nsCSSProperty
     nsCSSValue serializable;
     if (color.IsCurrentColor()) {
       serializable.SetIntValue(NS_COLOR_CURRENTCOLOR, eCSSUnit_EnumColor);
     } else if (color.IsNumericColor()) {
       serializable.SetColorValue(color.mColor);
     } else {
       MOZ_ASSERT_UNREACHABLE("Cannot serialize a complex color");
     }
-    serializable.AppendToString(aProperty, aResult, aSerialization);
+    serializable.AppendToString(aProperty, aResult);
   }
   else if (eCSSUnit_URL == unit || eCSSUnit_Image == unit) {
     aResult.AppendLiteral("url(");
     nsStyleUtil::AppendEscapedCSSString(
       nsDependentString(GetOriginalURLValue()), aResult);
     aResult.Append(')');
   }
   else if (eCSSUnit_Element == unit) {
@@ -1783,22 +1770,20 @@ nsCSSValue::AppendToString(nsCSSProperty
           AppendASCIItoUTF16(nsCSSProps::ValueToKeyword(intValue,
                                  nsCSSProps::kRadialGradientSizeKTable),
                              aResult);
           needSep = true;
         }
       } else {
         MOZ_ASSERT(gradient->GetRadiusX().GetUnit() != eCSSUnit_None,
                    "bad unit for radial gradient explicit size");
-        gradient->GetRadiusX().AppendToString(aProperty, aResult,
-                                              aSerialization);
+        gradient->GetRadiusX().AppendToString(aProperty, aResult);
         if (gradient->GetRadiusY().GetUnit() != eCSSUnit_None) {
           aResult.Append(' ');
-          gradient->GetRadiusY().AppendToString(aProperty, aResult,
-                                                aSerialization);
+          gradient->GetRadiusY().AppendToString(aProperty, aResult);
         }
         needSep = true;
       }
     }
     if (!gradient->mIsRadial &&
         !(gradient->mIsLegacySyntax && gradient->mIsMozLegacySyntax)) {
       if (gradient->mBgPos.mXValue.GetUnit() != eCSSUnit_None ||
           gradient->mBgPos.mYValue.GetUnit() != eCSSUnit_None) {
@@ -1807,56 +1792,56 @@ nsCSSValue::AppendToString(nsCSSProperty
                    gradient->mBgPos.mYValue.GetUnit() == eCSSUnit_Enumerated,
                    "unexpected unit");
         if (!gradient->mIsLegacySyntax) {
           aResult.AppendLiteral("to ");
         }
         bool didAppendX = false;
         if (!(gradient->mBgPos.mXValue.GetIntValue() & NS_STYLE_IMAGELAYER_POSITION_CENTER)) {
           gradient->mBgPos.mXValue.AppendToString(eCSSProperty_background_position_x,
-                                                  aResult, aSerialization);
+                                                  aResult);
           didAppendX = true;
         }
         if (!(gradient->mBgPos.mYValue.GetIntValue() & NS_STYLE_IMAGELAYER_POSITION_CENTER)) {
           if (didAppendX) {
             // We're appending both an x-keyword and a y-keyword.
             // Add a space between them here.
             aResult.Append(' ');
           }
           gradient->mBgPos.mYValue.AppendToString(eCSSProperty_background_position_y,
-                                                  aResult, aSerialization);
+                                                  aResult);
         }
         needSep = true;
       } else if (gradient->mAngle.GetUnit() != eCSSUnit_None) {
-        gradient->mAngle.AppendToString(aProperty, aResult, aSerialization);
+        gradient->mAngle.AppendToString(aProperty, aResult);
         needSep = true;
       }
     } else if (gradient->mBgPos.mXValue.GetUnit() != eCSSUnit_None ||
         gradient->mBgPos.mYValue.GetUnit() != eCSSUnit_None ||
         gradient->mAngle.GetUnit() != eCSSUnit_None) {
       if (needSep) {
         aResult.Append(' ');
       }
       if (gradient->mIsRadial && !gradient->mIsLegacySyntax) {
         aResult.AppendLiteral("at ");
       }
       if (gradient->mBgPos.mXValue.GetUnit() != eCSSUnit_None) {
         gradient->mBgPos.mXValue.AppendToString(eCSSProperty_background_position_x,
-                                                aResult, aSerialization);
+                                                aResult);
         aResult.Append(' ');
       }
       if (gradient->mBgPos.mYValue.GetUnit() != eCSSUnit_None) {
         gradient->mBgPos.mYValue.AppendToString(eCSSProperty_background_position_y,
-                                                aResult, aSerialization);
+                                                aResult);
         aResult.Append(' ');
       }
       if (gradient->mAngle.GetUnit() != eCSSUnit_None) {
         MOZ_ASSERT(gradient->mIsLegacySyntax,
                    "angle is allowed only for legacy syntax");
-        gradient->mAngle.AppendToString(aProperty, aResult, aSerialization);
+        gradient->mAngle.AppendToString(aProperty, aResult);
       }
       needSep = true;
     }
 
     if (gradient->mIsRadial && gradient->mIsLegacySyntax &&
         (gradient->GetRadialShape().GetUnit() != eCSSUnit_None ||
          gradient->GetRadialSize().GetUnit() != eCSSUnit_None)) {
       MOZ_ASSERT(!gradient->mIsExplicitSize);
@@ -1887,25 +1872,23 @@ nsCSSValue::AppendToString(nsCSSProperty
     }
     if (needSep) {
       aResult.AppendLiteral(", ");
     }
 
     for (uint32_t i = 0 ;;) {
       bool isInterpolationHint = gradient->mStops[i].mIsInterpolationHint;
       if (!isInterpolationHint) {
-        gradient->mStops[i].mColor.AppendToString(aProperty, aResult,
-                                                  aSerialization);
+        gradient->mStops[i].mColor.AppendToString(aProperty, aResult);
       }
       if (gradient->mStops[i].mLocation.GetUnit() != eCSSUnit_None) {
         if (!isInterpolationHint) {
           aResult.Append(' ');
         }
-        gradient->mStops[i].mLocation.AppendToString(aProperty, aResult,
-                                                     aSerialization);
+        gradient->mStops[i].mLocation.AppendToString(aProperty, aResult);
       }
       if (++i == gradient->mStops.Length()) {
         break;
       }
       aResult.AppendLiteral(", ");
     }
 
     aResult.Append(')');
@@ -1939,33 +1922,33 @@ nsCSSValue::AppendToString(nsCSSProperty
       // functional values
       const nsCSSValueList *list = GetPairValue().mYValue.GetListValue();
       AutoTArray<gfxAlternateValue,8> altValues;
 
       nsStyleUtil::ComputeFunctionalAlternates(list, altValues);
       nsStyleUtil::SerializeFunctionalAlternates(altValues, out);
       aResult.Append(out);
     } else {
-      GetPairValue().AppendToString(aProperty, aResult, aSerialization);
+      GetPairValue().AppendToString(aProperty, aResult);
     }
   } else if (eCSSUnit_Triplet == unit) {
-    GetTripletValue().AppendToString(aProperty, aResult, aSerialization);
+    GetTripletValue().AppendToString(aProperty, aResult);
   } else if (eCSSUnit_Rect == unit) {
-    GetRectValue().AppendToString(aProperty, aResult, aSerialization);
+    GetRectValue().AppendToString(aProperty, aResult);
   } else if (eCSSUnit_List == unit || eCSSUnit_ListDep == unit) {
-    GetListValue()->AppendToString(aProperty, aResult, aSerialization);
+    GetListValue()->AppendToString(aProperty, aResult);
   } else if (eCSSUnit_SharedList == unit) {
-    GetSharedListValue()->AppendToString(aProperty, aResult, aSerialization);
+    GetSharedListValue()->AppendToString(aProperty, aResult);
   } else if (eCSSUnit_PairList == unit || eCSSUnit_PairListDep == unit) {
     switch (aProperty) {
       case eCSSProperty_font_feature_settings:
         nsStyleUtil::AppendFontFeatureSettings(*this, aResult);
         break;
       default:
-        GetPairListValue()->AppendToString(aProperty, aResult, aSerialization);
+        GetPairListValue()->AppendToString(aProperty, aResult);
         break;
     }
   } else if (eCSSUnit_GridTemplateAreas == unit) {
     const mozilla::css::GridTemplateAreasValue* areas = GetGridTemplateAreas();
     MOZ_ASSERT(!areas->mTemplates.IsEmpty(),
                "Unexpected empty array in GridTemplateAreasValue");
     nsStyleUtil::AppendEscapedCSSString(areas->mTemplates[0], aResult);
     for (uint32_t i = 1; i < areas->mTemplates.Length(); i++) {
@@ -2295,36 +2278,34 @@ nsCSSValueList::CloneInto(nsCSSValueList
 {
   NS_ASSERTION(!aList->mNext, "Must be an empty list!");
   aList->mValue = mValue;
   aList->mNext = mNext ? mNext->Clone() : nullptr;
 }
 
 static void
 AppendValueListToString(const nsCSSValueList* val,
-                        nsCSSPropertyID aProperty, nsAString& aResult,
-                        nsCSSValue::Serialization aSerialization)
+                        nsCSSPropertyID aProperty, nsAString& aResult)
 {
   for (;;) {
-    val->mValue.AppendToString(aProperty, aResult, aSerialization);
+    val->mValue.AppendToString(aProperty, aResult);
     val = val->mNext;
     if (!val)
       break;
 
     if (nsCSSProps::PropHasFlags(aProperty,
                                  CSS_PROPERTY_VALUE_LIST_USES_COMMAS))
       aResult.Append(char16_t(','));
     aResult.Append(char16_t(' '));
   }
 }
 
 static void
 AppendGridTemplateToString(const nsCSSValueList* val,
-                           nsCSSPropertyID aProperty, nsAString& aResult,
-                           nsCSSValue::Serialization aSerialization)
+                           nsCSSPropertyID aProperty, nsAString& aResult)
 {
   // This is called for the "list" that's the top-level value of the property.
   bool isSubgrid = false;
   for (;;) {
     bool addSpaceSeparator = true;
     nsCSSUnit unit = val->mValue.GetUnit();
 
     if (unit == eCSSUnit_Enumerated &&
@@ -2345,32 +2326,32 @@ AppendGridTemplateToString(const nsCSSVa
           break;
         default:
           MOZ_ASSERT_UNREACHABLE("unexpected enum value");
       }
       const nsCSSValueList* repeatList = pair.mYValue.GetListValue();
       if (repeatList->mValue.GetUnit() != eCSSUnit_Null) {
         aResult.Append('[');
         AppendValueListToString(repeatList->mValue.GetListValue(), aProperty,
-                                aResult, aSerialization);
+                                aResult);
         aResult.Append(']');
         if (!isSubgrid) {
           aResult.Append(' ');
         }
       } else if (isSubgrid) {
         aResult.AppendLiteral("[]");
       }
       if (!isSubgrid) {
         repeatList = repeatList->mNext;
-        repeatList->mValue.AppendToString(aProperty, aResult, aSerialization);
+        repeatList->mValue.AppendToString(aProperty, aResult);
         repeatList = repeatList->mNext;
         if (repeatList->mValue.GetUnit() != eCSSUnit_Null) {
           aResult.AppendLiteral(" [");
           AppendValueListToString(repeatList->mValue.GetListValue(), aProperty,
-                                  aResult, aSerialization);
+                                  aResult);
           aResult.Append(']');
         }
       }
       aResult.Append(')');
 
     } else if (unit == eCSSUnit_Null) {
       // Empty or omitted <line-names>.
       if (isSubgrid) {
@@ -2378,23 +2359,22 @@ AppendGridTemplateToString(const nsCSSVa
       } else {
         // Serializes to nothing.
         addSpaceSeparator = false;  // Avoid a double space.
       }
 
     } else if (unit == eCSSUnit_List || unit == eCSSUnit_ListDep) {
       // Non-empty <line-names>
       aResult.Append('[');
-      AppendValueListToString(val->mValue.GetListValue(), aProperty,
-                              aResult, aSerialization);
+      AppendValueListToString(val->mValue.GetListValue(), aProperty, aResult);
       aResult.Append(']');
 
     } else {
       // <track-size>
-      val->mValue.AppendToString(aProperty, aResult, aSerialization);
+      val->mValue.AppendToString(aProperty, aResult);
       if (!isSubgrid &&
           val->mNext &&
           val->mNext->mValue.GetUnit() == eCSSUnit_Null &&
           !val->mNext->mNext) {
         // Break out of the loop early to avoid a trailing space.
         break;
       }
     }
@@ -2406,24 +2386,24 @@ AppendGridTemplateToString(const nsCSSVa
 
     if (addSpaceSeparator) {
       aResult.Append(char16_t(' '));
     }
   }
 }
 
 void
-nsCSSValueList::AppendToString(nsCSSPropertyID aProperty, nsAString& aResult,
-                               nsCSSValue::Serialization aSerialization) const
+nsCSSValueList::AppendToString(nsCSSPropertyID aProperty,
+                               nsAString& aResult) const
 {
   if (aProperty == eCSSProperty_grid_template_columns ||
       aProperty == eCSSProperty_grid_template_rows) {
-    AppendGridTemplateToString(this, aProperty, aResult, aSerialization);
+    AppendGridTemplateToString(this, aProperty, aResult);
   } else {
-    AppendValueListToString(this, aProperty, aResult, aSerialization);
+    AppendValueListToString(this, aProperty, aResult);
   }
 }
 
 /* static */ bool
 nsCSSValueList::Equal(const nsCSSValueList* aList1,
                       const nsCSSValueList* aList2)
 {
   if (aList1 == aList2) {
@@ -2470,21 +2450,21 @@ nsCSSValueSharedList::~nsCSSValueSharedL
 {
   if (mHead) {
     NS_CSS_DELETE_LIST_MEMBER(nsCSSValueList, mHead, mNext);
     delete mHead;
   }
 }
 
 void
-nsCSSValueSharedList::AppendToString(nsCSSPropertyID aProperty, nsAString& aResult,
-                                     nsCSSValue::Serialization aSerialization) const
+nsCSSValueSharedList::AppendToString(nsCSSPropertyID aProperty,
+                                     nsAString& aResult) const
 {
   if (mHead) {
-    mHead->AppendToString(aProperty, aResult, aSerialization);
+    mHead->AppendToString(aProperty, aResult);
   }
 }
 
 bool
 nsCSSValueSharedList::operator==(const nsCSSValueSharedList& aOther) const
 {
   return nsCSSValueList::Equal(mHead, aOther.mHead);
 }
@@ -2518,53 +2498,53 @@ nsCSSRect::nsCSSRect(const nsCSSRect& aC
 }
 
 nsCSSRect::~nsCSSRect()
 {
   MOZ_COUNT_DTOR(nsCSSRect);
 }
 
 void
-nsCSSRect::AppendToString(nsCSSPropertyID aProperty, nsAString& aResult,
-                          nsCSSValue::Serialization aSerialization) const
+nsCSSRect::AppendToString(nsCSSPropertyID aProperty,
+                          nsAString& aResult) const
 {
   MOZ_ASSERT(mTop.GetUnit() != eCSSUnit_Null &&
              mTop.GetUnit() != eCSSUnit_Inherit &&
              mTop.GetUnit() != eCSSUnit_Initial &&
              mTop.GetUnit() != eCSSUnit_Unset,
              "parser should have used a bare value");
 
   if (eCSSProperty_border_image_slice == aProperty ||
       eCSSProperty_border_image_width == aProperty ||
       eCSSProperty_border_image_outset == aProperty) {
     nsCSSPropertyID props[] = { aProperty, aProperty, aProperty, aProperty };
     const nsCSSValue* values[] = { &mTop, &mRight, &mBottom, &mLeft };
     nsCSSValue::AppendSidesShorthandToString(props, values,
-                                             aResult, aSerialization);
+                                             aResult);
   } else if (eCSSProperty_DOM == aProperty) {
      NS_NAMED_LITERAL_STRING(space, " ");
 
-    mTop.AppendToString(aProperty, aResult, aSerialization);
+    mTop.AppendToString(aProperty, aResult);
     aResult.Append(space);
-    mRight.AppendToString(aProperty, aResult, aSerialization);
+    mRight.AppendToString(aProperty, aResult);
     aResult.Append(space);
-    mBottom.AppendToString(aProperty, aResult, aSerialization);
+    mBottom.AppendToString(aProperty, aResult);
     aResult.Append(space);
-    mLeft.AppendToString(aProperty, aResult, aSerialization);
+    mLeft.AppendToString(aProperty, aResult);
   } else {
     NS_NAMED_LITERAL_STRING(comma, ", ");
 
     aResult.AppendLiteral("rect(");
-    mTop.AppendToString(aProperty, aResult, aSerialization);
+    mTop.AppendToString(aProperty, aResult);
     aResult.Append(comma);
-    mRight.AppendToString(aProperty, aResult, aSerialization);
+    mRight.AppendToString(aProperty, aResult);
     aResult.Append(comma);
-    mBottom.AppendToString(aProperty, aResult, aSerialization);
+    mBottom.AppendToString(aProperty, aResult);
     aResult.Append(comma);
-    mLeft.AppendToString(aProperty, aResult, aSerialization);
+    mLeft.AppendToString(aProperty, aResult);
     aResult.Append(char16_t(')'));
   }
 }
 
 void nsCSSRect::SetAllSidesTo(const nsCSSValue& aValue)
 {
   mTop = aValue;
   mRight = aValue;
@@ -2597,23 +2577,22 @@ static_assert(eSideTop == 0 && eSideRigh
   &nsCSSRect::mBottom,
   &nsCSSRect::mLeft,
 };
 
 // --- nsCSSValuePair -----------------
 
 void
 nsCSSValuePair::AppendToString(nsCSSPropertyID aProperty,
-                               nsAString& aResult,
-                               nsCSSValue::Serialization aSerialization) const
+                               nsAString& aResult) const
 {
-  mXValue.AppendToString(aProperty, aResult, aSerialization);
+  mXValue.AppendToString(aProperty, aResult);
   if (mYValue.GetUnit() != eCSSUnit_Null) {
     aResult.Append(char16_t(' '));
-    mYValue.AppendToString(aProperty, aResult, aSerialization);
+    mYValue.AppendToString(aProperty, aResult);
   }
 }
 
 size_t
 nsCSSValuePair::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
 {
   size_t n = 0;
   n += mXValue.SizeOfExcludingThis(aMallocSizeOf);
@@ -2633,26 +2612,25 @@ nsCSSValuePair_heap::SizeOfIncludingThis
   }
   return n;
 }
 
 // --- nsCSSValueTriplet -----------------
 
 void
 nsCSSValueTriplet::AppendToString(nsCSSPropertyID aProperty,
-                                  nsAString& aResult,
-                                  nsCSSValue::Serialization aSerialization) const
+                                  nsAString& aResult) const
 {
-  mXValue.AppendToString(aProperty, aResult, aSerialization);
+  mXValue.AppendToString(aProperty, aResult);
   if (mYValue.GetUnit() != eCSSUnit_Null) {
     aResult.Append(char16_t(' '));
-    mYValue.AppendToString(aProperty, aResult, aSerialization);
+    mYValue.AppendToString(aProperty, aResult);
     if (mZValue.GetUnit() != eCSSUnit_Null) {
       aResult.Append(char16_t(' '));
-      mZValue.AppendToString(aProperty, aResult, aSerialization);
+      mZValue.AppendToString(aProperty, aResult);
     }
   }
 }
 
 size_t
 nsCSSValueTriplet_heap::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
 {
   // Only measure it if it's unshared, to avoid double-counting.
@@ -2687,30 +2665,29 @@ nsCSSValuePairList::Clone() const
   }
 
   MOZ_ASSERT(result, "shouldn't return null; supposed to be infallible");
   return result;
 }
 
 void
 nsCSSValuePairList::AppendToString(nsCSSPropertyID aProperty,
-                                   nsAString& aResult,
-                                   nsCSSValue::Serialization aSerialization) const
+                                   nsAString& aResult) const
 {
   const nsCSSValuePairList* item = this;
   for (;;) {
     MOZ_ASSERT(item->mXValue.GetUnit() != eCSSUnit_Null,
                "unexpected null unit");
-    item->mXValue.AppendToString(aProperty, aResult, aSerialization);
+    item->mXValue.AppendToString(aProperty, aResult);
     if (item->mXValue.GetUnit() != eCSSUnit_Inherit &&
         item->mXValue.GetUnit() != eCSSUnit_Initial &&
         item->mXValue.GetUnit() != eCSSUnit_Unset &&
         item->mYValue.GetUnit() != eCSSUnit_Null) {
       aResult.Append(char16_t(' '));
-      item->mYValue.AppendToString(aProperty, aResult, aSerialization);
+      item->mYValue.AppendToString(aProperty, aResult);
     }
     item = item->mNext;
     if (!item)
       break;
 
     if (nsCSSProps::PropHasFlags(aProperty,
                                  CSS_PROPERTY_VALUE_LIST_USES_COMMAS) ||
         aProperty == eCSSProperty_clip_path ||
--- a/layout/style/nsCSSValue.h
+++ b/layout/style/nsCSSValue.h
@@ -610,25 +610,21 @@ public:
   nsCSSValue&  operator=(nsCSSValue&& aCopy);
   bool        operator==(const nsCSSValue& aOther) const;
 
   bool operator!=(const nsCSSValue& aOther) const
   {
     return !(*this == aOther);
   }
 
-  // Enum for AppendToString's aValueSerialization argument.
-  enum Serialization { eNormalized };
-
   /**
    * Serialize |this| as a specified value for |aProperty| and append
    * it to |aResult|.
    */
-  void AppendToString(nsCSSPropertyID aProperty, nsAString& aResult,
-                      Serialization aValueSerialization) const;
+  void AppendToString(nsCSSPropertyID aProperty, nsAString& aResult) const;
 
   nsCSSUnit GetUnit() const { return mUnit; }
   bool      IsLengthUnit() const
     { return eCSSUnit_PhysicalMillimeter <= mUnit && mUnit <= eCSSUnit_Pixel; }
   bool      IsLengthPercentCalcUnit() const
     { return IsLengthUnit() || mUnit == eCSSUnit_Percent || IsCalcUnit(); }
   /**
    * A "fixed" length unit is one that means a specific physical length
@@ -970,46 +966,40 @@ public:
   // Convert the given Ident value into AtomIdent.
   void AtomizeIdentValue();
 
   size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
 
   static void
   AppendSidesShorthandToString(const nsCSSPropertyID aProperties[],
                                const nsCSSValue* aValues[],
-                               nsAString& aString,
-                               Serialization aSerialization);
+                               nsAString& aString);
   static void
   AppendBasicShapeRadiusToString(const nsCSSPropertyID aProperties[],
                                  const nsCSSValue* aValues[],
-                                 nsAString& aResult,
-                                 Serialization aValueSerialization);
+                                 nsAString& aResult);
   static void
   AppendAlignJustifyValueToString(int32_t aValue, nsAString& aResult);
 
 private:
   static const char16_t* GetBufferValue(nsStringBuffer* aBuffer) {
     return static_cast<char16_t*>(aBuffer->Data());
   }
 
-  void AppendPolygonToString(nsCSSPropertyID aProperty, nsAString& aResult,
-                             Serialization aValueSerialization) const;
+  void AppendPolygonToString(nsCSSPropertyID aProperty,
+                             nsAString& aResult) const;
   void AppendPositionCoordinateToString(const nsCSSValue& aValue,
                                         nsCSSPropertyID aProperty,
-                                        nsAString& aResult,
-                                        Serialization aSerialization) const;
+                                        nsAString& aResult) const;
   void AppendCircleOrEllipseToString(
            nsCSSKeyword aFunctionId,
-           nsCSSPropertyID aProperty, nsAString& aResult,
-           Serialization aValueSerialization) const;
+           nsCSSPropertyID aProperty, nsAString& aResult) const;
   void AppendBasicShapePositionToString(
-           nsAString& aResult,
-           Serialization aValueSerialization) const;
-  void AppendInsetToString(nsCSSPropertyID aProperty, nsAString& aResult,
-                           Serialization aValueSerialization) const;
+           nsAString& aResult) const;
+  void AppendInsetToString(nsCSSPropertyID aProperty, nsAString& aResult) const;
 protected:
   nsCSSUnit mUnit;
   union {
     int32_t    mInt;
     float      mFloat;
     // Note: the capacity of the buffer may exceed the length of the string.
     // If we're of a string type, mString is not null.
     nsStringBuffer* MOZ_OWNING_REF mString;
@@ -1123,18 +1113,17 @@ private:
 
 // Prefer nsCSSValue::Array for lists of fixed size.
 struct nsCSSValueList {
   nsCSSValueList() : mNext(nullptr) { MOZ_COUNT_CTOR(nsCSSValueList); }
   ~nsCSSValueList();
 
   nsCSSValueList* Clone() const;  // makes a deep copy. Infallible.
   void CloneInto(nsCSSValueList* aList) const; // makes a deep copy into aList
-  void AppendToString(nsCSSPropertyID aProperty, nsAString& aResult,
-                      nsCSSValue::Serialization aValueSerialization) const;
+  void AppendToString(nsCSSPropertyID aProperty, nsAString& aResult) const;
 
   static bool Equal(const nsCSSValueList* aList1,
                     const nsCSSValueList* aList2);
 
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
 
   nsCSSValue      mValue;
   nsCSSValueList* mNext;
@@ -1186,18 +1175,17 @@ struct nsCSSValueSharedList final {
 
 private:
   // Private destructor, to discourage deletion outside of Release():
   ~nsCSSValueSharedList();
 
 public:
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(nsCSSValueSharedList)
 
-  void AppendToString(nsCSSPropertyID aProperty, nsAString& aResult,
-                      nsCSSValue::Serialization aValueSerialization) const;
+  void AppendToString(nsCSSPropertyID aProperty, nsAString& aResult) const;
 
   bool operator==(nsCSSValueSharedList const& aOther) const;
   bool operator!=(const nsCSSValueSharedList& aOther) const
   { return !(*this == aOther); }
 
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
 
   nsCSSValueList* mHead;
@@ -1227,18 +1215,17 @@ nsCSSValue::GetListValue() const
   }
 }
 
 struct nsCSSRect {
   nsCSSRect(void);
   nsCSSRect(const nsCSSRect& aCopy);
   ~nsCSSRect();
 
-  void AppendToString(nsCSSPropertyID aProperty, nsAString& aResult,
-                      nsCSSValue::Serialization aValueSerialization) const;
+  void AppendToString(nsCSSPropertyID aProperty, nsAString& aResult) const;
 
   bool operator==(const nsCSSRect& aOther) const {
     return mTop == aOther.mTop &&
            mRight == aOther.mRight &&
            mBottom == aOther.mBottom &&
            mLeft == aOther.mLeft;
   }
 
@@ -1369,18 +1356,17 @@ struct nsCSSValuePair {
     mYValue.Reset();
   }
 
   bool HasValue() const {
     return mXValue.GetUnit() != eCSSUnit_Null ||
            mYValue.GetUnit() != eCSSUnit_Null;
   }
 
-  void AppendToString(nsCSSPropertyID aProperty, nsAString& aResult,
-                      nsCSSValue::Serialization aValueSerialization) const;
+  void AppendToString(nsCSSPropertyID aProperty, nsAString& aResult) const;
 
   size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
 
   nsCSSValue mXValue;
   nsCSSValue mYValue;
 };
 
 // nsCSSValuePair_heap differs from nsCSSValuePair only in being
@@ -1461,18 +1447,17 @@ struct nsCSSValueTriplet {
     }
 
     bool HasValue() const {
         return mXValue.GetUnit() != eCSSUnit_Null ||
                mYValue.GetUnit() != eCSSUnit_Null ||
                mZValue.GetUnit() != eCSSUnit_Null;
     }
 
-    void AppendToString(nsCSSPropertyID aProperty, nsAString& aResult,
-                        nsCSSValue::Serialization aValueSerialization) const;
+    void AppendToString(nsCSSPropertyID aProperty, nsAString& aResult) const;
 
     nsCSSValue mXValue;
     nsCSSValue mYValue;
     nsCSSValue mZValue;
 };
 
 // nsCSSValueTriplet_heap differs from nsCSSValueTriplet only in being
 // refcounted.  It should not be necessary to use this class directly;
@@ -1525,18 +1510,17 @@ nsCSSValue::GetTripletValue() const
 }
 
 // Maybe should be replaced with nsCSSValueList and nsCSSValue::Array?
 struct nsCSSValuePairList {
   nsCSSValuePairList() : mNext(nullptr) { MOZ_COUNT_CTOR(nsCSSValuePairList); }
   ~nsCSSValuePairList();
 
   nsCSSValuePairList* Clone() const; // makes a deep copy. Infallible.
-  void AppendToString(nsCSSPropertyID aProperty, nsAString& aResult,
-                      nsCSSValue::Serialization aValueSerialization) const;
+  void AppendToString(nsCSSPropertyID aProperty, nsAString& aResult) const;
 
   static bool Equal(const nsCSSValuePairList* aList1,
                     const nsCSSValuePairList* aList2);
 
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
 
   nsCSSValue          mXValue;
   nsCSSValue          mYValue;
--- a/layout/style/nsMediaList.cpp
+++ b/layout/style/nsMediaList.cpp
@@ -384,53 +384,48 @@ nsMediaQuery::AppendToString(nsAString& 
 
     if (expr.mValue.GetUnit() != eCSSUnit_Null) {
       aString.AppendLiteral(": ");
       switch (feature->mValueType) {
         case nsMediaFeature::eLength:
           NS_ASSERTION(expr.mValue.IsLengthUnit(), "bad unit");
           // Use 'width' as a property that takes length values
           // written in the normal way.
-          expr.mValue.AppendToString(eCSSProperty_width, aString,
-                                     nsCSSValue::eNormalized);
+          expr.mValue.AppendToString(eCSSProperty_width, aString);
           break;
         case nsMediaFeature::eInteger:
         case nsMediaFeature::eBoolInteger:
           NS_ASSERTION(expr.mValue.GetUnit() == eCSSUnit_Integer,
                        "bad unit");
           // Use 'z-index' as a property that takes integer values
           // written without anything extra.
-          expr.mValue.AppendToString(eCSSProperty_z_index, aString,
-                                     nsCSSValue::eNormalized);
+          expr.mValue.AppendToString(eCSSProperty_z_index, aString);
           break;
         case nsMediaFeature::eFloat:
           {
             NS_ASSERTION(expr.mValue.GetUnit() == eCSSUnit_Number,
                          "bad unit");
             // Use 'line-height' as a property that takes float values
             // written in the normal way.
-            expr.mValue.AppendToString(eCSSProperty_line_height, aString,
-                                       nsCSSValue::eNormalized);
+            expr.mValue.AppendToString(eCSSProperty_line_height, aString);
           }
           break;
         case nsMediaFeature::eIntRatio:
           {
             NS_ASSERTION(expr.mValue.GetUnit() == eCSSUnit_Array,
                          "bad unit");
             nsCSSValue::Array *array = expr.mValue.GetArrayValue();
             NS_ASSERTION(array->Count() == 2, "unexpected length");
             NS_ASSERTION(array->Item(0).GetUnit() == eCSSUnit_Integer,
                          "bad unit");
             NS_ASSERTION(array->Item(1).GetUnit() == eCSSUnit_Integer,
                          "bad unit");
-            array->Item(0).AppendToString(eCSSProperty_z_index, aString,
-                                          nsCSSValue::eNormalized);
+            array->Item(0).AppendToString(eCSSProperty_z_index, aString);
             aString.Append('/');
-            array->Item(1).AppendToString(eCSSProperty_z_index, aString,
-                                          nsCSSValue::eNormalized);
+            array->Item(1).AppendToString(eCSSProperty_z_index, aString);
           }
           break;
         case nsMediaFeature::eResolution:
           {
             aString.AppendFloat(expr.mValue.GetFloatValue());
             if (expr.mValue.GetUnit() == eCSSUnit_Inch) {
               aString.AppendLiteral("dpi");
             } else if (expr.mValue.GetUnit() == eCSSUnit_Pixel) {