Web Inspector: Support Container Queries in the Styles sidebar
https://bugs.webkit.org/show_bug.cgi?id=238346
Reviewed by Devin Rousso.
Source/JavaScriptCore:
Add new container-rule
type for CSS::Grouping::Type
.
- inspector/protocol/CSS.json:
Source/WebCore:
Test: inspector/css/getMatchedStylesForNodeContainerGrouping.html
Add basic support to Web Inspector for viewing styles in @container
rules.
- css/CSSContainerRule.cpp:
(WebCore::CSSContainerRule::nameFilterText const):
- css/CSSContainerRule.h:
- Provide a way to get the name that is used to filter the rule to specific containers.
- inspector/InspectorStyleSheet.cpp:
(flattenSourceData):
- In order to prevent future rule types from being added without some consideration for how they are inspected,
use an exhaustive switch-case statement here. This will at minimum allow us to make sure we have opened a bug
and put a FIXME here for new values in the future.
(WebCore::asCSSRuleList):
(WebCore::buildArrayForGroupings):
- style/InspectorCSSOMWrappers.cpp:
(WebCore::Style::InspectorCSSOMWrappers::collect):
Source/WebInspectorUI:
- UserInterface/Models/CSSGrouping.js:
(WI.CSSGrouping.prototype.get isContainer):
(WI.CSSGrouping.prototype.get prefix):
(WI.CSSGrouping):
LayoutTests:
- inspector/css/getMatchedStylesForNodeContainerGrouping-expected.txt: Added.
- inspector/css/getMatchedStylesForNodeContainerGrouping.html: Added.