New issue
Advanced search Search tips

Issue 786956 link

Starred by 2 users

Issue metadata

Status: Duplicate
Merged: issue 785233
Owner: ----
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

setTimeout + :hover css not applying

Reported by arhi...@gmail.com, Nov 20 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36

Steps to reproduce the problem:
<style>.class:hover { color: red; }</style>
<div id="id">TEST</div>
<script>
  setTimeout(function(){
    document.getElementById('id').className = 'class';
  });
</script>

What is the expected behavior?
Hovering the div should change its color to red.

What went wrong?
The class is added, but the CSS for `:hover` doesn't apply. Removing `setTimeout()` wrapper seems to fix it.

Did this work before? N/A 

Chrome version: 62.0.3202.94  Channel: stable
OS Version: 
Flash Version: Shockwave Flash 27.0 r0
 

Comment 1 Deleted

Comment 2 by arhi...@gmail.com, Nov 20 2017

Adding any CSS rule to the class (without `:hover`) that forces a repaint on the element (i.e.: `transform: scale(1)`, `margin-top: 1px`) seems to also fix it: 
https://jsfiddle.net/websiter/n57dsh0v/

Comment 3 by junov@chromium.org, Nov 20 2017

Components: -Blink Blink>CSS
Mergedinto: 785233
Status: Duplicate (was: Unconfirmed)

Comment 5 Deleted

Comment 6 Deleted

Those two CLs landed look unrelated to this issue.

Comment 8 Deleted

Comment 9 Deleted

Comment 10 by brat...@opera.com, Nov 22 2017

Sorry about that. If someone came here looking for jumbo in /cc it's  bug 786926 .

Sign in to add a comment