[Webkit-unassigned] [Bug 21346] New: attribute value selector not being reevaluated upon attribute change

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 3 13:48:52 PDT 2008


https://bugs.webkit.org/show_bug.cgi?id=21346

           Summary: attribute value selector not being reevaluated upon
                    attribute change
           Product: WebKit
           Version: 528+ (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: pelaiata at ornl.gov


I have encountered a bug in which I have an attribute value selector which is
not being reevaluated when my JavaScript code changes the value of the
attribute. I have included the source code below and have verified that it
works fine in Mozilla browsers but fails in the latest nightly build of WebKit
r37126. The key features to observe the bug are that there must be an attribute
value selector on a class selector followed by another class selector whose
style we would like to define. In the example below, we have a container whose
class is "entry" with an attribute which is either "good" or "bad". Inside the
container we have a node whose class is "toggle" and we would like to define
the style on this node based on the status of its container. The toggle node
has a JavaScript click handler which toggles the status of its container
between "good" and "bad".

Example source code:

<html>
<head>
<title>Selector Test</title>
<style>
.toggle {cursor: pointer;}
.entry[status="good"] .toggle { color: green; }
.entry[status="bad"] .toggle { color: red; }
</style>
</head>

<body>

<div class="entry" status="good">
        <span class="toggle" onclick="var
status=this.parentNode.getAttribute('status'); var
newStatus=(status=='good'?'bad':'good'); this.parentNode.setAttribute('status',
newStatus);">Click to toggle between good (green) and bad (red).</span>
</div>

</body>
</html>


-- 
Configure bugmail: https://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