NEW110062
Web Inspector: RuleMatch.matchingSelectors is misleading
https://bugs.webkit.org/show_bug.cgi?id=110062
Summary Web Inspector: RuleMatch.matchingSelectors is misleading
Timothy Hatcher
Reported 2013-02-17 13:41:25 PST
Created attachment 188774 [details] Test Case The matchingSelectors array can be misleading in the UI. If you have a rule with multiple selectors, one specific and one less specific. Then a separate rule that is in the middle of those matches. The first and last matches will both highlight the two selectors, when I would expect only the one selector that matched at that time to be highlighted. See attached test case. I only expect "#foo" to be highlighted the 1st match, and "div" to be highlighted on the 3rd match.
Attachments
Test Case (143 bytes, text/html)
2013-02-17 13:41 PST, Timothy Hatcher
no flags
Timothy Hatcher
Comment 1 2013-02-17 13:53:43 PST
This happens because InspectorCSSAgent::buildArrayForMatchedRuleList asks if the selectors match after the resolver has made the rule list. The resolver should tell us per rule match what selector matched. I think it should only ever be one selector per match, so the current API of matchingSelectors being an array might just need to be matchingSelectorIndex.
Radar WebKit Bug Importer
Comment 2 2014-12-01 14:04:25 PST
Note You need to log in before you can comment on or make changes to this bug.