⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 286657 in webkit


Ignore:
Timestamp:
Dec 8, 2021, 8:55:05 AM (5 years ago)
Author:
Antti Koivisto
Message:

[CSS Cascade Layers] Update CSSOM to the spec
https://bugs.webkit.org/show_bug.cgi?id=231340
<rdar://problem/83958697>

Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

  • web-platform-tests/css/css-cascade/idlharness-expected.txt:
  • web-platform-tests/css/css-cascade/layer-rules-cssom-expected.txt:

Source/WebCore:

Add CSSLayerBlockRule and CSSLayerStatementRule interfaces.
Also add support for layerName property of CSSImportRule.

https://www.w3.org/TR/css-cascade-5/#layer-apis

  • DerivedSources-input.xcfilelist:
  • DerivedSources-output.xcfilelist:
  • DerivedSources.make:
  • Sources.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/JSCSSRuleCustom.cpp:

(WebCore::toJSNewlyCreated):

  • css/CSSImportRule+Layer.idl: Copied from Source/WebCore/css/CSSLayerRule.idl.
  • css/CSSImportRule.cpp:

(WebCore::CSSImportRule::layerName const):
(WebCore::CSSImportRule::cascadeLayerName const): Deleted.

  • css/CSSImportRule.h:
  • css/CSSLayerBlockRule.cpp: Renamed from Source/WebCore/css/CSSLayerRule.cpp.

(WebCore::CSSLayerBlockRule::CSSLayerBlockRule):
(WebCore::CSSLayerBlockRule::create):
(WebCore::CSSLayerBlockRule::cssText const):
(WebCore::CSSLayerBlockRule::name const):
(WebCore::stringFromCascadeLayerName):

  • css/CSSLayerBlockRule.h: Copied from Source/WebCore/css/CSSLayerRule.h.
  • css/CSSLayerBlockRule.idl: Copied from Source/WebCore/css/CSSLayerRule.idl.
  • css/CSSLayerStatementRule.cpp: Copied from Source/WebCore/css/CSSLayerRule.h.

(WebCore::CSSLayerStatementRule::CSSLayerStatementRule):
(WebCore::CSSLayerStatementRule::create):
(WebCore::CSSLayerStatementRule::cssText const):
(WebCore::CSSLayerStatementRule::nameList const):
(WebCore::CSSLayerStatementRule::reattach):

  • css/CSSLayerStatementRule.h: Renamed from Source/WebCore/css/CSSLayerRule.h.
  • css/CSSLayerStatementRule.idl: Renamed from Source/WebCore/css/CSSLayerRule.idl.
  • css/CSSRule.h:
  • css/StyleRule.cpp:

(WebCore::StyleRuleBase::destroy):
(WebCore::StyleRuleBase::copy const):
(WebCore::StyleRuleBase::createCSSOMWrapper const):
(WebCore::StyleRuleLayer::StyleRuleLayer):

  • css/StyleRule.h:

(WebCore::StyleRuleBase::isGroupRule const):
(WebCore::StyleRuleBase::isLayerRule const):

  • css/StyleRuleType.h:
  • css/StyleSheetContents.cpp:

(WebCore::traverseRulesInVector):
(WebCore::StyleSheetContents::traverseSubresources const):

  • css/parser/CSSParserImpl.cpp:

(WebCore::CSSParserImpl::consumeLayerRule):

  • inspector/InspectorStyleSheet.cpp:

(flattenSourceData):
(WebCore::asCSSRuleList):
(WebCore::buildArrayForGroupings):

  • style/InspectorCSSOMWrappers.cpp:

(WebCore::Style::InspectorCSSOMWrappers::collect):

Location:
trunk
Files:
21 edited
4 copied
3 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r286652 r286657  
     12021-12-08  Antti Koivisto  <antti@apple.com>
     2
     3        [CSS Cascade Layers] Update CSSOM to the spec
     4        https://bugs.webkit.org/show_bug.cgi?id=231340
     5        <rdar://problem/83958697>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * web-platform-tests/css/css-cascade/idlharness-expected.txt:
     10        * web-platform-tests/css/css-cascade/layer-rules-cssom-expected.txt:
     11
    1122021-12-08  Antoine Quint  <graouts@webkit.org>
    213
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/idlharness-expected.txt

    r286647 r286657  
    55PASS Partial interface CSSImportRule: valid exposure set
    66PASS Partial interface CSSImportRule: member names are unique
    7 FAIL CSSLayerBlockRule interface: existence and properties of interface object assert_own_property: self does not have own property "CSSLayerBlockRule" expected property "CSSLayerBlockRule" missing
    8 FAIL CSSLayerBlockRule interface object length assert_own_property: self does not have own property "CSSLayerBlockRule" expected property "CSSLayerBlockRule" missing
    9 FAIL CSSLayerBlockRule interface object name assert_own_property: self does not have own property "CSSLayerBlockRule" expected property "CSSLayerBlockRule" missing
    10 FAIL CSSLayerBlockRule interface: existence and properties of interface prototype object assert_own_property: self does not have own property "CSSLayerBlockRule" expected property "CSSLayerBlockRule" missing
    11 FAIL CSSLayerBlockRule interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "CSSLayerBlockRule" expected property "CSSLayerBlockRule" missing
    12 FAIL CSSLayerBlockRule interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "CSSLayerBlockRule" expected property "CSSLayerBlockRule" missing
    13 FAIL CSSLayerBlockRule interface: attribute name assert_own_property: self does not have own property "CSSLayerBlockRule" expected property "CSSLayerBlockRule" missing
    14 FAIL CSSLayerBlockRule must be primary interface of block assert_own_property: self does not have own property "CSSLayerBlockRule" expected property "CSSLayerBlockRule" missing
    15 FAIL Stringification of block assert_class_string: class string of block expected "[object CSSLayerBlockRule]" but got "[object CSSRule]"
    16 FAIL CSSLayerBlockRule interface: block must inherit property "name" with the proper type assert_inherits: property "name" not found in prototype chain
    17 FAIL CSSLayerStatementRule interface: existence and properties of interface object assert_own_property: self does not have own property "CSSLayerStatementRule" expected property "CSSLayerStatementRule" missing
    18 FAIL CSSLayerStatementRule interface object length assert_own_property: self does not have own property "CSSLayerStatementRule" expected property "CSSLayerStatementRule" missing
    19 FAIL CSSLayerStatementRule interface object name assert_own_property: self does not have own property "CSSLayerStatementRule" expected property "CSSLayerStatementRule" missing
    20 FAIL CSSLayerStatementRule interface: existence and properties of interface prototype object assert_own_property: self does not have own property "CSSLayerStatementRule" expected property "CSSLayerStatementRule" missing
    21 FAIL CSSLayerStatementRule interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "CSSLayerStatementRule" expected property "CSSLayerStatementRule" missing
    22 FAIL CSSLayerStatementRule interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "CSSLayerStatementRule" expected property "CSSLayerStatementRule" missing
    23 FAIL CSSLayerStatementRule interface: attribute nameList assert_own_property: self does not have own property "CSSLayerStatementRule" expected property "CSSLayerStatementRule" missing
    24 FAIL CSSLayerStatementRule must be primary interface of statement assert_own_property: self does not have own property "CSSLayerStatementRule" expected property "CSSLayerStatementRule" missing
    25 FAIL Stringification of statement assert_class_string: class string of statement expected "[object CSSLayerStatementRule]" but got "[object CSSRule]"
    26 FAIL CSSLayerStatementRule interface: statement must inherit property "nameList" with the proper type assert_inherits: property "nameList" not found in prototype chain
    27 FAIL CSSImportRule interface: attribute layerName assert_true: The prototype object must have a property "layerName" expected true got false
    28 FAIL CSSImportRule interface: layeredImport must inherit property "layerName" with the proper type assert_inherits: property "layerName" not found in prototype chain
     7PASS CSSLayerBlockRule interface: existence and properties of interface object
     8PASS CSSLayerBlockRule interface object length
     9PASS CSSLayerBlockRule interface object name
     10PASS CSSLayerBlockRule interface: existence and properties of interface prototype object
     11PASS CSSLayerBlockRule interface: existence and properties of interface prototype object's "constructor" property
     12PASS CSSLayerBlockRule interface: existence and properties of interface prototype object's @@unscopables property
     13PASS CSSLayerBlockRule interface: attribute name
     14PASS CSSLayerBlockRule must be primary interface of block
     15PASS Stringification of block
     16PASS CSSLayerBlockRule interface: block must inherit property "name" with the proper type
     17PASS CSSLayerStatementRule interface: existence and properties of interface object
     18PASS CSSLayerStatementRule interface object length
     19PASS CSSLayerStatementRule interface object name
     20PASS CSSLayerStatementRule interface: existence and properties of interface prototype object
     21PASS CSSLayerStatementRule interface: existence and properties of interface prototype object's "constructor" property
     22PASS CSSLayerStatementRule interface: existence and properties of interface prototype object's @@unscopables property
     23PASS CSSLayerStatementRule interface: attribute nameList
     24PASS CSSLayerStatementRule must be primary interface of statement
     25PASS Stringification of statement
     26PASS CSSLayerStatementRule interface: statement must inherit property "nameList" with the proper type
     27PASS CSSImportRule interface: attribute layerName
     28PASS CSSImportRule interface: layeredImport must inherit property "layerName" with the proper type
    2929
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/layer-rules-cssom-expected.txt

    r286647 r286657  
    11
    2 FAIL Basic layer block name assert_implements: undefined
    3 FAIL Anonymous layer block name assert_implements: undefined
    4 FAIL Basic layer statement name assert_implements: undefined
    5 FAIL Layer statement with multiple names assert_implements: undefined
    6 FAIL Nested layer block names assert_implements: undefined
    7 FAIL Nested layer statement name lists assert_implements: undefined
    8 FAIL Import into anonymous layer assert_implements: undefined
    9 FAIL Import into named layer assert_implements: undefined
    10 FAIL Import without layer assert_implements: undefined
     2PASS Basic layer block name
     3PASS Anonymous layer block name
     4PASS Basic layer statement name
     5PASS Layer statement with multiple names
     6PASS Nested layer block names
     7PASS Nested layer statement name lists
     8PASS Import into anonymous layer
     9PASS Import into named layer
     10PASS Import without layer
    1111
  • trunk/Source/WebCore/CMakeLists.txt

    r286640 r286657  
    751751    css/CSSKeyframeRule.idl
    752752    css/CSSKeyframesRule.idl
    753     css/CSSLayerRule.idl
     753    css/CSSLayerBlockRule.idl
     754    css/CSSLayerStatementRule.idl
    754755    css/CSSMediaRule.idl
    755756    css/CSSNamespaceRule.idl
  • trunk/Source/WebCore/ChangeLog

    r286656 r286657  
     12021-12-08  Antti Koivisto  <antti@apple.com>
     2
     3        [CSS Cascade Layers] Update CSSOM to the spec
     4        https://bugs.webkit.org/show_bug.cgi?id=231340
     5        <rdar://problem/83958697>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Add CSSLayerBlockRule and CSSLayerStatementRule interfaces.
     10        Also add support for layerName property of CSSImportRule.
     11
     12        https://www.w3.org/TR/css-cascade-5/#layer-apis
     13
     14        * DerivedSources-input.xcfilelist:
     15        * DerivedSources-output.xcfilelist:
     16        * DerivedSources.make:
     17        * Sources.txt:
     18        * WebCore.xcodeproj/project.pbxproj:
     19        * bindings/js/JSCSSRuleCustom.cpp:
     20        (WebCore::toJSNewlyCreated):
     21        * css/CSSImportRule+Layer.idl: Copied from Source/WebCore/css/CSSLayerRule.idl.
     22        * css/CSSImportRule.cpp:
     23        (WebCore::CSSImportRule::layerName const):
     24        (WebCore::CSSImportRule::cascadeLayerName const): Deleted.
     25        * css/CSSImportRule.h:
     26        * css/CSSLayerBlockRule.cpp: Renamed from Source/WebCore/css/CSSLayerRule.cpp.
     27        (WebCore::CSSLayerBlockRule::CSSLayerBlockRule):
     28        (WebCore::CSSLayerBlockRule::create):
     29        (WebCore::CSSLayerBlockRule::cssText const):
     30        (WebCore::CSSLayerBlockRule::name const):
     31        (WebCore::stringFromCascadeLayerName):
     32        * css/CSSLayerBlockRule.h: Copied from Source/WebCore/css/CSSLayerRule.h.
     33        * css/CSSLayerBlockRule.idl: Copied from Source/WebCore/css/CSSLayerRule.idl.
     34        * css/CSSLayerStatementRule.cpp: Copied from Source/WebCore/css/CSSLayerRule.h.
     35        (WebCore::CSSLayerStatementRule::CSSLayerStatementRule):
     36        (WebCore::CSSLayerStatementRule::create):
     37        (WebCore::CSSLayerStatementRule::cssText const):
     38        (WebCore::CSSLayerStatementRule::nameList const):
     39        (WebCore::CSSLayerStatementRule::reattach):
     40        * css/CSSLayerStatementRule.h: Renamed from Source/WebCore/css/CSSLayerRule.h.
     41        * css/CSSLayerStatementRule.idl: Renamed from Source/WebCore/css/CSSLayerRule.idl.
     42        * css/CSSRule.h:
     43        * css/StyleRule.cpp:
     44        (WebCore::StyleRuleBase::destroy):
     45        (WebCore::StyleRuleBase::copy const):
     46        (WebCore::StyleRuleBase::createCSSOMWrapper const):
     47        (WebCore::StyleRuleLayer::StyleRuleLayer):
     48        * css/StyleRule.h:
     49        (WebCore::StyleRuleBase::isGroupRule const):
     50        (WebCore::StyleRuleBase::isLayerRule const):
     51        * css/StyleRuleType.h:
     52        * css/StyleSheetContents.cpp:
     53        (WebCore::traverseRulesInVector):
     54        (WebCore::StyleSheetContents::traverseSubresources const):
     55        * css/parser/CSSParserImpl.cpp:
     56        (WebCore::CSSParserImpl::consumeLayerRule):
     57        * inspector/InspectorStyleSheet.cpp:
     58        (flattenSourceData):
     59        (WebCore::asCSSRuleList):
     60        (WebCore::buildArrayForGroupings):
     61        * style/InspectorCSSOMWrappers.cpp:
     62        (WebCore::Style::InspectorCSSOMWrappers::collect):
     63
    1642021-12-08  Youenn Fablet  <youenn@apple.com>
    265
  • trunk/Source/WebCore/DerivedSources-input.xcfilelist

    r286640 r286657  
    879879$(PROJECT_DIR)/css/CSSFontPaletteValuesRule.idl
    880880$(PROJECT_DIR)/css/CSSGroupingRule.idl
     881$(PROJECT_DIR)/css/CSSImportRule+Layer.idl
    881882$(PROJECT_DIR)/css/CSSImportRule.idl
    882883$(PROJECT_DIR)/css/CSSKeyframeRule.idl
    883884$(PROJECT_DIR)/css/CSSKeyframesRule.idl
    884 $(PROJECT_DIR)/css/CSSLayerRule.idl
     885$(PROJECT_DIR)/css/CSSLayerBlockRule.idl
     886$(PROJECT_DIR)/css/CSSLayerStatementRule.idl
    885887$(PROJECT_DIR)/css/CSSMediaRule.idl
    886888$(PROJECT_DIR)/css/CSSNamespaceRule.idl
     
    13261328$(PROJECT_DIR)/html/parser/create-html-entity-table
    13271329$(PROJECT_DIR)/html/shadow/imageOverlay.css
     1330$(PROJECT_DIR)/html/shadow/mac/imageControlsMac.css
    13281331$(PROJECT_DIR)/html/shadow/meterElementShadow.css
    1329 $(PROJECT_DIR)/html/shadow/mac/imageControlsMac.css
    13301332$(PROJECT_DIR)/html/track/AudioTrack.idl
    13311333$(PROJECT_DIR)/html/track/AudioTrackList.idl
  • trunk/Source/WebCore/DerivedSources-output.xcfilelist

    r286640 r286657  
    297297$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSGroupingRule.cpp
    298298$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSGroupingRule.h
     299$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSImportRule+Layer.cpp
     300$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSImportRule+Layer.h
    299301$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSImportRule.cpp
    300302$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSImportRule.h
     
    305307$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSKeywordValue.cpp
    306308$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSKeywordValue.h
    307 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSLayerRule.cpp
    308 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSLayerRule.h
     309$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSLayerBlockRule.cpp
     310$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSLayerBlockRule.h
     311$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSLayerStatementRule.cpp
     312$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSLayerStatementRule.h
    309313$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSMathInvert.cpp
    310314$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSMathInvert.h
  • trunk/Source/WebCore/DerivedSources.make

    r286640 r286657  
    759759    $(WebCore)/css/CSSGroupingRule.idl \
    760760    $(WebCore)/css/CSSImportRule.idl \
    761     $(WebCore)/css/CSSLayerRule.idl \
     761    $(WebCore)/css/CSSImportRule+Layer.idl \
     762    $(WebCore)/css/CSSLayerBlockRule.idl \
     763    $(WebCore)/css/CSSLayerStatementRule.idl \
    762764    $(WebCore)/css/CSSKeyframeRule.idl \
    763765    $(WebCore)/css/CSSKeyframesRule.idl \
  • trunk/Source/WebCore/Sources.txt

    r286640 r286657  
    734734css/CSSKeyframeRule.cpp
    735735css/CSSKeyframesRule.cpp
    736 css/CSSLayerRule.cpp
     736css/CSSLayerBlockRule.cpp
     737css/CSSLayerStatementRule.cpp
    737738css/CSSLineBoxContainValue.cpp
    738739css/CSSMarkup.cpp
     
    29262927JSCSSKeyframeRule.cpp
    29272928JSCSSKeyframesRule.cpp
    2928 JSCSSLayerRule.cpp
     2929JSCSSLayerBlockRule.cpp
     2930JSCSSLayerStatementRule.cpp
    29292931JSCSSMediaRule.cpp
    29302932JSCSSNamespaceRule.cpp
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r286650 r286657  
    53895389                E4F819C626FB4EBF0094E162 /* InlineBoxPainter.h in Headers */ = {isa = PBXBuildFile; fileRef = E4F819C526FB4EBF0094E162 /* InlineBoxPainter.h */; };
    53905390                E4F9EEF3156DA00700D23E7E /* StyleSheetContents.h in Headers */ = {isa = PBXBuildFile; fileRef = E4F9EEF1156D84C400D23E7E /* StyleSheetContents.h */; settings = {ATTRIBUTES = (Private, ); }; };
     5391                E4FFCEBB2760AC0100A68B03 /* CSSLayerStatementRule.h in Headers */ = {isa = PBXBuildFile; fileRef = E4FFCEB82760AC0000A68B03 /* CSSLayerStatementRule.h */; };
     5392                E4FFCEBE2760AC1600A68B03 /* CSSLayerBlockRule.h in Headers */ = {isa = PBXBuildFile; fileRef = E430C1B727030941003B553F /* CSSLayerBlockRule.h */; };
    53915393                E50620842540919C00C43091 /* ContactsRequestData.h in Headers */ = {isa = PBXBuildFile; fileRef = E50620832540919B00C43091 /* ContactsRequestData.h */; settings = {ATTRIBUTES = (Private, ); }; };
    53925394                E51194BF270E7E4A0064FCBA /* ShadowPseudoIds.h in Headers */ = {isa = PBXBuildFile; fileRef = E51194BD270E7E4A0064FCBA /* ShadowPseudoIds.h */; };
     
    1722617228                E403B7A1251B11930019E800 /* LayoutIntegrationCoverage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayoutIntegrationCoverage.h; sourceTree = "<group>"; };
    1722717229                E406F3FB1198307D009D59D6 /* ColorData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ColorData.cpp; path = DerivedSources/WebCore/ColorData.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
     17230                E4114B252760DC36007B789B /* CSSImportRule+Layer.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = "CSSImportRule+Layer.idl"; sourceTree = "<group>"; };
    1722817231                E415EB11270C351200E8DA1B /* InlineIteratorInlineBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InlineIteratorInlineBox.h; sourceTree = "<group>"; };
    1722917232                E415EB14270C353700E8DA1B /* InlineIteratorInlineBox.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = InlineIteratorInlineBox.cpp; sourceTree = "<group>"; };
     
    1724317246                E42E76D91C7AF76C00E3614D /* StyleUpdate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleUpdate.cpp; sourceTree = "<group>"; };
    1724417247                E42E76DB1C7AF77600E3614D /* StyleUpdate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleUpdate.h; sourceTree = "<group>"; };
    17245                 E430C1B727030941003B553F /* CSSLayerRule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CSSLayerRule.h; sourceTree = "<group>"; };
    17246                 E430C1B92703094E003B553F /* CSSLayerRule.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = CSSLayerRule.idl; sourceTree = "<group>"; };
    17247                 E430C1BA27030B86003B553F /* CSSLayerRule.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CSSLayerRule.cpp; sourceTree = "<group>"; };
     17248                E430C1B727030941003B553F /* CSSLayerBlockRule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CSSLayerBlockRule.h; sourceTree = "<group>"; };
     17249                E430C1B92703094E003B553F /* CSSLayerBlockRule.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = CSSLayerBlockRule.idl; sourceTree = "<group>"; };
     17250                E430C1BA27030B86003B553F /* CSSLayerBlockRule.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CSSLayerBlockRule.cpp; sourceTree = "<group>"; };
    1724817251                E43105B716750F0C00DB2FB8 /* NodeTraversal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NodeTraversal.cpp; sourceTree = "<group>"; };
    1724917252                E43105BA16750F1600DB2FB8 /* NodeTraversal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NodeTraversal.h; sourceTree = "<group>"; };
     
    1746217465                E4F9EEF1156D84C400D23E7E /* StyleSheetContents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleSheetContents.h; sourceTree = "<group>"; };
    1746317466                E4FB4B35239BEB10003C336A /* LayoutIntegrationInlineContent.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutIntegrationInlineContent.cpp; sourceTree = "<group>"; };
     17467                E4FFCEB82760AC0000A68B03 /* CSSLayerStatementRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSLayerStatementRule.h; sourceTree = "<group>"; };
     17468                E4FFCEB92760AC0000A68B03 /* CSSLayerStatementRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSLayerStatementRule.cpp; sourceTree = "<group>"; };
     17469                E4FFCEBA2760AC0100A68B03 /* CSSLayerStatementRule.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CSSLayerStatementRule.idl; sourceTree = "<group>"; };
    1746417470                E50620832540919B00C43091 /* ContactsRequestData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ContactsRequestData.h; sourceTree = "<group>"; };
    1746517471                E51194BD270E7E4A0064FCBA /* ShadowPseudoIds.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShadowPseudoIds.h; sourceTree = "<group>"; };
     
    3139131397                                A80E6CD40A1989CA007FB8C5 /* CSSImageValue.cpp */,
    3139231398                                A80E6CD00A1989CA007FB8C5 /* CSSImageValue.h */,
     31399                                E4114B252760DC36007B789B /* CSSImportRule+Layer.idl */,
    3139331400                                A80E6CC10A1989CA007FB8C5 /* CSSImportRule.cpp */,
    3139431401                                A80E6CCC0A1989CA007FB8C5 /* CSSImportRule.h */,
     
    3140031407                                31288E710E3005D6003619AE /* CSSKeyframesRule.h */,
    3140131408                                316FE0920E6CCD7F00BF6088 /* CSSKeyframesRule.idl */,
    31402                                 E430C1BA27030B86003B553F /* CSSLayerRule.cpp */,
    31403                                 E430C1B727030941003B553F /* CSSLayerRule.h */,
    31404                                 E430C1B92703094E003B553F /* CSSLayerRule.idl */,
     31409                                E430C1BA27030B86003B553F /* CSSLayerBlockRule.cpp */,
     31410                                E430C1B727030941003B553F /* CSSLayerBlockRule.h */,
     31411                                E430C1B92703094E003B553F /* CSSLayerBlockRule.idl */,
     31412                                E4FFCEB92760AC0000A68B03 /* CSSLayerStatementRule.cpp */,
     31413                                E4FFCEB82760AC0000A68B03 /* CSSLayerStatementRule.h */,
     31414                                E4FFCEBA2760AC0100A68B03 /* CSSLayerStatementRule.idl */,
    3140531415                                BC772E15133162C2001EC9CE /* CSSLineBoxContainValue.cpp */,
    3140631416                                BC772E121331620C001EC9CE /* CSSLineBoxContainValue.h */,
     
    3377033780                                31288E750E3005D6003619AE /* CSSKeyframesRule.h in Headers */,
    3377133781                                2A4107A426CB66F8003BF797 /* CSSKeywordValue.h in Headers */,
     33782                                E4FFCEBE2760AC1600A68B03 /* CSSLayerBlockRule.h in Headers */,
     33783                                E4FFCEBB2760AC0100A68B03 /* CSSLayerStatementRule.h in Headers */,
    3377233784                                BC772E131331620C001EC9CE /* CSSLineBoxContainValue.h in Headers */,
    3377333785                                946D374A1D6D06280077084F /* CSSMarkup.h in Headers */,
  • trunk/Source/WebCore/bindings/js/JSCSSRuleCustom.cpp

    r282806 r286657  
    3333#include "CSSKeyframeRule.h"
    3434#include "CSSKeyframesRule.h"
     35#include "CSSLayerBlockRule.h"
     36#include "CSSLayerStatementRule.h"
    3537#include "CSSMediaRule.h"
    3638#include "CSSNamespaceRule.h"
     
    4446#include "JSCSSKeyframeRule.h"
    4547#include "JSCSSKeyframesRule.h"
     48#include "JSCSSLayerBlockRule.h"
     49#include "JSCSSLayerStatementRule.h"
    4650#include "JSCSSMediaRule.h"
    4751#include "JSCSSNamespaceRule.h"
     
    8993    case CSSRule::COUNTER_STYLE_RULE:
    9094        return createWrapper<CSSCounterStyleRule>(globalObject, WTFMove(rule));
    91     default:
     95    case CSSRule::LAYER_BLOCK_RULE:
     96        return createWrapper<CSSLayerBlockRule>(globalObject, WTFMove(rule));
     97    case CSSRule::LAYER_STATEMENT_RULE:
     98        return createWrapper<CSSLayerStatementRule>(globalObject, WTFMove(rule));
     99    case CSSRule::UNKNOWN_RULE:
     100    case CSSRule::CHARSET_RULE:
     101    case CSSRule::MARGIN_RULE:
    92102        return createWrapper<CSSRule>(globalObject, WTFMove(rule));
    93103    }
  • trunk/Source/WebCore/css/CSSImportRule+Layer.idl

    r286656 r286657  
    2828 */
    2929
     30typedef USVString CSSOMString;
     31
    3032[
    3133    Exposed=Window
    32 ] interface CSSLayerRule : CSSGroupingRule {
     34] partial interface CSSImportRule {
     35  readonly attribute CSSOMString? layerName;
    3336};
  • trunk/Source/WebCore/css/CSSImportRule.cpp

    r286558 r286657  
    2323#include "CSSImportRule.h"
    2424
     25#include "CSSLayerBlockRule.h"
    2526#include "CSSStyleSheet.h"
    2627#include "MediaList.h"
     
    5758}
    5859
    59 const std::optional<CascadeLayerName>& CSSImportRule::cascadeLayerName() const
     60String CSSImportRule::layerName() const
    6061{
    61     return m_importRule.get().cascadeLayerName();
     62    auto name = m_importRule.get().cascadeLayerName();
     63    if (!name)
     64        return { };
     65
     66    return stringFromCascadeLayerName(*name);
    6267}
    6368
  • trunk/Source/WebCore/css/CSSImportRule.h

    r286558 r286657  
    3939    WEBCORE_EXPORT MediaList& media() const;
    4040    WEBCORE_EXPORT CSSStyleSheet* styleSheet() const;
    41     WEBCORE_EXPORT const std::optional<CascadeLayerName>& cascadeLayerName() const;
     41    String layerName() const;
    4242
    4343private:
  • trunk/Source/WebCore/css/CSSLayerBlockRule.cpp

    r286656 r286657  
    2929
    3030#include "config.h"
    31 #include "CSSLayerRule.h"
     31#include "CSSLayerBlockRule.h"
    3232
    3333#include "CSSStyleSheet.h"
     
    3737namespace WebCore {
    3838
    39 CSSLayerRule::CSSLayerRule(StyleRuleLayer& rule, CSSStyleSheet* parent)
     39CSSLayerBlockRule::CSSLayerBlockRule(StyleRuleLayer& rule, CSSStyleSheet* parent)
    4040    : CSSGroupingRule(rule, parent)
    4141{
     42    ASSERT(!rule.isStatement());
    4243}
    4344
    44 Ref<CSSLayerRule> CSSLayerRule::create(StyleRuleLayer& rule, CSSStyleSheet* parent)
     45Ref<CSSLayerBlockRule> CSSLayerBlockRule::create(StyleRuleLayer& rule, CSSStyleSheet* parent)
    4546{
    46     return adoptRef(*new CSSLayerRule(rule, parent));
     47    return adoptRef(*new CSSLayerBlockRule(rule, parent));
    4748}
    4849
    49 String CSSLayerRule::cssText() const
     50String CSSLayerBlockRule::cssText() const
     51{
     52    StringBuilder result;
     53
     54    result.append("@layer ");
     55    if (auto name = this->name(); !name.isEmpty())
     56        result.append(name, " ");
     57    result.append("{\n");
     58    appendCSSTextForItems(result);
     59    result.append('}');
     60
     61    return result.toString();
     62}
     63
     64String CSSLayerBlockRule::name() const
    5065{
    5166    auto& layer = downcast<StyleRuleLayer>(groupRule());
    5267
    53     StringBuilder result;
     68    if (layer.name().isEmpty())
     69        return emptyString();
    5470
    55     if (layer.isStatement()) {
    56         result.append("@layer ");
    57         for (auto& name : layer.nameList()) {
    58             result.append(stringFromCascadeLayerName(name));
    59             if (&name != &layer.nameList().last())
    60                 result.append(", ");
    61         }
    62         result.append(';');
    63         return result.toString();
    64     }
    65 
    66     result.append("@layer ");
    67     if (auto name = layerName())
    68         result.append(*name, " ");
    69     result.append("{\n");
    70     appendCSSTextForItems(result);
    71     result.append('}');
    72     return result.toString();
     71    return stringFromCascadeLayerName(layer.name());
    7372}
    7473
    75 std::optional<String> CSSLayerRule::layerName() const
    76 {
    77     auto& layer = downcast<StyleRuleLayer>(groupRule());
    78 
    79     if (!layer.isStatement() && !layer.name().isEmpty())
    80         return stringFromCascadeLayerName(layer.name());
    81    
    82     return std::nullopt;
    83 }
    84 
    85 String CSSLayerRule::stringFromCascadeLayerName(const CascadeLayerName& name)
     74String stringFromCascadeLayerName(const CascadeLayerName& name)
    8675{
    8776    StringBuilder result;
  • trunk/Source/WebCore/css/CSSLayerBlockRule.h

    r286656 r286657  
    3535namespace WebCore {
    3636
    37 class StyleRuleLayer;
    38 
    39 class CSSLayerRule final : public CSSGroupingRule {
     37class CSSLayerBlockRule final : public CSSGroupingRule {
    4038public:
    41     static Ref<CSSLayerRule> create(StyleRuleLayer&, CSSStyleSheet* parent);
     39    static Ref<CSSLayerBlockRule> create(StyleRuleLayer&, CSSStyleSheet* parent);
    4240
    4341    String cssText() const final;
    44     std::optional<String> layerName() const;
    45 
    46     static String stringFromCascadeLayerName(const CascadeLayerName&);
     42    String name() const;
    4743
    4844private:
    49     CSSLayerRule(StyleRuleLayer&, CSSStyleSheet*);
    50     CSSRule::Type type() const final { return LAYER_RULE; }
     45    CSSLayerBlockRule(StyleRuleLayer&, CSSStyleSheet*);
     46    CSSRule::Type type() const final { return LAYER_BLOCK_RULE; }
    5147};
     48
     49String stringFromCascadeLayerName(const CascadeLayerName&);
    5250
    5351} // namespace WebCore
    5452
    55 SPECIALIZE_TYPE_TRAITS_CSS_RULE(CSSLayerRule, CSSRule::LAYER_RULE)
     53SPECIALIZE_TYPE_TRAITS_CSS_RULE(CSSLayerBlockRule, CSSRule::LAYER_BLOCK_RULE)
  • trunk/Source/WebCore/css/CSSLayerBlockRule.idl

    r286656 r286657  
    2828 */
    2929
     30typedef USVString CSSOMString;
     31
    3032[
    3133    Exposed=Window
    32 ] interface CSSLayerRule : CSSGroupingRule {
     34] interface CSSLayerBlockRule : CSSGroupingRule {
     35    readonly attribute CSSOMString name;
    3336};
  • trunk/Source/WebCore/css/CSSLayerStatementRule.cpp

    r286656 r286657  
    2828 */
    2929
    30 #pragma once
     30#include "config.h"
     31#include "CSSLayerStatementRule.h"
    3132
    32 #include "CSSGroupingRule.h"
     33#include "CSSStyleSheet.h"
    3334#include "StyleRule.h"
     35#include <wtf/text/StringBuilder.h>
    3436
    3537namespace WebCore {
    3638
    37 class StyleRuleLayer;
     39CSSLayerStatementRule::CSSLayerStatementRule(StyleRuleLayer& rule, CSSStyleSheet* parent)
     40    : CSSRule(parent)
     41    , m_layerRule(rule)
     42{
     43    ASSERT(rule.isStatement());
     44}
    3845
    39 class CSSLayerRule final : public CSSGroupingRule {
    40 public:
    41     static Ref<CSSLayerRule> create(StyleRuleLayer&, CSSStyleSheet* parent);
     46Ref<CSSLayerStatementRule> CSSLayerStatementRule::create(StyleRuleLayer& rule, CSSStyleSheet* parent)
     47{
     48    return adoptRef(*new CSSLayerStatementRule(rule, parent));
     49}
    4250
    43     String cssText() const final;
    44     std::optional<String> layerName() const;
     51String CSSLayerStatementRule::cssText() const
     52{
     53    StringBuilder result;
    4554
    46     static String stringFromCascadeLayerName(const CascadeLayerName&);
     55    result.append("@layer ");
    4756
    48 private:
    49     CSSLayerRule(StyleRuleLayer&, CSSStyleSheet*);
    50     CSSRule::Type type() const final { return LAYER_RULE; }
    51 };
     57    auto nameList = this->nameList();
     58    for (auto& name : nameList) {
     59        result.append(name);
     60        if (&name != &nameList.last())
     61            result.append(", ");
     62    }
     63    result.append(';');
     64
     65    return result.toString();
     66}
     67
     68Vector<String> CSSLayerStatementRule::nameList() const
     69{
     70    Vector<String> result;
     71
     72    for (auto& name : m_layerRule.get().nameList())
     73        result.append(stringFromCascadeLayerName(name));
     74
     75    return result;
     76}
     77
     78void CSSLayerStatementRule::reattach(StyleRuleBase& rule)
     79{
     80    m_layerRule = static_cast<StyleRuleLayer&>(rule);
     81}
    5282
    5383} // namespace WebCore
    5484
    55 SPECIALIZE_TYPE_TRAITS_CSS_RULE(CSSLayerRule, CSSRule::LAYER_RULE)
  • trunk/Source/WebCore/css/CSSLayerStatementRule.h

    r286656 r286657  
    3535namespace WebCore {
    3636
    37 class StyleRuleLayer;
    38 
    39 class CSSLayerRule final : public CSSGroupingRule {
     37class CSSLayerStatementRule final : public CSSRule {
    4038public:
    41     static Ref<CSSLayerRule> create(StyleRuleLayer&, CSSStyleSheet* parent);
     39    static Ref<CSSLayerStatementRule> create(StyleRuleLayer&, CSSStyleSheet* parent);
    4240
    4341    String cssText() const final;
    44     std::optional<String> layerName() const;
    45 
    46     static String stringFromCascadeLayerName(const CascadeLayerName&);
     42    Vector<String> nameList() const;
    4743
    4844private:
    49     CSSLayerRule(StyleRuleLayer&, CSSStyleSheet*);
    50     CSSRule::Type type() const final { return LAYER_RULE; }
     45    CSSLayerStatementRule(StyleRuleLayer&, CSSStyleSheet*);
     46    CSSRule::Type type() const final { return LAYER_STATEMENT_RULE; }
     47    void reattach(StyleRuleBase&) final;
     48
     49    Ref<StyleRuleLayer> m_layerRule;
    5150};
    5251
    5352} // namespace WebCore
    5453
    55 SPECIALIZE_TYPE_TRAITS_CSS_RULE(CSSLayerRule, CSSRule::LAYER_RULE)
     54SPECIALIZE_TYPE_TRAITS_CSS_RULE(CSSLayerStatementRule, CSSRule::LAYER_STATEMENT_RULE)
  • trunk/Source/WebCore/css/CSSLayerStatementRule.idl

    r286656 r286657  
    2828 */
    2929
     30typedef USVString CSSOMString;
     31
    3032[
    3133    Exposed=Window
    32 ] interface CSSLayerRule : CSSGroupingRule {
     34] interface CSSLayerStatementRule : CSSRule {
     35    readonly attribute FrozenArray<CSSOMString> nameList;
    3336};
  • trunk/Source/WebCore/css/CSSRule.h

    r283170 r286657  
    5252        COUNTER_STYLE_RULE = 11,
    5353        SUPPORTS_RULE = 12,
    54         LAYER_RULE = 16,
     54        LAYER_BLOCK_RULE = 16,
     55        LAYER_STATEMENT_RULE = 17,
    5556        FONT_PALETTE_VALUES_RULE = 19,
    5657    };
  • trunk/Source/WebCore/css/StyleRule.cpp

    r283752 r286657  
    3030#include "CSSKeyframeRule.h"
    3131#include "CSSKeyframesRule.h"
    32 #include "CSSLayerRule.h"
     32#include "CSSLayerBlockRule.h"
     33#include "CSSLayerStatementRule.h"
    3334#include "CSSMediaRule.h"
    3435#include "CSSNamespaceRule.h"
     
    100101        delete downcast<StyleRuleCounterStyle>(this);
    101102        return;
    102     case StyleRuleType::Layer:
     103    case StyleRuleType::LayerBlock:
     104    case StyleRuleType::LayerStatement:
    103105        delete downcast<StyleRuleLayer>(this);
    104106        return;
     
    129131    case StyleRuleType::CounterStyle:
    130132        return downcast<StyleRuleCounterStyle>(*this).copy();
    131     case StyleRuleType::Layer:
     133    case StyleRuleType::LayerBlock:
     134    case StyleRuleType::LayerStatement:
    132135        return downcast<StyleRuleLayer>(*this).copy();
    133136    case StyleRuleType::Import:
     
    178181        rule = CSSCounterStyleRule::create(downcast<StyleRuleCounterStyle>(self), parentSheet);
    179182        break;
    180     case StyleRuleType::Layer:
    181         rule = CSSLayerRule::create(downcast<StyleRuleLayer>(self), parentSheet);
     183    case StyleRuleType::LayerBlock:
     184        rule = CSSLayerBlockRule::create(downcast<StyleRuleLayer>(self), parentSheet);
     185        break;
     186    case StyleRuleType::LayerStatement:
     187        rule = CSSLayerStatementRule::create(downcast<StyleRuleLayer>(self), parentSheet);
    182188        break;
    183189    case StyleRuleType::Unknown:
     
    480486
    481487StyleRuleLayer::StyleRuleLayer(Vector<CascadeLayerName>&& nameList)
    482     : StyleRuleGroup(StyleRuleType::Layer, Vector<RefPtr<StyleRuleBase>> { })
     488    : StyleRuleGroup(StyleRuleType::LayerStatement, Vector<RefPtr<StyleRuleBase>> { })
    483489    , m_nameVariant(WTFMove(nameList))
    484490{
     
    486492
    487493StyleRuleLayer::StyleRuleLayer(CascadeLayerName&& name, Vector<RefPtr<StyleRuleBase>>&& rules)
    488     : StyleRuleGroup(StyleRuleType::Layer, WTFMove(rules))
     494    : StyleRuleGroup(StyleRuleType::LayerBlock, WTFMove(rules))
    489495    , m_nameVariant(WTFMove(name))
    490496{
     
    492498
    493499StyleRuleLayer::StyleRuleLayer(CascadeLayerName&& name, std::unique_ptr<DeferredStyleGroupRuleList>&& rules)
    494     : StyleRuleGroup(StyleRuleType::Layer, WTFMove(rules))
     500    : StyleRuleGroup(StyleRuleType::LayerBlock, WTFMove(rules))
    495501    , m_nameVariant(WTFMove(name))
    496502{
  • trunk/Source/WebCore/css/StyleRule.h

    r284213 r286657  
    6161    bool isPageRule() const { return type() == StyleRuleType::Page; }
    6262    bool isStyleRule() const { return type() == StyleRuleType::Style; }
    63     bool isGroupRule() const { return type() == StyleRuleType::Media || type() == StyleRuleType::Supports || type() == StyleRuleType::Layer; }
     63    bool isGroupRule() const { return type() == StyleRuleType::Media || type() == StyleRuleType::Supports || type() == StyleRuleType::LayerBlock; }
    6464    bool isSupportsRule() const { return type() == StyleRuleType::Supports; }
    6565    bool isImportRule() const { return type() == StyleRuleType::Import; }
    66     bool isLayerRule() const { return type() == StyleRuleType::Layer; }
     66    bool isLayerRule() const { return type() == StyleRuleType::LayerBlock || type() == StyleRuleType::LayerStatement; }
    6767
    6868    Ref<StyleRuleBase> copy() const;
     
    299299    Ref<StyleRuleLayer> copy() const { return adoptRef(*new StyleRuleLayer(*this)); }
    300300
    301     bool isStatement() const { return std::holds_alternative<Vector<CascadeLayerName>>(m_nameVariant); }
     301    bool isStatement() const { return type() == StyleRuleType::LayerStatement; }
    302302
    303303    auto& name() const { return std::get<CascadeLayerName>(m_nameVariant); }
  • trunk/Source/WebCore/css/StyleRuleType.h

    r283170 r286657  
    4141    CounterStyle = 11,
    4242    Supports = 12,
    43     Layer = 16,
     43    LayerBlock = 16,
     44    LayerStatement = 17,
    4445    FontPaletteValues = 19,
    4546};
  • trunk/Source/WebCore/css/StyleSheetContents.cpp

    r285980 r286657  
    459459        case StyleRuleType::Media:
    460460        case StyleRuleType::Supports:
    461         case StyleRuleType::Layer: {
     461        case StyleRuleType::LayerBlock: {
    462462            auto* childRules = downcast<StyleRuleGroup>(*rule).childRulesWithoutDeferredParsing();
    463463            if (childRules && traverseRulesInVector(*childRules, handler))
     
    478478        case StyleRuleType::CounterStyle:
    479479        case StyleRuleType::Keyframe:
     480        case StyleRuleType::LayerStatement:
    480481            break;
    481482        }
     
    520521        case StyleRuleType::Keyframe:
    521522        case StyleRuleType::Supports:
    522         case StyleRuleType::Layer:
     523        case StyleRuleType::LayerBlock:
     524        case StyleRuleType::LayerStatement:
    523525        case StyleRuleType::FontPaletteValues:
    524526            return false;
  • trunk/Source/WebCore/css/parser/CSSParserImpl.cpp

    r286064 r286657  
    812812        if (m_observerWrapper) {
    813813            unsigned endOffset = m_observerWrapper->endOffset(preludeCopy);
    814             m_observerWrapper->observer().startRuleHeader(StyleRuleType::Layer, m_observerWrapper->startOffset(preludeCopy));
     814            m_observerWrapper->observer().startRuleHeader(StyleRuleType::LayerStatement, m_observerWrapper->startOffset(preludeCopy));
    815815            m_observerWrapper->observer().endRuleHeader(endOffset);
    816816            m_observerWrapper->observer().startRuleBody(endOffset);
     
    833833
    834834    if (m_observerWrapper) {
    835         m_observerWrapper->observer().startRuleHeader(StyleRuleType::Layer, m_observerWrapper->startOffset(preludeCopy));
     835        m_observerWrapper->observer().startRuleHeader(StyleRuleType::LayerBlock, m_observerWrapper->startOffset(preludeCopy));
    836836        m_observerWrapper->observer().endRuleHeader(m_observerWrapper->endOffset(preludeCopy));
    837837        m_observerWrapper->observer().startRuleBody(m_observerWrapper->previousTokenStartOffset(*block));
  • trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp

    r286558 r286657  
    2929#include "CSSImportRule.h"
    3030#include "CSSKeyframesRule.h"
    31 #include "CSSLayerRule.h"
     31#include "CSSLayerBlockRule.h"
     32#include "CSSLayerStatementRule.h"
    3233#include "CSSMediaRule.h"
    3334#include "CSSParser.h"
     
    108109        if (data->type == WebCore::StyleRuleType::Style)
    109110            target.append(data.copyRef());
    110         else if (data->type == WebCore::StyleRuleType::Media || data->type == WebCore::StyleRuleType::Supports || data->type == WebCore::StyleRuleType::Layer)
     111        else if (data->type == WebCore::StyleRuleType::Media || data->type == WebCore::StyleRuleType::Supports || data->type == WebCore::StyleRuleType::LayerBlock)
    111112            flattenSourceData(data->childRules, target);
    112113    }
     
    427428        return &downcast<CSSSupportsRule>(*rule).cssRules();
    428429
    429     if (is<CSSLayerRule>(*rule))
    430         return &downcast<CSSLayerRule>(*rule).cssRules();
     430    if (is<CSSLayerBlockRule>(*rule))
     431        return &downcast<CSSLayerBlockRule>(*rule).cssRules();
    431432
    432433    return nullptr;
     
    451452            }
    452453        } else if (is<CSSImportRule>(parentRule)) {
    453             if (auto& layerName = downcast<CSSImportRule>(parentRule)->cascadeLayerName()) {
     454            auto layerName = downcast<CSSImportRule>(parentRule)->layerName();
     455            if (!layerName.isNull()) {
    454456                auto layerRulePayload = Protocol::CSS::Grouping::create()
    455457                    .setType(Protocol::CSS::Grouping::Type::LayerImportRule)
    456458                    .release();
    457                 layerRulePayload->setText(CSSLayerRule::stringFromCascadeLayerName(*layerName));
     459                layerRulePayload->setText(layerName);
    458460                ruleGroupingPayloads.append(WTFMove(layerRulePayload));
    459461            }
     
    473475            supportsRulePayload->setText(downcast<CSSSupportsRule>(parentRule)->conditionText());
    474476            ruleGroupingPayloads.append(WTFMove(supportsRulePayload));
    475         } else if (is<CSSLayerRule>(parentRule)) {
     477        } else if (is<CSSLayerBlockRule>(parentRule)) {
    476478            auto layerRulePayload = Protocol::CSS::Grouping::create()
    477479                .setType(Protocol::CSS::Grouping::Type::LayerRule)
    478480                .release();
    479             if (auto layerName = downcast<CSSLayerRule>(parentRule)->layerName())
    480                 layerRulePayload->setText(*layerName);
     481            layerRulePayload->setText(downcast<CSSLayerBlockRule>(parentRule)->name());
    481482            ruleGroupingPayloads.append(WTFMove(layerRulePayload));
    482483        }
  • trunk/Source/WebCore/style/InspectorCSSOMWrappers.cpp

    r286558 r286657  
    3131
    3232#include "CSSImportRule.h"
    33 #include "CSSLayerRule.h"
     33#include "CSSLayerBlockRule.h"
     34#include "CSSLayerStatementRule.h"
    3435#include "CSSMediaRule.h"
    3536#include "CSSRule.h"
     
    6364            collect(downcast<CSSImportRule>(*cssRule).styleSheet());
    6465            break;
    65         case CSSRule::LAYER_RULE:
    66             collect(downcast<CSSLayerRule>(cssRule));
     66        case CSSRule::LAYER_BLOCK_RULE:
     67            collect(downcast<CSSLayerBlockRule>(cssRule));
    6768            break;
    6869        case CSSRule::MEDIA_RULE:
Note: See TracChangeset for help on using the changeset viewer.