From ad199e4cf96592fb57d0a58861270d82b0a453d3 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sun, 21 Dec 2014 21:30:51 +0100 Subject: 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. --- testsuite/reftests/Makefile.am | 3 +++ testsuite/reftests/style-context-save-inheritance.css | 18 ++++++++++++++++++ .../reftests/style-context-save-inheritance.ref.ui | 19 +++++++++++++++++++ testsuite/reftests/style-context-save-inheritance.ui | 18 ++++++++++++++++++ 4 files changed, 58 insertions(+) create mode 100644 testsuite/reftests/style-context-save-inheritance.css create mode 100644 testsuite/reftests/style-context-save-inheritance.ref.ui create mode 100644 testsuite/reftests/style-context-save-inheritance.ui (limited to 'testsuite/reftests') 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 @@ + + + + + + False + popup + + + reference + True + False + GREEN +<a href="http://www.gtk.org">GREEN</a> + True + + + + 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 @@ + + + + + + False + popup + + + True + False + GREEN +<a href="http://www.gtk.org">GREEN</a> + True + + + + -- cgit v1.2.1