Bug 29029 - :focus pseudo-class and general sibling combinator (selector) not working together
Summary: :focus pseudo-class and general sibling combinator (selector) not working tog...
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2009-09-08 06:25 PDT by Simas Toleikis
Modified: 2022-07-23 08:26 PDT (History)
7 users (show)

See Also:

Simple test case (330 bytes, text/html)
2009-09-08 06:25 PDT, Simas Toleikis
no flags Details
More test cases (846 bytes, text/html)
2010-11-18 21:37 PST, Chris T.
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simas Toleikis 2009-09-08 06:25:45 PDT
Created attachment 39181 [details]
Simple test case

The following CSS3 selector:

input:focus ~ div {}

.. will not select preceding <div> element(s).


- removing :focus works fine, so it must be a bug with combination of :focus and ~
- the following selector works fine: input:focus + div
- Gecko/Presto behaves as expected
Comment 1 Justin Mecham 2009-10-02 10:38:29 PDT
I have seen this behavior in Safari 4.0.3 (6531.9) on Mac OS X (10.6.1) as well.
Comment 2 Chris T. 2010-11-18 21:37:05 PST
Created attachment 74352 [details]
More test cases

I've also found issue with multiple "next sibling" selectors, input:focus + div + div has no effect. When comparing my test case to the existing "Simple Test Case", found that having said rule after a copy of the rule in the other test case makes the latter work. Removing it breaks it (commented in my test case). Testing in Safari 5.0.2 Mac.
Comment 3 Ahmad Saleem 2022-07-23 08:03:01 PDT
I am unable to reproduce this bug in Safari 15.6 on macOS 12.5 using both test cases and it matches with all other browsers (Chrome Canary 106 and Firefox Nightly 104) and on input, do same as expected results. I think it was fixed along the way and this can be marked as RESOLVED CONFIGURATION CHANGED. Thanks!