RESOLVED FIXED 96999
Web Inspector: [Styles] For group selectors, transmit their segments with the "matches" flag
https://bugs.webkit.org/show_bug.cgi?id=96999
Summary Web Inspector: [Styles] For group selectors, transmit their segments with the...
Alexander Pavlov (apavlov)
Reported 2012-09-18 04:45:46 PDT
Bug 96626 implemented the highlighting of matched individual selectors in grouped selectors. This can be done more effectively by modifying the protocol to transmit the grouped selectors broken down by comma-separated individual selectors, each having a flag telling whether the related node matches the selector.
Attachments
Patch (19.76 KB, patch)
2012-09-19 04:56 PDT, Alexander Pavlov (apavlov)
no flags
Patch (19.85 KB, patch)
2012-09-20 02:46 PDT, Alexander Pavlov (apavlov)
no flags
Patch (41.80 KB, patch)
2012-09-24 02:11 PDT, Alexander Pavlov (apavlov)
pfeldman: review+
Alexander Pavlov (apavlov)
Comment 1 2012-09-19 04:56:49 PDT
Alexander Pavlov (apavlov)
Comment 2 2012-09-20 02:46:06 PDT
Pavel Feldman
Comment 3 2012-09-21 03:17:18 PDT
Comment on attachment 164870 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=164870&action=review > Source/WebCore/ChangeLog:11 > + * inspector/Inspector.json: Introduce SelectorSegment type and add elementMatchData field to CSSRule. Lets add a test! > Source/WebCore/inspector/Inspector.json:2027 > + "id": "SelectorSegment", SelectorList and Selector ? > Source/WebCore/inspector/Inspector.json:2031 > + { "name": "matched", "type": "boolean", "optional": true, "description": "Whether the related element matches this selector segment (default: false)." } matching ? > Source/WebCore/inspector/Inspector.json:2073 > + { "name": "elementMatchData", "type": "array", "items": { "$ref": "SelectorSegment" }, "optional": true, "description": "Present for style rules' grouping selectors if a context element is known and not all individual selectors are matched. Contains element matching data for each selector segment."}, I would introduce the SelectorList class and refer to it from here (it would encapsulate selectorText and selectorRange) > Source/WebCore/inspector/InspectorCSSAgent.cpp:684 > + if (selectorList.hasOneSelector()) Lets provide this information at all times as a start - it would make front-end life easier.
Alexander Pavlov (apavlov)
Comment 4 2012-09-24 02:11:53 PDT
Pavel Feldman
Comment 5 2012-09-24 09:29:02 PDT
Comment on attachment 165334 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=165334&action=review > Source/WebCore/inspector/Inspector.json:2013 > + { "name": "matches", "type": "array", "items": { "$ref": "RuleMatch" }, "description": "Matches of CSS rules applicable to the pseudo style."} Rename the group to PseudoIdMatches ? > Source/WebCore/inspector/Inspector.json:2031 > + { "name": "matchingIndices", "type": "array", "items": { "type": "integer" }, "description": "Matching selector indices in the rule's selectorList selectors (0-based)." } matchingSelectors
Alexander Pavlov (apavlov)
Comment 6 2012-09-25 01:05:04 PDT
Note You need to log in before you can comment on or make changes to this bug.