From d115441a57d6bec49b43a40dee885647b8afbf99 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sun, 18 Mar 2012 02:53:44 +0100 Subject: [PATCH] reftests: Add a reftest for nth-child Prime numbers are fun. --- tests/reftests/Makefile.am | 3 + tests/reftests/nth-child.css | 148 +++++++++++++++ tests/reftests/nth-child.ref.ui | 289 +++++++++++++++++++++++++++++ tests/reftests/nth-child.ui | 314 ++++++++++++++++++++++++++++++++ 4 files changed, 754 insertions(+) create mode 100644 tests/reftests/nth-child.css create mode 100644 tests/reftests/nth-child.ref.ui create mode 100644 tests/reftests/nth-child.ui diff --git a/tests/reftests/Makefile.am b/tests/reftests/Makefile.am index 6b13388066..2c5fe8c013 100644 --- a/tests/reftests/Makefile.am +++ b/tests/reftests/Makefile.am @@ -185,6 +185,9 @@ EXTRA_DIST += \ nonresizable-size.ui \ notebook-childproperties.ui \ notebook-childproperties.ref.ui \ + nth-child.css \ + nth-child.ref.ui \ + nth-child.ui \ paned-undersized.css \ paned-undersized.ref.ui \ paned-undersized.ui \ diff --git a/tests/reftests/nth-child.css b/tests/reftests/nth-child.css new file mode 100644 index 0000000000..4b177eb8cf --- /dev/null +++ b/tests/reftests/nth-child.css @@ -0,0 +1,148 @@ +/* For nth-child, we have a custom rule for every multiple of + * the prime numbers. + * For nth-last-child, we also color the prime number itself. + */ + +:nth-child(2n+2), +:nth-last-child(-2n+200) { + color: blue; +} + +:nth-child(3n+3), +:nth-last-child(3n-300) { + font-weight: bold; +} + +:nth-child(5n+5), +:nth-last-child(-5n+500) { + font-style: italic; +} + +:nth-child(7n+7), +:nth-last-child(7n-700) { + text-shadow: red 1 1; +} + +:nth-child(11n+11), +:nth-last-child(-11n+1100) { + text-shadow: green 1 1; +} + +#ref1 { + font-style: italic; +} + +#ref2 { + color: blue; + font-weight: bold; +} + +#ref3 { +} + +#ref4 { + color: blue; + text-shadow: green 1 1; +} + +#ref5 { + font-weight: bold; + text-shadow: red 1 1; +} + +#ref6 { + color: blue; + font-weight: bold; + font-style: italic; +} + +#ref7 { +} + +#ref8 { + color: blue; + font-weight: bold; +} + +#ref9 { + font-weight: bold; +} + +#ref10 { + color: blue; + font-style: italic; +} + +#ref11 { + font-weight: bold; + font-style: italic; +} + +#ref12 { + color: blue; + font-weight: bold; + text-shadow: red 1 1; +} + +#ref13 { +} + +#ref14 { + color: blue; + font-weight: bold; + text-shadow: red 1 1; +} + +#ref15 { + font-weight: bold; + font-style: italic; + text-shadow: green 1 1; +} + +#ref16 { + color: blue; + font-style: italic; +} + +#ref17 { + font-weight: bold; +} + +#ref18 { + color: blue; + font-weight: bold; +} + +#ref19 { + text-shadow: red 1 1; +} + +#ref20 { + color: blue; + font-weight: bold; + font-style: italic; +} + +#ref21 { + font-weight: bold; + font-style: italic; + text-shadow: red 1 1; +} + +#ref22 { + color: blue; + text-shadow: green 1 1; +} + +#ref23 { + font-weight: bold; +} + +#ref24 { + color: blue; + font-weight: bold; +} + +#ref25 { + font-style: italic; +} diff --git a/tests/reftests/nth-child.ref.ui b/tests/reftests/nth-child.ref.ui new file mode 100644 index 0000000000..f0481bc62d --- /dev/null +++ b/tests/reftests/nth-child.ref.ui @@ -0,0 +1,289 @@ + + + + + False + + + True + False + vertical + + + True + False + 1 + ref1 + + + 0 + + + + + True + False + 2 + ref2 + + + 1 + + + + + True + False + 3 + ref3 + + + 2 + + + + + True + False + 4 = 2 * 2 + ref4 + + + 3 + + + + + True + False + 5 + ref5 + + + 4 + + + + + True + False + 6 = 2 * 3 + ref6 + + + 5 + + + + + True + False + 7 + ref7 + + + 6 + + + + + True + False + 8 = 2 * 2 * 2 + ref8 + + + 7 + + + + + True + False + 9 = 3 * 3 + ref9 + + + 8 + + + + + True + False + 10 = 2 * 5 + ref10 + + + 9 + + + + + True + False + 11 + ref11 + + + 10 + + + + + True + False + 12 = 2 * 2 * 3 + ref12 + + + 11 + + + + + True + False + 13 + ref13 + + + 12 + + + + + True + False + 14 = 2 * 7 + ref14 + + + 13 + + + + + True + False + 15 = 3 * 5 + ref15 + + + 14 + + + + + True + False + 16 = 2 * 2 * 2 * 2 + ref16 + + + 15 + + + + + True + False + 17 + ref17 + + + 16 + + + + + True + False + 18 = 2 * 3 * 3 + ref18 + + + 17 + + + + + True + False + 19 + ref19 + + + 18 + + + + + True + False + 20 = 2 * 2 * 5 + ref20 + + + 19 + + + + + True + False + 21 = 3 * 7 + ref21 + + + 20 + + + + + True + False + 22 = 2 * 11 + ref22 + + + 21 + + + + + True + False + 23 + ref23 + + + 22 + + + + + True + False + 24 = 2 * 2 * 2 * 3 + ref24 + + + 23 + + + + + True + False + 25 = 5 * 5 + ref25 + + + 24 + + + + + + diff --git a/tests/reftests/nth-child.ui b/tests/reftests/nth-child.ui new file mode 100644 index 0000000000..fd9e503fe4 --- /dev/null +++ b/tests/reftests/nth-child.ui @@ -0,0 +1,314 @@ + + + + + False + + + True + False + vertical + + + True + False + 1 + + + False + True + 0 + + + + + True + False + 2 + + + False + True + 1 + + + + + True + False + 3 + + + False + True + 2 + + + + + True + False + 4 = 2 * 2 + + + False + True + 3 + + + + + True + False + 5 + + + False + True + 4 + + + + + True + False + 6 = 2 * 3 + + + False + True + 5 + + + + + True + False + 7 + + + False + True + 6 + + + + + True + False + 8 = 2 * 2 * 2 + + + False + True + 7 + + + + + True + False + 9 = 3 * 3 + + + False + True + 8 + + + + + True + False + 10 = 2 * 5 + + + False + True + 9 + + + + + True + False + 11 + + + False + True + 10 + + + + + True + False + 12 = 2 * 2 * 3 + + + False + True + 11 + + + + + True + False + 13 + + + False + True + 12 + + + + + True + False + 14 = 2 * 7 + + + False + True + 13 + + + + + True + False + 15 = 3 * 5 + + + False + True + 14 + + + + + True + False + 16 = 2 * 2 * 2 * 2 + + + False + True + 15 + + + + + True + False + 17 + + + False + True + 16 + + + + + True + False + 18 = 2 * 3 * 3 + + + False + True + 17 + + + + + True + False + 19 + + + False + True + 18 + + + + + True + False + 20 = 2 * 2 * 5 + + + False + True + 19 + + + + + True + False + 21 = 3 * 7 + + + False + True + 20 + + + + + True + False + 22 = 2 * 11 + + + False + True + 21 + + + + + True + False + 23 + + + False + True + 22 + + + + + True + False + 24 = 2 * 2 * 2 * 3 + + + False + True + 23 + + + + + True + False + 25 = 5 * 5 + + + False + True + 24 + + + + + +