source: webkit/trunk/Source/WebCore/css/parser/CSSParser.h

Last change on this file was 294007, checked in by Brent Fulgham, 3 years ago

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:
  • Property svn:eol-style set to native
File size: 3.8 KB
Line 
1/*
2 * Copyright (C) 2003 Lars Knoll ([email protected])
3 * Copyright (C) 2004-2022 Apple Inc. All rights reserved.
4 * Copyright (C) 2008 Eric Seidel <[email protected]>
5 * Copyright (C) 2009 - 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
16 *
17 * You should have received a copy of the GNU Library General Public License
18 * along with this library; see the file COPYING.LIB. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
21 */
22
23#pragma once
24
25#include "CSSParserContext.h"
26#include "CSSRegisteredCustomProperty.h"
27#include "CSSValue.h"
28#include "ColorTypes.h"
29#include "WritingMode.h"
30#include <wtf/text/WTFString.h>
31
32namespace WebCore {
33
34class CSSParserObserver;
35class CSSSelectorList;
36class CSSValueList;
37class CSSValuePool;
38class Color;
39class Element;
40class ImmutableStyleProperties;
41class MutableStyleProperties;
42class StyleRuleBase;
43class StyleRuleKeyframe;
44class StyleSheetContents;
45class RenderStyle;
46
47namespace CSSPropertyParserHelpers {
48struct FontRaw;
49}
50
51namespace Style {
52class BuilderState;
53}
54
55class CSSParser {
56public:
57 enum class ParseResult {
58 Changed,
59 Unchanged,
60 Error
61 };
62
63 WEBCORE_EXPORT explicit CSSParser(const CSSParserContext&);
64 WEBCORE_EXPORT ~CSSParser();
65
66 void parseSheet(StyleSheetContents&, const String&);
67
68 static RefPtr<StyleRuleBase> parseRule(const CSSParserContext&, StyleSheetContents*, const String&);
69
70 RefPtr<StyleRuleKeyframe> parseKeyframeRule(const String&);
71 static Vector<double> parseKeyframeKeyList(const String&);
72
73 bool parseSupportsCondition(const String&);
74
75 static void parseSheetForInspector(const CSSParserContext&, StyleSheetContents*, const String&, CSSParserObserver&);
76 static void parseDeclarationForInspector(const CSSParserContext&, const String&, CSSParserObserver&);
77
78 static ParseResult parseValue(MutableStyleProperties&, CSSPropertyID, const String&, bool important, const CSSParserContext&);
79 static ParseResult parseCustomPropertyValue(MutableStyleProperties&, const AtomString& propertyName, const String&, bool important, const CSSParserContext&);
80
81 static RefPtr<CSSValue> parseSingleValue(CSSPropertyID, const String&, const CSSParserContext& = strictCSSParserContext());
82
83 WEBCORE_EXPORT bool parseDeclaration(MutableStyleProperties&, const String&);
84 static Ref<ImmutableStyleProperties> parseInlineStyleDeclaration(const String&, const Element*);
85
86 std::optional<CSSSelectorList> parseSelector(const String&);
87
88 RefPtr<CSSValue> parseValueWithVariableReferences(CSSPropertyID, const CSSValue&, Style::BuilderState&);
89
90 WEBCORE_EXPORT static Color parseColor(const String&, const CSSParserContext&);
91 // FIXME: All callers are not getting the right Settings for parsing due to lack of CSSParserContext and should switch to the parseColor function above.
92 WEBCORE_EXPORT static Color parseColorWithoutContext(const String&, bool strict = false);
93 static Color parseSystemColor(StringView);
94 static std::optional<SRGBA<uint8_t>> parseNamedColor(StringView);
95 static std::optional<SRGBA<uint8_t>> parseHexColor(StringView);
96
97private:
98 ParseResult parseValue(MutableStyleProperties&, CSSPropertyID, const String&, bool important);
99
100 CSSParserContext m_context;
101};
102
103} // namespace WebCore
Note: See TracBrowser for help on using the repository browser.