Bug 1203142 - Insert /**/ separate between two adjacent '-' symbols when serializing token streams. r=simon.sapin
authorCameron McCormack <cam@mcc.id.au>
Thu, 17 Sep 2015 11:34:04 +1000
changeset 297258 5fc62c86d050a6780212675050565ee4bea63e37
parent 297257 2cbe7dae98c5061f822c1523cf7aefb2545e5f3f
child 297259 76d24976824c2345bb45045e3332fef4e2eb0579
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssimon
bugs1203142
milestone43.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 1203142 - Insert /**/ separate between two adjacent '-' symbols when serializing token streams. r=simon.sapin
layout/style/nsCSSParser.cpp
layout/style/nsCSSScanner.h
layout/style/test/test_variable_serialization_computed.html
--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -2140,25 +2140,25 @@ SeparatorRequiredBetweenTokens(nsCSSToke
              aToken2 == eCSSTokenSerialization_URL_or_BadURL ||
              aToken2 == eCSSTokenSerialization_Symbol_Minus ||
              aToken2 == eCSSTokenSerialization_Number ||
              aToken2 == eCSSTokenSerialization_Percentage ||
              aToken2 == eCSSTokenSerialization_Dimension ||
              aToken2 == eCSSTokenSerialization_URange ||
              aToken2 == eCSSTokenSerialization_CDC;
     case eCSSTokenSerialization_Symbol_Hash:
+    case eCSSTokenSerialization_Symbol_Minus:
       return aToken2 == eCSSTokenSerialization_Ident ||
              aToken2 == eCSSTokenSerialization_Function ||
              aToken2 == eCSSTokenSerialization_URL_or_BadURL ||
              aToken2 == eCSSTokenSerialization_Symbol_Minus ||
              aToken2 == eCSSTokenSerialization_Number ||
              aToken2 == eCSSTokenSerialization_Percentage ||
              aToken2 == eCSSTokenSerialization_Dimension ||
              aToken2 == eCSSTokenSerialization_URange;
-    case eCSSTokenSerialization_Symbol_Minus:
     case eCSSTokenSerialization_Number:
       return aToken2 == eCSSTokenSerialization_Ident ||
              aToken2 == eCSSTokenSerialization_Function ||
              aToken2 == eCSSTokenSerialization_URL_or_BadURL ||
              aToken2 == eCSSTokenSerialization_Number ||
              aToken2 == eCSSTokenSerialization_Percentage ||
              aToken2 == eCSSTokenSerialization_Dimension ||
              aToken2 == eCSSTokenSerialization_URange;
--- a/layout/style/nsCSSScanner.h
+++ b/layout/style/nsCSSScanner.h
@@ -99,17 +99,17 @@ enum nsCSSTokenType {
 
 // Classification of tokens used to determine if a "/**/" string must be
 // inserted if pasting token streams together when serializing.  We include
 // values corresponding to eCSSToken_Dashmatch and eCSSToken_Containsmatch,
 // as css-syntax does not treat these as whole tokens, but we will still
 // need to insert a "/**/" string between a '|' delim and a '|=' dashmatch
 // and between a '/' delim and a '*=' containsmatch.
 //
-// https://dvcs.w3.org/hg/csswg/raw-file/372e659027a0/css-syntax/Overview.html#serialization
+// https://drafts.csswg.org/css-syntax/#serialization
 enum nsCSSTokenSerializationType {
   eCSSTokenSerialization_Nothing,
   eCSSTokenSerialization_Whitespace,
   eCSSTokenSerialization_AtKeyword_or_Hash,
   eCSSTokenSerialization_Number,
   eCSSTokenSerialization_Dimension,
   eCSSTokenSerialization_Percentage,
   eCSSTokenSerialization_URange,
--- a/layout/style/test/test_variable_serialization_computed.html
+++ b/layout/style/test/test_variable_serialization_computed.html
@@ -30,16 +30,22 @@ var values = [
   ["--a: something 3px url(whereever) calc(var(--b,1em) + 1px)", "--a", " something 3px url(whereever) calc(1em + 1px)"],
   ["--a: var(--b, var(--c, var(--d, Black)))", "--a", "    Black"],
   ["--a: a var(--b) c; --b:b", "--a", " a b c"],
   ["--a: a var(--b,b var(--c) d) e; --c:c", "--a", " a b c d e"],
   ["--a: var(--b)red; --b:orange;", "--a", " orange/**/red"],
   ["--a: var(--b)var(--c); --b:orange; --c:red;", "--a", " orange/**/red"],
   ["--a: var(--b)var(--c,red); --b:orange;", "--a", " orange/**/red"],
   ["--a: var(--b,orange)var(--c); --c:red;", "--a", " orange/**/red"],
+  ["--a: var(--b)-; --b:-;", "--a", " -/**/-"],
+  ["--a: var(--b)--; --b:-;", "--a", " -/**/--"],
+  ["--a: var(--b)--x; --b:-;", "--a", " -/**/--x"],
+  ["--a: var(--b)var(--c); --b:-; --c:-;", "--a", " -/**/-"],
+  ["--a: var(--b)var(--c); --b:--; --c:-;", "--a", " --/**/-"],
+  ["--a: var(--b)var(--c); --b:--x; --c:-;", "--a", " --x/**/-"],
   ["counter-reset: var(--a)red; --a:orange;", "counter-reset", "orange 0 red 0"],
   ["--a: var(--b)var(--c); --c:[c]; --b:('ab", "--a", " ('ab')[c]"],
   ["--a: '", "--a", " ''"],
   ["--a: '\\", "--a", " ''"],
   ["--a: \\", "--a", " \\\ufffd"],
   ["--a: \"", "--a", " \"\""],
   ["--a: \"\\", "--a", " \"\""],
   ["--a: /* abc ", "--a", " /* abc */"],