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.
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.
<rdar://problem/19106456>