Title: [294007] trunk
Revision
294007
Author
[email protected]
Date
2022-05-10 09:48:31 -0700 (Tue, 10 May 2022)

Log Message

Remove abandoned CSSDeferredParser implementation and feature flag
https://bugs.webkit.org/show_bug.cgi?id=240244

Reviewed by Antti Koivisto.

This patch rolls out the abandoned CSSDeferredParser implementation added in Bug 165743.

Source/WebCore:

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSKeyframesRule.cpp:
(WebCore::StyleRuleKeyframes::keyframes const):
(WebCore::StyleRuleKeyframes::wrapperAppendKeyframe):
(WebCore::StyleRuleKeyframes::wrapperRemoveKeyframe):
(WebCore::StyleRuleKeyframes::findKeyframeIndex const):
(WebCore::StyleRuleKeyframes::parseDeferredRulesIfNeeded const): Deleted.
* css/CSSKeyframesRule.h:
* css/StyleProperties.cpp:
(WebCore::MutableStyleProperties::MutableStyleProperties):
(WebCore::StyleProperties::PropertyReference::cssText const):
(WebCore::DeferredStyleProperties::create): Deleted.
(WebCore::DeferredStyleProperties::DeferredStyleProperties): Deleted.
(WebCore::DeferredStyleProperties::parseDeferredProperties): Deleted.
* css/StyleProperties.h:
(WebCore::StylePropertiesBase::deref const):
(isType):
* css/StyleRule.cpp:
(WebCore::StyleRule::properties const):
(WebCore::StyleRuleGroup::childRules const):
(WebCore::StyleRuleGroup::wrapperInsertRule):
(WebCore::StyleRuleGroup::wrapperRemoveRule):
(WebCore::DeferredStyleGroupRuleList::DeferredStyleGroupRuleList): Deleted.
(WebCore::DeferredStyleGroupRuleList::parseDeferredRules): Deleted.
(WebCore::DeferredStyleGroupRuleList::parseDeferredKeyframes): Deleted.
(WebCore::StyleRuleGroup::parseDeferredRulesIfNeeded const): Deleted.
* css/StyleRule.h:
(WebCore::StyleRule::propertiesWithoutDeferredParsing const): Deleted.
(WebCore::StyleRuleGroup::childRulesWithoutDeferredParsing const): Deleted.
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::parseAuthorStyleSheet):
(WebCore::StyleSheetContents::parseString):
(WebCore::traverseRulesInVector):
(WebCore::StyleSheetContents::traverseSubresources const):
* css/parser/CSSDeferredParser.cpp: Removed.
* css/parser/CSSDeferredParser.h: Removed.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseSheet):
* css/parser/CSSParser.h:
* css/parser/CSSParserContext.cpp:
(WebCore::operator==):
(WebCore::add):
* css/parser/CSSParserContext.h:
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::CSSParserImpl):
(WebCore::CSSParserImpl::parseStyleSheet):
(WebCore::CSSParserImpl::consumeMediaRule):
(WebCore::CSSParserImpl::consumeSupportsRule):
(WebCore::CSSParserImpl::consumeKeyframesRule):
(WebCore::CSSParserImpl::consumeLayerRule):
(WebCore::CSSParserImpl::consumeContainerRule):
(WebCore::CSSParserImpl::consumeStyleRule):
(WebCore::CSSParserImpl::createDeferredStyleProperties): Deleted.
(WebCore::CSSParserImpl::parseDeferredDeclaration): Deleted.
(WebCore::CSSParserImpl::parseDeferredRuleList): Deleted.
(WebCore::CSSParserImpl::parseDeferredKeyframeList): Deleted.
(WebCore::CSSParserImpl::adoptTokenizerEscapedStrings): Deleted.
* css/parser/CSSParserImpl.h:
(WebCore::CSSParserImpl::tokenizer const):
(WebCore::CSSParserImpl::deferredParser const): Deleted.
* style/ElementRuleCollector.cpp:
(WebCore::Style::ElementRuleCollector::collectMatchingRulesForList):
* style/StyleInvalidator.cpp:
(WebCore::Style::shouldDirtyAllStyle):
* testing/Internals.cpp:
(WebCore::deferredStyleRulesCountForList): Deleted.
(WebCore::Internals::deferredStyleRulesCount): Deleted.
(WebCore::deferredGroupRulesCountForList): Deleted.
(WebCore::Internals::deferredGroupRulesCount): Deleted.
(WebCore::deferredKeyframesRulesCountForList): Deleted.
(WebCore::Internals::deferredKeyframesRulesCount): Deleted.
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetDeferredCSSParserEnabled): Deleted.
(WKPreferencesGetDeferredCSSParserEnabled): Deleted.
* UIProcess/API/C/WKPreferencesRefPrivate.h:

Source/WTF:

* Scripts/Preferences/WebPreferences.yaml:

LayoutTests:

* fast/css/deferred-parsing/dynamic-external-style-expected.txt: Removed.
* fast/css/deferred-parsing/dynamic-external-style.html: Removed.
* fast/css/deferred-parsing/dynamic-style-in-document-expected.txt: Removed.
* fast/css/deferred-parsing/dynamic-style-in-document.html: Removed.
* fast/css/deferred-parsing/hover-test-expected.txt: Removed.
* fast/css/deferred-parsing/hover-test.html: Removed.
* fast/css/deferred-parsing/keyframes-rule-expected.txt: Removed.
* fast/css/deferred-parsing/keyframes-rule.html: Removed.
* fast/css/deferred-parsing/media-print-expected.txt: Removed.
* fast/css/deferred-parsing/media-print.html: Removed.
* fast/css/deferred-parsing/nth-of-type-expected.txt: Removed.
* fast/css/deferred-parsing/nth-of-type.html: Removed.
* fast/css/deferred-parsing/resources/basic-sheet.css: Removed.
* fast/css/deferred-parsing/simple-external-style-expected.txt: Removed.
* fast/css/deferred-parsing/simple-external-style.html: Removed.
* fast/css/deferred-parsing/simple-style-in-document-expected.txt: Removed.
* fast/css/deferred-parsing/simple-style-in-document.html: Removed.
* fast/css/deferred-parsing/supports-rule-expected.txt: Removed.
* fast/css/deferred-parsing/supports-rule.html: Removed.
* platform/ios-wk2/TestExpectations:
* platform/ios/TestExpectations:

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (294006 => 294007)


--- trunk/LayoutTests/ChangeLog	2022-05-10 10:13:57 UTC (rev 294006)
+++ trunk/LayoutTests/ChangeLog	2022-05-10 16:48:31 UTC (rev 294007)
@@ -1,3 +1,34 @@
+2022-05-10  Brent Fulgham  <[email protected]>
+
+        Remove abandoned CSSDeferredParser implementation and feature flag
+        https://bugs.webkit.org/show_bug.cgi?id=240244
+
+        Reviewed by Antti Koivisto.
+
+        This patch rolls out the abandoned CSSDeferredParser implementation added in Bug 165743.
+
+        * fast/css/deferred-parsing/dynamic-external-style-expected.txt: Removed.
+        * fast/css/deferred-parsing/dynamic-external-style.html: Removed.
+        * fast/css/deferred-parsing/dynamic-style-in-document-expected.txt: Removed.
+        * fast/css/deferred-parsing/dynamic-style-in-document.html: Removed.
+        * fast/css/deferred-parsing/hover-test-expected.txt: Removed.
+        * fast/css/deferred-parsing/hover-test.html: Removed.
+        * fast/css/deferred-parsing/keyframes-rule-expected.txt: Removed.
+        * fast/css/deferred-parsing/keyframes-rule.html: Removed.
+        * fast/css/deferred-parsing/media-print-expected.txt: Removed.
+        * fast/css/deferred-parsing/media-print.html: Removed.
+        * fast/css/deferred-parsing/nth-of-type-expected.txt: Removed.
+        * fast/css/deferred-parsing/nth-of-type.html: Removed.
+        * fast/css/deferred-parsing/resources/basic-sheet.css: Removed.
+        * fast/css/deferred-parsing/simple-external-style-expected.txt: Removed.
+        * fast/css/deferred-parsing/simple-external-style.html: Removed.
+        * fast/css/deferred-parsing/simple-style-in-document-expected.txt: Removed.
+        * fast/css/deferred-parsing/simple-style-in-document.html: Removed.
+        * fast/css/deferred-parsing/supports-rule-expected.txt: Removed.
+        * fast/css/deferred-parsing/supports-rule.html: Removed.
+        * platform/ios-wk2/TestExpectations:
+        * platform/ios/TestExpectations:
+
 2022-05-09  Oriol Brufau  <[email protected]>
 
         [cssom] Don't index perspective/transform-origin-* in computed styles

Modified: trunk/LayoutTests/platform/ios/TestExpectations (294006 => 294007)


--- trunk/LayoutTests/platform/ios/TestExpectations	2022-05-10 10:13:57 UTC (rev 294006)
+++ trunk/LayoutTests/platform/ios/TestExpectations	2022-05-10 16:48:31 UTC (rev 294007)
@@ -2463,8 +2463,6 @@
 
 webkit.org/b/165691 http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-iframe-in-main-frame.html [ Pass Failure ]
 
-fast/css/deferred-parsing/hover-test.html [ Skip ]
-
 # Form validation popover does not obey minimum font size setting on iOS but Dynamic Type instead.
 fast/forms/validation-message-minimum-font-size.html [ Skip ]
 

Modified: trunk/LayoutTests/platform/ios-wk2/TestExpectations (294006 => 294007)


--- trunk/LayoutTests/platform/ios-wk2/TestExpectations	2022-05-10 10:13:57 UTC (rev 294006)
+++ trunk/LayoutTests/platform/ios-wk2/TestExpectations	2022-05-10 16:48:31 UTC (rev 294007)
@@ -1196,9 +1196,6 @@
 
 webkit.org/b/162685 [ Release ] http/tests/cache/disk-cache/disk-cache-204-status-code.html [ Pass Failure ]
 
-# Hover test does not apply
-fast/css/deferred-parsing/hover-test.html [ Skip ]
-
 # Skipped because there is no key to show the context menu
 fast/events/context-activated-by-key-event.html [ Skip ]
 

Modified: trunk/Source/WTF/ChangeLog (294006 => 294007)


--- trunk/Source/WTF/ChangeLog	2022-05-10 10:13:57 UTC (rev 294006)
+++ trunk/Source/WTF/ChangeLog	2022-05-10 16:48:31 UTC (rev 294007)
@@ -1,3 +1,14 @@
+2022-05-10  Brent Fulgham  <[email protected]>
+
+        Remove abandoned CSSDeferredParser implementation and feature flag
+        https://bugs.webkit.org/show_bug.cgi?id=240244
+
+        Reviewed by Antti Koivisto.
+
+        This patch rolls out the abandoned CSSDeferredParser implementation added in Bug 165743.
+
+        * Scripts/Preferences/WebPreferences.yaml:
+
 2022-05-09  Ross Kirsling  <[email protected]>
 
         Temporal and Date must reject expanded year -000000

Modified: trunk/Source/WTF/Scripts/Preferences/WebPreferences.yaml (294006 => 294007)


--- trunk/Source/WTF/Scripts/Preferences/WebPreferences.yaml	2022-05-10 10:13:57 UTC (rev 294006)
+++ trunk/Source/WTF/Scripts/Preferences/WebPreferences.yaml	2022-05-10 16:48:31 UTC (rev 294007)
@@ -579,16 +579,6 @@
     WebCore:
       default: '{ }'
 
-DeferredCSSParserEnabled:
-  type: bool
-  defaultValue:
-    WebKitLegacy:
-      default: false
-    WebKit:
-      default: false
-    WebCore:
-      default: false
-
 DeviceHeight:
   type: uint32_t
   defaultValue:

Modified: trunk/Source/WebCore/ChangeLog (294006 => 294007)


--- trunk/Source/WebCore/ChangeLog	2022-05-10 10:13:57 UTC (rev 294006)
+++ trunk/Source/WebCore/ChangeLog	2022-05-10 16:48:31 UTC (rev 294007)
@@ -1,3 +1,87 @@
+2022-05-10  Brent Fulgham  <[email protected]>
+
+        Remove abandoned CSSDeferredParser implementation and feature flag
+        https://bugs.webkit.org/show_bug.cgi?id=240244
+
+        Reviewed by Antti Koivisto.
+
+        This patch rolls out the abandoned CSSDeferredParser implementation added in Bug 165743.
+
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * css/CSSKeyframesRule.cpp:
+        (WebCore::StyleRuleKeyframes::keyframes const):
+        (WebCore::StyleRuleKeyframes::wrapperAppendKeyframe):
+        (WebCore::StyleRuleKeyframes::wrapperRemoveKeyframe):
+        (WebCore::StyleRuleKeyframes::findKeyframeIndex const):
+        (WebCore::StyleRuleKeyframes::parseDeferredRulesIfNeeded const): Deleted.
+        * css/CSSKeyframesRule.h:
+        * css/StyleProperties.cpp:
+        (WebCore::MutableStyleProperties::MutableStyleProperties):
+        (WebCore::StyleProperties::PropertyReference::cssText const):
+        (WebCore::DeferredStyleProperties::create): Deleted.
+        (WebCore::DeferredStyleProperties::DeferredStyleProperties): Deleted.
+        (WebCore::DeferredStyleProperties::parseDeferredProperties): Deleted.
+        * css/StyleProperties.h:
+        (WebCore::StylePropertiesBase::deref const):
+        (isType):
+        * css/StyleRule.cpp:
+        (WebCore::StyleRule::properties const):
+        (WebCore::StyleRuleGroup::childRules const):
+        (WebCore::StyleRuleGroup::wrapperInsertRule):
+        (WebCore::StyleRuleGroup::wrapperRemoveRule):
+        (WebCore::DeferredStyleGroupRuleList::DeferredStyleGroupRuleList): Deleted.
+        (WebCore::DeferredStyleGroupRuleList::parseDeferredRules): Deleted.
+        (WebCore::DeferredStyleGroupRuleList::parseDeferredKeyframes): Deleted.
+        (WebCore::StyleRuleGroup::parseDeferredRulesIfNeeded const): Deleted.
+        * css/StyleRule.h:
+        (WebCore::StyleRule::propertiesWithoutDeferredParsing const): Deleted.
+        (WebCore::StyleRuleGroup::childRulesWithoutDeferredParsing const): Deleted.
+        * css/StyleSheetContents.cpp:
+        (WebCore::StyleSheetContents::parseAuthorStyleSheet):
+        (WebCore::StyleSheetContents::parseString):
+        (WebCore::traverseRulesInVector):
+        (WebCore::StyleSheetContents::traverseSubresources const):
+        * css/parser/CSSDeferredParser.cpp: Removed.
+        * css/parser/CSSDeferredParser.h: Removed.
+        * css/parser/CSSParser.cpp:
+        (WebCore::CSSParser::parseSheet):
+        * css/parser/CSSParser.h:
+        * css/parser/CSSParserContext.cpp:
+        (WebCore::operator==):
+        (WebCore::add):
+        * css/parser/CSSParserContext.h:
+        * css/parser/CSSParserImpl.cpp:
+        (WebCore::CSSParserImpl::CSSParserImpl):
+        (WebCore::CSSParserImpl::parseStyleSheet):
+        (WebCore::CSSParserImpl::consumeMediaRule):
+        (WebCore::CSSParserImpl::consumeSupportsRule):
+        (WebCore::CSSParserImpl::consumeKeyframesRule):
+        (WebCore::CSSParserImpl::consumeLayerRule):
+        (WebCore::CSSParserImpl::consumeContainerRule):
+        (WebCore::CSSParserImpl::consumeStyleRule):
+        (WebCore::CSSParserImpl::createDeferredStyleProperties): Deleted.
+        (WebCore::CSSParserImpl::parseDeferredDeclaration): Deleted.
+        (WebCore::CSSParserImpl::parseDeferredRuleList): Deleted.
+        (WebCore::CSSParserImpl::parseDeferredKeyframeList): Deleted.
+        (WebCore::CSSParserImpl::adoptTokenizerEscapedStrings): Deleted.
+        * css/parser/CSSParserImpl.h:
+        (WebCore::CSSParserImpl::tokenizer const):
+        (WebCore::CSSParserImpl::deferredParser const): Deleted.
+        * style/ElementRuleCollector.cpp:
+        (WebCore::Style::ElementRuleCollector::collectMatchingRulesForList):
+        * style/StyleInvalidator.cpp:
+        (WebCore::Style::shouldDirtyAllStyle):
+        * testing/Internals.cpp:
+        (WebCore::deferredStyleRulesCountForList): Deleted.
+        (WebCore::Internals::deferredStyleRulesCount): Deleted.
+        (WebCore::deferredGroupRulesCountForList): Deleted.
+        (WebCore::Internals::deferredGroupRulesCount): Deleted.
+        (WebCore::deferredKeyframesRulesCountForList): Deleted.
+        (WebCore::Internals::deferredKeyframesRulesCount): Deleted.
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
 2022-05-10  Youenn Fablet  <[email protected]>
 
         Create a stopped CacheStorageConnection for workers in case of detached documents

Modified: trunk/Source/WebCore/Sources.txt (294006 => 294007)


--- trunk/Source/WebCore/Sources.txt	2022-05-10 10:13:57 UTC (rev 294006)
+++ trunk/Source/WebCore/Sources.txt	2022-05-10 16:48:31 UTC (rev 294007)
@@ -832,7 +832,6 @@
 css/calc/CSSCalcSymbolTable.cpp
 css/calc/CSSCalcValue.cpp
 css/parser/CSSAtRuleID.cpp
-css/parser/CSSDeferredParser.cpp
 css/parser/CSSParser.cpp
 css/parser/CSSParserContext.cpp
 css/parser/CSSParserFastPaths.cpp

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (294006 => 294007)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2022-05-10 10:13:57 UTC (rev 294006)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2022-05-10 16:48:31 UTC (rev 294007)
@@ -3086,7 +3086,6 @@
 		9444CBDA1D88483A0073A074 /* CSSVariableParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 9444CBD71D88482A0073A074 /* CSSVariableParser.h */; };
 		9444CBE81D8861C20073A074 /* CSSVariableData.h in Headers */ = {isa = PBXBuildFile; fileRef = 9444CBDD1D8861580073A074 /* CSSVariableData.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		9444CBEA1D8861CA0073A074 /* CSSVariableReferenceValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 9444CBDB1D8861580073A074 /* CSSVariableReferenceValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		94476BDB1DFCAC0300690E23 /* CSSDeferredParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 94476BD91DFCA4A700690E23 /* CSSDeferredParser.h */; };
 		946D372E1D6CB2940077084F /* CSSParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 946D37291D6CB28B0077084F /* CSSParser.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		946D372F1D6CB2940077084F /* CSSParserMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 946D372A1D6CB28B0077084F /* CSSParserMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		946D37311D6CB2940077084F /* CSSParserSelector.h in Headers */ = {isa = PBXBuildFile; fileRef = 946D372C1D6CB28B0077084F /* CSSParserSelector.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -13031,8 +13030,6 @@
 		9444CBDC1D8861580073A074 /* CSSVariableReferenceValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSVariableReferenceValue.cpp; sourceTree = "<group>"; };
 		9444CBDD1D8861580073A074 /* CSSVariableData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSVariableData.h; sourceTree = "<group>"; };
 		9444CBDE1D8861580073A074 /* CSSVariableData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSVariableData.cpp; sourceTree = "<group>"; };
-		94476BD81DFCA4A700690E23 /* CSSDeferredParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CSSDeferredParser.cpp; path = parser/CSSDeferredParser.cpp; sourceTree = "<group>"; };
-		94476BD91DFCA4A700690E23 /* CSSDeferredParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSDeferredParser.h; path = parser/CSSDeferredParser.h; sourceTree = "<group>"; };
 		946D37281D6CB28B0077084F /* CSSParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CSSParser.cpp; path = parser/CSSParser.cpp; sourceTree = "<group>"; };
 		946D37291D6CB28B0077084F /* CSSParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSParser.h; path = parser/CSSParser.h; sourceTree = "<group>"; };
 		946D372A1D6CB28B0077084F /* CSSParserMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSParserMode.h; path = parser/CSSParserMode.h; sourceTree = "<group>"; };
@@ -26231,8 +26228,6 @@
 			children = (
 				94DE5C7F1D7F39D000164F2A /* CSSAtRuleID.cpp */,
 				94DE5C801D7F39D000164F2A /* CSSAtRuleID.h */,
-				94476BD81DFCA4A700690E23 /* CSSDeferredParser.cpp */,
-				94476BD91DFCA4A700690E23 /* CSSDeferredParser.h */,
 				946D37281D6CB28B0077084F /* CSSParser.cpp */,
 				946D37291D6CB28B0077084F /* CSSParser.h */,
 				E4A7995020EE4AE200C19568 /* CSSParserContext.cpp */,
@@ -34281,7 +34276,6 @@
 				2D8FEBDD143E3EF70072502B /* CSSCrossfadeValue.h in Headers */,
 				AA21ECCD0ABF0FC6002B834C /* CSSCursorImageValue.h in Headers */,
 				BC779E141BB215BB00CAA8BF /* CSSCustomPropertyValue.h in Headers */,
-				94476BDB1DFCAC0300690E23 /* CSSDeferredParser.h in Headers */,
 				7246963B275C5FA600A9156A /* CSSFilter.h in Headers */,
 				FBB0C5B817BBD629003D3677 /* CSSFilterImageValue.h in Headers */,
 				BC64B4D60CB4298A005F2B62 /* CSSFontFace.h in Headers */,

Modified: trunk/Source/WebCore/css/CSSKeyframesRule.cpp (294006 => 294007)


--- trunk/Source/WebCore/css/CSSKeyframesRule.cpp	2022-05-10 10:13:57 UTC (rev 294006)
+++ trunk/Source/WebCore/css/CSSKeyframesRule.cpp	2022-05-10 16:48:31 UTC (rev 294007)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007, 2008, 2012, 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2007-2022 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -26,7 +26,6 @@
 #include "config.h"
 #include "CSSKeyframesRule.h"
 
-#include "CSSDeferredParser.h"
 #include "CSSKeyframeRule.h"
 #include "CSSParser.h"
 #include "CSSRuleList.h"
@@ -42,14 +41,6 @@
 {
 }
 
-StyleRuleKeyframes::StyleRuleKeyframes(const AtomString& name, std::unique_ptr<DeferredStyleGroupRuleList>&& deferredRules)
-    : StyleRuleBase(StyleRuleType::Keyframes)
-    , m_name(name)
-    , m_deferredRules(WTFMove(deferredRules))
-{
-    
-}
-
 StyleRuleKeyframes::StyleRuleKeyframes(const StyleRuleKeyframes& o)
     : StyleRuleBase(o)
     , m_keyframes(o.keyframes())
@@ -62,25 +53,10 @@
     return adoptRef(*new StyleRuleKeyframes(name));
 }
 
-Ref<StyleRuleKeyframes> StyleRuleKeyframes::create(const AtomString& name, std::unique_ptr<DeferredStyleGroupRuleList>&& deferredRules)
-{
-    return adoptRef(*new StyleRuleKeyframes(name, WTFMove(deferredRules)));
-}
-
 StyleRuleKeyframes::~StyleRuleKeyframes() = default;
 
-void StyleRuleKeyframes::parseDeferredRulesIfNeeded() const
-{
-    if (!m_deferredRules)
-        return;
-
-    m_deferredRules->parseDeferredKeyframes(const_cast<StyleRuleKeyframes&>(*this));
-    m_deferredRules = nullptr;
-}
-
 const Vector<Ref<StyleRuleKeyframe>>& StyleRuleKeyframes::keyframes() const
 {
-    parseDeferredRulesIfNeeded();
     return m_keyframes;
 }
 
@@ -93,19 +69,16 @@
 
 void StyleRuleKeyframes::wrapperAppendKeyframe(Ref<StyleRuleKeyframe>&& keyframe)
 {
-    parseDeferredRulesIfNeeded();
     m_keyframes.append(WTFMove(keyframe));
 }
 
 void StyleRuleKeyframes::wrapperRemoveKeyframe(unsigned index)
 {
-    parseDeferredRulesIfNeeded();
     m_keyframes.remove(index);
 }
 
 std::optional<size_t> StyleRuleKeyframes::findKeyframeIndex(const String& key) const
 {
-    parseDeferredRulesIfNeeded();
     auto keys = CSSParser::parseKeyframeKeyList(key);
     if (keys.isEmpty())
         return std::nullopt;

Modified: trunk/Source/WebCore/css/CSSKeyframesRule.h (294006 => 294007)


--- trunk/Source/WebCore/css/CSSKeyframesRule.h	2022-05-10 10:13:57 UTC (rev 294006)
+++ trunk/Source/WebCore/css/CSSKeyframesRule.h	2022-05-10 16:48:31 UTC (rev 294007)
@@ -40,14 +40,9 @@
 class StyleRuleKeyframes final : public StyleRuleBase {
 public:
     static Ref<StyleRuleKeyframes> create(const AtomString& name);
-    static Ref<StyleRuleKeyframes> create(const AtomString& name, std::unique_ptr<DeferredStyleGroupRuleList>&&);
     ~StyleRuleKeyframes();
     
     const Vector<Ref<StyleRuleKeyframe>>& keyframes() const;
-    const Vector<Ref<StyleRuleKeyframe>>* keyframesWithoutDeferredParsing() const
-    {
-        return !m_deferredRules ? &m_keyframes : nullptr;
-    }
 
     void parserAppendKeyframe(RefPtr<StyleRuleKeyframe>&&);
     void wrapperAppendKeyframe(Ref<StyleRuleKeyframe>&&);
@@ -64,15 +59,10 @@
 
 private:
     explicit StyleRuleKeyframes(const AtomString&);
-    StyleRuleKeyframes(const AtomString&, std::unique_ptr<DeferredStyleGroupRuleList>&&);
     StyleRuleKeyframes(const StyleRuleKeyframes&);
-
-    void parseDeferredRulesIfNeeded() const;
     
     mutable Vector<Ref<StyleRuleKeyframe>> m_keyframes;
     AtomString m_name;
-    
-    mutable std::unique_ptr<DeferredStyleGroupRuleList> m_deferredRules;
 };
 
 class CSSKeyframesRule final : public CSSRule {

Modified: trunk/Source/WebCore/css/StyleProperties.cpp (294006 => 294007)


--- trunk/Source/WebCore/css/StyleProperties.cpp	2022-05-10 10:13:57 UTC (rev 294006)
+++ trunk/Source/WebCore/css/StyleProperties.cpp	2022-05-10 16:48:31 UTC (rev 294007)
@@ -26,7 +26,6 @@
 #include "CSSBorderImageWidthValue.h"
 #include "CSSComputedStyleDeclaration.h"
 #include "CSSCustomPropertyValue.h"
-#include "CSSDeferredParser.h"
 #include "CSSGridLineNamesValue.h"
 #include "CSSGridTemplateAreasValue.h"
 #include "CSSOffsetRotateValue.h"
@@ -133,7 +132,6 @@
 MutableStyleProperties::MutableStyleProperties(const StyleProperties& other)
     : StyleProperties(other.cssParserMode(), MutablePropertiesType)
 {
-    ASSERT(other.type() != DeferredPropertiesType);
     if (is<MutableStyleProperties>(other))
         m_propertyVector = downcast<MutableStyleProperties>(other).m_propertyVector;
     else {
@@ -2007,24 +2005,5 @@
 {
     return makeString(cssName(), ": ", m_value->cssText(), isImportant() ? " !important" : "", ';');
 }
-    
-Ref<DeferredStyleProperties> DeferredStyleProperties::create(const CSSParserTokenRange& tokenRange, CSSDeferredParser& parser)
-{
-    return adoptRef(*new DeferredStyleProperties(tokenRange, parser));
-}
 
-DeferredStyleProperties::DeferredStyleProperties(const CSSParserTokenRange& range, CSSDeferredParser& parser)
-    : StylePropertiesBase(parser.mode(), DeferredPropertiesType)
-    , m_tokens(range.begin(), range.end() - range.begin())
-    , m_parser(parser)
-{
-}
-    
-DeferredStyleProperties::~DeferredStyleProperties() = default;
-
-Ref<ImmutableStyleProperties> DeferredStyleProperties::parseDeferredProperties()
-{
-    return m_parser->parseDeclaration(m_tokens);
-}
-
 } // namespace WebCore

Modified: trunk/Source/WebCore/css/StyleProperties.h (294006 => 294007)


--- trunk/Source/WebCore/css/StyleProperties.h	2022-05-10 10:13:57 UTC (rev 294006)
+++ trunk/Source/WebCore/css/StyleProperties.h	2022-05-10 16:48:31 UTC (rev 294007)
@@ -1,6 +1,6 @@
 /*
  * (C) 1999-2003 Lars Knoll ([email protected])
- * Copyright (C) 2004, 2005, 2006, 2008, 2012, 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2004-2022 Apple Inc. All rights reserved.
  * Copyright (C) 2013 Intel Corporation. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
@@ -33,7 +33,6 @@
 
 namespace WebCore {
 
-class CSSDeferredParser;
 class CSSStyleDeclaration;
 class CachedResource;
 class Color;
@@ -44,7 +43,7 @@
 class StylePropertyShorthand;
 class StyleSheetContents;
 
-enum StylePropertiesType { ImmutablePropertiesType, MutablePropertiesType, DeferredPropertiesType };
+enum StylePropertiesType { ImmutablePropertiesType, MutablePropertiesType };
 
 class StylePropertiesBase : public RefCounted<StylePropertiesBase> {
 public:
@@ -281,20 +280,6 @@
     friend class StyleProperties;
 };
 
-class DeferredStyleProperties final : public StylePropertiesBase {
-public:
-    WEBCORE_EXPORT ~DeferredStyleProperties();
-    static Ref<DeferredStyleProperties> create(const CSSParserTokenRange&, CSSDeferredParser&);
-
-    Ref<ImmutableStyleProperties> parseDeferredProperties();
-    
-private:
-    DeferredStyleProperties(const CSSParserTokenRange&, CSSDeferredParser&);
-    
-    Vector<CSSParserToken> m_tokens;
-    Ref<CSSDeferredParser> m_parser;
-};
-
 inline ImmutableStyleProperties::PropertyReference ImmutableStyleProperties::propertyAt(unsigned index) const
 {
     return PropertyReference(metadataArray()[index], valueArray()[index].get());
@@ -329,8 +314,6 @@
         delete downcast<MutableStyleProperties>(this);
     else if (is<ImmutableStyleProperties>(*this))
         delete downcast<ImmutableStyleProperties>(this);
-    else
-        delete downcast<DeferredStyleProperties>(this);
 }
 
 inline int StyleProperties::findPropertyIndex(CSSPropertyID propertyID) const
@@ -350,7 +333,7 @@
 } // namespace WebCore
 
 SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::StyleProperties)
-    static bool isType(const WebCore::StylePropertiesBase& set) { return set.type() != WebCore::DeferredPropertiesType; }
+    static bool isType(const WebCore::StylePropertiesBase&) { return true; }
 SPECIALIZE_TYPE_TRAITS_END()
 
 SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::MutableStyleProperties)
@@ -361,7 +344,3 @@
     static bool isType(const WebCore::StylePropertiesBase& set) { return set.type() == WebCore::ImmutablePropertiesType; }
 SPECIALIZE_TYPE_TRAITS_END()
 
-SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::DeferredStyleProperties)
-    static bool isType(const WebCore::StylePropertiesBase& set) { return set.type() == WebCore::DeferredPropertiesType; }
-SPECIALIZE_TYPE_TRAITS_END()
-

Modified: trunk/Source/WebCore/css/StyleRule.cpp (294006 => 294007)


--- trunk/Source/WebCore/css/StyleRule.cpp	2022-05-10 10:13:57 UTC (rev 294006)
+++ trunk/Source/WebCore/css/StyleRule.cpp	2022-05-10 16:48:31 UTC (rev 294007)
@@ -1,7 +1,7 @@
 /*
  * (C) 1999-2003 Lars Knoll ([email protected])
  * (C) 2002-2003 Dirk Mueller ([email protected])
- * Copyright (C) 2002-2021 Apple Inc. All rights reserved.
+ * Copyright (C) 2002-2022 Apple Inc. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -24,7 +24,6 @@
 
 #include "CSSContainerRule.h"
 #include "CSSCounterStyleRule.h"
-#include "CSSDeferredParser.h"
 #include "CSSFontFaceRule.h"
 #include "CSSFontPaletteValuesRule.h"
 #include "CSSImportRule.h"
@@ -246,8 +245,6 @@
 
 const StyleProperties& StyleRule::properties() const
 {
-    if (m_properties->type() == DeferredPropertiesType)
-        m_properties = downcast<DeferredStyleProperties>(m_properties.get()).parseDeferredProperties();
     return downcast<StyleProperties>(m_properties.get());
 }
 
@@ -365,24 +362,6 @@
 }
 
 StyleRuleFontPaletteValues::~StyleRuleFontPaletteValues() = default;
-
-DeferredStyleGroupRuleList::DeferredStyleGroupRuleList(const CSSParserTokenRange& range, CSSDeferredParser& parser)
-    : m_tokens(range.begin(), range.end() - range.begin())
-    , m_parser(parser)
-{
-}
-
-DeferredStyleGroupRuleList::~DeferredStyleGroupRuleList() = default;
-
-void DeferredStyleGroupRuleList::parseDeferredRules(Vector<RefPtr<StyleRuleBase>>& childRules)
-{
-    m_parser->parseRuleList(m_tokens, childRules);
-}
-
-void DeferredStyleGroupRuleList::parseDeferredKeyframes(StyleRuleKeyframes& keyframesRule)
-{
-    m_parser->parseKeyframeList(m_tokens, keyframesRule);
-}
     
 StyleRuleGroup::StyleRuleGroup(StyleRuleType type, Vector<RefPtr<StyleRuleBase>>&& rules)
     : StyleRuleBase(type)
@@ -390,12 +369,6 @@
 {
 }
 
-StyleRuleGroup::StyleRuleGroup(StyleRuleType type, std::unique_ptr<DeferredStyleGroupRuleList>&& rules)
-    : StyleRuleBase(type)
-    , m_deferredRules(WTFMove(rules))
-{
-}
-
 StyleRuleGroup::StyleRuleGroup(const StyleRuleGroup& o)
     : StyleRuleBase(o)
     , m_childRules(o.childRules().map([](auto& rule) -> RefPtr<StyleRuleBase> { return rule->copy(); }))
@@ -404,31 +377,19 @@
 
 const Vector<RefPtr<StyleRuleBase>>& StyleRuleGroup::childRules() const
 {
-    parseDeferredRulesIfNeeded();
     return m_childRules;
 }
 
 void StyleRuleGroup::wrapperInsertRule(unsigned index, Ref<StyleRuleBase>&& rule)
 {
-    parseDeferredRulesIfNeeded();
     m_childRules.insert(index, WTFMove(rule));
 }
     
 void StyleRuleGroup::wrapperRemoveRule(unsigned index)
 {
-    parseDeferredRulesIfNeeded();
     m_childRules.remove(index);
 }
 
-void StyleRuleGroup::parseDeferredRulesIfNeeded() const
-{
-    if (!m_deferredRules)
-        return;
-    
-    m_deferredRules->parseDeferredRules(m_childRules);
-    m_deferredRules = nullptr;
-}
-    
 StyleRuleMedia::StyleRuleMedia(Ref<MediaQuerySet>&& media, Vector<RefPtr<StyleRuleBase>>&& rules)
     : StyleRuleGroup(StyleRuleType::Media, WTFMove(rules))
     , m_mediaQueries(WTFMove(media))
@@ -435,12 +396,6 @@
 {
 }
 
-StyleRuleMedia::StyleRuleMedia(Ref<MediaQuerySet>&& media, std::unique_ptr<DeferredStyleGroupRuleList>&& rules)
-    : StyleRuleGroup(StyleRuleType::Media, WTFMove(rules))
-    , m_mediaQueries(WTFMove(media))
-{
-}
-
 StyleRuleMedia::StyleRuleMedia(const StyleRuleMedia& other)
     : StyleRuleGroup(other)
     , m_mediaQueries(other.m_mediaQueries->copy())
@@ -452,11 +407,6 @@
     return adoptRef(*new StyleRuleMedia(WTFMove(media), WTFMove(rules)));
 }
 
-Ref<StyleRuleMedia> StyleRuleMedia::create(Ref<MediaQuerySet>&& media, std::unique_ptr<DeferredStyleGroupRuleList>&& deferredChildRules)
-{
-    return adoptRef(*new StyleRuleMedia(WTFMove(media), WTFMove(deferredChildRules)));
-}
-
 Ref<StyleRuleMedia> StyleRuleMedia::copy() const
 {
     return adoptRef(*new StyleRuleMedia(*this));
@@ -469,13 +419,6 @@
 {
 }
 
-StyleRuleSupports::StyleRuleSupports(const String& conditionText, bool conditionIsSupported, std::unique_ptr<DeferredStyleGroupRuleList>&& rules)
-    : StyleRuleGroup(StyleRuleType::Supports, WTFMove(rules))
-    , m_conditionText(conditionText)
-    , m_conditionIsSupported(conditionIsSupported)
-{
-}
-
 StyleRuleSupports::StyleRuleSupports(const StyleRuleSupports& o)
     : StyleRuleGroup(o)
     , m_conditionText(o.m_conditionText)
@@ -489,11 +432,6 @@
     return adoptRef(*new StyleRuleSupports(conditionText, conditionIsSupported, WTFMove(rules)));
 }
 
-Ref<StyleRuleSupports> StyleRuleSupports::create(const String& conditionText, bool conditionIsSupported, std::unique_ptr<DeferredStyleGroupRuleList>&& rules)
-{
-    return adoptRef(*new StyleRuleSupports(conditionText, conditionIsSupported, WTFMove(rules)));
-}
-
 StyleRuleLayer::StyleRuleLayer(Vector<CascadeLayerName>&& nameList)
     : StyleRuleGroup(StyleRuleType::LayerStatement, Vector<RefPtr<StyleRuleBase>> { })
     , m_nameVariant(WTFMove(nameList))
@@ -506,12 +444,6 @@
 {
 }
 
-StyleRuleLayer::StyleRuleLayer(CascadeLayerName&& name, std::unique_ptr<DeferredStyleGroupRuleList>&& rules)
-    : StyleRuleGroup(StyleRuleType::LayerBlock, WTFMove(rules))
-    , m_nameVariant(WTFMove(name))
-{
-}
-
 StyleRuleLayer::StyleRuleLayer(const StyleRuleLayer& other)
     : StyleRuleGroup(other)
     , m_nameVariant(other.m_nameVariant)
@@ -528,11 +460,6 @@
     return adoptRef(*new StyleRuleLayer(WTFMove(name), WTFMove(rules)));
 }
 
-Ref<StyleRuleLayer> StyleRuleLayer::createBlock(CascadeLayerName&& name, std::unique_ptr<DeferredStyleGroupRuleList>&& rules)
-{
-    return adoptRef(*new StyleRuleLayer(WTFMove(name), WTFMove(rules)));
-}
-
 StyleRuleContainer::StyleRuleContainer(FilteredContainerQuery&& query, Vector<RefPtr<StyleRuleBase>>&& rules)
     : StyleRuleGroup(StyleRuleType::Container, WTFMove(rules))
     , m_filteredQuery(WTFMove(query))
@@ -539,12 +466,6 @@
 {
 }
 
-StyleRuleContainer::StyleRuleContainer(FilteredContainerQuery&& query, std::unique_ptr<DeferredStyleGroupRuleList>&& rules)
-    : StyleRuleGroup(StyleRuleType::Container, WTFMove(rules))
-    , m_filteredQuery(WTFMove(query))
-{
-}
-
 StyleRuleContainer::StyleRuleContainer(const StyleRuleContainer& other)
     : StyleRuleGroup(other)
     , m_filteredQuery(other.m_filteredQuery)
@@ -556,11 +477,6 @@
     return adoptRef(*new StyleRuleContainer(WTFMove(query), WTFMove(rules)));
 }
 
-Ref<StyleRuleContainer> StyleRuleContainer::create(FilteredContainerQuery&& query, std::unique_ptr<DeferredStyleGroupRuleList>&& rules)
-{
-    return adoptRef(*new StyleRuleContainer(WTFMove(query), WTFMove(rules)));
-}
-
 StyleRuleCharset::StyleRuleCharset()
     : StyleRuleBase(StyleRuleType::Charset)
 {

Modified: trunk/Source/WebCore/css/StyleRule.h (294006 => 294007)


--- trunk/Source/WebCore/css/StyleRule.h	2022-05-10 10:13:57 UTC (rev 294006)
+++ trunk/Source/WebCore/css/StyleRule.h	2022-05-10 16:48:31 UTC (rev 294007)
@@ -104,7 +104,6 @@
 
     const StyleProperties& properties() const;
     MutableStyleProperties& mutableProperties();
-    const StyleProperties* propertiesWithoutDeferredParsing() const;
 
     bool isSplitRule() const { return m_isSplitRule; }
     void markAsSplitRule() { m_isSplitRule = true; }
@@ -226,24 +225,9 @@
     CSSSelectorList m_selectorList;
 };
 
-class DeferredStyleGroupRuleList final {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    DeferredStyleGroupRuleList(const CSSParserTokenRange&, CSSDeferredParser&);
-    ~DeferredStyleGroupRuleList();
-    
-    void parseDeferredRules(Vector<RefPtr<StyleRuleBase>>&);
-    void parseDeferredKeyframes(StyleRuleKeyframes&);
-
-private:
-    Vector<CSSParserToken> m_tokens;
-    Ref<CSSDeferredParser> m_parser;
-};
-    
 class StyleRuleGroup : public StyleRuleBase {
 public:
     const Vector<RefPtr<StyleRuleBase>>& childRules() const;
-    const Vector<RefPtr<StyleRuleBase>>* childRulesWithoutDeferredParsing() const;
 
     void wrapperInsertRule(unsigned, Ref<StyleRuleBase>&&);
     void wrapperRemoveRule(unsigned);
@@ -250,20 +234,15 @@
     
 protected:
     StyleRuleGroup(StyleRuleType, Vector<RefPtr<StyleRuleBase>>&&);
-    StyleRuleGroup(StyleRuleType, std::unique_ptr<DeferredStyleGroupRuleList>&&);
     StyleRuleGroup(const StyleRuleGroup&);
     
 private:
-    void parseDeferredRulesIfNeeded() const;
-
     mutable Vector<RefPtr<StyleRuleBase>> m_childRules;
-    mutable std::unique_ptr<DeferredStyleGroupRuleList> m_deferredRules;
 };
 
 class StyleRuleMedia final : public StyleRuleGroup {
 public:
     static Ref<StyleRuleMedia> create(Ref<MediaQuerySet>&&, Vector<RefPtr<StyleRuleBase>>&&);
-    static Ref<StyleRuleMedia> create(Ref<MediaQuerySet>&&, std::unique_ptr<DeferredStyleGroupRuleList>&&);
     Ref<StyleRuleMedia> copy() const;
 
     MediaQuerySet& mediaQueries() const { return m_mediaQueries; }
@@ -270,7 +249,6 @@
 
 private:
     StyleRuleMedia(Ref<MediaQuerySet>&&, Vector<RefPtr<StyleRuleBase>>&&);
-    StyleRuleMedia(Ref<MediaQuerySet>&&, std::unique_ptr<DeferredStyleGroupRuleList>&&);
     StyleRuleMedia(const StyleRuleMedia&);
 
     Ref<MediaQuerySet> m_mediaQueries;
@@ -279,7 +257,6 @@
 class StyleRuleSupports final : public StyleRuleGroup {
 public:
     static Ref<StyleRuleSupports> create(const String& conditionText, bool conditionIsSupported, Vector<RefPtr<StyleRuleBase>>&&);
-    static Ref<StyleRuleSupports> create(const String& conditionText, bool conditionIsSupported, std::unique_ptr<DeferredStyleGroupRuleList>&&);
     Ref<StyleRuleSupports> copy() const { return adoptRef(*new StyleRuleSupports(*this)); }
 
     String conditionText() const { return m_conditionText; }
@@ -287,7 +264,6 @@
 
 private:
     StyleRuleSupports(const String& conditionText, bool conditionIsSupported, Vector<RefPtr<StyleRuleBase>>&&);
-    StyleRuleSupports(const String& conditionText, bool conditionIsSupported, std::unique_ptr<DeferredStyleGroupRuleList>&&);
     StyleRuleSupports(const StyleRuleSupports&);
 
     String m_conditionText;
@@ -298,7 +274,6 @@
 public:
     static Ref<StyleRuleLayer> createStatement(Vector<CascadeLayerName>&&);
     static Ref<StyleRuleLayer> createBlock(CascadeLayerName&&, Vector<RefPtr<StyleRuleBase>>&&);
-    static Ref<StyleRuleLayer> createBlock(CascadeLayerName&&, std::unique_ptr<DeferredStyleGroupRuleList>&&);
     Ref<StyleRuleLayer> copy() const { return adoptRef(*new StyleRuleLayer(*this)); }
 
     bool isStatement() const { return type() == StyleRuleType::LayerStatement; }
@@ -309,7 +284,6 @@
 private:
     StyleRuleLayer(Vector<CascadeLayerName>&&);
     StyleRuleLayer(CascadeLayerName&&, Vector<RefPtr<StyleRuleBase>>&&);
-    StyleRuleLayer(CascadeLayerName&&, std::unique_ptr<DeferredStyleGroupRuleList>&&);
     StyleRuleLayer(const StyleRuleLayer&);
 
     std::variant<CascadeLayerName, Vector<CascadeLayerName>> m_nameVariant;
@@ -318,7 +292,6 @@
 class StyleRuleContainer final : public StyleRuleGroup {
 public:
     static Ref<StyleRuleContainer> create(FilteredContainerQuery&&, Vector<RefPtr<StyleRuleBase>>&&);
-    static Ref<StyleRuleContainer> create(FilteredContainerQuery&&, std::unique_ptr<DeferredStyleGroupRuleList>&&);
     Ref<StyleRuleContainer> copy() const { return adoptRef(*new StyleRuleContainer(*this)); }
 
     const FilteredContainerQuery& filteredQuery() const { return m_filteredQuery; }
@@ -325,7 +298,6 @@
 
 private:
     StyleRuleContainer(FilteredContainerQuery&&, Vector<RefPtr<StyleRuleBase>>&&);
-    StyleRuleContainer(FilteredContainerQuery&&, std::unique_ptr<DeferredStyleGroupRuleList>&&);
     StyleRuleContainer(const StyleRuleContainer&);
 
     FilteredContainerQuery m_filteredQuery;
@@ -399,16 +371,6 @@
 
 #endif
 
-inline const StyleProperties* StyleRule::propertiesWithoutDeferredParsing() const
-{
-    return m_properties->type() != DeferredPropertiesType ? &downcast<StyleProperties>(m_properties.get()) : nullptr;
-}
-
-inline const Vector<RefPtr<StyleRuleBase>>* StyleRuleGroup::childRulesWithoutDeferredParsing() const
-{
-    return !m_deferredRules ? &m_childRules : nullptr;
-}
-
 } // namespace WebCore
 
 SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::StyleRule)

Modified: trunk/Source/WebCore/css/StyleSheetContents.cpp (294006 => 294007)


--- trunk/Source/WebCore/css/StyleSheetContents.cpp	2022-05-10 10:13:57 UTC (rev 294006)
+++ trunk/Source/WebCore/css/StyleSheetContents.cpp	2022-05-10 16:48:31 UTC (rev 294007)
@@ -391,7 +391,7 @@
         return false;
     }
 
-    CSSParser(parserContext()).parseSheet(*this, sheetText, CSSParser::RuleParsing::Deferred);
+    CSSParser(parserContext()).parseSheet(*this, sheetText);
     return true;
 }
 
@@ -398,7 +398,7 @@
 bool StyleSheetContents::parseString(const String& sheetText)
 {
     CSSParser p(parserContext());
-    p.parseSheet(*this, sheetText, parserContext().mode != UASheetMode ? CSSParser::RuleParsing::Deferred : CSSParser::RuleParsing::Normal);
+    p.parseSheet(*this, sheetText);
     return true;
 }
 
@@ -476,8 +476,7 @@
             return true;
         if (!rule->isGroupRule())
             continue;
-        auto* childRules = downcast<StyleRuleGroup>(*rule).childRulesWithoutDeferredParsing();
-        if (childRules && traverseRulesInVector(*childRules, handler))
+        if (traverseRulesInVector(downcast<StyleRuleGroup>(*rule).childRules(), handler))
             return true;
     }
     return false;
@@ -499,10 +498,8 @@
 {
     return traverseRules([&] (const StyleRuleBase& rule) {
         switch (rule.type()) {
-        case StyleRuleType::Style: {
-            auto* properties = downcast<StyleRule>(rule).propertiesWithoutDeferredParsing();
-            return properties && properties->traverseSubresources(handler);
-        }
+        case StyleRuleType::Style:
+            return downcast<StyleRule>(rule).properties().traverseSubresources(handler);
         case StyleRuleType::FontFace:
             return downcast<StyleRuleFontFace>(rule).properties().traverseSubresources(handler);
         case StyleRuleType::Import:

Deleted: trunk/Source/WebCore/css/parser/CSSDeferredParser.cpp (294006 => 294007)


--- trunk/Source/WebCore/css/parser/CSSDeferredParser.cpp	2022-05-10 10:13:57 UTC (rev 294006)
+++ trunk/Source/WebCore/css/parser/CSSDeferredParser.cpp	2022-05-10 16:48:31 UTC (rev 294007)
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "CSSDeferredParser.h"
-
-#include "CSSParserImpl.h"
-#include "StyleSheetContents.h"
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-CSSDeferredParser::CSSDeferredParser(const CSSParserContext& context, const String& sheetText, StyleSheetContents& styleSheet)
-    : m_context(context)
-    , m_sheetText(sheetText)
-    , m_styleSheet(styleSheet)
-{
-}
-
-StyleSheetContents* CSSDeferredParser::styleSheet() const
-{
-    return m_styleSheet.get();
-}
-
-Ref<ImmutableStyleProperties> CSSDeferredParser::parseDeclaration(const CSSParserTokenRange& range)
-{
-    return CSSParserImpl::parseDeferredDeclaration(range, m_context, m_styleSheet.get());
-}
-
-void CSSDeferredParser::parseRuleList(const CSSParserTokenRange& range, Vector<RefPtr<StyleRuleBase>>& childRules)
-{
-    CSSParserImpl::parseDeferredRuleList(range, *this, childRules);
-}
-
-void CSSDeferredParser::parseKeyframeList(const CSSParserTokenRange& range, StyleRuleKeyframes&keyframesRule)
-{
-    CSSParserImpl::parseDeferredKeyframeList(range, *this, keyframesRule);
-}
-
-} // namespace WebCore

Deleted: trunk/Source/WebCore/css/parser/CSSDeferredParser.h (294006 => 294007)


--- trunk/Source/WebCore/css/parser/CSSDeferredParser.h	2022-05-10 10:13:57 UTC (rev 294006)
+++ trunk/Source/WebCore/css/parser/CSSDeferredParser.h	2022-05-10 16:48:31 UTC (rev 294007)
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "CSSParserContext.h"
-#include <wtf/RefCounted.h>
-#include <wtf/WeakPtr.h>
-
-namespace WebCore {
-
-class CSSParserTokenRange;
-class ImmutableStyleProperties;
-class StyleRuleKeyframes;
-class StyleRuleBase;
-class StyleSheetContents;
-
-class CSSDeferredParser : public RefCounted<CSSDeferredParser> {
-public:
-    static Ref<CSSDeferredParser> create(const CSSParserContext& parserContext, const String& sheetText, StyleSheetContents& styleSheet)
-    {
-        return adoptRef(*new CSSDeferredParser(parserContext, sheetText, styleSheet));
-    }
-
-    CSSParserMode mode() const { return m_context.mode; }
-
-    const CSSParserContext& context() const { return m_context; }
-    StyleSheetContents* styleSheet() const;
-
-    Ref<ImmutableStyleProperties> parseDeclaration(const CSSParserTokenRange&);
-    void parseRuleList(const CSSParserTokenRange&, Vector<RefPtr<StyleRuleBase>>&);
-    void parseKeyframeList(const CSSParserTokenRange&, StyleRuleKeyframes&);
-
-    void adoptTokenizerEscapedStrings(Vector<String>&& strings) { m_escapedStrings = WTFMove(strings); }
-
-private:
-    CSSDeferredParser(const CSSParserContext&, const String&, StyleSheetContents&);
-    
-    Vector<String> m_escapedStrings;
-    CSSParserContext m_context;
-    
-    String m_sheetText;
-
-    WeakPtr<StyleSheetContents> m_styleSheet;
-};
-
-} // namespace WebCore

Modified: trunk/Source/WebCore/css/parser/CSSParser.cpp (294006 => 294007)


--- trunk/Source/WebCore/css/parser/CSSParser.cpp	2022-05-10 10:13:57 UTC (rev 294006)
+++ trunk/Source/WebCore/css/parser/CSSParser.cpp	2022-05-10 16:48:31 UTC (rev 294007)
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2003 Lars Knoll ([email protected])
  * Copyright (C) 2005 Allan Sandfeld Jensen ([email protected])
- * Copyright (C) 2004-2021 Apple Inc. All rights reserved.
+ * Copyright (C) 2004-2022 Apple Inc. All rights reserved.
  * Copyright (C) 2007 Nicholas Shanks <[email protected]>
  * Copyright (C) 2008 Eric Seidel <[email protected]>
  * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
@@ -65,9 +65,9 @@
 
 CSSParser::~CSSParser() = default;
 
-void CSSParser::parseSheet(StyleSheetContents& sheet, const String& string, RuleParsing ruleParsing)
+void CSSParser::parseSheet(StyleSheetContents& sheet, const String& string)
 {
-    return CSSParserImpl::parseStyleSheet(string, m_context, sheet, ruleParsing);
+    return CSSParserImpl::parseStyleSheet(string, m_context, sheet);
 }
 
 void CSSParser::parseSheetForInspector(const CSSParserContext& context, StyleSheetContents* sheet, const String& string, CSSParserObserver& observer)

Modified: trunk/Source/WebCore/css/parser/CSSParser.h (294006 => 294007)


--- trunk/Source/WebCore/css/parser/CSSParser.h	2022-05-10 10:13:57 UTC (rev 294006)
+++ trunk/Source/WebCore/css/parser/CSSParser.h	2022-05-10 16:48:31 UTC (rev 294007)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2003 Lars Knoll ([email protected])
- * Copyright (C) 2004-2010, 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2004-2022 Apple Inc. All rights reserved.
  * Copyright (C) 2008 Eric Seidel <[email protected]>
  * Copyright (C) 2009 - 2010  Torch Mobile (Beijing) Co. Ltd. All rights reserved.
  *
@@ -63,8 +63,7 @@
     WEBCORE_EXPORT explicit CSSParser(const CSSParserContext&);
     WEBCORE_EXPORT ~CSSParser();
 
-    enum class RuleParsing { Normal, Deferred };
-    void parseSheet(StyleSheetContents&, const String&, RuleParsing = RuleParsing::Normal);
+    void parseSheet(StyleSheetContents&, const String&);
     
     static RefPtr<StyleRuleBase> parseRule(const CSSParserContext&, StyleSheetContents*, const String&);
     

Modified: trunk/Source/WebCore/css/parser/CSSParserContext.cpp (294006 => 294007)


--- trunk/Source/WebCore/css/parser/CSSParserContext.cpp	2022-05-10 10:13:57 UTC (rev 294006)
+++ trunk/Source/WebCore/css/parser/CSSParserContext.cpp	2022-05-10 16:48:31 UTC (rev 294007)
@@ -88,7 +88,6 @@
     , counterStyleAtRulesEnabled { document.settings().cssCounterStyleAtRulesEnabled() }
     , counterStyleAtRuleImageSymbolsEnabled { document.settings().cssCounterStyleAtRuleImageSymbolsEnabled() }
     , cssColor4 { document.settings().cssColor4() }
-    , deferredCSSParserEnabled { document.settings().deferredCSSParserEnabled() }
     , individualTransformPropertiesEnabled { document.settings().cssIndividualTransformPropertiesEnabled() }
 #if ENABLE(OVERFLOW_SCROLLING_TOUCH)
     , legacyOverflowScrollingTouchEnabled { shouldEnableLegacyOverflowScrollingTouch(document) }
@@ -140,7 +139,6 @@
         && a.counterStyleAtRulesEnabled == b.counterStyleAtRulesEnabled
         && a.counterStyleAtRuleImageSymbolsEnabled == b.counterStyleAtRuleImageSymbolsEnabled
         && a.cssColor4 == b.cssColor4
-        && a.deferredCSSParserEnabled == b.deferredCSSParserEnabled
         && a.individualTransformPropertiesEnabled == b.individualTransformPropertiesEnabled
 #if ENABLE(OVERFLOW_SCROLLING_TOUCH)
         && a.legacyOverflowScrollingTouchEnabled == b.legacyOverflowScrollingTouchEnabled
@@ -185,28 +183,27 @@
         | context.constantPropertiesEnabled                 << 8
         | context.containmentEnabled                        << 9
         | context.cssColor4                                 << 10
-        | context.deferredCSSParserEnabled                  << 11
-        | context.individualTransformPropertiesEnabled      << 12
+        | context.individualTransformPropertiesEnabled      << 11
 #if ENABLE(OVERFLOW_SCROLLING_TOUCH)
-        | context.legacyOverflowScrollingTouchEnabled       << 13
+        | context.legacyOverflowScrollingTouchEnabled       << 12
 #endif
-        | context.overscrollBehaviorEnabled                 << 14
-        | context.relativeColorSyntaxEnabled                << 15
-        | context.scrollBehaviorEnabled                     << 16
-        | context.springTimingFunctionEnabled               << 17
+        | context.overscrollBehaviorEnabled                 << 13
+        | context.relativeColorSyntaxEnabled                << 14
+        | context.scrollBehaviorEnabled                     << 15
+        | context.springTimingFunctionEnabled               << 16
 #if ENABLE(TEXT_AUTOSIZING)
-        | context.textAutosizingEnabled                     << 18
+        | context.textAutosizingEnabled                     << 17
 #endif
 #if ENABLE(CSS_TRANSFORM_STYLE_OPTIMIZED_3D)
-        | context.transformStyleOptimized3DEnabled          << 19
+        | context.transformStyleOptimized3DEnabled          << 18
 #endif
-        | context.useLegacyBackgroundSizeShorthandBehavior  << 20
-        | context.focusVisibleEnabled                       << 21
-        | context.hasPseudoClassEnabled                     << 22
-        | context.cascadeLayersEnabled                      << 23
-        | context.containerQueriesEnabled                   << 24
-        | context.overflowClipEnabled                       << 25
-        | context.gradientPremultipliedAlphaInterpolationEnabled << 26
+        | context.useLegacyBackgroundSizeShorthandBehavior  << 19
+        | context.focusVisibleEnabled                       << 20
+        | context.hasPseudoClassEnabled                     << 21
+        | context.cascadeLayersEnabled                      << 22
+        | context.containerQueriesEnabled                   << 23
+        | context.overflowClipEnabled                       << 24
+        | context.gradientPremultipliedAlphaInterpolationEnabled << 25
         | context.gradientInterpolationColorSpacesEnabled   << 27
 #if ENABLE(ATTACHMENT_ELEMENT)
         | context.attachmentEnabled                         << 28

Modified: trunk/Source/WebCore/css/parser/CSSParserContext.h (294006 => 294007)


--- trunk/Source/WebCore/css/parser/CSSParserContext.h	2022-05-10 10:13:57 UTC (rev 294006)
+++ trunk/Source/WebCore/css/parser/CSSParserContext.h	2022-05-10 16:48:31 UTC (rev 294007)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2018-2021 Apple Inc. All rights reserved.
+ * Copyright (C) 2018-2022 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -65,7 +65,6 @@
     bool counterStyleAtRulesEnabled { false };
     bool counterStyleAtRuleImageSymbolsEnabled { false };
     bool cssColor4 { false };
-    bool deferredCSSParserEnabled { false };
     bool individualTransformPropertiesEnabled { false };
 #if ENABLE(OVERFLOW_SCROLLING_TOUCH)
     bool legacyOverflowScrollingTouchEnabled { false };

Modified: trunk/Source/WebCore/css/parser/CSSParserImpl.cpp (294006 => 294007)


--- trunk/Source/WebCore/css/parser/CSSParserImpl.cpp	2022-05-10 10:13:57 UTC (rev 294006)
+++ trunk/Source/WebCore/css/parser/CSSParserImpl.cpp	2022-05-10 16:48:31 UTC (rev 294007)
@@ -1,5 +1,5 @@
 // Copyright 2014 The Chromium Authors. All rights reserved.
-// Copyright (C) 2016-2021 Apple Inc. All rights reserved.
+// Copyright (C) 2016-2022 Apple Inc. All rights reserved.
 //
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
@@ -33,7 +33,6 @@
 #include "CSSAtRuleID.h"
 #include "CSSCounterStyleRule.h"
 #include "CSSCustomPropertyValue.h"
-#include "CSSDeferredParser.h"
 #include "CSSFontFamily.h"
 #include "CSSFontPaletteValuesOverrideColorsValue.h"
 #include "CSSKeyframeRule.h"
@@ -70,23 +69,12 @@
     
 }
 
-CSSParserImpl::CSSParserImpl(CSSDeferredParser& deferredParser)
-    : m_context(deferredParser.context())
-    , m_styleSheet(deferredParser.styleSheet())
-    , m_deferredParser(&deferredParser)
-{
-}
-
-CSSParserImpl::CSSParserImpl(const CSSParserContext& context, const String& string, StyleSheetContents* styleSheet, CSSParserObserverWrapper* wrapper, CSSParser::RuleParsing ruleParsing)
+CSSParserImpl::CSSParserImpl(const CSSParserContext& context, const String& string, StyleSheetContents* styleSheet, CSSParserObserverWrapper* wrapper)
     : m_context(context)
     , m_styleSheet(styleSheet)
+    , m_tokenizer(wrapper ? CSSTokenizer::tryCreate(string, *wrapper) : CSSTokenizer::tryCreate(string))
     , m_observerWrapper(wrapper)
 {
-    m_tokenizer = wrapper ? CSSTokenizer::tryCreate(string, *wrapper) : CSSTokenizer::tryCreate(string);
-    if (!m_tokenizer)
-        return;
-    if (context.deferredCSSParserEnabled && !wrapper && styleSheet && ruleParsing == CSSParser::RuleParsing::Deferred)
-        m_deferredParser = CSSDeferredParser::create(context, string, *styleSheet);
 }
 
 CSSParser::ParseResult CSSParserImpl::parseValue(MutableStyleProperties* declaration, CSSPropertyID propertyID, const String& string, bool important, const CSSParserContext& context)
@@ -134,12 +122,6 @@
     }
 }
 
-Ref<DeferredStyleProperties> CSSParserImpl::createDeferredStyleProperties(const CSSParserTokenRange& propertyRange)
-{
-    ASSERT(m_deferredParser);
-    return DeferredStyleProperties::create(propertyRange, *m_deferredParser);
-}
-
 static Ref<ImmutableStyleProperties> createStyleProperties(ParsedPropertyVector& parsedProperties, CSSParserMode mode)
 {
     std::bitset<numCSSProperties> seenProperties;
@@ -165,38 +147,6 @@
     return createStyleProperties(parser.m_parsedProperties, context.mode);
 }
 
-Ref<ImmutableStyleProperties> CSSParserImpl::parseDeferredDeclaration(CSSParserTokenRange tokenRange, const CSSParserContext& context, StyleSheetContents* styleSheet)
-{
-    if (!styleSheet) {
-        ParsedPropertyVector properties;
-        return createStyleProperties(properties, context.mode);
-    }
-    CSSParserImpl parser(context, styleSheet);
-    parser.consumeDeclarationList(tokenRange, StyleRuleType::Style);
-    return createStyleProperties(parser.m_parsedProperties, context.mode);
-}
-    
-void CSSParserImpl::parseDeferredRuleList(CSSParserTokenRange tokenRange, CSSDeferredParser& deferredParser, Vector<RefPtr<StyleRuleBase>>& childRules)
-{
-    if (!deferredParser.styleSheet())
-        return;
-    CSSParserImpl parser(deferredParser);
-    parser.consumeRuleList(tokenRange, RegularRuleList, [&childRules](const RefPtr<StyleRuleBase>& rule) {
-        childRules.append(rule);
-    });
-    childRules.shrinkToFit();
-}
-
-void CSSParserImpl::parseDeferredKeyframeList(CSSParserTokenRange tokenRange, CSSDeferredParser& deferredParser, StyleRuleKeyframes& keyframeRule)
-{
-    if (!deferredParser.styleSheet())
-        return;
-    CSSParserImpl parser(deferredParser);
-    parser.consumeRuleList(tokenRange, KeyframesRuleList, [&keyframeRule](const RefPtr<StyleRuleBase>& keyframe) {
-        keyframeRule.parserAppendKeyframe(downcast<const StyleRuleKeyframe>(keyframe.get()));
-    });
-}
-
 bool CSSParserImpl::parseDeclarationList(MutableStyleProperties* declaration, const String& string, const CSSParserContext& context)
 {
     CSSParserImpl parser(context, string);
@@ -236,9 +186,9 @@
     return rule;
 }
 
-void CSSParserImpl::parseStyleSheet(const String& string, const CSSParserContext& context, StyleSheetContents& styleSheet, CSSParser::RuleParsing ruleParsing)
+void CSSParserImpl::parseStyleSheet(const String& string, const CSSParserContext& context, StyleSheetContents& styleSheet)
 {
-    CSSParserImpl parser(context, string, &styleSheet, nullptr, ruleParsing);
+    CSSParserImpl parser(context, string, &styleSheet, nullptr);
     bool firstRuleValid = parser.consumeRuleList(parser.tokenizer()->tokenRange(), TopLevelRuleList, [&styleSheet](RefPtr<StyleRuleBase> rule) {
         if (rule->isCharsetRule())
             return;
@@ -246,16 +196,8 @@
     });
     styleSheet.setHasSyntacticallyValidCSSHeader(firstRuleValid);
     styleSheet.shrinkToFit();
-    parser.adoptTokenizerEscapedStrings();
 }
 
-void CSSParserImpl::adoptTokenizerEscapedStrings()
-{
-    if (!m_deferredParser || !m_tokenizer)
-        return;
-    m_deferredParser->adoptTokenizerEscapedStrings(m_tokenizer->escapedStringsForAdoption());
-}
-
 CSSSelectorList CSSParserImpl::parsePageSelector(CSSParserTokenRange range, StyleSheetContents* styleSheet)
 {
     // We only support a small subset of the css-page spec.
@@ -589,9 +531,6 @@
 
 RefPtr<StyleRuleMedia> CSSParserImpl::consumeMediaRule(CSSParserTokenRange prelude, CSSParserTokenRange block)
 {
-    if (m_deferredParser)
-        return StyleRuleMedia::create(MediaQueryParser::parseMediaQuerySet(prelude, MediaQueryParserContext(m_context)).releaseNonNull(),  makeUnique<DeferredStyleGroupRuleList>(block, *m_deferredParser));
-
     Vector<RefPtr<StyleRuleBase>> rules;
 
     if (m_observerWrapper) {
@@ -617,9 +556,6 @@
     if (supported == CSSSupportsParser::Invalid)
         return nullptr; // Parse error, invalid @supports condition
 
-    if (m_deferredParser)
-        return StyleRuleSupports::create(prelude.serialize().stripWhiteSpace(), supported, makeUnique<DeferredStyleGroupRuleList>(block, *m_deferredParser));
-
     if (m_observerWrapper) {
         m_observerWrapper->observer().startRuleHeader(StyleRuleType::Supports, m_observerWrapper->startOffset(prelude));
         m_observerWrapper->observer().endRuleHeader(m_observerWrapper->endOffset(prelude));
@@ -718,9 +654,6 @@
     else
         return nullptr; // Parse error; expected ident token in @keyframes header
 
-    if (m_deferredParser)
-        return StyleRuleKeyframes::create(name, makeUnique<DeferredStyleGroupRuleList>(block, *m_deferredParser));
-
     if (m_observerWrapper) {
         m_observerWrapper->observer().startRuleHeader(StyleRuleType::Keyframes, m_observerWrapper->startOffset(rangeCopy));
         m_observerWrapper->observer().endRuleHeader(m_observerWrapper->endOffset(prelude));
@@ -821,9 +754,6 @@
     if (!prelude.atEnd())
         return nullptr;
 
-    if (m_deferredParser)
-        return StyleRuleLayer::createBlock(WTFMove(*name), makeUnique<DeferredStyleGroupRuleList>(*block, *m_deferredParser));
-
     if (m_observerWrapper) {
         m_observerWrapper->observer().startRuleHeader(StyleRuleType::LayerBlock, m_observerWrapper->startOffset(preludeCopy));
         m_observerWrapper->observer().endRuleHeader(m_observerWrapper->endOffset(preludeCopy));
@@ -858,9 +788,6 @@
     if (!prelude.atEnd())
         return nullptr;
 
-    if (m_deferredParser)
-        return StyleRuleContainer::create(WTFMove(*query), makeUnique<DeferredStyleGroupRuleList>(block, *m_deferredParser));
-
     Vector<RefPtr<StyleRuleBase>> rules;
 
     if (m_observerWrapper) {
@@ -924,18 +851,6 @@
     if (m_observerWrapper)
         observeSelectors(*m_observerWrapper, prelude);
     
-    if (m_deferredParser) {
-        // If a rule is empty (i.e., only whitespace), don't bother using
-        // deferred parsing. This allows the empty rule optimization in ElementRuleCollector
-        // to continue to work. Note we don't have to consider CommentTokens, since those
-        // are stripped out.
-        CSSParserTokenRange blockCopy = block;
-        blockCopy.consumeWhitespace();
-        if (!blockCopy.atEnd()) {
-            return StyleRule::create(createDeferredStyleProperties(block), m_context.hasDocumentSecurityOrigin, WTFMove(*selectorList));
-        }
-    }
-
     consumeDeclarationList(block, StyleRuleType::Style);
     return StyleRule::create(createStyleProperties(m_parsedProperties, m_context.mode), m_context.hasDocumentSecurityOrigin, WTFMove(*selectorList));
 }

Modified: trunk/Source/WebCore/css/parser/CSSParserImpl.h (294006 => 294007)


--- trunk/Source/WebCore/css/parser/CSSParserImpl.h	2022-05-10 10:13:57 UTC (rev 294006)
+++ trunk/Source/WebCore/css/parser/CSSParserImpl.h	2022-05-10 16:48:31 UTC (rev 294007)
@@ -1,5 +1,5 @@
 // Copyright 2014 The Chromium Authors. All rights reserved.
-// Copyright (C) 2016-2021 Apple Inc. All rights reserved.
+// Copyright (C) 2016-2022 Apple Inc. All rights reserved.
 //
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
@@ -29,7 +29,6 @@
 
 #pragma once
 
-#include "CSSDeferredParser.h"
 #include "CSSParser.h"
 #include "CSSParserTokenRange.h"
 #include "CSSPropertyNames.h"
@@ -68,7 +67,7 @@
 class CSSParserImpl {
     WTF_MAKE_NONCOPYABLE(CSSParserImpl);
 public:
-    CSSParserImpl(const CSSParserContext&, const String&, StyleSheetContents* = nullptr, CSSParserObserverWrapper* = nullptr, CSSParser::RuleParsing = CSSParser::RuleParsing::Normal);
+    CSSParserImpl(const CSSParserContext&, const String&, StyleSheetContents* = nullptr, CSSParserObserverWrapper* = nullptr);
 
     enum AllowedRulesType {
         // As per css-syntax, css-cascade and css-namespaces, @charset rules
@@ -91,7 +90,7 @@
     static Ref<ImmutableStyleProperties> parseInlineStyleDeclaration(const String&, const Element*);
     static bool parseDeclarationList(MutableStyleProperties*, const String&, const CSSParserContext&);
     static RefPtr<StyleRuleBase> parseRule(const String&, const CSSParserContext&, StyleSheetContents*, AllowedRulesType);
-    static void parseStyleSheet(const String&, const CSSParserContext&, StyleSheetContents&, CSSParser::RuleParsing);
+    static void parseStyleSheet(const String&, const CSSParserContext&, StyleSheetContents&);
     static CSSSelectorList parsePageSelector(CSSParserTokenRange, StyleSheetContents*);
 
     static Vector<double> parseKeyframeKeyList(const String&);
@@ -102,16 +101,10 @@
     static void parseDeclarationListForInspector(const String&, const CSSParserContext&, CSSParserObserver&);
     static void parseStyleSheetForInspector(const String&, const CSSParserContext&, StyleSheetContents*, CSSParserObserver&);
 
-    static Ref<ImmutableStyleProperties> parseDeferredDeclaration(CSSParserTokenRange, const CSSParserContext&, StyleSheetContents*);
-    static void parseDeferredRuleList(CSSParserTokenRange, CSSDeferredParser&, Vector<RefPtr<StyleRuleBase>>&);
-    static void parseDeferredKeyframeList(CSSParserTokenRange, CSSDeferredParser&, StyleRuleKeyframes&);
-
     CSSTokenizer* tokenizer() const { return m_tokenizer.get(); };
-    CSSDeferredParser* deferredParser() const { return m_deferredParser.get(); }
 
 private:
     CSSParserImpl(const CSSParserContext&, StyleSheetContents*);
-    CSSParserImpl(CSSDeferredParser&);
 
     enum RuleListType {
         TopLevelRuleList,
@@ -151,10 +144,6 @@
 
     static Vector<double> consumeKeyframeKeyList(CSSParserTokenRange);
 
-    Ref<DeferredStyleProperties> createDeferredStyleProperties(const CSSParserTokenRange& propertyRange);
-    
-    void adoptTokenizerEscapedStrings();
-
     // FIXME: Can we build StylePropertySets directly?
     // FIXME: Investigate using a smaller inline buffer
     ParsedPropertyVector m_parsedProperties;
@@ -161,11 +150,6 @@
     const CSSParserContext& m_context;
 
     RefPtr<StyleSheetContents> m_styleSheet;
-
-    // For deferred property parsing.
-    RefPtr<CSSDeferredParser> m_deferredParser;
-    
-    // For normal parsing.
     std::unique_ptr<CSSTokenizer> m_tokenizer;
 
     // For the inspector

Modified: trunk/Source/WebCore/style/ElementRuleCollector.cpp (294006 => 294007)


--- trunk/Source/WebCore/style/ElementRuleCollector.cpp	2022-05-10 10:13:57 UTC (rev 294006)
+++ trunk/Source/WebCore/style/ElementRuleCollector.cpp	2022-05-10 16:48:31 UTC (rev 294007)
@@ -496,8 +496,7 @@
         // If the rule has no properties to apply, then ignore it in the non-debug mode.
         // Note that if we get null back here, it means we have a rule with deferred properties,
         // and that means we always have to consider it.
-        const StyleProperties* properties = rule.propertiesWithoutDeferredParsing();
-        if (properties && properties->isEmpty() && !m_shouldIncludeEmptyRules)
+        if (rule.properties().isEmpty() && !m_shouldIncludeEmptyRules)
             continue;
 
         unsigned specificity;

Modified: trunk/Source/WebCore/style/StyleInvalidator.cpp (294006 => 294007)


--- trunk/Source/WebCore/style/StyleInvalidator.cpp	2022-05-10 10:13:57 UTC (rev 294006)
+++ trunk/Source/WebCore/style/StyleInvalidator.cpp	2022-05-10 16:48:31 UTC (rev 294007)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012, 2014, 2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2012-2022 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -50,8 +50,7 @@
 {
     for (auto& rule : rules) {
         if (is<StyleRuleMedia>(*rule)) {
-            const auto* childRules = downcast<StyleRuleMedia>(*rule).childRulesWithoutDeferredParsing();
-            if (childRules && shouldDirtyAllStyle(*childRules))
+            if (shouldDirtyAllStyle(downcast<StyleRuleMedia>(*rule).childRules()))
                 return true;
             continue;
         }

Modified: trunk/Source/WebCore/testing/Internals.cpp (294006 => 294007)


--- trunk/Source/WebCore/testing/Internals.cpp	2022-05-10 10:13:57 UTC (rev 294006)
+++ trunk/Source/WebCore/testing/Internals.cpp	2022-05-10 16:48:31 UTC (rev 294007)
@@ -1317,101 +1317,6 @@
     return element.setPseudo(id);
 }
 
-static unsigned deferredStyleRulesCountForList(const Vector<RefPtr<StyleRuleBase>>& childRules)
-{
-    unsigned count = 0;
-    for (auto rule : childRules) {
-        if (is<StyleRule>(rule)) {
-            auto* cssRule = downcast<StyleRule>(rule.get());
-            if (!cssRule->propertiesWithoutDeferredParsing())
-                count++;
-            continue;
-        }
-
-        StyleRuleGroup* groupRule = nullptr;
-        if (is<StyleRuleMedia>(rule))
-            groupRule = downcast<StyleRuleMedia>(rule.get());
-        else if (is<StyleRuleSupports>(rule))
-            groupRule = downcast<StyleRuleSupports>(rule.get());
-        if (!groupRule)
-            continue;
-
-        auto* groupChildRules = groupRule->childRulesWithoutDeferredParsing();
-        if (!groupChildRules)
-            continue;
-
-        count += deferredStyleRulesCountForList(*groupChildRules);
-    }
-
-    return count;
-}
-
-unsigned Internals::deferredStyleRulesCount(StyleSheet& styleSheet)
-{
-    return deferredStyleRulesCountForList(downcast<CSSStyleSheet>(styleSheet).contents().childRules());
-}
-
-static unsigned deferredGroupRulesCountForList(const Vector<RefPtr<StyleRuleBase>>& childRules)
-{
-    unsigned count = 0;
-    for (auto rule : childRules) {
-        StyleRuleGroup* groupRule = nullptr;
-        if (is<StyleRuleMedia>(rule))
-            groupRule = downcast<StyleRuleMedia>(rule.get());
-        else if (is<StyleRuleSupports>(rule))
-            groupRule = downcast<StyleRuleSupports>(rule.get());
-        if (!groupRule)
-            continue;
-
-        auto* groupChildRules = groupRule->childRulesWithoutDeferredParsing();
-        if (!groupChildRules)
-            count++;
-        else
-            count += deferredGroupRulesCountForList(*groupChildRules);
-    }
-    return count;
-}
-
-unsigned Internals::deferredGroupRulesCount(StyleSheet& styleSheet)
-{
-    return deferredGroupRulesCountForList(downcast<CSSStyleSheet>(styleSheet).contents().childRules());
-}
-
-static unsigned deferredKeyframesRulesCountForList(const Vector<RefPtr<StyleRuleBase>>& childRules)
-{
-    unsigned count = 0;
-    for (auto rule : childRules) {
-        if (is<StyleRuleKeyframes>(rule)) {
-            auto* cssRule = downcast<StyleRuleKeyframes>(rule.get());
-            if (!cssRule->keyframesWithoutDeferredParsing())
-                count++;
-            continue;
-        }
-
-        StyleRuleGroup* groupRule = nullptr;
-        if (is<StyleRuleMedia>(rule))
-            groupRule = downcast<StyleRuleMedia>(rule.get());
-        else if (is<StyleRuleSupports>(rule))
-            groupRule = downcast<StyleRuleSupports>(rule.get());
-        if (!groupRule)
-            continue;
-
-        auto* groupChildRules = groupRule->childRulesWithoutDeferredParsing();
-        if (!groupChildRules)
-            continue;
-
-        count += deferredKeyframesRulesCountForList(*groupChildRules);
-    }
-
-    return count;
-}
-
-unsigned Internals::deferredKeyframesRulesCount(StyleSheet& styleSheet)
-{
-    StyleSheetContents& contents = downcast<CSSStyleSheet>(styleSheet).contents();
-    return deferredKeyframesRulesCountForList(contents.childRules());
-}
-
 ExceptionOr<bool> Internals::isTimerThrottled(int timeoutId)
 {
     auto* timer = scriptExecutionContext()->findTimeout(timeoutId);

Modified: trunk/Source/WebCore/testing/Internals.h (294006 => 294007)


--- trunk/Source/WebCore/testing/Internals.h	2022-05-10 10:13:57 UTC (rev 294006)
+++ trunk/Source/WebCore/testing/Internals.h	2022-05-10 16:48:31 UTC (rev 294007)
@@ -248,11 +248,6 @@
     const AtomString& shadowPseudoId(Element&);
     void setShadowPseudoId(Element&, const AtomString&);
 
-    // CSS Deferred Parsing Testing
-    unsigned deferredStyleRulesCount(StyleSheet&);
-    unsigned deferredGroupRulesCount(StyleSheet&);
-    unsigned deferredKeyframesRulesCount(StyleSheet&);
-
     // DOMTimers throttling testing.
     ExceptionOr<bool> isTimerThrottled(int timeoutId);
     String requestAnimationFrameThrottlingReasons() const;

Modified: trunk/Source/WebCore/testing/Internals.idl (294006 => 294007)


--- trunk/Source/WebCore/testing/Internals.idl	2022-05-10 10:13:57 UTC (rev 294006)
+++ trunk/Source/WebCore/testing/Internals.idl	2022-05-10 16:48:31 UTC (rev 294007)
@@ -378,11 +378,6 @@
     Node ensureUserAgentShadowRoot(Element host);
     Node shadowRoot(Element host);
 
-    // CSS Deferred Parsing Testing.
-    long deferredStyleRulesCount(StyleSheet sheet);
-    long deferredGroupRulesCount(StyleSheet sheet);
-    long deferredKeyframesRulesCount(StyleSheet sheet);
-
     DOMString shadowRootType(Node root);
     DOMString shadowPseudoId(Element element);
     undefined setShadowPseudoId(Element element, [AtomString] DOMString id);

Modified: trunk/Source/WebKit/ChangeLog (294006 => 294007)


--- trunk/Source/WebKit/ChangeLog	2022-05-10 10:13:57 UTC (rev 294006)
+++ trunk/Source/WebKit/ChangeLog	2022-05-10 16:48:31 UTC (rev 294007)
@@ -1,3 +1,17 @@
+2022-05-10  Brent Fulgham  <[email protected]>
+
+        Remove abandoned CSSDeferredParser implementation and feature flag
+        https://bugs.webkit.org/show_bug.cgi?id=240244
+
+        Reviewed by Antti Koivisto.
+
+        This patch rolls out the abandoned CSSDeferredParser implementation added in Bug 165743.
+
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesSetDeferredCSSParserEnabled): Deleted.
+        (WKPreferencesGetDeferredCSSParserEnabled): Deleted.
+        * UIProcess/API/C/WKPreferencesRefPrivate.h:
+
 2022-05-10  Youenn Fablet  <[email protected]>
 
         RemoteVideoFrameObjectHeapProxyProcessor binary semaphore usage might trigger deadlocks in case of GPUProcess crash

Modified: trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp (294006 => 294007)


--- trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp	2022-05-10 10:13:57 UTC (rev 294006)
+++ trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp	2022-05-10 16:48:31 UTC (rev 294007)
@@ -1235,16 +1235,6 @@
     return toImpl(preferencesRef)->contentChangeObserverEnabled();
 }
 
-void WKPreferencesSetDeferredCSSParserEnabled(WKPreferencesRef preferencesRef, bool flag)
-{
-    toImpl(preferencesRef)->setDeferredCSSParserEnabled(flag);
-}
-
-bool WKPreferencesGetDeferredCSSParserEnabled(WKPreferencesRef preferencesRef)
-{
-    return toImpl(preferencesRef)->deferredCSSParserEnabled();
-}
-
 void WKPreferencesSetUseGiantTiles(WKPreferencesRef preferencesRef, bool flag)
 {
     toImpl(preferencesRef)->setUseGiantTiles(flag);

Modified: trunk/Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h (294006 => 294007)


--- trunk/Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h	2022-05-10 10:13:57 UTC (rev 294006)
+++ trunk/Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h	2022-05-10 16:48:31 UTC (rev 294007)
@@ -311,10 +311,6 @@
 WK_EXPORT bool WKPreferencesGetContentChangeObserverEnabled(WKPreferencesRef);
 
 // Defaults to false.
-WK_EXPORT void WKPreferencesSetDeferredCSSParserEnabled(WKPreferencesRef, bool);
-WK_EXPORT bool WKPreferencesGetDeferredCSSParserEnabled(WKPreferencesRef);
-
-// Defaults to false.
 WK_EXPORT void WKPreferencesSetUseGiantTiles(WKPreferencesRef, bool);
 WK_EXPORT bool WKPreferencesGetUseGiantTiles(WKPreferencesRef);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to