[Webkit-unassigned] [Bug 76736] New: window.getMatchedCSSRules() not supporting pseudo classes
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Jan 20 13:49:59 PST 2012
https://bugs.webkit.org/show_bug.cgi?id=76736
Summary: window.getMatchedCSSRules() not supporting pseudo
classes
Product: WebKit
Version: 528+ (Nightly build)
Platform: All
OS/Version: Unspecified
Status: UNCONFIRMED
Severity: Major
Priority: P2
Component: CSS
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: epiceric24 at gmail.com
Created an attachment (id=123371)
--> (https://bugs.webkit.org/attachment.cgi?id=123371&action=review)
Demo of getMatchedCSSRules bug
What steps will reproduce the problem?
1. Create CSS rules that apply to an element (including pseudo-class selectors)
2. Call window.getMatchedCSSRules(domElement, pseudoClassString), with pseudoClassString corresponding to those used in step 1.
What is the expected result?
The method should return a rule list containing the rules with pseudo class selectors.
What happens instead?
It only returns a rule list with the non-pseudo class selectors.
I don't know why this method only seems to support pseudo element selectors, when the use case for pseudo class selectors seems more common (or at least easy enough to support).
It would also be convenient for the method to return all CSS rules matching an element including all pseudo classes/elements. Currently, if you want to get all of the CSS rules targeting the element (in one state or another), this method would need to be called repeatedly.
Another problem with the method is that if a pseudo argument is supplied, but no css rules match the pseudo, it will return the non-psuedo CSS rules. I think returning null is the appropriate behavior.
About Attachment
I've provided an html page which has a demo of the bug. The html page includes an element which is styled with pseudo classes/elements. A button on the page calls "getMatchedCSSRules(element, pseudo)" passing in the pseudo specified in the drop down. There is also a log that shows the cssText of the returned rules.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list