reftests: Add a test for descendant CSS selectors match

In widget hierarchy like "Foo Bar Bar Baz", we want the selector "Foo >
Bar Baz" to match, because it matches the elements 1, 2 and 4.
Previously, the selector only matches the Bar at position 3 and then
failed because it wasn't preceded by a Foo.
This commit is contained in:
Benjamin Otte 2011-05-15 13:24:10 +02:00
parent 806c804271
commit f3ed498c5b
4 changed files with 76 additions and 0 deletions

View File

@ -32,6 +32,9 @@ EXTRA_DIST += \
css-match-class.css \
css-match-class.ref.ui \
css-match-class.ui \
css-match-descendant-later.css \
css-match-descendant-later.ref.ui \
css-match-descendant-later.ui \
css-match-name.css \
css-match-name.ref.ui \
css-match-name.ui \

View File

@ -0,0 +1,11 @@
GtkEventBox {
background-color: blue
}
GtkGrid GtkEventBox {
background-color: red
}
GtkWindow > GtkGrid GtkEventBox {
background-color: blue
}

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkWindow" id="window1">
<property name="can_focus">False</property>
<property name="type">popup</property>
<child>
<object class="GtkEventBox" id="eventbox1">
<property name="width_request">10</property>
<property name="height_request">10</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
</object>
</child>
</object>
</interface>

View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkWindow" id="window1">
<property name="can_focus">False</property>
<property name="type">popup</property>
<child>
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkGrid" id="grid2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkEventBox" id="eventbox1">
<property name="width_request">10</property>
<property name="height_request">10</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
</child>
</object>
</interface>