summaryrefslogtreecommitdiff
path: root/testsuite/reftests
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2014-12-21 21:30:51 +0100
committerBenjamin Otte <otte@redhat.com>2015-01-07 14:26:48 +0100
commitad199e4cf96592fb57d0a58861270d82b0a453d3 (patch)
tree66a854b0610b896ca06629520c819a6b7b4062cb /testsuite/reftests
parent26f36ef8aefb81c3d87f4c577a248efd77733e2d (diff)
downloadgtk+-ad199e4cf96592fb57d0a58861270d82b0a453d3.tar.gz
stylecontext: Use correct parent style for lookups
After 3a337156d11a86c7a88f1f30a09276fdf6f63008 style lookups still used the parent context's style as the parent style, even though after a gtk_style_context_save() the root style of the style context is the proper parent. Testcase attached.
Diffstat (limited to 'testsuite/reftests')
-rw-r--r--testsuite/reftests/Makefile.am3
-rw-r--r--testsuite/reftests/style-context-save-inheritance.css18
-rw-r--r--testsuite/reftests/style-context-save-inheritance.ref.ui19
-rw-r--r--testsuite/reftests/style-context-save-inheritance.ui18
4 files changed, 58 insertions, 0 deletions
diff --git a/testsuite/reftests/Makefile.am b/testsuite/reftests/Makefile.am
index b4b2bc89f7..1577dade4b 100644
--- a/testsuite/reftests/Makefile.am
+++ b/testsuite/reftests/Makefile.am
@@ -397,6 +397,9 @@ testdata = \
sizegroups-get-preferred-null.ref.ui \
statusbar-remove-all.ref.ui \
statusbar-remove-all.ui \
+ style-context-save-inheritance.css \
+ style-context-save-inheritance.ref.ui \
+ style-context-save-inheritance.ui \
style-properties-nth-child.css \
style-properties-nth-child.ref.ui \
style-properties-nth-child.ui \
diff --git a/testsuite/reftests/style-context-save-inheritance.css b/testsuite/reftests/style-context-save-inheritance.css
new file mode 100644
index 0000000000..3f3630c06e
--- /dev/null
+++ b/testsuite/reftests/style-context-save-inheritance.css
@@ -0,0 +1,18 @@
+@import "reset-to-defaults.css";
+
+.background {
+ color: red;
+}
+
+GtkLabel {
+ color: green;
+}
+
+GtkLabel:link,
+GtkLabel:visited {
+ color: inherit;
+}
+
+#reference, #reference * {
+ color: green;
+}
diff --git a/testsuite/reftests/style-context-save-inheritance.ref.ui b/testsuite/reftests/style-context-save-inheritance.ref.ui
new file mode 100644
index 0000000000..09b5af581a
--- /dev/null
+++ b/testsuite/reftests/style-context-save-inheritance.ref.ui
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.18.3 -->
+<interface>
+ <requires lib="gtk+" version="3.12"/>
+ <object class="GtkWindow" id="window1">
+ <property name="can_focus">False</property>
+ <property name="type">popup</property>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="name">reference</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">GREEN
+&lt;a href="http://www.gtk.org"&gt;GREEN&lt;/a&gt;</property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/testsuite/reftests/style-context-save-inheritance.ui b/testsuite/reftests/style-context-save-inheritance.ui
new file mode 100644
index 0000000000..022033b22c
--- /dev/null
+++ b/testsuite/reftests/style-context-save-inheritance.ui
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.18.3 -->
+<interface>
+ <requires lib="gtk+" version="3.12"/>
+ <object class="GtkWindow" id="window1">
+ <property name="can_focus">False</property>
+ <property name="type">popup</property>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">GREEN
+&lt;a href="http://www.gtk.org"&gt;GREEN&lt;/a&gt;</property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+</interface>