Bug 1265001 part 2 - Add some tests with uppercase N in An+B.
authorMats Palmgren <mats@mozilla.com>
Tue, 19 Apr 2016 22:12:16 +0200
changeset 317704 4f139d664ccc461f43174119bfe356841482e6ca
parent 317703 1157791f8ec1da340bcb87f03d405d04d0f65e0d
child 317705 d5920404005033ac00cd2eabdbb1826b30215269
push id9480
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 17:12:58 +0000
treeherdermozilla-aurora@0d6a91c76a9e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1265001
milestone48.0a1
Bug 1265001 part 2 - Add some tests with uppercase N in An+B.
layout/reftests/css-selectors/nth-child-1.html
layout/reftests/css-selectors/nth-child-2.html
layout/reftests/css-selectors/nth-child-ref.html
layout/reftests/css-selectors/reftest.list
layout/style/test/test_selectors.html
new file mode 100644
--- /dev/null
+++ b/layout/reftests/css-selectors/nth-child-1.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML>
+<html><head>
+    <meta charset="utf-8">
+    <title>Tests :nth-child(An+B) matching</title>
+    <style type="text/css">
+
+    div :nth-child(+/**/3n-2)  { color:white; }
+    div :nth-child(+3n/**/-2)  { background-color:black; }
+    div :nth-child(+3n/**/-2)  { font-size:12px; }
+    div :nth-child(+3n-/**/2)  { text-decoration: underline; }
+    div :nth-child(+3n-2/**/)  { border-left-width: 1px; }
+    div :nth-child(+3/**/n-2) { border-right-width: 1px; }
+    div :nth-child(+3n/**/-2) { border-top-width: 1px; }
+    div :nth-child(+3n/**/-2) { border-bottom-width: 1px; }
+    div :nth-child(+3n-/**/2) { border-style: solid; }
+    div :nth-child(+3n-2/**/) { border-color: blue; }
+
+    /* valid but will not match anything */
+    div :nth-child(-/**/n-2)  { color:red; }
+    div :nth-child(-n/**/-2)  { color:red; }
+    div :nth-child(-n/**/-2)  { color:red; }
+    div :nth-child(-n-/**/2)  { color:red; }
+    div :nth-child(-n-2/**/)  { color:red; }
+    div :nth-child(-1/**/n-2) { color:red; }
+    div :nth-child(-1n/**/-2) { color:red; }
+    div :nth-child(-1n/**/-2) { color:red; }
+    div :nth-child(-1n-/**/2) { color:red; }
+    div :nth-child(-1n-2/**/) { color:red; }
+
+    /* invalid */
+    div :nth-child(-/**/ n-2) { color:red; }
+    div :nth-child(- /**/n-2) { color:red; }
+    div :nth-child(+/**/ n-2) { color:red; }
+    div :nth-child(+ /**/n-2) { color:red; }
+
+    </style>
+</head>
+<body>
+
+<div><x>x</x><x>x</x><x>x</x><x>x</x><x>x</x><x>x</x><x>x</x><x>x</x><x>x</x><x>x</x><x>x</x></div>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/css-selectors/nth-child-2.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML>
+<html><head>
+    <meta charset="utf-8">
+    <title>Tests :nth-child(An+B) matching</title>
+    <style type="text/css">
+
+    div :nth-child(+/**/3N-2)  { color:white; }
+    div :nth-child(+3N/**/-2)  { background-color:black; }
+    div :nth-child(+3N/**/-2)  { font-size:12px; }
+    div :nth-child(+3N-/**/2)  { text-decoration: underline; }
+    div :nth-child(+3N-2/**/)  { border-left-width: 1px; }
+    div :nth-child(+3/**/N-2) { border-right-width: 1px; }
+    div :nth-child(+3N/**/-2) { border-top-width: 1px; }
+    div :nth-child(+3N/**/-2) { border-bottom-width: 1px; }
+    div :nth-child(+3N-/**/2) { border-style: solid; }
+    div :nth-child(+3N-2/**/) { border-color: blue; }
+
+    /* valid but will not match anything */
+    div :nth-child(-/**/N-2)  { color:red; }
+    div :nth-child(-N/**/-2)  { color:red; }
+    div :nth-child(-N/**/-2)  { color:red; }
+    div :nth-child(-N-/**/2)  { color:red; }
+    div :nth-child(-N-2/**/)  { color:red; }
+    div :nth-child(-1/**/N-2) { color:red; }
+    div :nth-child(-1N/**/-2) { color:red; }
+    div :nth-child(-1N/**/-2) { color:red; }
+    div :nth-child(-1N-/**/2) { color:red; }
+    div :nth-child(-1N-2/**/) { color:red; }
+
+    /* invalid */
+    div :nth-child(-/**/ N-2) { color:red; }
+    div :nth-child(- /**/N-2) { color:red; }
+    div :nth-child(+/**/ N-2) { color:red; }
+    div :nth-child(+ /**/N-2) { color:red; }
+
+    </style>
+</head>
+<body>
+
+<div><x>x</x><x>x</x><x>x</x><x>x</x><x>x</x><x>x</x><x>x</x><x>x</x><x>x</x><x>x</x><x>x</x></div>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/css-selectors/nth-child-ref.html
@@ -0,0 +1,25 @@
+<!DOCTYPE HTML>
+<html><head>
+    <meta charset="utf-8">
+    <title>Tests :nth-child(An+B) matching</title>
+    <style type="text/css">
+
+    x { color:white; }
+    x { background-color:black; }
+    x { font-size:12px; }
+    x { text-decoration: underline; }
+    x { border-left-width: 1px; }
+    x { border-right-width: 1px; }
+    x { border-top-width: 1px; }
+    x { border-bottom-width: 1px; }
+    x { border-style: solid; }
+    x { border-color: blue; }
+
+    </style>
+</head>
+<body>
+
+<div><x>x</x><y>x</y><y>x</y><x>x</x><y>x</y><y>x</y><x>x</x><y>x</y><y>x</y><x>x</x><y>x</y></div>
+
+</body>
+</html>
--- a/layout/reftests/css-selectors/reftest.list
+++ b/layout/reftests/css-selectors/reftest.list
@@ -1,4 +1,6 @@
 == state-dependent-in-any.html state-dependent-in-any-ref.html
 == attr-case-insensitive-1.html attr-case-insensitive-1-ref.html
 skip-if((B2G&&browserIsRemote)||Mulet) == sibling-combinators-on-anon-content-1.xhtml sibling-combinators-on-anon-content-ref.xhtml # Initial mulet triage: parity with B2G/B2G Desktop
 skip-if((B2G&&browserIsRemote)||Mulet) == sibling-combinators-on-anon-content-2.xhtml sibling-combinators-on-anon-content-ref.xhtml # Initial mulet triage: parity with B2G/B2G Desktop
+== nth-child-1.html nth-child-ref.html
+== nth-child-2.html nth-child-ref.html
--- a/layout/style/test/test_selectors.html
+++ b/layout/style/test/test_selectors.html
@@ -635,16 +635,40 @@ function run() {
     test_parseable(":nth-child(-1n/**/-2)");
     test_parseable(":nth-child(-1n/**/-2)");
     test_parseable(":nth-child(-1n-/**/2)");
     test_parseable(":nth-child(-1n-2/**/)");
     test_balanced_unparseable(":nth-child(-/**/ n-2)");
     test_balanced_unparseable(":nth-child(- /**/n-2)");
     test_balanced_unparseable(":nth-child(+/**/ n-2)");
     test_balanced_unparseable(":nth-child(+ /**/n-2)");
+    test_parseable(":nth-child(+/**/N-2)");
+    test_parseable(":nth-child(+N/**/-2)");
+    test_parseable(":nth-child(+N/**/-2)");
+    test_parseable(":nth-child(+N-/**/2)");
+    test_parseable(":nth-child(+N-2/**/)");
+    test_parseable(":nth-child(+1/**/N-2)");
+    test_parseable(":nth-child(+1N/**/-2)");
+    test_parseable(":nth-child(+1N/**/-2)");
+    test_parseable(":nth-child(+1N-/**/2)");
+    test_parseable(":nth-child(+1N-2/**/)");
+    test_parseable(":nth-child(-/**/N-2)");
+    test_parseable(":nth-child(-N/**/-2)");
+    test_parseable(":nth-child(-N/**/-2)");
+    test_parseable(":nth-child(-N-/**/2)");
+    test_parseable(":nth-child(-N-2/**/)");
+    test_parseable(":nth-child(-1/**/N-2)");
+    test_parseable(":nth-child(-1N/**/-2)");
+    test_parseable(":nth-child(-1N/**/-2)");
+    test_parseable(":nth-child(-1N-/**/2)");
+    test_parseable(":nth-child(-1N-2/**/)");
+    test_balanced_unparseable(":nth-child(-/**/ N-2)");
+    test_balanced_unparseable(":nth-child(- /**/N-2)");
+    test_balanced_unparseable(":nth-child(+/**/ N-2)");
+    test_balanced_unparseable(":nth-child(+ /**/N-2)");
     test_parseable(":nth-child( +n + 1 )");
     test_parseable(":nth-child( +/**/n + 1 )");
     test_parseable(":nth-child( -/**/2/**/n/**/+/**/4 )");
     test_balanced_unparseable(":nth-child( -/**/ 2/**/n/**/+/**/4 )");
     test_balanced_unparseable(":nth-child( -/**/2 /**/n/**/+/**/4 )");
     test_balanced_unparseable(":nth-child( -/**/2/**/ n/**/+/**/4 )");
     test_parseable(":nth-child( -/**/2/**/n /**/+/**/4 )");
     test_parseable(":nth-child( -/**/2/**/n/**/ +/**/4 )");