source: webkit/trunk/Source/WebCore/css/CSSKeyframesRule.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.7 KB
Line 
1/*
2 * Copyright (C) 2007, 2008, 2012, 2014 Apple Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#pragma once
27
28#include "CSSRule.h"
29#include "StyleRule.h"
30#include <memory>
31#include <wtf/Forward.h>
32#include <wtf/text/AtomString.h>
33
34namespace WebCore {
35
36class CSSKeyframeRule;
37class CSSRuleList;
38class StyleRuleKeyframe;
39
40class StyleRuleKeyframes final : public StyleRuleBase {
41public:
42 static Ref<StyleRuleKeyframes> create(const AtomString& name);
43 ~StyleRuleKeyframes();
44
45 const Vector<Ref<StyleRuleKeyframe>>& keyframes() const;
46
47 void parserAppendKeyframe(RefPtr<StyleRuleKeyframe>&&);
48 void wrapperAppendKeyframe(Ref<StyleRuleKeyframe>&&);
49 void wrapperRemoveKeyframe(unsigned);
50
51 const AtomString& name() const { return m_name; }
52 void setName(const AtomString& name) { m_name = name; }
53
54 std::optional<size_t> findKeyframeIndex(const String& key) const;
55
56 Ref<StyleRuleKeyframes> copy() const { return adoptRef(*new StyleRuleKeyframes(*this)); }
57
58 void shrinkToFit();
59
60private:
61 explicit StyleRuleKeyframes(const AtomString&);
62 StyleRuleKeyframes(const StyleRuleKeyframes&);
63
64 mutable Vector<Ref<StyleRuleKeyframe>> m_keyframes;
65 AtomString m_name;
66};
67
68class CSSKeyframesRule final : public CSSRule {
69public:
70 static Ref<CSSKeyframesRule> create(StyleRuleKeyframes& rule, CSSStyleSheet* sheet) { return adoptRef(*new CSSKeyframesRule(rule, sheet)); }
71
72 virtual ~CSSKeyframesRule();
73
74 StyleRuleType styleRuleType() const final { return StyleRuleType::Keyframes; }
75 String cssText() const final;
76 void reattach(StyleRuleBase&) final;
77
78 const AtomString& name() const { return m_keyframesRule->name(); }
79 void setName(const AtomString&);
80
81 CSSRuleList& cssRules();
82
83 void insertRule(const String& rule);
84 void appendRule(const String& rule);
85 void deleteRule(const String& key);
86 CSSKeyframeRule* findRule(const String& key);
87
88 // For IndexedGetter and CSSRuleList.
89 unsigned length() const;
90 CSSKeyframeRule* item(unsigned index) const;
91
92private:
93 CSSKeyframesRule(StyleRuleKeyframes&, CSSStyleSheet* parent);
94
95 Ref<StyleRuleKeyframes> m_keyframesRule;
96 mutable Vector<RefPtr<CSSKeyframeRule>> m_childRuleCSSOMWrappers;
97 mutable std::unique_ptr<CSSRuleList> m_ruleListCSSOMWrapper;
98};
99
100} // namespace WebCore
101
102SPECIALIZE_TYPE_TRAITS_CSS_RULE(CSSKeyframesRule, StyleRuleType::Keyframes)
103
104SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::StyleRuleKeyframes)
105 static bool isType(const WebCore::StyleRuleBase& rule) { return rule.isKeyframesRule(); }
106SPECIALIZE_TYPE_TRAITS_END()
Note: See TracBrowser for help on using the repository browser.