Skip to content
Permalink
Browse files
Update equalLettersIgnoringASCIICase() / startsWithLettersIgnoringASC…
…IICase() to take in an ASCIILiteral

https://bugs.webkit.org/show_bug.cgi?id=239775

Reviewed by Geoff Garen.

Update equalLettersIgnoringASCIICase() / startsWithLettersIgnoringASCIICase() to take in an ASCIILiteral,
as we are encouraging developers to use _s suffix for string literals.

* Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp:
(TestWebKitAPI::TEST):
* Tools/WebKitTestRunner/InjectedBundle/atspi/AccessibilityUIElementAtspi.cpp:
(WTR::xmlRoleValueString):
* Tools/WebKitTestRunner/cocoa/CrashReporterInfo.mm:
(WTR::testPathFromURL):
* Source/JavaScriptCore/runtime/Options.cpp:
(JSC::parse):
* Source/WebCore/PAL/pal/text/TextEncodingRegistry.cpp:
(PAL::defaultTextEncodingNameForSystemLanguage):
* Source/WebDriver/WebDriverService.cpp:
(WebDriver::WebDriverService::matchCapabilities const):
* Source/WebKit/NetworkProcess/NetworkDataTaskBlob.cpp:
(WebKit::NetworkDataTaskBlob::resume):
* Source/WebKit/NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::preconnectTo):
* Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didReceiveResponse):
* Source/WebKit/NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::isMediaMIMEType):
* Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
* Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp:
(WebKit::NetworkDataTaskCurl::willPerformHTTPRedirection):
* Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
* Source/WebKit/UIProcess/API/C/WKWebsitePolicies.cpp:
(WKWebsitePoliciesSetCustomHeaderFields):
* Source/WebKit/UIProcess/API/Cocoa/_WKCustomHeaderFields.mm:
(-[_WKCustomHeaderFields setFields:]):
* Source/WebKit/UIProcess/Cocoa/MediaPermissionUtilities.mm:
(WebKit::visibleDomain):
* Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::matchesExtensionOrEquivalent):
* Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::desktopClassBrowsingRecommendedForRequest):
* Source/WebKit/WebProcess/WebPage/IPCTestingAPI.cpp:
(WebKit::IPCTestingAPI::encodeSharedMemory):
* Source/WTF/wtf/Assertions.cpp:
* Source/WTF/wtf/DateMath.cpp:
(WTF::parseDateFromNullTerminatedCharacters):
* Source/WTF/wtf/SortedArrayMap.h:
(WTF::operator==):
* Source/WTF/wtf/text/AtomString.h:
(WTF::equalLettersIgnoringASCIICase):
* Source/WTF/wtf/text/StringCommon.h:
(WTF::equalLettersIgnoringASCIICase):
(WTF::equalLettersIgnoringASCIICaseCommon):
(WTF::startsWithLettersIgnoringASCIICaseCommon):
(WTF::equalLettersIgnoringASCIICaseCommonWithoutLength): Deleted.
(WTF::startsWithLettersIgnoringASCIICaseCommonWithoutLength): Deleted.
* Source/WTF/wtf/text/StringImpl.h:
(WTF::startsWithLettersIgnoringASCIICase):
(WTF::equalLettersIgnoringASCIICase):
* Source/WTF/wtf/text/StringView.h:
(WTF::equalLettersIgnoringASCIICase):
(WTF::startsWithLettersIgnoringASCIICase):
* Source/WTF/wtf/text/WTFString.h:
(WTF::equalLettersIgnoringASCIICase):
(WTF::startsWithLettersIgnoringASCIICase):
* Source/WebCore/Modules/applepay/PaymentCoordinator.cpp:
(WebCore::PaymentCoordinator::validatedPaymentNetwork const):
* Source/WebCore/Modules/applicationmanifest/ApplicationManifestParser.cpp:
(WebCore::ApplicationManifestParser::parseIcons):
* Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.cpp:
(WebCore::LegacyCDMPrivateClearKey::supportsKeySystem):
(WebCore::LegacyCDMPrivateClearKey::supportsKeySystemAndMimeType):
* Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
(WebCore::CDMSessionClearKey::update):
* Source/WebCore/Modules/fetch/FetchBodyConsumer.cpp:
(WebCore::FetchBodyConsumer::packageFormData):
* Source/WebCore/Modules/mediacapabilities/MediaCapabilities.cpp:
(WebCore::isValidVideoMIMEType):
(WebCore::isValidAudioMIMEType):
* Source/WebCore/Modules/mediarecorder/MediaRecorderProvider.cpp:
(WebCore::MediaRecorderProvider::isSupported):
* Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp:
(WebCore::YouTubePluginReplacement::supportsMIMEType):
(WebCore::YouTubePluginReplacement::supportsFileExtension):
(WebCore::isYouTubeURL):
(WebCore::processAndCreateYouTubeURL):
(WebCore::YouTubePluginReplacement::youTubeURLFromAbsoluteURL):
* Source/WebCore/Modules/webauthn/AuthenticatorCoordinator.cpp:
(WebCore::AuthenticatorCoordinatorInternal::needsAppIdQuirks):
* Source/WebCore/Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::checkResponseHeaders):
* Source/WebCore/accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::isModalElement const):
(WebCore::AXObjectCache::handleMenuItemSelected):
(WebCore::isNodeAriaVisible):
* Source/WebCore/accessibility/AccessibilityARIAGrid.cpp:
(WebCore::AccessibilityARIAGrid::isMultiSelectable const):
* Source/WebCore/accessibility/AccessibilityListBoxOption.cpp:
(WebCore::AccessibilityListBoxOption::isEnabled const):
* Source/WebCore/accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::determineAccessibilityRoleFromNode const):
(WebCore::AccessibilityNodeObject::isEnabled const):
(WebCore::AccessibilityNodeObject::isIndeterminate const):
(WebCore::AccessibilityNodeObject::isPressed const):
(WebCore::AccessibilityNodeObject::isChecked const):
(WebCore::AccessibilityNodeObject::isMultiSelectable const):
(WebCore::AccessibilityNodeObject::isRequired const):
(WebCore::AccessibilityNodeObject::elementAttributeValue const):
(WebCore::shouldUseAccessibilityObjectInnerText):
(WebCore::AccessibilityNodeObject::textUnderElement const):
* Source/WebCore/accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::autoCompleteValue const):
(WebCore::AccessibilityObject::contentEditableAttributeIsEnabled):
(WebCore::AccessibilityObject::ariaIsMultiline const):
(WebCore::AccessibilityObject::liveRegionStatusIsEnabled):
(WebCore::AccessibilityObject::sortDirection const):
(WebCore::AccessibilityObject::popupValue const):
(WebCore::AccessibilityObject::supportsPressed const):
(WebCore::AccessibilityObject::supportsExpanded const):
(WebCore::AccessibilityObject::isExpanded const):
(WebCore::AccessibilityObject::checkboxOrRadioValue const):
(WebCore::AccessibilityObject::isAXHidden const):
(WebCore::AccessibilityObject::setIsIgnoredFromParentDataForChild):
* Source/WebCore/accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::hasPopup const):
(WebCore::AccessibilityRenderObject::supportsDragging const):
(WebCore::AccessibilityRenderObject::defaultObjectInclusion const):
(WebCore::AccessibilityRenderObject::isSelected const):
(WebCore::AccessibilityRenderObject::orientation const):
(WebCore::AccessibilityRenderObject::liveRegionAtomic const):
* Source/WebCore/accessibility/AccessibilitySlider.cpp:
(WebCore::AccessibilitySlider::orientation const):
* Source/WebCore/accessibility/mac/AccessibilityObjectMac.mm:
(WebCore::AccessibilityObject::rolePlatformDescription const):
* Source/WebCore/animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::processKeyframes):
* Source/WebCore/contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::processContentRuleListsForLoad):
* Source/WebCore/css/CSSFontFaceSrcValue.cpp:
(WebCore::CSSFontFaceSrcValue::isSVGFontFaceSrc const):
* Source/WebCore/css/MediaList.cpp:
(WebCore::reportMediaQueryWarningIfNeeded):
* Source/WebCore/css/MediaQueryEvaluator.cpp:
(WebCore::MediaQueryEvaluator::mediaTypeMatch const):
(WebCore::MediaQueryEvaluator::mediaTypeMatchSpecific const):
(WebCore::evaluateResolution):
* Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::setProperty):
* Source/WebCore/css/parser/CSSParserFastPaths.cpp:
(WebCore::isUniversalKeyword):
* Source/WebCore/css/parser/CSSParserImpl.cpp:
(WebCore::consumeStringOrURI):
(WebCore::CSSParserImpl::consumeImportRule):
(WebCore::CSSParserImpl::consumeDeclaration):
(WebCore::CSSParserImpl::consumeKeyframeKeyList):
* Source/WebCore/css/parser/CSSParserSelector.cpp:
(WebCore::CSSParserSelector::parsePagePseudoSelector):
(WebCore::CSSParserSelector::parsePseudoElementSelector):
* Source/WebCore/css/parser/CSSParserTokenRange.cpp:
(WebCore::CSSParserTokenRange::consumeBlockCheckingForEditability):
* Source/WebCore/css/parser/CSSPropertyParser.cpp:
(WebCore::consumeAnimationName):
* Source/WebCore/css/parser/CSSPropertyParserWorkerSafe.cpp:
(WebCore::CSSPropertyParserHelpersWorkerSafe::consumeUnicodeRangeString):
* 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):
(WebCore::MediaQueryParser::handleBlocks):
* Source/WebCore/css/parser/SizesCalcParser.cpp:
(WebCore::SizesCalcParser::calcToReversePolishNotation):
* Source/WebCore/css/typedom/transform/CSSPerspective.cpp:
(WebCore::checkLength):
* Source/WebCore/dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument):
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::determineActiveThemeColorMetaElement):
(WebCore::Document::processColorScheme):
(WebCore::Document::processFormatDetection):
(WebCore::Document::createEvent):
(WebCore::Document::setDesignMode):
(WebCore::Document::parseDNSPrefetchControlHeader):
* Source/WebCore/dom/Element.cpp:
(WebCore::isStyleAttribute):
(WebCore::Element::isSpellCheckingEnabled const):
(WebCore::Element::canContainRangeEndPoint const):
* Source/WebCore/dom/InlineStyleSheetOwner.cpp:
(WebCore::isValidCSSContentType):
* Source/WebCore/dom/ScriptElement.cpp:
(WebCore::ScriptElement::determineScriptType const):
(WebCore::ScriptElement::isScriptForEventSupported const):
* Source/WebCore/dom/SecurityContext.cpp:
(WebCore::SecurityContext::parseSandboxPolicy):
* Source/WebCore/dom/ViewportArguments.cpp:
(WebCore::findSizeValue):
(WebCore::findScaleValue):
(WebCore::findBooleanValue):
(WebCore::parseViewportFitValue):
(WebCore::setViewportFeature):
* Source/WebCore/editing/EditorCommand.cpp:
(WebCore::executeDefaultParagraphSeparator):
(WebCore::executeStyleWithCSS):
(WebCore::executeUseCSS):
* Source/WebCore/editing/TextIterator.cpp:
(WebCore::isRendererReplacedElement):
* Source/WebCore/editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::requiresExtendedContext):
(WebCore::removeResultLinksFromAnchor):
(WebCore::searchForLinkRemovingExistingDDLinks):
(WebCore::DataDetection::isDataDetectorElement):
* Source/WebCore/history/HistoryItem.cpp:
(WebCore::HistoryItem::setFormInfoFromRequest):
* Source/WebCore/html/Autocapitalize.cpp:
(WebCore::autocapitalizeTypeForAttributeValue):
* Source/WebCore/html/Autofill.cpp:
(WebCore::AutofillData::createFromHTMLFormControlElement):
* Source/WebCore/html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::draggable const):
(WebCore::HTMLAnchorElement::relList):
* Source/WebCore/html/HTMLAreaElement.cpp:
(WebCore::HTMLAreaElement::parseAttribute):
* Source/WebCore/html/HTMLBRElement.cpp:
(WebCore::HTMLBRElement::collectPresentationalHintsForAttribute):
* Source/WebCore/html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::collectPresentationalHintsForAttribute):
* Source/WebCore/html/HTMLButtonElement.cpp:
(WebCore::HTMLButtonElement::parseAttribute):
* Source/WebCore/html/HTMLDivElement.cpp:
(WebCore::HTMLDivElement::collectPresentationalHintsForAttribute):
* Source/WebCore/html/HTMLElement.cpp:
(WebCore::isLTROrRTLIgnoringCase):
(WebCore::contentEditableType):
(WebCore::HTMLElement::collectPresentationalHintsForAttribute):
(WebCore::toValidDirValue):
(WebCore::HTMLElement::applyAlignmentAttributeToStyle):
(WebCore::HTMLElement::setContentEditable):
(WebCore::HTMLElement::draggable const):
(WebCore::HTMLElement::translate const):
(WebCore::HTMLElement::hasDirectionAuto const):
(WebCore::HTMLElement::directionality const):
(WebCore::HTMLElement::dirAttributeChanged):
(WebCore::parseLegacyColorValue):
(WebCore::HTMLElement::shouldAutocorrect const):
* Source/WebCore/html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::collectPresentationalHintsForAttribute):
* Source/WebCore/html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::shouldAutocorrect const):
* Source/WebCore/html/HTMLFormElement.cpp:
(WebCore::parseFormRelAttributes):
(WebCore::HTMLFormElement::shouldAutocorrect const):
(WebCore::HTMLFormElement::relList):
(WebCore::HTMLFormElement::shouldAutocomplete const):
(WebCore::HTMLFormElement::autocomplete const):
* Source/WebCore/html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::scrollingMode const):
* Source/WebCore/html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::parseAttribute):
* Source/WebCore/html/HTMLHRElement.cpp:
(WebCore::HTMLHRElement::collectPresentationalHintsForAttribute):
* Source/WebCore/html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::parseAttribute):
(WebCore::HTMLIFrameElement::loadingForBindings const):
(WebCore::isFrameLazyLoadable):
* Source/WebCore/html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::hasLazyLoadableAttributeValue):
(WebCore::parseCrossoriginState):
(WebCore::HTMLImageElement::decodingMode const):
* Source/WebCore/html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::parseAttribute):
(WebCore::HTMLInputElement::mediaCaptureType const):
* Source/WebCore/html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::as const):
(WebCore::HTMLLinkElement::process):
* Source/WebCore/html/HTMLMarqueeElement.cpp:
(WebCore::HTMLMarqueeElement::collectPresentationalHintsForAttribute):
* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):
* Source/WebCore/html/HTMLMenuElement.cpp:
(WebCore::HTMLMenuElement::parseAttribute):
* Source/WebCore/html/HTMLMetaElement.cpp:
(WebCore::HTMLMetaElement::attributeChanged):
(WebCore::HTMLMetaElement::removedFromAncestor):
(WebCore::HTMLMetaElement::process):
* Source/WebCore/html/HTMLObjectElement.cpp:
(WebCore::mapDataParamToSrc):
(WebCore::HTMLObjectElement::parametersForPlugin):
(WebCore::HTMLObjectElement::containsJavaApplet const):
* Source/WebCore/html/HTMLParagraphElement.cpp:
(WebCore::HTMLParagraphElement::collectPresentationalHintsForAttribute):
* Source/WebCore/html/HTMLParamElement.cpp:
(WebCore::HTMLParamElement::isURLParameter):
* Source/WebCore/html/HTMLTableElement.cpp:
(WebCore::getBordersFromFrameAttributeValue):
(WebCore::HTMLTableElement::collectPresentationalHintsForAttribute):
(WebCore::HTMLTableElement::parseAttribute):
* Source/WebCore/html/HTMLTablePartElement.cpp:
(WebCore::HTMLTablePartElement::collectPresentationalHintsForAttribute):
* Source/WebCore/html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::parseAttribute):
* Source/WebCore/html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::setRangeText):
(WebCore::HTMLTextFormControlElement::directionForFormData const):
* Source/WebCore/html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::parseAttribute):
* Source/WebCore/html/InputType.cpp:
(WebCore::InputType::applyStep):
* Source/WebCore/html/LinkRelAttribute.cpp:
(WebCore::LinkRelAttribute::LinkRelAttribute):
(WebCore::LinkRelAttribute::isSupported):
* Source/WebCore/html/MediaElementSession.cpp:
(WebCore::MediaElementSession::wirelessVideoPlaybackDisabled const):
* Source/WebCore/html/NumberInputType.cpp:
(WebCore::NumberInputType::sizeShouldIncludeDecoration const):
* Source/WebCore/html/RangeInputType.cpp:
(WebCore::RangeInputType::createStepRange const):
(WebCore::RangeInputType::handleKeydownEvent):
* Source/WebCore/html/StepRange.cpp:
(WebCore::StepRange::parseStep):
* Source/WebCore/html/canvas/CanvasStyle.cpp:
(WebCore::isCurrentColorString):
* Source/WebCore/html/parser/CSSPreloadScanner.cpp:
(WebCore::CSSPreloadScanner::emitRule):
* Source/WebCore/html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::setCompatibilityModeFromDoctype):
* Source/WebCore/html/parser/HTMLElementStack.cpp:
(WebCore::HTMLElementStack::isHTMLIntegrationPoint):
* Source/WebCore/html/parser/HTMLMetaCharsetParser.cpp:
(WebCore::HTMLMetaCharsetParser::encodingFromMetaAttributes):
* Source/WebCore/html/parser/HTMLParserIdioms.cpp:
(WebCore::parseCORSSettingsAttribute):
* Source/WebCore/html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
* Source/WebCore/html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::processStartTagForInBody):
(WebCore::HTMLTreeBuilder::processStartTagForInTable):
* Source/WebCore/html/parser/ParsingUtilities.h:
(WebCore::skipExactlyIgnoringASCIICase):
* Source/WebCore/html/track/TextTrack.cpp:
(WebCore::TextTrack::setKindKeywordIgnoringASCIICase):
* Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::shouldTreatAsText):
* Source/WebCore/loader/CrossOriginAccessControl.cpp:
(WebCore::createPotentialAccessControlRequest):
* Source/WebCore/loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::loadApplicationManifest):
* Source/WebCore/loader/FetchIdioms.cpp:
(WebCore::shouldBlockResponseDueToMIMEType):
* Source/WebCore/loader/FormSubmission.cpp:
(WebCore::appendMailtoPostFormDataToURL):
(WebCore::FormSubmission::Attributes::parseEncodingType):
(WebCore::FormSubmission::Attributes::parseMethodType):
* Source/WebCore/loader/FrameLoader.cpp:
(WebCore::FrameLoader::shouldPerformFragmentNavigation):
* Source/WebCore/loader/LinkHeader.cpp:
(WebCore::paramterNameFromString):
* Source/WebCore/loader/LinkLoader.cpp:
(WebCore::LinkLoader::resourceTypeFromAsAttribute):
(WebCore::LinkLoader::preconnectIfNeeded):
* Source/WebCore/loader/ResourceCryptographicDigest.cpp:
(WebCore::parseHashAlgorithmAdvancingPosition):
* Source/WebCore/loader/ServerTiming.cpp:
(WebCore::ServerTiming::setParameter):
* Source/WebCore/loader/TextResourceDecoder.cpp:
(WebCore::TextResourceDecoder::determineContentType):
(WebCore::TextResourceDecoder::setEncoding):
* Source/WebCore/loader/appcache/ApplicationCache.cpp:
(WebCore::ApplicationCache::requestIsHTTPOrHTTPSGet):
* Source/WebCore/loader/appcache/ApplicationCacheManifestParser.cpp:
(WebCore::parseApplicationCacheManifest):
* Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::shouldStoreResourceAsFlatFile):
* Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::mimeTypeAllowedByNosniff const):
(WebCore::CachedCSSStyleSheet::canUseSheet const):
* Source/WebCore/loader/cache/CachedResource.cpp:
(WebCore::shouldCacheSchemeIndefinitely):
* Source/WebCore/mathml/MathMLElement.cpp:
(WebCore::MathMLElement::collectPresentationalHintsForAttribute):
* Source/WebCore/mathml/MathMLFractionElement.cpp:
(WebCore::MathMLFractionElement::lineThickness):
(WebCore::MathMLFractionElement::cachedFractionAlignment):
* Source/WebCore/page/DOMSelection.cpp:
(WebCore::DOMSelection::modify):
* Source/WebCore/page/EventSource.cpp:
(WebCore::EventSource::responseIsValid const):
* Source/WebCore/page/FrameView.cpp:
(WebCore::FrameView::scrollToFragmentInternal):
* Source/WebCore/page/Page.cpp:
(WebCore::Page::useDarkAppearance const):
* Source/WebCore/page/PageConsoleClient.cpp:
(WebCore::PageConsoleClient::screenshot):
* Source/WebCore/page/Quirks.cpp:
(WebCore::isYahooMail):
(WebCore::Quirks::needsFormControlToBeMouseFocusable const):
(WebCore::Quirks::needsSeekingSupportDisabled const):
(WebCore::Quirks::needsPerDocumentAutoplayBehavior const):
(WebCore::Quirks::shouldAutoplayWebAudioForArbitraryUserGesture const):
(WebCore::Quirks::shouldTooltipPreventFromProceedingWithClick const):
(WebCore::Quirks::needsMillisecondResolutionForHighResTimeStamp const):
(WebCore::Quirks::shouldStripQuotationMarkInFontFaceSetFamily const):
(WebCore::Quirks::isTouchBarUpdateSupressedForHiddenContentEditable const):
(WebCore::Quirks::isNeverRichlyEditableForTouchBar const):
(WebCore::shouldSuppressAutocorrectionAndAutocaptializationInHiddenEditableAreasForHost):
(WebCore::Quirks::shouldDispatchSyntheticMouseEventsWhenModifyingSelection const):
(WebCore::Quirks::needsYouTubeMouseOutQuirk const):
(WebCore::Quirks::shouldAvoidUsingIOS13ForGmail const):
(WebCore::Quirks::isGoogleMaps const):
(WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
(WebCore::Quirks::shouldDispatchedSimulatedMouseEventsAssumeDefaultPrevented const):
(WebCore::Quirks::simulatedMouseEventTypeForTarget const):
(WebCore::Quirks::shouldMakeTouchEventNonCancelableForTarget const):
(WebCore::Quirks::shouldPreventPointerMediaQueryFromEvaluatingToCoarse const):
(WebCore::Quirks::shouldPreventDispatchOfTouchEvent const):
(WebCore::Quirks::shouldAvoidResizingWhenInputViewBoundsChange const):
(WebCore::Quirks::shouldDisablePointerEventsQuirk const):
(WebCore::Quirks::needsDeferKeyDownAndKeyPressTimersUntilNextEditingCommand const):
(WebCore::Quirks::needsInputModeNoneImplicitly const):
(WebCore::Quirks::needsGMailOverflowScrollQuirk const):
(WebCore::Quirks::needsYouTubeOverflowScrollQuirk const):
(WebCore::Quirks::needsFullscreenDisplayNoneQuirk const):
(WebCore::Quirks::shouldSilenceWindowResizeEvents const):
(WebCore::Quirks::shouldSilenceMediaQueryListChangeEvents const):
(WebCore::Quirks::shouldAvoidScrollingWhenFocusedContentIsVisible const):
(WebCore::Quirks::shouldUseLegacySelectPopoverDismissalBehaviorInDataActivation const):
(WebCore::Quirks::shouldIgnoreAriaForFastPathContentObservationCheck const):
(WebCore::Quirks::shouldOpenAsAboutBlank const):
(WebCore::Quirks::shouldBypassBackForwardCache const):
(WebCore::Quirks::shouldIgnoreContentObservationForSyntheticClick const):
(WebCore::Quirks::needsVP9FullRangeFlagQuirk const):
(WebCore::Quirks::needsHDRPixelDepthQuirk const):
(WebCore::Quirks::needsBlackFullscreenBackgroundQuirk const):
(WebCore::Quirks::shouldDisableEndFullscreenEventWhenEnteringPictureInPictureFromFullscreenQuirk const):
(WebCore::Quirks::needsToForceUserSelectAndUserDragWhenInstallingImageOverlay const):
* Source/WebCore/page/SecurityOrigin.cpp:
(WebCore::isFeedWithNestedProtocolInHTTPFamily):
(WebCore::SecurityOrigin::isLocalHostOrLoopbackIPAddress):
* Source/WebCore/page/SecurityOriginData.cpp:
(WebCore::SecurityOriginData::databaseIdentifier const):
* Source/WebCore/page/UserContentURLPattern.cpp:
(WebCore::UserContentURLPattern::parse):
(WebCore::UserContentURLPattern::matches const):
* Source/WebCore/page/WindowFeatures.cpp:
(WebCore::setWindowFeature):
(WebCore::boolFeature):
* Source/WebCore/page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::reportUnsupportedDirective const):
(WebCore::ContentSecurityPolicy::reportInvalidSourceExpression const):
* Source/WebCore/page/csp/ContentSecurityPolicySourceList.cpp:
(WebCore::isSourceListNone):
(WebCore::schemeIsInHttpFamily):
(WebCore::ContentSecurityPolicySourceList::isValidSourceForExtensionMode):
(WebCore::ContentSecurityPolicySourceList::parseSource):
(WebCore::ContentSecurityPolicySourceList::parseNonceSource):
* Source/WebCore/platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::isSupportedImageVideoOrSVGMIMEType):
(WebCore::MIMETypeRegistry::isSupportedWebAssemblyMIMEType):
(WebCore::MIMETypeRegistry::isSupportedStyleSheetMIMEType):
(WebCore::MIMETypeRegistry::isSupportedFontMIMEType):
(WebCore::MIMETypeRegistry::isTextMediaPlaylistMIMEType):
(WebCore::MIMETypeRegistry::isSupportedJSONMIMEType):
(WebCore::MIMETypeRegistry::isSupportedTextTrackMIMEType):
(WebCore::MIMETypeRegistry::isTextMIMEType):
(WebCore::MIMETypeRegistry::isXMLMIMEType):
(WebCore::MIMETypeRegistry::isXMLEntityMIMEType):
(WebCore::MIMETypeRegistry::isJavaAppletMIMEType):
(WebCore::MIMETypeRegistry::isPostScriptMIMEType):
(WebCore::MIMETypeRegistry::canShowMIMEType):
* Source/WebCore/platform/PreviewConverter.cpp:
(WebCore::PreviewConverter::supportsMIMEType):
* Source/WebCore/platform/ReferrerPolicy.cpp:
(WebCore::parseReferrerPolicyToken):
* Source/WebCore/platform/encryptedmedia/clearkey/CDMClearKey.cpp:
(WebCore::parseLicenseFormat):
(WebCore::CDMFactoryClearKey::supportsKeySystem):
(WebCore::CDMPrivateClearKey::supportsInitData const):
(WebCore::CDMInstanceSessionClearKey::requestLicense):
* Source/WebCore/platform/graphics/FontCache.cpp:
(WebCore::FontCache::alternateFamilyName):
* Source/WebCore/platform/graphics/FontDescription.cpp:
(WebCore::computeSpecializedChineseLocale):
* 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/CDMPrivateMediaSourceAVFObjC.mm:
(WebCore::CDMPrivateMediaSourceAVFObjC::supportsKeySystemAndMimeType):
* Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::keySystemIsSupported):
* Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
(WebCore::CDMSessionAVContentKeySession::generateKeyRequest):
* Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
(WebCore::CDMSessionAVStreamSession::generateKeyRequest):
* Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::willUseWebMFormatReaderForType):
(WebCore::keySystemIsSupported):
(WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem):
* Source/WebCore/platform/graphics/cg/ImageBufferUtilitiesCG.cpp:
(WebCore::utiFromImageBufferMIMEType):
* Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontCache::similarFont):
(WebCore::isDotPrefixedForbiddenFont):
(WebCore::fontWithFamilySpecialCase):
(WebCore::FontCache::platformAlternateFamilyName):
* Source/WebCore/platform/graphics/cocoa/FontDescriptionCocoa.cpp:
(WebCore::matchSystemFontUse):
* Source/WebCore/platform/graphics/cocoa/SourceBufferParserWebM.cpp:
(WebCore::SourceBufferParserWebM::isContentTypeSupported):
* Source/WebCore/platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
(WebCore::SystemFontDatabaseCoreText::monospaceFamily):
* Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::isCommonlyUsedGenericFamily):
* Source/WebCore/platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
(WebCore::FontCustomPlatformData::supportsFormat):
* Source/WebCore/platform/graphics/gstreamer/DMABufVideoSinkGStreamer.cpp:
(webKitDMABufVideoSinkIsEnabled):
* Source/WebCore/platform/graphics/gstreamer/eme/CDMThunder.cpp:
(WebCore::CDMPrivateThunder::supportsInitData const):
* Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::supportsFormat):
* Source/WebCore/platform/graphics/win/FontCacheWin.cpp:
(WebCore::adjustedGDIFontWeight):
(WebCore::FontCache::createFontPlatformData):
(WebCore::FontCache::platformAlternateFamilyName):
* Source/WebCore/platform/graphics/win/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::supportsFormat):
* Source/WebCore/platform/graphics/win/FontCustomPlatformDataCairo.cpp:
(WebCore::FontCustomPlatformData::supportsFormat):
* Source/WebCore/platform/mediarecorder/cocoa/VideoSampleBufferCompressor.mm:
(WebCore::VideoSampleBufferCompressor::create):
* Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::LibWebRTCProvider::createDecodingConfiguration):
(WebCore::LibWebRTCProvider::createEncodingConfiguration):
* Source/WebCore/platform/network/BlobResourceHandle.cpp:
(WebCore::BlobResourceHandle::loadResourceSynchronously):
(WebCore::BlobResourceHandle::doStart):
* Source/WebCore/platform/network/CacheValidation.cpp:
(WebCore::parseCacheControlDirectives):
* Source/WebCore/platform/network/DataURLDecoder.cpp:
(WebCore::DataURLDecoder::shouldRemoveFragmentIdentifier):
(WebCore::DataURLDecoder::DecodeTask::process):
* Source/WebCore/platform/network/FormData.h:
(WebCore::FormData::parseEncodingType):
* Source/WebCore/platform/network/HTTPParsers.cpp:
(WebCore::parseContentTypeOptionsHeader):
(WebCore::parseXFrameOptionsHeader):
(WebCore::parseRange):
(WebCore::isForbiddenHeaderName):
(WebCore::isPriviledgedNoCORSRequestHeaderName):
(WebCore::isForbiddenResponseHeaderName):
(WebCore::isForbiddenMethod):
(WebCore::isCrossOriginSafeRequestHeader):
* Source/WebCore/platform/network/MIMEHeader.cpp:
(WebCore::MIMEHeader::parseContentTransferEncoding):
* Source/WebCore/platform/network/ResourceRequestBase.cpp:
(WebCore::shouldUseGet):
* Source/WebCore/platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::isAttachment const):
(WebCore::ResourceResponseBase::isAttachmentWithFilename const):
* Source/WebCore/platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegate::createResourceRequest):
* Source/WebCore/platform/network/curl/CookieUtil.cpp:
(WebCore::CookieUtil::parseCookieAttributes):
* Source/WebCore/platform/network/curl/CurlMultipartHandle.cpp:
(WebCore::CurlMultipartHandle::extractBoundary):
* Source/WebCore/platform/network/curl/ResourceResponseCurl.cpp:
(WebCore::ResourceResponse::isAppendableHeader):
(WebCore::ResourceResponse::appendHTTPHeaderField):
* Source/WebCore/platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::willSendRequest):
* Source/WebCore/platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::useWALJournalMode):
* Source/WebCore/platform/sql/SQLiteStatement.cpp:
(WebCore::SQLiteStatement::isColumnDeclaredAsBlob):
* Source/WebCore/platform/win/PasteboardWin.cpp:
(WebCore::clipboardTypeFromMIMEType):
* Source/WebCore/plugins/PluginData.cpp:
(WebCore::isBuiltInPDFPlugIn):
* Source/WebCore/rendering/RenderThemeMac.mm:
(WebCore::iconForAttachment):
* Source/WebCore/style/StyleBuilderConverter.h:
(WebCore::Style::BuilderConverter::convertTouchCallout):
* Source/WebCore/svg/SVGAElement.cpp:
(WebCore::SVGAElement::relList):
* Source/WebCore/svg/SVGTests.cpp:
(WebCore::SVGTests::hasFeatureForLegacyBindings):
* Source/WebCore/svg/SVGToOTFFontConversion.cpp:
(WebCore::SVGToOTFFontConverter::compareCodepointsLexicographically):
(WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
* Source/WebCore/testing/Internals.cpp:
(WebCore::markerTypeFrom):
(WebCore::markerTypesFrom):
(WebCore::Internals::mediaElementHasCharacteristic):
(WebCore::Internals::setCaptionDisplayMode):
(WebCore::Internals::beginMediaSessionInterruption):
(WebCore::Internals::endMediaSessionInterruption):
(WebCore::mediaTypeFromString):
(WebCore::Internals::setMediaSessionRestrictions):
(WebCore::Internals::setMediaElementRestrictions):
(WebCore::Internals::postRemoteControlCommand):
(WebCore::Internals::setAudioContextRestrictions):
(WebCore::Internals::setMockMediaPlaybackTargetPickerState):
(WebCore::Internals::setPageMuted):
(WebCore::Internals::addPrefetchLoadEventListener):
* Source/WebCore/testing/LegacyMockCDM.cpp:
(WebCore::LegacyMockCDM::supportsKeySystem):
(WebCore::LegacyMockCDM::supportsKeySystemAndMimeType):
(WebCore::LegacyMockCDM::supportsMIMEType):
* Source/WebCore/testing/MockCDMFactory.cpp:
(WebCore::MockCDMFactory::supportsKeySystem):
(WebCore::MockCDM::sanitizeSessionId const):
(WebCore::MockCDMInstance::setServerCertificate):
* Source/WebCore/workers/service/server/SWServer.cpp:
(WebCore::SWServer::canHandleScheme const):
* Source/WebCore/xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::createDecoder const):
* Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::shouldAllowExternalLoad):

Canonical link: https://commits.webkit.org/250018@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@293484 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
cdumez committed Apr 26, 2022
1 parent aaccf88 commit 147df77f6bb805a2c35456b30b5bbb8f794b043c
Show file tree
Hide file tree
Showing 208 changed files with 1,068 additions and 1,074 deletions.
@@ -64,9 +64,9 @@ std::optional<T> parse(const char* string);
template<>
std::optional<OptionsStorage::Bool> parse(const char* string)
{
if (equalLettersIgnoringASCIICase(string, "true") || equalLettersIgnoringASCIICase(string, "yes") || !strcmp(string, "1"))
if (equalLettersIgnoringASCIICase(string, "true"_s) || equalLettersIgnoringASCIICase(string, "yes"_s) || !strcmp(string, "1"))
return true;
if (equalLettersIgnoringASCIICase(string, "false") || equalLettersIgnoringASCIICase(string, "no") || !strcmp(string, "0"))
if (equalLettersIgnoringASCIICase(string, "false"_s) || equalLettersIgnoringASCIICase(string, "no"_s) || !strcmp(string, "0"))
return false;
return std::nullopt;
}
@@ -134,13 +134,13 @@ std::optional<OptionsStorage::OptionString> parse(const char* string)
template<>
std::optional<OptionsStorage::GCLogLevel> parse(const char* string)
{
if (equalLettersIgnoringASCIICase(string, "none") || equalLettersIgnoringASCIICase(string, "no") || equalLettersIgnoringASCIICase(string, "false") || !strcmp(string, "0"))
if (equalLettersIgnoringASCIICase(string, "none"_s) || equalLettersIgnoringASCIICase(string, "no"_s) || equalLettersIgnoringASCIICase(string, "false"_s) || !strcmp(string, "0"))
return GCLogging::None;

if (equalLettersIgnoringASCIICase(string, "basic") || equalLettersIgnoringASCIICase(string, "yes") || equalLettersIgnoringASCIICase(string, "true") || !strcmp(string, "1"))
if (equalLettersIgnoringASCIICase(string, "basic"_s) || equalLettersIgnoringASCIICase(string, "yes"_s) || equalLettersIgnoringASCIICase(string, "true"_s) || !strcmp(string, "1"))
return GCLogging::Basic;

if (equalLettersIgnoringASCIICase(string, "verbose") || !strcmp(string, "2"))
if (equalLettersIgnoringASCIICase(string, "verbose"_s) || !strcmp(string, "2"))
return GCLogging::Verbose;

return std::nullopt;
@@ -562,21 +562,21 @@ void WTFInitializeLogChannelStatesFromString(WTFLogChannel* channels[], size_t c
component = component.substring(1);
}

if (equalLettersIgnoringASCIICase(component, "all")) {
if (equalLettersIgnoringASCIICase(component, "all"_s)) {
setStateOfAllChannels(channels, count, logChannelState);
continue;
}

WTFLogLevel logChannelLevel = WTFLogLevel::Error;
if (++it != componentInfo.end()) {
auto level = (*it).stripWhiteSpace();
if (equalLettersIgnoringASCIICase(level, "error"))
if (equalLettersIgnoringASCIICase(level, "error"_s))
logChannelLevel = WTFLogLevel::Error;
else if (equalLettersIgnoringASCIICase(level, "warning"))
else if (equalLettersIgnoringASCIICase(level, "warning"_s))
logChannelLevel = WTFLogLevel::Warning;
else if (equalLettersIgnoringASCIICase(level, "info"))
else if (equalLettersIgnoringASCIICase(level, "info"_s))
logChannelLevel = WTFLogLevel::Info;
else if (equalLettersIgnoringASCIICase(level, "debug"))
else if (equalLettersIgnoringASCIICase(level, "debug"_s))
logChannelLevel = WTFLogLevel::Debug;
else
WTFLogAlways("Unknown logging level: %s", level.utf8().data());
@@ -868,14 +868,14 @@ double parseDateFromNullTerminatedCharacters(const char* dateString, bool& isLoc

skipSpacesAndComments(dateString);

if (startsWithLettersIgnoringASCIICase(dateString, "am")) {
if (startsWithLettersIgnoringASCIICase(dateString, "am"_s)) {
if (hour > 12)
return std::numeric_limits<double>::quiet_NaN();
if (hour == 12)
hour = 0;
dateString += 2;
skipSpacesAndComments(dateString);
} else if (startsWithLettersIgnoringASCIICase(dateString, "pm")) {
} else if (startsWithLettersIgnoringASCIICase(dateString, "pm"_s)) {
if (hour > 12)
return std::numeric_limits<double>::quiet_NaN();
if (hour != 12)
@@ -899,7 +899,7 @@ double parseDateFromNullTerminatedCharacters(const char* dateString, bool& isLoc
// Don't fail if the time zone is missing.
// Some websites omit the time zone (4275206).
if (*dateString) {
if (startsWithLettersIgnoringASCIICase(dateString, "gmt") || startsWithLettersIgnoringASCIICase(dateString, "utc")) {
if (startsWithLettersIgnoringASCIICase(dateString, "gmt"_s) || startsWithLettersIgnoringASCIICase(dateString, "utc"_s)) {
dateString += 3;
isLocalTime = false;
}
@@ -290,7 +290,7 @@ inline bool operator<(ComparableASCIILiteral a, ComparableStringView b)

inline bool operator==(ComparableStringView a, ComparableLettersLiteral b)
{
return equalLettersIgnoringASCIICaseCommonWithoutLength(a.string, b.literal);
return equalLettersIgnoringASCIICaseCommon(a.string, b.literal);
}

inline bool operator<(ComparableStringView a, ComparableLettersLiteral b)
@@ -206,7 +206,7 @@ bool equalIgnoringASCIICase(const AtomString&, const String&);
bool equalIgnoringASCIICase(const String&, const AtomString&);
bool equalIgnoringASCIICase(const AtomString&, const char*);

template<unsigned length> bool equalLettersIgnoringASCIICase(const AtomString&, const char (&lowercaseLetters)[length]);
bool equalLettersIgnoringASCIICase(const AtomString&, ASCIILiteral);

WTF_EXPORT_PRIVATE AtomString replaceUnpairedSurrogatesWithReplacementCharacter(AtomString&&);
WTF_EXPORT_PRIVATE String replaceUnpairedSurrogatesWithReplacementCharacter(String&&);
@@ -331,9 +331,9 @@ inline AtomString AtomString::fromUTF8(const char* characters)
template<typename> struct DefaultHash;
template<> struct DefaultHash<AtomString>;

template<unsigned length> inline bool equalLettersIgnoringASCIICase(const AtomString& string, const char (&lowercaseLetters)[length])
inline bool equalLettersIgnoringASCIICase(const AtomString& string, ASCIILiteral literal)
{
return equalLettersIgnoringASCIICase(string.string(), lowercaseLetters);
return equalLettersIgnoringASCIICase(string.string(), literal);
}

inline bool equalIgnoringASCIICase(const AtomString& a, const AtomString& b)
@@ -47,12 +47,12 @@ template<typename CharacterTypeA, typename CharacterTypeB> bool equalIgnoringASC
template<typename StringClassA, typename StringClassB> bool equalIgnoringASCIICaseCommon(const StringClassA&, const StringClassB&);

template<typename CharacterType> bool equalLettersIgnoringASCIICase(const CharacterType*, const char* lowercaseLetters, unsigned length);
template<typename CharacterType, unsigned lowercaseLettersLength> bool equalLettersIgnoringASCIICase(const CharacterType*, unsigned charactersLength, const char (&lowercaseLetters)[lowercaseLettersLength]);
template<typename CharacterType> bool equalLettersIgnoringASCIICase(const CharacterType*, unsigned charactersLength, ASCIILiteral);

template<typename StringClass, unsigned length> bool equalLettersIgnoringASCIICaseCommon(const StringClass&, const char (&lowercaseLetters)[length]);
template<typename StringClass> bool equalLettersIgnoringASCIICaseCommon(const StringClass&, ASCIILiteral);

bool equalIgnoringASCIICase(const char*, const char*);
template<unsigned lowercaseLettersLength> bool equalLettersIgnoringASCIICase(const char*, const char (&lowercaseLetters)[lowercaseLettersLength]);
bool equalLettersIgnoringASCIICase(const char*, ASCIILiteral);

// Do comparisons 8 or 4 bytes-at-a-time on architectures where it's safe.
#if (CPU(X86_64) || CPU(ARM64)) && !ASAN_ENABLED
@@ -496,11 +496,10 @@ template<typename CharacterType> inline bool equalLettersIgnoringASCIICase(const
return true;
}

template<typename CharacterType, unsigned lowercaseLettersLength> inline bool equalLettersIgnoringASCIICase(const CharacterType* characters, unsigned charactersLength, const char (&lowercaseLetters)[lowercaseLettersLength])
template<typename CharacterType> inline bool equalLettersIgnoringASCIICase(const CharacterType* characters, unsigned charactersLength, ASCIILiteral literal)
{
ASSERT(strlen(lowercaseLetters) == lowercaseLettersLength - 1);
unsigned lowercaseLettersStringLength = lowercaseLettersLength - 1;
return charactersLength == lowercaseLettersStringLength && equalLettersIgnoringASCIICase(characters, lowercaseLetters, lowercaseLettersStringLength);
unsigned literalLength = literal.length();
return charactersLength == literalLength && equalLettersIgnoringASCIICase(characters, literal.characters(), literalLength);
}

template<typename StringClass> bool inline hasPrefixWithLettersIgnoringASCIICaseCommon(const StringClass& string, const char* lowercaseLetters, unsigned length)
@@ -518,36 +517,31 @@ template<typename StringClass> bool inline hasPrefixWithLettersIgnoringASCIICase
}

// This is intentionally not marked inline because it's used often and is not speed-critical enough to want it inlined everywhere.
template<typename StringClass> bool equalLettersIgnoringASCIICaseCommonWithoutLength(const StringClass& string, const char* lowercaseLetters)
template<typename StringClass> bool equalLettersIgnoringASCIICaseCommon(const StringClass& string, const char* literal, unsigned literalLength)
{
unsigned length = string.length();
if (length != strlen(lowercaseLetters))
if (length != literalLength)
return false;
return hasPrefixWithLettersIgnoringASCIICaseCommon(string, lowercaseLetters, length);
return hasPrefixWithLettersIgnoringASCIICaseCommon(string, literal, length);
}

template<typename StringClass> bool startsWithLettersIgnoringASCIICaseCommonWithoutLength(const StringClass& string, const char* lowercaseLetters)
template<typename StringClass> bool startsWithLettersIgnoringASCIICaseCommon(const StringClass& string, const char* prefix, unsigned prefixLength)
{
size_t prefixLength = strlen(lowercaseLetters);
if (!prefixLength)
return true;
if (string.length() < prefixLength)
return false;
return hasPrefixWithLettersIgnoringASCIICaseCommon(string, lowercaseLetters, prefixLength);
return hasPrefixWithLettersIgnoringASCIICaseCommon(string, prefix, prefixLength);
}

template<typename StringClass, unsigned length> inline bool equalLettersIgnoringASCIICaseCommon(const StringClass& string, const char (&lowercaseLetters)[length])
template<typename StringClass> inline bool equalLettersIgnoringASCIICaseCommon(const StringClass& string, ASCIILiteral literal)
{
// Don't actually use the length; we are choosing code size over speed.
ASSERT(strlen(lowercaseLetters) == length - 1);
const char* pointer = lowercaseLetters;
return equalLettersIgnoringASCIICaseCommonWithoutLength(string, pointer);
return equalLettersIgnoringASCIICaseCommon(string, literal.characters(), literal.length());
}

template<typename StringClass, unsigned length> inline bool startsWithLettersIgnoringASCIICaseCommon(const StringClass& string, const char (&lowercaseLetters)[length])
template<typename StringClass> inline bool startsWithLettersIgnoringASCIICaseCommon(const StringClass& string, ASCIILiteral literal)
{
const char* pointer = lowercaseLetters;
return startsWithLettersIgnoringASCIICaseCommonWithoutLength(string, pointer);
return startsWithLettersIgnoringASCIICaseCommon(string, literal.characters(), literal.length());
}

inline bool equalIgnoringASCIICase(const char* a, const char* b)
@@ -556,10 +550,10 @@ inline bool equalIgnoringASCIICase(const char* a, const char* b)
return length == strlen(b) && equalIgnoringASCIICase(a, b, length);
}

template<unsigned lowercaseLettersLength> inline bool equalLettersIgnoringASCIICase(const char* string, const char (&lowercaseLetters)[lowercaseLettersLength])
inline bool equalLettersIgnoringASCIICase(const char* string, ASCIILiteral literal)
{
auto length = strlen(lowercaseLetters);
return strlen(string) == length && equalLettersIgnoringASCIICase(string, lowercaseLetters, length);
auto literalLength = literal.length();
return strlen(string) == literalLength && equalLettersIgnoringASCIICase(string, literal.characters(), literalLength);
}

}
@@ -585,8 +585,8 @@ bool equalIgnoringASCIICase(const StringImpl*, const char*);

WTF_EXPORT_PRIVATE bool equalIgnoringASCIICaseNonNull(const StringImpl*, const StringImpl*);

template<unsigned length> bool equalLettersIgnoringASCIICase(const StringImpl&, const char (&lowercaseLetters)[length]);
template<unsigned length> bool equalLettersIgnoringASCIICase(const StringImpl*, const char (&lowercaseLetters)[length]);
bool equalLettersIgnoringASCIICase(const StringImpl&, ASCIILiteral);
bool equalLettersIgnoringASCIICase(const StringImpl*, ASCIILiteral);

template<typename CodeUnit, typename CodeUnitMatchFunction, std::enable_if_t<std::is_invocable_r_v<bool, CodeUnitMatchFunction, CodeUnit>>* = nullptr>
size_t find(const CodeUnit*, unsigned length, CodeUnitMatchFunction&&, unsigned start = 0);
@@ -1269,24 +1269,24 @@ inline bool equalIgnoringASCIICase(const StringImpl* a, const char* b)
return a && equalIgnoringASCIICase(*a, b);
}

template<unsigned length> inline bool startsWithLettersIgnoringASCIICase(const StringImpl& string, const char (&lowercaseLetters)[length])
inline bool startsWithLettersIgnoringASCIICase(const StringImpl& string, ASCIILiteral literal)
{
return startsWithLettersIgnoringASCIICaseCommon(string, lowercaseLetters);
return startsWithLettersIgnoringASCIICaseCommon(string, literal);
}

template<unsigned length> inline bool startsWithLettersIgnoringASCIICase(const StringImpl* string, const char (&lowercaseLetters)[length])