source: webkit/trunk/Source/WebCore/css/parser/CSSAtRuleID.cpp

Last change on this file was 293309, checked in by Chris Dumez, 3 years ago

Use equalLettersIgnoringASCIICase() and SortedArrayMap in more places
https://bugs.webkit.org/show_bug.cgi?id=239714

Reviewed by Darin Adler.

Use equalLettersIgnoringASCIICase() and SortedArrayMap in more places, for performance.

  • Source/WebKit/NetworkProcess/NetworkProcess.cpp:

(WebKit::NetworkProcess::preconnectTo):

  • Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp:

(WebKit::NetworkResourceLoader::didReceiveResponse):

  • Source/WTF/wtf/unix/LanguageUnix.cpp:

(WTF::platformLanguage):

  • Source/WebCore/Modules/applepay/PaymentCoordinator.cpp:

(WebCore::PaymentCoordinator::validatedPaymentNetwork const):

  • Source/WebCore/Modules/fetch/FetchBodyConsumer.cpp:

(WebCore::FetchBodyConsumer::packageFormData):

  • Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp:

(WebCore::PropertySetCSSStyleDeclaration::setProperty):

  • Source/WebCore/css/parser/CSSAtRuleID.cpp:

(WebCore::cssAtRuleID):

  • Source/WebCore/css/parser/CSSParserImpl.cpp:

(WebCore::consumeStringOrURI):
(WebCore::CSSParserImpl::consumeImportRule):
(WebCore::CSSParserImpl::consumeDeclaration):
(WebCore::CSSParserImpl::consumeKeyframeKeyList):

  • Source/WebCore/css/parser/CSSPropertyParser.cpp:

(WebCore::consumeAnimationName):

  • Source/WebCore/css/parser/CSSSelectorParser.cpp:

(WebCore::CSSSelectorParser::consumePseudo):
(WebCore::CSSSelectorParser::consumeAttributeFlags):
(WebCore::consumeANPlusB):

  • Source/WebCore/css/parser/CSSSupportsParser.cpp:

(WebCore::CSSSupportsParser::consumeCondition):

  • Source/WebCore/css/parser/CSSTokenizer.cpp:

(WebCore::CSSTokenizer::consumeIdentLikeToken):

  • Source/WebCore/css/parser/MediaQueryParser.cpp:

(WebCore::MediaQueryParser::readMediaNot):
(WebCore::isRestrictorOrLogicalOperator):
(WebCore::MediaQueryParser::readMediaType):
(WebCore::MediaQueryParser::readAnd):

  • Source/WebCore/css/parser/SizesCalcParser.cpp:

(WebCore::SizesCalcParser::calcToReversePolishNotation):

  • Source/WebCore/css/typedom/transform/CSSPerspective.cpp:

(WebCore::checkLength):

  • Source/WebCore/editing/cocoa/DataDetection.mm:

(WebCore::DataDetection::requiresExtendedContext):
(WebCore::removeResultLinksFromAnchor):
(WebCore::searchForLinkRemovingExistingDDLinks):
(WebCore::DataDetection::isDataDetectorElement):

  • Source/WebCore/html/Autofill.cpp:

(WebCore::AutofillData::createFromHTMLFormControlElement):

  • Source/WebCore/html/EnterKeyHint.cpp:

(WebCore::enterKeyHintForAttributeValue):

  • Source/WebCore/html/EnterKeyHint.h:
  • Source/WebCore/html/HTMLAnchorElement.cpp:

(WebCore::HTMLAnchorElement::relList):

  • Source/WebCore/html/HTMLFormElement.cpp:

(WebCore::parseFormRelAttributes):
(WebCore::HTMLFormElement::relList):

  • Source/WebCore/html/HTMLImageElement.cpp:

(WebCore::parseCrossoriginState):

  • Source/WebCore/html/InputType.cpp:

(WebCore::InputType::applyStep):

  • Source/WebCore/html/LinkRelAttribute.cpp:

(WebCore::LinkRelAttribute::isSupported):

  • Source/WebCore/html/parser/HTMLParserIdioms.cpp:

(WebCore::parseCORSSettingsAttribute):

  • Source/WebCore/loader/DocumentLoader.cpp:

(WebCore::DocumentLoader::loadApplicationManifest):

  • Source/WebCore/loader/LinkLoader.cpp:

(WebCore::LinkLoader::preconnectIfNeeded):

  • Source/WebCore/loader/ServerTiming.cpp:

(WebCore::ServerTiming::setParameter):

  • Source/WebCore/page/PageConsoleClient.cpp:

(WebCore::PageConsoleClient::screenshot):

  • Source/WebCore/page/Quirks.cpp:

(WebCore::Quirks::isGoogleMaps const):
(WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
(WebCore::Quirks::needsDeferKeyDownAndKeyPressTimersUntilNextEditingCommand const):

  • Source/WebCore/page/SecurityOriginData.cpp:

(WebCore::SecurityOriginData::databaseIdentifier const):

  • Source/WebCore/page/csp/ContentSecurityPolicySourceList.cpp:

(WebCore::schemeIsInHttpFamily):
(WebCore::ContentSecurityPolicySourceList::isValidSourceForExtensionMode):

  • Source/WebCore/platform/graphics/FontGenericFamilies.cpp:

(WebCore::computeUserPrefersSimplified):

  • Source/WebCore/platform/graphics/MIMETypeCache.cpp:

(WebCore::MIMETypeCache::shouldOverrideExtendedType):

  • Source/WebCore/platform/graphics/MediaPlayer.cpp:

(WebCore::MediaPlayer::supportsType):

  • Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:

(WebCore::willUseWebMFormatReaderForType):
(WebCore::keySystemIsSupported):
(WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem):

  • Source/WebCore/platform/graphics/cocoa/SourceBufferParserWebM.cpp:

(WebCore::SourceBufferParserWebM::isContentTypeSupported):

  • Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp:

(WebCore::Font::platformInit):

  • Source/WebCore/platform/graphics/gstreamer/DMABufVideoSinkGStreamer.cpp:

(webKitDMABufVideoSinkIsEnabled):

  • Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp:

(WebCore::isThunderRanked):

  • Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:

(WebCore::LibWebRTCProvider::createDecodingConfiguration):
(WebCore::LibWebRTCProvider::createEncodingConfiguration):

  • Source/WebCore/platform/network/curl/CookieUtil.cpp:

(WebCore::CookieUtil::parseCookieAttributes):

  • Source/WebCore/platform/network/curl/CurlMultipartHandle.cpp:

(WebCore::CurlMultipartHandle::extractBoundary):

  • Source/WebCore/rendering/RenderThemeMac.mm:

(WebCore::iconForAttachment):

  • Source/WebCore/svg/SVGAElement.cpp:

(WebCore::SVGAElement::relList):

  • Source/WebCore/testing/MockCDMFactory.cpp:

(WebCore::MockCDMFactory::supportsKeySystem):
(WebCore::MockCDMInstance::setServerCertificate):

Canonical link: https://commits.webkit.org/249932@main

File size: 2.6 KB
Line 
1// Copyright 2015 The Chromium Authors. All rights reserved.
2// Copyright (C) 2016-2021 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 are
6// met:
7//
8// * Redistributions of source code must retain the above copyright
9// notice, this list of conditions and the following disclaimer.
10// * Redistributions in binary form must reproduce the above
11// copyright notice, this list of conditions and the following disclaimer
12// in the documentation and/or other materials provided with the
13// distribution.
14// * Neither the name of Google Inc. nor the names of its
15// contributors may be used to endorse or promote products derived from
16// this software without specific prior written permission.
17//
18// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
30#include "config.h"
31#include "CSSAtRuleID.h"
32
33#include <wtf/SortedArrayMap.h>
34
35namespace WebCore {
36
37CSSAtRuleID cssAtRuleID(StringView name)
38{
39 static constexpr std::pair<ComparableLettersLiteral, CSSAtRuleID> mappings[] = {
40 { "-webkit-keyframes", CSSAtRuleWebkitKeyframes },
41 { "charset", CSSAtRuleCharset },
42 { "container", CSSAtRuleContainer },
43 { "counter-style", CSSAtRuleCounterStyle },
44 { "font-face", CSSAtRuleFontFace },
45 { "font-palette-values", CSSAtRuleFontPaletteValues },
46 { "import", CSSAtRuleImport },
47 { "keyframes", CSSAtRuleKeyframes },
48 { "layer", CSSAtRuleLayer },
49 { "media", CSSAtRuleMedia },
50 { "namespace", CSSAtRuleNamespace },
51 { "page", CSSAtRulePage },
52 { "supports", CSSAtRuleSupports },
53 { "viewport", CSSAtRuleViewport },
54 };
55 static constexpr SortedArrayMap cssAtRules { mappings };
56 return cssAtRules.get(name, CSSAtRuleInvalid);
57}
58
59} // namespace WebCore
60
Note: See TracBrowser for help on using the repository browser.