summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2019-12-02 17:31:15 +0100
committerBenjamin Otte <otte@redhat.com>2019-12-03 18:12:25 +0100
commit292371932b5aa8221ad7ec64693b075b7985914e (patch)
tree81477e21f00e41c37c30554464963b3877519bde /testsuite
parent564e8f483c6c196634c16f90dc4c2af43cb98155 (diff)
downloadgtk+-292371932b5aa8221ad7ec64693b075b7985914e.tar.gz
css: Handle invalid :not() selectors
We weren't correctly ending the ( ) block when encountering an error. Testcases added. Fixes #2281
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/css/parser/meson.build3
-rw-r--r--testsuite/css/parser/not-unclosed.css3
-rw-r--r--testsuite/css/parser/not-unclosed.errors3
-rw-r--r--testsuite/css/parser/not-unclosed.ref.css0
4 files changed, 9 insertions, 0 deletions
diff --git a/testsuite/css/parser/meson.build b/testsuite/css/parser/meson.build
index 1e171aaa36..607faab0bb 100644
--- a/testsuite/css/parser/meson.build
+++ b/testsuite/css/parser/meson.build
@@ -369,6 +369,9 @@ test_data = [
'no-semicolon.ref.css',
'not.css',
'not.ref.css',
+ 'not-unclosed.css',
+ 'not-unclosed.errors',
+ 'not-unclosed.ref.css',
'nth-child.css',
'nth-child.ref.css',
'opacity.css',
diff --git a/testsuite/css/parser/not-unclosed.css b/testsuite/css/parser/not-unclosed.css
new file mode 100644
index 0000000000..06a801146c
--- /dev/null
+++ b/testsuite/css/parser/not-unclosed.css
@@ -0,0 +1,3 @@
+:not(valid invalid) {}
+
+:not(
diff --git a/testsuite/css/parser/not-unclosed.errors b/testsuite/css/parser/not-unclosed.errors
new file mode 100644
index 0000000000..f83d9d7a2b
--- /dev/null
+++ b/testsuite/css/parser/not-unclosed.errors
@@ -0,0 +1,3 @@
+not-unclosed.css:1:12-19: error: GTK_CSS_PARSER_ERROR_SYNTAX
+not-unclosed.css:4:1: error: GTK_CSS_PARSER_ERROR_SYNTAX
+not-unclosed.css:3:2-4:1: error: GTK_CSS_PARSER_WARNING_SYNTAX
diff --git a/testsuite/css/parser/not-unclosed.ref.css b/testsuite/css/parser/not-unclosed.ref.css
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/testsuite/css/parser/not-unclosed.ref.css