]> Pileus Git - ~andy/gtk/commitdiff
reftests: add a reftest for the CSS :only-child selector
authorCosimo Cecchi <cosimoc@gnome.org>
Tue, 4 Oct 2011 15:46:25 +0000 (11:46 -0400)
committerCosimo Cecchi <cosimoc@gnome.org>
Tue, 4 Oct 2011 15:48:20 +0000 (11:48 -0400)
https://bugzilla.gnome.org/show_bug.cgi?id=660833

tests/reftests/Makefile.am
tests/reftests/style-properties-only-child.css [new file with mode: 0644]
tests/reftests/style-properties-only-child.ref.ui [new file with mode: 0644]
tests/reftests/style-properties-only-child.ui [new file with mode: 0644]

index 767a4692d3db0a351f8746d0f1ff1613c3b41d30..844643a4914b3fd45be7510166e811f1edd9aae9 100644 (file)
@@ -152,6 +152,9 @@ EXTRA_DIST += \
        style-properties-nth-child.css \
        style-properties-nth-child.ref.ui \
        style-properties-nth-child.ui \
+       style-properties-only-child.css \
+       style-properties-only-child.ref.ui \
+       style-properties-only-child.ui \
        toplevel-vs-popup.ref.ui \
        toplevel-vs-popup.ui \
        unresolvable.css \
diff --git a/tests/reftests/style-properties-only-child.css b/tests/reftests/style-properties-only-child.css
new file mode 100644 (file)
index 0000000..e652ef7
--- /dev/null
@@ -0,0 +1,9 @@
+.only-child-ref:nth-child(first):nth-child(last) {
+    color: blue;
+    background-color: red;
+}
+
+.only-child-notref:only-child {
+    color: blue;
+    background-color: red;
+}
diff --git a/tests/reftests/style-properties-only-child.ref.ui b/tests/reftests/style-properties-only-child.ref.ui
new file mode 100644 (file)
index 0000000..ff05332
--- /dev/null
@@ -0,0 +1,32 @@
+<?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>
+    <property name="width_request">300</property>
+    <property name="height_request">300</property>
+    <child>
+      <object class="GtkBox" id="box1">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkButton" id="button1">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="label">Foo</property>
+            <style>
+              <class name="only-child-ref"/>
+            </style>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/tests/reftests/style-properties-only-child.ui b/tests/reftests/style-properties-only-child.ui
new file mode 100644 (file)
index 0000000..0f769cf
--- /dev/null
@@ -0,0 +1,32 @@
+<?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>
+    <property name="width_request">300</property>
+    <property name="height_request">300</property>
+    <child>
+      <object class="GtkBox" id="box1">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkButton" id="button1">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="label">Foo</property>
+            <style>
+              <class name="only-child-notref"/>
+            </style>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>