Summary: | Web Inspector: RuleMatch.matchingSelectors is misleading | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Timothy Hatcher <timothy> | ||||
Component: | Web Inspector | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | NEW --- | ||||||
Severity: | Normal | CC: | apavlov, graouts, inspector-bugzilla-changes, keishi, loislo, pfeldman, pmuellr, vsevik, web-inspector-bugs, webkit-bug-importer, yurys | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Attachments: |
|
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. |
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.