[gtk/matthiasc/for-master: 7/7] Add tests for the css filter property




commit 1a6c7473021377418f56ed3ed89176fbfaff9670
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Feb 5 21:37:47 2021 -0500

    Add tests for the css filter property
    
    Test that we can parse filters and that we
    don't accept invalid filters.

 .../{invalid-filter1.css => filter-invalid1.css}   |  0
 testsuite/css/parser/filter-invalid1.errors        |  1 +
 ...lid-filter1.ref.css => filter-invalid1.ref.css} |  0
 testsuite/css/parser/filter-invalid2.css           |  3 +++
 testsuite/css/parser/filter-invalid2.errors        |  1 +
 testsuite/css/parser/filter-invalid2.ref.css       |  0
 testsuite/css/parser/filter-invalid3.css           |  3 +++
 testsuite/css/parser/filter-invalid3.errors        |  1 +
 testsuite/css/parser/filter-invalid3.ref.css       |  0
 testsuite/css/parser/filter-invalid4.css           |  3 +++
 testsuite/css/parser/filter-invalid4.errors        |  1 +
 testsuite/css/parser/filter-invalid4.ref.css       |  0
 testsuite/css/parser/filter-invalid5.css           |  3 +++
 testsuite/css/parser/filter-invalid5.errors        |  1 +
 testsuite/css/parser/filter-invalid5.ref.css       |  0
 testsuite/css/parser/filter-invalid6.css           |  3 +++
 testsuite/css/parser/filter-invalid6.errors        |  1 +
 testsuite/css/parser/filter-invalid6.ref.css       |  0
 testsuite/css/parser/filter-invalid7.css           |  3 +++
 testsuite/css/parser/filter-invalid7.errors        |  1 +
 testsuite/css/parser/filter-invalid7.ref.css       |  0
 testsuite/css/parser/filter-invalid8.css           |  3 +++
 testsuite/css/parser/filter-invalid8.errors        |  1 +
 testsuite/css/parser/filter-invalid8.ref.css       |  0
 testsuite/css/parser/filter-invalid9.css           |  3 +++
 testsuite/css/parser/filter-invalid9.errors        |  1 +
 testsuite/css/parser/filter-invalid9.ref.css       |  0
 testsuite/css/parser/filter.css                    | 23 +++++++++++++++++
 testsuite/css/parser/filter.ref.css                | 23 +++++++++++++++++
 testsuite/css/parser/invalid-filter1.errors        |  1 -
 testsuite/css/parser/meson.build                   | 29 ++++++++++++++++++++++
 31 files changed, 108 insertions(+), 1 deletion(-)
---
diff --git a/testsuite/css/parser/invalid-filter1.css b/testsuite/css/parser/filter-invalid1.css
similarity index 100%
rename from testsuite/css/parser/invalid-filter1.css
rename to testsuite/css/parser/filter-invalid1.css
diff --git a/testsuite/css/parser/filter-invalid1.errors b/testsuite/css/parser/filter-invalid1.errors
new file mode 100644
index 0000000000..27865aacf0
--- /dev/null
+++ b/testsuite/css/parser/filter-invalid1.errors
@@ -0,0 +1 @@
+filter-invalid1.css:2:20-21: error: GTK_CSS_PARSER_ERROR_SYNTAX
diff --git a/testsuite/css/parser/invalid-filter1.ref.css b/testsuite/css/parser/filter-invalid1.ref.css
similarity index 100%
rename from testsuite/css/parser/invalid-filter1.ref.css
rename to testsuite/css/parser/filter-invalid1.ref.css
diff --git a/testsuite/css/parser/filter-invalid2.css b/testsuite/css/parser/filter-invalid2.css
new file mode 100644
index 0000000000..3d83236fb0
--- /dev/null
+++ b/testsuite/css/parser/filter-invalid2.css
@@ -0,0 +1,3 @@
+a {
+  filter: brightness(-100%);
+}
diff --git a/testsuite/css/parser/filter-invalid2.errors b/testsuite/css/parser/filter-invalid2.errors
new file mode 100644
index 0000000000..5c23f1a7f2
--- /dev/null
+++ b/testsuite/css/parser/filter-invalid2.errors
@@ -0,0 +1 @@
+filter-invalid2.css:2:27-28: error: GTK_CSS_PARSER_ERROR_SYNTAX
diff --git a/testsuite/css/parser/filter-invalid2.ref.css b/testsuite/css/parser/filter-invalid2.ref.css
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/testsuite/css/parser/filter-invalid3.css b/testsuite/css/parser/filter-invalid3.css
new file mode 100644
index 0000000000..49640bf7fe
--- /dev/null
+++ b/testsuite/css/parser/filter-invalid3.css
@@ -0,0 +1,3 @@
+a {
+  filter: contrast(-100%);
+}
diff --git a/testsuite/css/parser/filter-invalid3.errors b/testsuite/css/parser/filter-invalid3.errors
new file mode 100644
index 0000000000..8d0f15fa77
--- /dev/null
+++ b/testsuite/css/parser/filter-invalid3.errors
@@ -0,0 +1 @@
+filter-invalid3.css:2:25-26: error: GTK_CSS_PARSER_ERROR_SYNTAX
diff --git a/testsuite/css/parser/filter-invalid3.ref.css b/testsuite/css/parser/filter-invalid3.ref.css
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/testsuite/css/parser/filter-invalid4.css b/testsuite/css/parser/filter-invalid4.css
new file mode 100644
index 0000000000..0cd2ab68b2
--- /dev/null
+++ b/testsuite/css/parser/filter-invalid4.css
@@ -0,0 +1,3 @@
+a {
+  filter: grayscale(-100%);
+}
diff --git a/testsuite/css/parser/filter-invalid4.errors b/testsuite/css/parser/filter-invalid4.errors
new file mode 100644
index 0000000000..3e40f6526b
--- /dev/null
+++ b/testsuite/css/parser/filter-invalid4.errors
@@ -0,0 +1 @@
+filter-invalid4.css:2:26-27: error: GTK_CSS_PARSER_ERROR_SYNTAX
diff --git a/testsuite/css/parser/filter-invalid4.ref.css b/testsuite/css/parser/filter-invalid4.ref.css
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/testsuite/css/parser/filter-invalid5.css b/testsuite/css/parser/filter-invalid5.css
new file mode 100644
index 0000000000..ccdc682b8e
--- /dev/null
+++ b/testsuite/css/parser/filter-invalid5.css
@@ -0,0 +1,3 @@
+a {
+  filter: invert(-100%);
+}
diff --git a/testsuite/css/parser/filter-invalid5.errors b/testsuite/css/parser/filter-invalid5.errors
new file mode 100644
index 0000000000..b20ae843a5
--- /dev/null
+++ b/testsuite/css/parser/filter-invalid5.errors
@@ -0,0 +1 @@
+filter-invalid5.css:2:23-24: error: GTK_CSS_PARSER_ERROR_SYNTAX
diff --git a/testsuite/css/parser/filter-invalid5.ref.css b/testsuite/css/parser/filter-invalid5.ref.css
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/testsuite/css/parser/filter-invalid6.css b/testsuite/css/parser/filter-invalid6.css
new file mode 100644
index 0000000000..3aa37e0e51
--- /dev/null
+++ b/testsuite/css/parser/filter-invalid6.css
@@ -0,0 +1,3 @@
+a {
+  filter: opacity(-100%);
+}
diff --git a/testsuite/css/parser/filter-invalid6.errors b/testsuite/css/parser/filter-invalid6.errors
new file mode 100644
index 0000000000..b6f26a9832
--- /dev/null
+++ b/testsuite/css/parser/filter-invalid6.errors
@@ -0,0 +1 @@
+filter-invalid6.css:2:24-25: error: GTK_CSS_PARSER_ERROR_SYNTAX
diff --git a/testsuite/css/parser/filter-invalid6.ref.css b/testsuite/css/parser/filter-invalid6.ref.css
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/testsuite/css/parser/filter-invalid7.css b/testsuite/css/parser/filter-invalid7.css
new file mode 100644
index 0000000000..7e0e7a3835
--- /dev/null
+++ b/testsuite/css/parser/filter-invalid7.css
@@ -0,0 +1,3 @@
+a {
+  filter: saturate(-100%);
+}
diff --git a/testsuite/css/parser/filter-invalid7.errors b/testsuite/css/parser/filter-invalid7.errors
new file mode 100644
index 0000000000..981124d401
--- /dev/null
+++ b/testsuite/css/parser/filter-invalid7.errors
@@ -0,0 +1 @@
+filter-invalid7.css:2:25-26: error: GTK_CSS_PARSER_ERROR_SYNTAX
diff --git a/testsuite/css/parser/filter-invalid7.ref.css b/testsuite/css/parser/filter-invalid7.ref.css
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/testsuite/css/parser/filter-invalid8.css b/testsuite/css/parser/filter-invalid8.css
new file mode 100644
index 0000000000..c5d000c349
--- /dev/null
+++ b/testsuite/css/parser/filter-invalid8.css
@@ -0,0 +1,3 @@
+a {
+  filter: sepia(-100%);
+}
diff --git a/testsuite/css/parser/filter-invalid8.errors b/testsuite/css/parser/filter-invalid8.errors
new file mode 100644
index 0000000000..5c1de0d383
--- /dev/null
+++ b/testsuite/css/parser/filter-invalid8.errors
@@ -0,0 +1 @@
+filter-invalid8.css:2:22-23: error: GTK_CSS_PARSER_ERROR_SYNTAX
diff --git a/testsuite/css/parser/filter-invalid8.ref.css b/testsuite/css/parser/filter-invalid8.ref.css
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/testsuite/css/parser/filter-invalid9.css b/testsuite/css/parser/filter-invalid9.css
new file mode 100644
index 0000000000..beaf0b2ef3
--- /dev/null
+++ b/testsuite/css/parser/filter-invalid9.css
@@ -0,0 +1,3 @@
+a {
+  filter: drop-shadow(none);
+}
diff --git a/testsuite/css/parser/filter-invalid9.errors b/testsuite/css/parser/filter-invalid9.errors
new file mode 100644
index 0000000000..47893d496e
--- /dev/null
+++ b/testsuite/css/parser/filter-invalid9.errors
@@ -0,0 +1 @@
+filter-invalid9.css:2:23-27: error: GTK_CSS_PARSER_ERROR_SYNTAX
diff --git a/testsuite/css/parser/filter-invalid9.ref.css b/testsuite/css/parser/filter-invalid9.ref.css
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/testsuite/css/parser/filter.css b/testsuite/css/parser/filter.css
new file mode 100644
index 0000000000..8a114e590a
--- /dev/null
+++ b/testsuite/css/parser/filter.css
@@ -0,0 +1,23 @@
+a {
+  filter: initial;
+}
+
+b {
+  filter: inherit;
+}
+
+c {
+  filter: unset;
+}
+
+d {
+  filter: none;
+}
+
+e {
+  filter: blur(2px) brightness(20%) contrast(120%) grayscale(100%) hue-rotate(45deg) invert(50%) 
opacity(25%) saturate(90%) sepia(100%);
+}
+
+f {
+  filter: drop-shadow(rgb(255,0,0) 1px 2px);
+}
diff --git a/testsuite/css/parser/filter.ref.css b/testsuite/css/parser/filter.ref.css
new file mode 100644
index 0000000000..70b733b325
--- /dev/null
+++ b/testsuite/css/parser/filter.ref.css
@@ -0,0 +1,23 @@
+a {
+  filter: initial;
+}
+
+b {
+  filter: inherit;
+}
+
+c {
+  filter: unset;
+}
+
+d {
+  filter: none;
+}
+
+e {
+  filter: blur(2px) brightness(20%) contrast(120%) grayscale(100%) hue-rotate(45deg) invert(50%) 
opacity(25%) saturate(90%) sepia(100%);
+}
+
+f {
+  filter: drop_shadow(1px 2px rgb(255,0,0));
+}
diff --git a/testsuite/css/parser/meson.build b/testsuite/css/parser/meson.build
index b398251450..2d476f018d 100644
--- a/testsuite/css/parser/meson.build
+++ b/testsuite/css/parser/meson.build
@@ -311,6 +311,35 @@ test_data = [
   'doubled.css',
   'doubled.ref.css',
   'empty.css',
+  'filter.css',
+  'filter.ref.css',
+  'filter-invalid1.css',
+  'filter-invalid1.errors',
+  'filter-invalid1.ref.css',
+  'filter-invalid2.css',
+  'filter-invalid2.errors',
+  'filter-invalid2.ref.css',
+  'filter-invalid3.css',
+  'filter-invalid3.errors',
+  'filter-invalid3.ref.css',
+  'filter-invalid4.css',
+  'filter-invalid4.errors',
+  'filter-invalid4.ref.css',
+  'filter-invalid5.css',
+  'filter-invalid5.errors',
+  'filter-invalid5.ref.css',
+  'filter-invalid6.css',
+  'filter-invalid6.errors',
+  'filter-invalid6.ref.css',
+  'filter-invalid7.css',
+  'filter-invalid7.errors',
+  'filter-invalid7.ref.css',
+  'filter-invalid8.css',
+  'filter-invalid8.errors',
+  'filter-invalid8.ref.css',
+  'filter-invalid9.css',
+  'filter-invalid9.errors',
+  'filter-invalid9.ref.css',
   'font-family.css',
   'font-family.ref.css',
   'font-size.css',


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]