After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 722727 - Widget state CSS pseudoclasses should work with adjacent selectors
Widget state CSS pseudoclasses should work with adjacent selectors
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Class: GtkStyleContext
3.10.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 660489 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-01-21 20:48 UTC by Philip Chimento
Modified: 2016-01-10 19:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Minimal example (1.05 KB, text/x-python-script)
2014-01-21 20:48 UTC, Philip Chimento
Details

Description Philip Chimento 2014-01-21 20:48:52 UTC
Created attachment 266923 [details]
Minimal example

The documentation says "Widget state pseudoclasses may only apply to the last element in a selector." However, it would be nice if this were not the case, for two reasons:

1) it is legal CSS.
2) since GTK 3.10 widget states don't propagate to child widgets, so if you want to select a GtkImage inside a prelit GtkButton you have to manually propagate the state flags, which is annoying.

The attached minimal example illustrates the problem: the desired behavior is that the icon inside the "I should turn red" button turns red on mouse-over. The "I do turn red" button illustrates the current way of implementing that behavior.
Comment 1 Matthias Clasen 2014-01-23 05:07:55 UTC
legal or not, the challenge is to implemet it...
Comment 2 Matthias Clasen 2014-07-14 03:07:47 UTC
*** Bug 660489 has been marked as a duplicate of this bug. ***
Comment 3 Matthias Clasen 2014-07-19 22:47:24 UTC
this works now
Comment 4 Philip Chimento 2014-07-21 20:51:17 UTC
Cool! I'm really excited about this one.
Comment 5 Lapo Calamandrei 2014-08-01 10:26:10 UTC
Reopening since it doesn't work with adiacent selectors, e.g. .entry:focus + .button {}
Comment 6 Matthias Clasen 2016-01-10 19:53:35 UTC
This seems to work correctly now. I've added a test that verifies this.
If you see something else thats not working, adding a similar test would
be great.