[Webkit-unassigned] [Bug 17976] New: can't target next sibling element when using :hover pseudo selector and next element combinator

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Mar 20 18:08:42 PDT 2008


http://bugs.webkit.org/show_bug.cgi?id=17976

           Summary: can't target next sibling element when using :hover
                    pseudo selector and next element combinator
           Product: WebKit
           Version: 526+ (Nightly build)
          Platform: Macintosh
        OS/Version: Mac OS X 10.5
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: CSS
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: mauayan at prototypecreative.com


The behavior of using the pseudo selector ":hover" and the next combinator "+"
is incorrect. When the hovered element loses focus, the next element still
retains the style assigned with the :hover declaration.

Firefox and Internet Explorer 7 behave as expected.

With any luck the following code should help illustrate my point.

<style>
    li:hover{
      background:red;
    }

    li:hover + li{
      background:green;
    }

    li a{
      background:grey;
  }

</style>

<ul>
  <li>first element</li>
  <li>second element</li>
  <li>third element</li>
</ul>

Upon hovering over the element, the hovered li should display a green
background, and the next element should display a red background. These
elements don't actually display a red background unless it was hovered over
then moved to a previous element. When it loses :hover, the next element still
retains its background color. 

Wow that ended up rather... circuitous.


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list