Bug 1230398 - [css-align] Don't output 'unsafe' in serialization because it's the default. r=dholbert
authorMats Palmgren <mats@mozilla.com>
Tue, 05 Jan 2016 21:27:13 +0100
changeset 278546 38258df6f6d479539cb35032b552c5cf0f88c274
parent 278545 d5245c7bbe0f3de36830693ce57412102d19854b
child 278547 814ec51c8f038e7bd9718dcd11d6a6d8d105f35f
push id69815
push usermpalmgren@mozilla.com
push dateTue, 05 Jan 2016 20:27:26 +0000
treeherdermozilla-inbound@91d546e91e8a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1230398
milestone46.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1230398 - [css-align] Don't output 'unsafe' in serialization because it's the default. r=dholbert Prompted by a CSS Align spec change: https://lists.w3.org/Archives/Public/www-style/2015Dec/0067.html
layout/style/nsCSSValue.cpp
--- a/layout/style/nsCSSValue.cpp
+++ b/layout/style/nsCSSValue.cpp
@@ -1021,20 +1021,22 @@ nsCSSValue::AppendAlignJustifyValueToStr
   aValue &= ~overflowPos;
   MOZ_ASSERT(!(aValue & NS_STYLE_ALIGN_FLAG_BITS),
              "unknown bits in align/justify value");
   MOZ_ASSERT((aValue != NS_STYLE_ALIGN_AUTO &&
               aValue != NS_STYLE_ALIGN_BASELINE &&
               aValue != NS_STYLE_ALIGN_LAST_BASELINE) ||
              (!legacy && !overflowPos),
              "auto/baseline/last-baseline never have any flags");
+  MOZ_ASSERT(legacy == 0 || overflowPos == 0,
+             "'legacy' together with <overflow-position>");
   const auto& kwtable(nsCSSProps::kAlignAllKeywords);
   AppendASCIItoUTF16(nsCSSProps::ValueToKeyword(aValue, kwtable), aResult);
-  if (MOZ_UNLIKELY(overflowPos != 0)) {
-    MOZ_ASSERT(legacy == 0, "'legacy' together with <overflow-position>");
+  // Don't serialize the 'unsafe' keyword; it's the default.
+  if (MOZ_UNLIKELY(overflowPos == NS_STYLE_ALIGN_SAFE)) {
     aResult.Append(' ');
     AppendASCIItoUTF16(nsCSSProps::ValueToKeyword(overflowPos, kwtable),
                        aResult);
   }
 }
 
 void
 nsCSSValue::AppendToString(nsCSSProperty aProperty, nsAString& aResult,