[gtk+/parser] reftests: Add a test for descendant CSS selectors match



commit 40169649e28802b3e6f8934e0c9c04af271e2335
Author: Benjamin Otte <otte redhat com>
Date:   Sun May 15 13:24:10 2011 +0200

    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.

 tests/reftests/Makefile.am                       |    3 ++
 tests/reftests/css-match-descendant-later.css    |   11 ++++++
 tests/reftests/css-match-descendant-later.ref.ui |   19 ++++++++++
 tests/reftests/css-match-descendant-later.ui     |   43 ++++++++++++++++++++++
 4 files changed, 76 insertions(+), 0 deletions(-)
---
diff --git a/tests/reftests/Makefile.am b/tests/reftests/Makefile.am
index e6a4d4c..8be11df 100644
--- a/tests/reftests/Makefile.am
+++ b/tests/reftests/Makefile.am
@@ -31,6 +31,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 \
diff --git a/tests/reftests/css-match-descendant-later.css b/tests/reftests/css-match-descendant-later.css
new file mode 100644
index 0000000..421b6d4
--- /dev/null
+++ b/tests/reftests/css-match-descendant-later.css
@@ -0,0 +1,11 @@
+GtkEventBox {
+  background-color: blue
+}
+
+GtkGrid GtkEventBox {
+  background-color: red
+}
+
+GtkWindow > GtkGrid GtkEventBox {
+  background-color: blue
+}
diff --git a/tests/reftests/css-match-descendant-later.ref.ui b/tests/reftests/css-match-descendant-later.ref.ui
new file mode 100644
index 0000000..1afc99b
--- /dev/null
+++ b/tests/reftests/css-match-descendant-later.ref.ui
@@ -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>
diff --git a/tests/reftests/css-match-descendant-later.ui b/tests/reftests/css-match-descendant-later.ui
new file mode 100644
index 0000000..68c8f58
--- /dev/null
+++ b/tests/reftests/css-match-descendant-later.ui
@@ -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>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]