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 e98cac7849
commit 1681e2e671
6 changed files with 75 additions and 0 deletions

View File

@ -0,0 +1,11 @@
.a {
color: red;
}
.b {
color: mix(blue, currentcolor, 0.5);
}
.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: rgb(128,0,128); /* currentcolor2.css:6:3-39 */
label.c:dir(ltr)
color: rgb(64,0,191);
background-color: rgb(64,0,191); /* 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: mix(currentcolor, yellow, 0.4);
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: rgb(102,102,153); /* currentcolor3.css:2:3-47 */
text:dir(ltr)
color: rgb(255,0,0); /* currentcolor3.css:7:3-14 */
caret-color: rgb(255,102,0);
undershoot.left:dir(ltr)
caret-color: rgb(255,102,0);
undershoot.right:dir(ltr)
caret-color: rgb(255,102,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>