css: Add more currentcolor style tests

These tests check various situations with inheritance and
currentColor. In particular the caret-color test was not
working correctly before we handled used values explicitly.
This commit is contained in:
Matthias Clasen 2024-05-19 02:49:38 -04:00
parent f57010180c
commit e4325e5b2b
6 changed files with 75 additions and 0 deletions

View File

@ -0,0 +1,11 @@
.a {
color: red;
}
.b {
color: color-mix(in srgb, blue, currentcolor);
}
.c {
background-color: currentcolor;
}

View File

@ -0,0 +1,9 @@
window.a:dir(ltr)
color: rgb(255,0,0); /* currentcolor2.css:2:3-14 */
box.b:dir(ltr)
color: color(srgb 0.5 0 0.5); /* currentcolor2.css:6:3-49 */
label.c:dir(ltr)
color: color(srgb 0.25 0 0.75);
background-color: color(srgb 0.25 0 0.75); /* currentcolor2.css:10:3-34 */

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkWindow" id="window1">
<property name="can_focus">False</property>
<property name="decorated">0</property>
<property name="css-classes">a</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="css-classes">b</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="label" translatable="yes">Hello World!</property>
<property name="css-classes">c</property>
</object>
</child>
</object>
</child>
</object>
</interface>

View File

@ -0,0 +1,8 @@
entry {
caret-color: color-mix(in srgb, currentcolor, yellow 40%);
color: blue;
}
text {
color: red;
}

View File

@ -0,0 +1,13 @@
window.background:dir(ltr)
entry:dir(ltr)
color: rgb(0,0,255); /* currentcolor3.css:3:3-15 */
caret-color: color(srgb 0.4 0.4 0.6); /* currentcolor3.css:2:3-61 */
text:dir(ltr)
color: rgb(255,0,0); /* currentcolor3.css:7:3-14 */
caret-color: color(srgb 1 0.4 0);
undershoot.left:dir(ltr)
caret-color: color(srgb 1 0.4 0);
undershoot.right:dir(ltr)
caret-color: color(srgb 1 0.4 0);

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkWindow" id="window1">
<property name="can_focus">False</property>
<property name="decorated">0</property>
<child>
<object class="GtkEntry">
<property name="visible">True</property>
<property name="text" translatable="yes">Hello World!</property>
</object>
</child>
</object>
</interface>