Closed Bug 1384020 Opened 2 years ago Closed 2 years ago

Stylo: CSS targeting nested element on hover state doesn't work (quirksmode)

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set

Tracking

()

VERIFIED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: rohitpaulk, Assigned: emilio)

References

(Blocks 1 open bug, )

Details

(Keywords: nightly-community)

Attachments

(2 files, 1 obsolete file)

528 bytes, text/html
Details
59 bytes, text/x-review-board-request
canaltinova
: review+
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:56.0) Gecko/20100101 Firefox/56.0
Build ID: 20170724100311

Steps to reproduce:

- Using nightly. Version: 56.0a1 (2017-07-24) (64-bit). 
- I've turned `layout.css.servo.enabled` on. When that setting is turned off, the bug is not reproducible. 

Here's a test page: 

```
<body>

    <h2>Here's the bug</h2>

    <div class="container">
        <span class="remove-this-and-it-works">
            <span class="only-on-hover">Only visible on hover</span>
        </span>

        <span>
            Text should apper to the left when you hover on this.
        </span>
    </div>

    <style>
        .container .only-on-hover {
            visibility: hidden;
            color: red;
        }

        .container:hover .only-on-hover {
            visibility: visible;
        }
    </style>
</body>
```

- I hovered on the text, triggering the :hover state on `.container`


Actual results:

- The `.only-on-hover` element's visibility did not change


Expected results:

- The `.only-on-hover` element's visibility should've changed to `visible`.
Product: Firefox → Core
Summary: CSS targeting nested element on hover state doesn't work with stylo enabled → CSS targeting nested element on hover state doesn't work with servo enabled
Component: Untriaged → CSS Parsing and Computation
Summary: CSS targeting nested element on hover state doesn't work with servo enabled → Stylo: CSS targeting nested element on hover state doesn't work
Thank you! :)
Confirmed in Nightly 56 x64 20170725144053 @ Debian Testing.
Status: UNCONFIRMED → NEW
Has STR: --- → yes
Ever confirmed: true
Version: 56 Branch → Trunk
Huh, this is an interesting one... If I change it to be other kind of selector like a class, which should trigger a very similar invalidation pass, it does work.

And furthermore, I've verified that the invalidation pass works as intended, that is, finds the "only-on-hover" element, and marks it as dirty...
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0

Confirming. This bug is only in quirksmode for me, works in standards mode (with <!doctype html>). 
(Changing summary)
Summary: Stylo: CSS targeting nested element on hover state doesn't work → Stylo: CSS targeting nested element on hover state doesn't work (quirksmode)
Gah, I know why this is... Nazim, this is due to the :hover quirk.
Assignee: nobody → emilio+bugs
Attachment #8890097 - Flags: review?(canaltinova)
Comment on attachment 8890097 [details]
selectors: Fix note_next_sequence.

https://reviewboard.mozilla.org/r/161172/#review166514

Looks good. Thanks for fixing this!
Attachment #8890097 - Flags: review?(canaltinova) → review+
Attachment #8890097 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/215c7f7ff026
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
Verified fixed in Nightly 56 x64 20170726100241 @ Debian testing. (Stylo: true (enabled by user))
The hidden text in attachment 8889774 [details] is shown on mouseover even with Stylo now.
Status: RESOLVED → VERIFIED
Yay! That was quick :)
You need to log in before you can comment on or make changes to this bug.