[gtk/matthiasc/css-change-tracking-5: 10/10] Add another css change testcase



commit 1125ff6174bd6f2e47eb7ed90a0e63b2f61b0351
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jan 18 12:13:31 2020 -0500

    Add another css change testcase
    
    This one tests selectors similar to the ones we are using
    for linked buttons and entries, involving siblings and
    :first-child/:last-child.

 testsuite/css/change/meson.build |  1 +
 testsuite/css/change/test6.css   | 19 +++++++++++++++++++
 testsuite/css/change/test6.nodes | 12 ++++++++++++
 testsuite/css/change/test6.ui    | 34 ++++++++++++++++++++++++++++++++++
 4 files changed, 66 insertions(+)
---
diff --git a/testsuite/css/change/meson.build b/testsuite/css/change/meson.build
index 59a2562710..90195d631c 100644
--- a/testsuite/css/change/meson.build
+++ b/testsuite/css/change/meson.build
@@ -25,6 +25,7 @@ test_data = [
   'test3.css', 'test3.ui', 'test3.nodes',
   'test4.css', 'test4.ui', 'test4.nodes',
   'test5.css', 'test5.ui', 'test5.nodes',
+  'test6.css', 'test6.ui', 'test6.nodes',
 ]
 
 if get_option('install-tests')
diff --git a/testsuite/css/change/test6.css b/testsuite/css/change/test6.css
new file mode 100644
index 0000000000..9b49086829
--- /dev/null
+++ b/testsuite/css/change/test6.css
@@ -0,0 +1,19 @@
+/* a simplified version of some of the things we do for linked buttons and entries */
+
+box:not(.vertical).linked > button:not(:first-child) {
+  border-top-left-radius: 0;
+  border-bottom-left-radius: 0;
+}
+
+box:not(.vertical).linked > button:not(:last-child) {
+  border-top-right-radius: 0;
+  border-bottom-right-radius: 0;
+}
+
+box:not(.vetical).linked > *:disabled ~ entry:disabled {
+  border-left-color: red;
+}
+
+box:not(.vetical).linked > entry:focus + button {
+  border-left-color: blue;
+}
diff --git a/testsuite/css/change/test6.nodes b/testsuite/css/change/test6.nodes
new file mode 100644
index 0000000000..60a5d85e85
--- /dev/null
+++ b/testsuite/css/change/test6.nodes
@@ -0,0 +1,12 @@
+window.background:dir(ltr)    
+  decoration:dir(ltr)    
+  box.horizontal.linked:dir(ltr)    
+    button:dir(ltr)    name|first-child|last-child|parent-class|parent-name
+    button:dir(ltr)    name|first-child|last-child|sibling-name|sibling-state|parent-class|parent-name
+    button:dir(ltr)    name|first-child|last-child|sibling-name|sibling-state|parent-class|parent-name
+  box.horizontal.linked:dir(ltr)    
+    entry:dir(ltr)    
+      text:dir(ltr)    
+        undershoot.left:dir(ltr)    
+        undershoot.right:dir(ltr)    
+    button:dir(ltr)    name|first-child|last-child|sibling-name|sibling-state|parent-class|parent-name
diff --git a/testsuite/css/change/test6.ui b/testsuite/css/change/test6.ui
new file mode 100644
index 0000000000..779c82628b
--- /dev/null
+++ b/testsuite/css/change/test6.ui
@@ -0,0 +1,34 @@
+
+<?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="GtkBox">
+        <style><class name="linked"/></style>
+        <child>
+          <object class="GtkButton"/>
+        </child>
+        <child>
+          <object class="GtkButton"/>
+        </child>
+        <child>
+          <object class="GtkButton"/>
+        </child>
+      </object>
+    </child>
+    <child>
+      <object class="GtkBox">
+        <style><class name="linked"/></style>
+        <child>
+          <object class="GtkEntry"/>
+        </child>
+        <child>
+          <object class="GtkButton"/>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>


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