summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2018-03-01 01:08:05 +0100
committerBenjamin Otte <otte@redhat.com>2018-03-02 02:00:24 +0100
commit4ac3f916d0f56a6def2f0d897e4c11689d4736b2 (patch)
treea444b88f22353efe7d238a9c906c5a0113950298 /testsuite
parent67b959f1a749eea74810ba71e06dd23fb284f854 (diff)
downloadgtk+-4ac3f916d0f56a6def2f0d897e4c11689d4736b2.tar.gz
css: Parse hex colors with alpha value
The CSS color spec version 4 introduces this, support has hit Safari, Chrome and Firefox, so this looks like a feature that's here to stay. https://drafts.csswg.org/css-color/#hex-notation
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/css/parser/color.css20
-rw-r--r--testsuite/css/parser/color.ref.css20
-rw-r--r--testsuite/css/parser/colors-errors.css12
-rw-r--r--testsuite/css/parser/colors-errors.errors1
-rw-r--r--testsuite/css/parser/colors-errors.ref.css3
5 files changed, 32 insertions, 24 deletions
diff --git a/testsuite/css/parser/color.css b/testsuite/css/parser/color.css
index 38e5448cc7..6350bfb1c6 100644
--- a/testsuite/css/parser/color.css
+++ b/testsuite/css/parser/color.css
@@ -37,29 +37,37 @@ i {
}
j {
- color: #012345;
+ color: #0123;
}
k {
- color: lighter(red);
+ color: #012345;
}
l {
- color: darker(red);
+ color: #FFEEDDCC;
}
m {
- color: shade(green,0.5);
+ color: lighter(red);
}
n {
- color: alpha(green,0.5);
+ color: darker(red);
}
o {
- color: mix(red,blue,0.25);
+ color: shade(green,0.5);
}
p {
+ color: alpha(green,0.5);
+}
+
+q {
+ color: mix(red,blue,0.25);
+}
+
+r {
color: @mygreen;
}
diff --git a/testsuite/css/parser/color.ref.css b/testsuite/css/parser/color.ref.css
index ee6faf116d..7ce7ed626e 100644
--- a/testsuite/css/parser/color.ref.css
+++ b/testsuite/css/parser/color.ref.css
@@ -37,29 +37,37 @@ i {
}
j {
- color: rgb(1,35,69);
+ color: rgba(0,17,34,0.2);
}
k {
- color: shade(rgb(255,0,0), 1.3);
+ color: rgb(1,35,69);
}
l {
- color: shade(rgb(255,0,0), 0.69999999999999996);
+ color: rgba(255,238,221,0.8);
}
m {
- color: shade(rgb(0,128,0), 0.5);
+ color: shade(rgb(255,0,0), 1.3);
}
n {
- color: alpha(rgb(0,128,0), 0.5);
+ color: shade(rgb(255,0,0), 0.69999999999999996);
}
o {
- color: mix(rgb(255,0,0), rgb(0,0,255), 0.25);
+ color: shade(rgb(0,128,0), 0.5);
}
p {
+ color: alpha(rgb(0,128,0), 0.5);
+}
+
+q {
+ color: mix(rgb(255,0,0), rgb(0,0,255), 0.25);
+}
+
+r {
color: @mygreen;
}
diff --git a/testsuite/css/parser/colors-errors.css b/testsuite/css/parser/colors-errors.css
index d5dd178cab..4f7f3f938d 100644
--- a/testsuite/css/parser/colors-errors.css
+++ b/testsuite/css/parser/colors-errors.css
@@ -7,25 +7,21 @@ b {
}
c {
- color: #1234;
-}
-
-d {
color: #12345;
}
-e {
+d {
color: #1234567;
}
-f {
+e {
color: notacolorname;
}
-g {
+f {
color: rgb(1,2,3,4);
}
-h {
+g {
color: rgba(1,2,3,4,5);
}
diff --git a/testsuite/css/parser/colors-errors.errors b/testsuite/css/parser/colors-errors.errors
index 02e9c2b367..dddf389837 100644
--- a/testsuite/css/parser/colors-errors.errors
+++ b/testsuite/css/parser/colors-errors.errors
@@ -5,4 +5,3 @@ colors-errors.css:14: error: GTK_CSS_PROVIDER_ERROR_SYNTAX
colors-errors.css:18: error: GTK_CSS_PROVIDER_ERROR_SYNTAX
colors-errors.css:22: error: GTK_CSS_PROVIDER_ERROR_SYNTAX
colors-errors.css:26: error: GTK_CSS_PROVIDER_ERROR_SYNTAX
-colors-errors.css:30: error: GTK_CSS_PROVIDER_ERROR_SYNTAX
diff --git a/testsuite/css/parser/colors-errors.ref.css b/testsuite/css/parser/colors-errors.ref.css
index cfb1eff431..e458bcfc14 100644
--- a/testsuite/css/parser/colors-errors.ref.css
+++ b/testsuite/css/parser/colors-errors.ref.css
@@ -18,6 +18,3 @@ f {
g {
}
-
-h {
-}