Title: [294468] trunk
Revision
294468
Author
[email protected]
Date
2022-05-18 22:53:40 -0700 (Wed, 18 May 2022)

Log Message

Add find()/reverseFind()/contains() overloads takes an ASCIILiteral to our String types https://bugs.webkit.org/show_bug.cgi?id=240247
https://bugs.webkit.org/show_bug.cgi?id=240247

Reviewed by Darin Adler.

Add find()/reverseFind()/contains() overloads takes an ASCIILiteral to our String types.
These versions are more efficient when the call sites have an ASCIILiteral as they have
less branching.

* Source/_javascript_Core/runtime/ExceptionHelpers.cpp:
(JSC::notAFunctionSourceAppender):
(JSC::invalidParameterInSourceAppender):
(JSC::invalidParameterInstanceofSourceAppender):
(JSC::invalidPrototypeSourceAppender):
* Source/_javascript_Core/runtime/IntlObject.cpp:
(JSC::canonicalizeUnicodeExtensionsAfterICULocaleCanonicalization):
(JSC::lookupMatcher):
* Source/_javascript_Core/tools/FunctionOverrides.cpp:
(JSC::initializeOverrideInfo):
* Source/WebCore/PAL/pal/text/DecodeEscapeSequences.h:
(PAL::Unicode16BitEscapeSequence::findInString):
* Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::needsNewCreateTableSchema):
(WebKit::ResourceLoadStatisticsDatabaseStore::insertDomainRelationshipList):
* Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didReceiveResponse):
* Source/WebKit/NetworkProcess/cache/PrefetchCache.cpp:
(WebKit::PrefetchCache::take):
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _updateTextInputTraits:]):
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::focusedElementInformation):
* Source/WebKit/WebProcess/WebProcess.cpp:
(WebKit::checkDocumentsCaptureStateConsistency):
* Source/WebKitLegacy/mac/WebView/WebView.mm:
(-[WebView updateTextTouchBar]):
* Source/WTF/wtf/text/AtomString.h:
* Source/WTF/wtf/text/StringImpl.cpp:
(WTF::StringImpl::find):
(WTF::StringImpl::reverseFind):
* Source/WTF/wtf/text/StringImpl.h:
(WTF::StringImpl::find):
(WTF::StringImpl::reverseFind):
* Source/WTF/wtf/text/StringView.cpp:
(WTF::StringView::find const):
(WTF::StringView::reverseFind const):
* Source/WTF/wtf/text/StringView.h:
* Source/WTF/wtf/text/WTFString.h:
* Source/WebCore/Modules/fetch/FetchBodyConsumer.cpp:
(WebCore::FetchBodyConsumer::packageFormData):
* Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::validateSDP const):
(WebCore::PeerConnectionBackend::newICECandidate):
* Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp:
(WebCore::YouTubePluginReplacement::youTubeURLFromAbsoluteURL):
* Source/WebCore/dom/DataTransfer.cpp:
(WebCore::DataTransfer::types const):
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::createCDATASection):
(WebCore::Document::createProcessingInstruction):
* Source/WebCore/editing/cocoa/HTMLConverter.mm:
(HTMLConverter::computedAttributesForElement):
* Source/WebCore/editing/libwpe/EditorLibWPE.cpp:
(WebCore::createFragmentFromPasteboardData):
* Source/WebCore/editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::shouldPreserveMSOListStyleForElement):
(WebCore::StyledMarkupAccumulator::appendNodeToPreserveMSOList):
(WebCore::shouldPreserveMSOLists):
* Source/WebCore/html/track/VTTRegion.cpp:
(WebCore::VTTRegion::parseSettingValue):
* Source/WebCore/html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::collectWebVTTBlock):
(WebCore::WebVTTParser::checkAndRecoverCue):
(WebCore::WebVTTParser::checkAndCreateRegion):
(WebCore::WebVTTParser::checkAndStoreRegion):
(WebCore::WebVTTParser::checkStyleSheet):
(WebCore::WebVTTParser::checkAndStoreStyleSheet):
(WebCore::WebVTTParser::collectCueId):
(WebCore::WebVTTParser::collectCueText):
(WebCore::WebVTTParser::ignoreBadCue):
* Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
(WebCore::GStreamerRegistryScanner::ElementFactories::hasElementForMediaType const):
* Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
* Source/WebCore/platform/graphics/opengl/ExtensionsGLOpenGLCommon.cpp:
(WebCore::ExtensionsGLOpenGLCommon::ExtensionsGLOpenGLCommon):
* Source/WebCore/platform/graphics/texmap/TextureMapperContextAttributes.cpp:
(WebCore::TextureMapperContextAttributes::get):
* Source/WebCore/platform/ios/UserAgentIOS.mm:
(WebCore::deviceNameForUserAgent):
* Source/WebCore/platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
(WebCore::isValidCaptureDevice):
* Source/WebCore/rendering/style/GridPositionsResolver.cpp:
(WebCore::NamedLineCollectionBase::NamedLineCollectionBase):
* Source/WebCore/style/StyleScope.cpp:
(WebCore::Style::Scope::collectActiveStyleSheets):
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::isVP9VTBDeccoderUsed):
* Source/WebCore/testing/MockLibWebRTCPeerConnection.cpp:
(WebCore::MockLibWebRTCPeerConnection::SetRemoteDescription):

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

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/runtime/ExceptionHelpers.cpp (294467 => 294468)


--- trunk/Source/_javascript_Core/runtime/ExceptionHelpers.cpp	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/_javascript_Core/runtime/ExceptionHelpers.cpp	2022-05-19 05:53:40 UTC (rev 294468)
@@ -161,7 +161,7 @@
         return defaultApproximateSourceError(originalMessage, sourceText);
 
     ASSERT(occurrence == ErrorInstance::FoundExactSource);
-    auto notAFunctionIndex = originalMessage.reverseFind("is not a function");
+    auto notAFunctionIndex = originalMessage.reverseFind("is not a function"_s);
     RELEASE_ASSERT(notAFunctionIndex != notFound);
     StringView displayValue;
     if (originalMessage.is8Bit()) 
@@ -197,7 +197,7 @@
         return defaultApproximateSourceError(originalMessage, sourceText);
 
     ASSERT(occurrence == ErrorInstance::FoundExactSource);
-    auto inIndex = sourceText.reverseFind("in");
+    auto inIndex = sourceText.reverseFind("in"_s);
     if (inIndex == notFound) {
         // This should basically never happen, since JS code must use the literal
         // text "in" for the `in` operation. However, if we fail to find "in"
@@ -204,7 +204,7 @@
         // for any reason, just fail gracefully.
         return originalMessage;
     }
-    if (sourceText.find("in") != inIndex)
+    if (sourceText.find("in"_s) != inIndex)
         return makeString(originalMessage, " (evaluating '", sourceText, "')");
 
     static constexpr unsigned inLength = 2;
@@ -218,12 +218,12 @@
         return defaultApproximateSourceError(originalMessage, sourceText);
 
     ASSERT(occurrence == ErrorInstance::FoundExactSource);
-    auto instanceofIndex = sourceText.reverseFind("instanceof");
+    auto instanceofIndex = sourceText.reverseFind("instanceof"_s);
     // This can happen when Symbol.hasInstance function is directly called.
     if (instanceofIndex == notFound)
         return originalMessage;
 
-    if (sourceText.find("instanceof") != instanceofIndex)
+    if (sourceText.find("instanceof"_s) != instanceofIndex)
         return makeString(originalMessage, " (evaluating '", sourceText, "')");
 
     static constexpr unsigned instanceofLength = 10;
@@ -246,8 +246,8 @@
     if (occurrence == ErrorInstance::FoundApproximateSource)
         return defaultApproximateSourceError(originalMessage, sourceText);
 
-    auto extendsIndex = sourceText.reverseFind("extends");
-    if (extendsIndex == notFound || sourceText.find("extends") != extendsIndex)
+    auto extendsIndex = sourceText.reverseFind("extends"_s);
+    if (extendsIndex == notFound || sourceText.find("extends"_s) != extendsIndex)
         return makeString(originalMessage, " (evaluating '", sourceText, "')");
 
     return "The value of the superclass's prototype property is not an object or null."_s;

Modified: trunk/Source/_javascript_Core/runtime/IntlObject.cpp (294467 => 294468)


--- trunk/Source/_javascript_Core/runtime/IntlObject.cpp	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/_javascript_Core/runtime/IntlObject.cpp	2022-05-19 05:53:40 UTC (rev 294468)
@@ -320,7 +320,7 @@
 {
     StringView locale(buffer.data(), buffer.size());
     ASSERT(locale.is8Bit());
-    size_t extensionIndex = locale.find("-u-");
+    size_t extensionIndex = locale.find("-u-"_s);
     if (extensionIndex == notFound)
         return WTFMove(buffer);
 
@@ -855,7 +855,7 @@
     if (!availableLocale.isEmpty()) {
         result.locale = availableLocale;
         if (locale != noExtensionsLocale) {
-            size_t extensionIndex = locale.find("-u-");
+            size_t extensionIndex = locale.find("-u-"_s);
             RELEASE_ASSERT(extensionIndex != notFound);
 
             size_t extensionLength = locale.length() - extensionIndex;

Modified: trunk/Source/_javascript_Core/tools/FunctionOverrides.cpp (294467 => 294468)


--- trunk/Source/_javascript_Core/tools/FunctionOverrides.cpp	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/_javascript_Core/tools/FunctionOverrides.cpp	2022-05-19 05:53:40 UTC (rev 294468)
@@ -130,7 +130,7 @@
     FunctionOverridesAssertScope assertScope;
     String origProviderStr = origCode.provider()->source().toString();
     unsigned origStart = origCode.startOffset();
-    unsigned origFunctionStart = origProviderStr.reverseFind("function", origStart);
+    unsigned origFunctionStart = origProviderStr.reverseFind("function"_s, origStart);
     unsigned origBraceStart = origProviderStr.find('{', origStart);
     unsigned headerLength = origBraceStart - origFunctionStart;
     auto origHeaderView = StringView(origProviderStr).substring(origFunctionStart, headerLength);

Modified: trunk/Source/WTF/wtf/text/AtomString.h (294467 => 294468)


--- trunk/Source/WTF/wtf/text/AtomString.h	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WTF/wtf/text/AtomString.h	2022-05-19 05:53:40 UTC (rev 294468)
@@ -97,14 +97,17 @@
     // If we need more overloads of the number function, we can add all the others that String has, but these seem to do for now.
 
     bool contains(UChar character) const { return m_string.contains(character); }
-    bool contains(const LChar* string) const { return m_string.contains(string); }
+    bool contains(ASCIILiteral literal) const { return m_string.contains(literal); }
+    bool contains(const char*) const = delete;
     bool contains(StringView) const;
     bool containsIgnoringASCIICase(StringView) const;
 
     size_t find(UChar character, unsigned start = 0) const { return m_string.find(character, start); }
-    size_t find(const LChar* string, unsigned start = 0) const { return m_string.find(string, start); }
+    size_t find(ASCIILiteral literal, unsigned start = 0) const { return m_string.find(literal, start); }
+    size_t find(const char*, unsigned start = 0) const = delete;
     size_t find(StringView, unsigned start = 0) const;
     size_t findIgnoringASCIICase(StringView) const;
+    size_t findIgnoringASCIICase(const char*) const = delete;
     size_t findIgnoringASCIICase(StringView, unsigned start) const;
     size_t find(CodeUnitMatchFunction matchFunction, unsigned start = 0) const { return m_string.find(matchFunction, start); }
 

Modified: trunk/Source/WTF/wtf/text/StringImpl.cpp (294467 => 294468)


--- trunk/Source/WTF/wtf/text/StringImpl.cpp	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WTF/wtf/text/StringImpl.cpp	2022-05-19 05:53:40 UTC (rev 294468)
@@ -809,25 +809,11 @@
     return charactersToFloat(characters16(), m_length, ok);
 }
 
-size_t StringImpl::find(const LChar* matchString, unsigned start)
+size_t StringImpl::find(const LChar* matchString, unsigned matchLength, unsigned start)
 {
-    // Check for null or empty string to match against
-    if (!matchString)
-        return notFound;
-    size_t matchStringLength = strlen(reinterpret_cast<const char*>(matchString));
-    if (matchStringLength > MaxLength)
-        CRASH();
-    unsigned matchLength = matchStringLength;
-    if (!matchLength)
-        return std::min(start, length());
+    ASSERT(matchLength);
+    ASSERT(matchLength <= MaxLength);
 
-    // Optimization 1: fast case for strings of length 1.
-    if (matchLength == 1) {
-        if (is8Bit())
-            return WTF::find(characters8(), length(), matchString[0], start);
-        return WTF::find(characters16(), length(), *matchString, start);
-    }
-
     // Check start & matchLength are in range.
     if (start > length())
         return notFound;
@@ -837,7 +823,7 @@
     // delta is the number of additional times to test; delta == 0 means test only once.
     unsigned delta = searchLength - matchLength;
 
-    // Optimization 2: keep a running hash of the strings,
+    // Optimization: keep a running hash of the strings,
     // only call equal if the hashes match.
 
     if (is8Bit()) {
@@ -881,6 +867,19 @@
     return start + i;
 }
 
+size_t StringImpl::reverseFind(const LChar* matchString, unsigned matchLength, unsigned start)
+{
+    ASSERT(matchLength);
+
+    unsigned length = this->length();
+    if (matchLength > length)
+        return notFound;
+
+    if (is8Bit())
+        return reverseFindInner(characters8(), matchString, start, length, matchLength);
+    return reverseFindInner(characters16(), matchString, start, length, matchLength);
+}
+
 size_t StringImpl::find(StringView matchString)
 {
     // Check for null string to match against

Modified: trunk/Source/WTF/wtf/text/StringImpl.h (294467 => 294468)


--- trunk/Source/WTF/wtf/text/StringImpl.h	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WTF/wtf/text/StringImpl.h	2022-05-19 05:53:40 UTC (rev 294468)
@@ -432,7 +432,8 @@
     size_t find(UChar character, unsigned start = 0);
     template<typename CodeUnitMatchFunction, std::enable_if_t<std::is_invocable_r_v<bool, CodeUnitMatchFunction, UChar>>* = nullptr>
     size_t find(CodeUnitMatchFunction, unsigned start = 0);
-    WTF_EXPORT_PRIVATE size_t find(const LChar*, unsigned start = 0);
+    ALWAYS_INLINE size_t find(ASCIILiteral literal, unsigned start = 0) { return find(literal.characters8(), literal.length(), start); }
+    size_t find(const char*, unsigned start = 0) = delete;
     WTF_EXPORT_PRIVATE size_t find(StringView);
     WTF_EXPORT_PRIVATE size_t find(StringView, unsigned start);
     WTF_EXPORT_PRIVATE size_t findIgnoringASCIICase(StringView) const;
@@ -440,6 +441,8 @@
 
     WTF_EXPORT_PRIVATE size_t reverseFind(UChar, unsigned start = MaxLength);
     WTF_EXPORT_PRIVATE size_t reverseFind(StringView, unsigned start = MaxLength);
+    ALWAYS_INLINE size_t reverseFind(ASCIILiteral literal, unsigned start = MaxLength) { return reverseFind(literal.characters8(), literal.length(), start); }
+    size_t reverseFind(const char*, unsigned start = MaxLength) = delete;
 
     WTF_EXPORT_PRIVATE bool startsWith(StringView) const;
     WTF_EXPORT_PRIVATE bool startsWithIgnoringASCIICase(StringView) const;
@@ -495,6 +498,9 @@
     template<typename> static size_t maxInternalLength();
     template<typename> static size_t tailOffset();
 
+    WTF_EXPORT_PRIVATE size_t find(const LChar*, unsigned length, unsigned start);
+    WTF_EXPORT_PRIVATE size_t reverseFind(const LChar*, unsigned length, unsigned start);
+
     bool requiresCopy() const;
     template<typename T> const T* tailPointer() const;
     template<typename T> T* tailPointer();

Modified: trunk/Source/WTF/wtf/text/StringView.cpp (294467 => 294468)


--- trunk/Source/WTF/wtf/text/StringView.cpp	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WTF/wtf/text/StringView.cpp	2022-05-19 05:53:40 UTC (rev 294468)
@@ -109,6 +109,34 @@
     return findCommon(*this, matchString, start);
 }
 
+size_t StringView::find(const LChar* match, unsigned matchLength, unsigned start) const
+{
+    ASSERT(matchLength);
+    auto length = this->length();
+    if (start > length)
+        return notFound;
+
+    unsigned searchLength = length - start;
+    if (matchLength > searchLength)
+        return notFound;
+
+    if (is8Bit())
+        return findInner(characters8() + start, match, start, searchLength, matchLength);
+    return findInner(characters16() + start, match, start, searchLength, matchLength);
+}
+
+size_t StringView::reverseFind(const LChar* match, unsigned matchLength, unsigned start) const
+{
+    ASSERT(matchLength);
+    auto length = this->length();
+    if (matchLength > length)
+        return notFound;
+
+    if (is8Bit())
+        return reverseFindInner(characters8(), match, start, length, matchLength);
+    return reverseFindInner(characters16(), match, start, length, matchLength);
+}
+
 void StringView::SplitResult::Iterator::findNextSubstring()
 {
     for (size_t separatorPosition; (separatorPosition = m_result.m_string.find(m_result.m_separator, m_position)) != notFound; ++m_position) {
@@ -343,11 +371,6 @@
     return equalCommon(a, b);
 }
 
-bool StringView::contains(const char* string) const
-{
-    return find(string) != notFound;
-}
-
 StringView StringView::stripWhiteSpace() const
 {
     return stripLeadingAndTrailingMatchedCharacters(isASCIISpace<UChar>);

Modified: trunk/Source/WTF/wtf/text/StringView.h (294467 => 294468)


--- trunk/Source/WTF/wtf/text/StringView.h	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WTF/wtf/text/StringView.h	2022-05-19 05:53:40 UTC (rev 294468)
@@ -146,9 +146,13 @@
     size_t find(UChar, unsigned start = 0) const;
     template<typename CodeUnitMatchFunction, std::enable_if_t<std::is_invocable_r_v<bool, CodeUnitMatchFunction, UChar>>* = nullptr>
     size_t find(CodeUnitMatchFunction&&, unsigned start = 0) const;
+    ALWAYS_INLINE size_t find(ASCIILiteral literal, unsigned start = 0) const { return find(literal.characters8(), literal.length(), start); }
+    size_t find(const char*, unsigned start = 0) const = delete;
     WTF_EXPORT_PRIVATE size_t find(StringView, unsigned start = 0) const;
 
     size_t reverseFind(UChar, unsigned index = std::numeric_limits<unsigned>::max()) const;
+    ALWAYS_INLINE size_t reverseFind(ASCIILiteral literal, unsigned start = std::numeric_limits<unsigned>::max()) const { return reverseFind(literal.characters8(), literal.length(), start); }
+    size_t reverseFind(const char*, unsigned start = std::numeric_limits<unsigned>::max()) const = delete;
     WTF_EXPORT_PRIVATE size_t reverseFind(StringView, unsigned start = std::numeric_limits<unsigned>::max()) const;
 
     WTF_EXPORT_PRIVATE size_t findIgnoringASCIICase(StringView) const;
@@ -161,8 +165,9 @@
     bool contains(UChar) const;
     template<typename CodeUnitMatchFunction, std::enable_if_t<std::is_invocable_r_v<bool, CodeUnitMatchFunction, UChar>>* = nullptr>
     bool contains(CodeUnitMatchFunction&&) const;
-    bool contains(StringView string) const { return find(string, 0) != notFound; }
-    WTF_EXPORT_PRIVATE bool contains(const char*) const;
+    bool contains(ASCIILiteral literal) const { return find(literal) != notFound; }
+    bool contains(const char*) const = delete;
+    bool contains(StringView string) const { return find(string) != notFound; }
 
     WTF_EXPORT_PRIVATE bool containsIgnoringASCIICase(StringView) const;
     WTF_EXPORT_PRIVATE bool containsIgnoringASCIICase(StringView, unsigned start) const;
@@ -191,6 +196,9 @@
     void initialize(const LChar*, unsigned length);
     void initialize(const UChar*, unsigned length);
 
+    WTF_EXPORT_PRIVATE size_t find(const LChar* match, unsigned matchLength, unsigned start) const;
+    WTF_EXPORT_PRIVATE size_t reverseFind(const LChar* match, unsigned matchLength, unsigned start) const;
+
     template<typename CharacterType, typename MatchedCharacterPredicate>
     StringView stripLeadingAndTrailingMatchedCharacters(const CharacterType*, const MatchedCharacterPredicate&) const;
 

Modified: trunk/Source/WTF/wtf/text/WTFString.h (294467 => 294468)


--- trunk/Source/WTF/wtf/text/WTFString.h	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WTF/wtf/text/WTFString.h	2022-05-19 05:53:40 UTC (rev 294468)
@@ -162,10 +162,11 @@
 
     template<typename CodeUnitMatchFunction, std::enable_if_t<std::is_invocable_r_v<bool, CodeUnitMatchFunction, UChar>>* = nullptr>
     size_t find(CodeUnitMatchFunction matchFunction, unsigned start = 0) const { return m_impl ? m_impl->find(matchFunction, start) : notFound; }
-    size_t find(const LChar* string, unsigned start = 0) const { return m_impl ? m_impl->find(string, start) : notFound; }
+    size_t find(ASCIILiteral literal, unsigned start = 0) const { return m_impl ? m_impl->find(literal, start) : notFound; }
 
     // Find the last instance of a single character or string.
     size_t reverseFind(UChar character, unsigned start = MaxLength) const { return m_impl ? m_impl->reverseFind(character, start) : notFound; }
+    size_t reverseFind(ASCIILiteral literal, unsigned start = MaxLength) const { return m_impl ? m_impl->reverseFind(literal, start) : notFound; }
     size_t reverseFind(StringView, unsigned start = MaxLength) const;
 
     WTF_EXPORT_PRIVATE Vector<UChar> charactersWithNullTermination() const;
@@ -174,7 +175,7 @@
     WTF_EXPORT_PRIVATE UChar32 characterStartingAt(unsigned) const;
 
     bool contains(UChar character) const { return find(character) != notFound; }
-    bool contains(const LChar* string) const { return find(string) != notFound; }
+    bool contains(ASCIILiteral literal) const { return find(literal) != notFound; }
     bool contains(StringView) const;
     template<typename CodeUnitMatchFunction, std::enable_if_t<std::is_invocable_r_v<bool, CodeUnitMatchFunction, UChar>>* = nullptr>
     bool contains(CodeUnitMatchFunction matchFunction) const { return find(matchFunction, 0) != notFound; }

Modified: trunk/Source/WebCore/Modules/fetch/FetchBodyConsumer.cpp (294467 => 294468)


--- trunk/Source/WebCore/Modules/fetch/FetchBodyConsumer.cpp	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WebCore/Modules/fetch/FetchBodyConsumer.cpp	2022-05-19 05:53:40 UTC (rev 294468)
@@ -144,7 +144,7 @@
         size_t contentDispositionBegin = header.find(contentDispositionCharacters);
         if (contentDispositionBegin == notFound)
             return false;
-        size_t contentDispositionEnd = header.find("\r\n", contentDispositionBegin);
+        size_t contentDispositionEnd = header.find("\r\n"_s, contentDispositionBegin);
         size_t contentDispositionParametersBegin = header.find(';', contentDispositionBegin + strlen(contentDispositionCharacters));
         if (contentDispositionParametersBegin != notFound)
             contentDispositionParametersBegin++;
@@ -163,7 +163,7 @@
             size_t contentTypePrefixLength = strlen(contentTypeCharacters);
             size_t contentTypeBegin = header.find(contentTypeCharacters);
             if (contentTypeBegin != notFound) {
-                size_t contentTypeEnd = header.find("\r\n", contentTypeBegin);
+                size_t contentTypeEnd = header.find("\r\n"_s, contentTypeBegin);
                 contentType = StringView(header).substring(contentTypeBegin + contentTypePrefixLength, contentTypeEnd - contentTypeBegin - contentTypePrefixLength).stripLeadingAndTrailingMatchedCharacters(isHTTPSpace).toString();
             }
 

Modified: trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp (294467 => 294468)


--- trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp	2022-05-19 05:53:40 UTC (rev 294468)
@@ -358,7 +358,7 @@
     if (!m_shouldFilterICECandidates)
         return;
     sdp.split('\n', [](auto line) {
-        ASSERT(!line.startsWith("a=candidate") || line.contains(".local"));
+        ASSERT(!line.startsWith("a=candidate"_s) || line.contains(".local"_s));
     });
 #else
     UNUSED_PARAM(sdp);
@@ -381,7 +381,7 @@
         ALWAYS_LOG(logSiteIdentifier, "Gathered ice candidate:", sdp);
         m_finishedGatheringCandidates = false;
 
-        ASSERT(!m_shouldFilterICECandidates || sdp.contains(".local") || sdp.contains(" srflx "));
+        ASSERT(!m_shouldFilterICECandidates || sdp.contains(".local"_s) || sdp.contains(" srflx "_s));
         auto candidate = RTCIceCandidate::create(WTFMove(sdp), WTFMove(mid), sdpMLineIndex);
         m_peerConnection.dispatchEvent(RTCPeerConnectionIceEvent::create(Event::CanBubble::No, Event::IsCancelable::No, WTFMove(candidate), WTFMove(serverURL)));
     });

Modified: trunk/Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp (294467 => 294468)


--- trunk/Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp	2022-05-19 05:53:40 UTC (rev 294468)
@@ -307,7 +307,7 @@
     } else if (equalLettersIgnoringASCIICase(srcPath, "/watch"_s)) {
         // From the original URL, we need to get the part before /watch/#!v=VideoID
         // FIXME: Shouldn't this be ASCII case-insensitive?
-        locationOfPathBeforeVideoID = srcString.find("/watch");
+        locationOfPathBeforeVideoID = srcString.find("/watch"_s);
     } else
         return srcString;
 

Modified: trunk/Source/WebCore/PAL/pal/text/DecodeEscapeSequences.h (294467 => 294468)


--- trunk/Source/WebCore/PAL/pal/text/DecodeEscapeSequences.h	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WebCore/PAL/pal/text/DecodeEscapeSequences.h	2022-05-19 05:53:40 UTC (rev 294468)
@@ -39,7 +39,7 @@
 // See <http://en.wikipedia.org/wiki/Percent-encoding#Non-standard_implementations>.
 struct Unicode16BitEscapeSequence {
     enum { SequenceSize = 6 }; // e.g. %u26C4
-    static size_t findInString(StringView string, size_t startPosition) { return string.find("%u", startPosition); }
+    static size_t findInString(StringView string, size_t startPosition) { return string.find("%u"_s, startPosition); }
     static size_t findEndOfRun(StringView string, size_t startPosition, size_t endPosition)
     {
         size_t runEnd = startPosition;

Modified: trunk/Source/WebCore/dom/DataTransfer.cpp (294467 => 294468)


--- trunk/Source/WebCore/dom/DataTransfer.cpp	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WebCore/dom/DataTransfer.cpp	2022-05-19 05:53:40 UTC (rev 294468)
@@ -319,7 +319,7 @@
     
     if (!RuntimeEnabledFeatures::sharedFeatures().customPasteboardDataEnabled()) {
         auto types = m_pasteboard->typesForLegacyUnsafeBindings();
-        ASSERT(!types.contains("Files"));
+        ASSERT(!types.contains("Files"_s));
         if (m_pasteboard->fileContentState() != Pasteboard::FileContentState::NoFileOrImageData && addFilesType == AddFilesType::Yes)
             types.append("Files"_s);
         return types;
@@ -341,14 +341,14 @@
             return types;
         }
 
-        if (safeTypes.contains("text/uri-list"))
+        if (safeTypes.contains("text/uri-list"_s))
             types.append("text/uri-list"_s);
-        if (safeTypes.contains("text/html") && RuntimeEnabledFeatures::sharedFeatures().customPasteboardDataEnabled())
+        if (safeTypes.contains("text/html"_s) && RuntimeEnabledFeatures::sharedFeatures().customPasteboardDataEnabled())
             types.append("text/html"_s);
         return types;
     }
 
-    ASSERT(!safeTypes.contains("Files"));
+    ASSERT(!safeTypes.contains("Files"_s));
     return safeTypes;
 }
 

Modified: trunk/Source/WebCore/dom/Document.cpp (294467 => 294468)


--- trunk/Source/WebCore/dom/Document.cpp	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WebCore/dom/Document.cpp	2022-05-19 05:53:40 UTC (rev 294468)
@@ -1085,7 +1085,7 @@
     if (isHTMLDocument())
         return Exception { NotSupportedError };
 
-    if (data.contains("]]>"))
+    if (data.contains("]]>"_s))
         return Exception { InvalidCharacterError };
 
     return CDATASection::create(*this, WTFMove(data));
@@ -1096,7 +1096,7 @@
     if (!isValidName(target))
         return Exception { InvalidCharacterError };
 
-    if (data.contains("?>"))
+    if (data.contains("?>"_s))
         return Exception { InvalidCharacterError };
 
     return ProcessingInstruction::create(*this, WTFMove(target), WTFMove(data));

Modified: trunk/Source/WebCore/dom/Element.cpp (294467 => 294468)


--- trunk/Source/WebCore/dom/Element.cpp	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WebCore/dom/Element.cpp	2022-05-19 05:53:40 UTC (rev 294468)
@@ -325,8 +325,8 @@
 
     if (hasAttributes()
         && (is<HTMLScriptElement>(*this) || is<SVGScriptElement>(*this))) {
-        static const char scriptString[] = "<script";
-        static const char styleString[] = "<style";
+        static constexpr auto scriptString = "<script"_s;
+        static constexpr auto styleString = "<style"_s;
 
         for (const auto& attribute : attributesIterator()) {
             auto name = attribute.localName().convertToASCIILowercase();

Modified: trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm (294467 => 294468)


--- trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm	2022-05-19 05:53:40 UTC (rev 294468)
@@ -1031,19 +1031,19 @@
 
     String fontLigatures = _caches->propertyValueForNode(element, CSSPropertyFontVariantLigatures);
     if (fontLigatures.length()) {
-        if (fontLigatures.contains("normal"))
+        if (fontLigatures.contains("normal"_s))
             ;   // default: whatever the system decides to do
-        else if (fontLigatures.contains("common-ligatures"))
+        else if (fontLigatures.contains("common-ligatures"_s))
             [attrs setObject:@1 forKey:NSLigatureAttributeName];   // explicitly enabled
-        else if (fontLigatures.contains("no-common-ligatures"))
+        else if (fontLigatures.contains("no-common-ligatures"_s))
             [attrs setObject:@0 forKey:NSLigatureAttributeName];  // explicitly disabled
     }
 
     String textDecoration = _caches->propertyValueForNode(element, CSSPropertyTextDecorationLine);
     if (textDecoration.length()) {
-        if (textDecoration.contains("underline"))
+        if (textDecoration.contains("underline"_s))
             [attrs setObject:[NSNumber numberWithInteger:NSUnderlineStyleSingle] forKey:NSUnderlineStyleAttributeName];
-        if (textDecoration.contains("line-through"))
+        if (textDecoration.contains("line-through"_s))
             [attrs setObject:[NSNumber numberWithInteger:NSUnderlineStyleSingle] forKey:NSStrikethroughStyleAttributeName];
     }
 

Modified: trunk/Source/WebCore/editing/libwpe/EditorLibWPE.cpp (294467 => 294468)


--- trunk/Source/WebCore/editing/libwpe/EditorLibWPE.cpp	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WebCore/editing/libwpe/EditorLibWPE.cpp	2022-05-19 05:53:40 UTC (rev 294468)
@@ -46,7 +46,7 @@
     if (types.isEmpty())
         return nullptr;
 
-    if (types.contains("text/html;charset=utf-8") && frame.document()) {
+    if (types.contains("text/html;charset=utf-8"_s) && frame.document()) {
         String markup = pasteboard.readString("text/html;charset=utf-8"_s);
         return createFragmentFromMarkup(*frame.document(), markup, emptyString(), DisallowScriptingAndPluginContent);
     }
@@ -54,7 +54,7 @@
     if (!allowPlainText)
         return nullptr;
 
-    if (types.contains("text/plain;charset=utf-8")) {
+    if (types.contains("text/plain;charset=utf-8"_s)) {
         chosePlainText = true;
         return createFragmentFromText(range, pasteboard.readString("text/plain;charset=utf-8"_s));
     }

Modified: trunk/Source/WebCore/editing/markup.cpp (294467 => 294468)


--- trunk/Source/WebCore/editing/markup.cpp	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WebCore/editing/markup.cpp	2022-05-19 05:53:40 UTC (rev 294468)
@@ -519,7 +519,7 @@
         return true;
     if (m_shouldPreserveMSOList) {
         auto style = element.getAttribute(styleAttr);
-        return style.startsWith("mso-list:") || style.contains(";mso-list:") || style.contains("\nmso-list:");
+        return style.startsWith("mso-list:"_s) || style.contains(";mso-list:"_s) || style.contains("\nmso-list:"_s);
     }
     return false;
 }
@@ -757,14 +757,14 @@
         auto& textChild = downcast<Text>(*firstChild);
         auto& styleContent = textChild.data();
 
-        const auto msoStyleDefinitionsStart = styleContent.find("/* Style Definitions */");
-        const auto msoListDefinitionsStart = styleContent.find("/* List Definitions */");
-        const auto lastListItem = styleContent.reverseFind("\n@list");
+        const auto msoStyleDefinitionsStart = styleContent.find("/* Style Definitions */"_s);
+        const auto msoListDefinitionsStart = styleContent.find("/* List Definitions */"_s);
+        const auto lastListItem = styleContent.reverseFind("\n@list"_s);
         if (msoListDefinitionsStart == notFound || lastListItem == notFound)
             return false;
         const auto start = msoStyleDefinitionsStart != notFound && msoStyleDefinitionsStart < msoListDefinitionsStart ? msoStyleDefinitionsStart : msoListDefinitionsStart;
 
-        const auto msoListDefinitionsEnd = styleContent.find(";}\n", lastListItem);
+        const auto msoListDefinitionsEnd = styleContent.find(";}\n"_s, lastListItem);
         if (msoListDefinitionsEnd == notFound || start >= msoListDefinitionsEnd)
             return false;
 
@@ -998,8 +998,8 @@
     if (tagClose == notFound)
         return false;
     auto tag = markup.left(tagClose);
-    return tag.contains("xmlns:o=\"urn:schemas-microsoft-com:office:office\"")
-        && tag.contains("xmlns:w=\"urn:schemas-microsoft-com:office:word\"");
+    return tag.contains("xmlns:o=\"urn:schemas-microsoft-com:office:office\""_s)
+        && tag.contains("xmlns:w=\"urn:schemas-microsoft-com:office:word\""_s);
 }
 
 String sanitizedMarkupForFragmentInDocument(Ref<DocumentFragment>&& fragment, Document& document, MSOListQuirks msoListQuirks, const String& originalMarkup)

Modified: trunk/Source/WebCore/html/track/VTTRegion.cpp (294467 => 294468)


--- trunk/Source/WebCore/html/track/VTTRegion.cpp	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WebCore/html/track/VTTRegion.cpp	2022-05-19 05:53:40 UTC (rev 294468)
@@ -212,7 +212,7 @@
     switch (setting) {
     case Id: {
         String stringValue = input.extractString(valueRun);
-        if (stringValue.find("-->") == notFound)
+        if (stringValue.find("-->"_s) == notFound)
             m_id = stringValue;
         break;
     }

Modified: trunk/Source/WebCore/html/track/WebVTTParser.cpp (294467 => 294468)


--- trunk/Source/WebCore/html/track/WebVTTParser.cpp	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WebCore/html/track/WebVTTParser.cpp	2022-05-19 05:53:40 UTC (rev 294468)
@@ -279,7 +279,7 @@
             m_client.newRegionsParsed();
         if (!m_styleSheets.isEmpty())
             m_client.newStyleSheetsParsed();
-        if (!m_previousLine.isEmpty() && !m_previousLine.contains("-->"))
+        if (!m_previousLine.isEmpty() && !m_previousLine.contains("-->"_s))
             m_currentId = AtomString { m_previousLine };
         
         return state;
@@ -298,7 +298,7 @@
 WebVTTParser::ParseState WebVTTParser::checkAndRecoverCue(const String& line)
 {
     // parse cue timings and settings
-    if (line.contains("-->")) {
+    if (line.contains("-->"_s)) {
         ParseState state = recoverCue(line);
         if (state != BadCue)
             return state;
@@ -318,7 +318,7 @@
 
 bool WebVTTParser::checkAndCreateRegion(StringView line)
 {
-    if (m_previousLine.contains("-->"))
+    if (m_previousLine.contains("-->"_s))
         return false;
     // line starts with the substring "REGION" and remaining characters
     // zero or more U+0020 SPACE characters or U+0009 CHARACTER TABULATION
@@ -332,7 +332,7 @@
 
 bool WebVTTParser::checkAndStoreRegion(StringView line)
 {
-    if (!line.isEmpty() && !line.contains("-->"))
+    if (!line.isEmpty() && !line.contains("-->"_s))
         return false;
 
     if (!m_currentRegion->id().isEmpty()) {
@@ -347,12 +347,12 @@
 
 bool WebVTTParser::checkStyleSheet(StringView line)
 {
-    if (m_previousLine.contains("-->"))
+    if (m_previousLine.contains("-->"_s))
         return false;
     // line starts with the substring "STYLE" and remaining characters
     // zero or more U+0020 SPACE characters or U+0009 CHARACTER TABULATION
     // (tab) characters expected other than these charecters it is invalid.
-    if (line.startsWith("STYLE") && line.substring(styleIdentifierLength).isAllSpecialCharacters<isASpace>())
+    if (line.startsWith("STYLE"_s) && line.substring(styleIdentifierLength).isAllSpecialCharacters<isASpace>())
         return true;
 
     return false;
@@ -360,7 +360,7 @@
 
 bool WebVTTParser::checkAndStoreStyleSheet(StringView line)
 {
-    if (!line.isEmpty() && !line.contains("-->"))
+    if (!line.isEmpty() && !line.contains("-->"_s))
         return false;
     
     auto styleSheetText = m_currentSourceStyleSheet.toString();
@@ -415,7 +415,7 @@
 
 WebVTTParser::ParseState WebVTTParser::collectCueId(const String& line)
 {
-    if (line.contains("-->"))
+    if (line.contains("-->"_s))
         return collectTimingsAndSettings(line);
     m_currentId = AtomString { line };
     return TimingsAndSettings;
@@ -463,7 +463,7 @@
         return Id;
     }
     // Step 35.
-    if (line.contains("-->")) {
+    if (line.contains("-->"_s)) {
         // Step 39-40.
         createNewCue();
 
@@ -490,7 +490,7 @@
 {
     if (line.isEmpty())
         return Id;
-    if (line.contains("-->"))
+    if (line.contains("-->"_s))
         return recoverCue(line);
     return BadCue;
 }

Modified: trunk/Source/WebCore/page/Quirks.cpp (294467 => 294468)


--- trunk/Source/WebCore/page/Quirks.cpp	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WebCore/page/Quirks.cpp	2022-05-19 05:53:40 UTC (rev 294468)
@@ -295,7 +295,7 @@
 
     if (equalLettersIgnoringASCIICase(host, "www.icloud.com"_s)) {
         auto path = url.path();
-        if (path.contains("notes") || url.fragmentIdentifier().contains("notes"))
+        if (path.contains("notes"_s) || url.fragmentIdentifier().contains("notes"_s))
             return true;
     }
 #endif

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp (294467 => 294468)


--- trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp	2022-05-19 05:53:40 UTC (rev 294468)
@@ -178,7 +178,7 @@
             auto* factory = reinterpret_cast<GstElementFactory*>(factories->data);
             auto metadata = String::fromLatin1(gst_element_factory_get_metadata(factory, GST_ELEMENT_METADATA_KLASS));
             auto components = metadata.split('/');
-            if (components.contains("Hardware")) {
+            if (components.contains("Hardware"_s)) {
                 isUsingHardware = true;
                 break;
             }

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (294467 => 294468)


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2022-05-19 05:53:40 UTC (rev 294468)
@@ -2763,7 +2763,7 @@
         auto classifiers = elementClass.split('/');
 
         // Collect processing time metrics for video decoders and converters.
-        if ((classifiers.contains("Converter"_s) || classifiers.contains("Decoder"_s)) && classifiers.contains("Video"_s) && !classifiers.contains("Parser"))
+        if ((classifiers.contains("Converter"_s) || classifiers.contains("Decoder"_s)) && classifiers.contains("Video"_s) && !classifiers.contains("Parser"_s))
             webkitGstTraceProcessingTimeForElement(element);
 
         if (classifiers.contains("Decoder"_s) && classifiers.contains("Video"_s)) {

Modified: trunk/Source/WebCore/platform/graphics/opengl/ExtensionsGLOpenGLCommon.cpp (294467 => 294468)


--- trunk/Source/WebCore/platform/graphics/opengl/ExtensionsGLOpenGLCommon.cpp	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WebCore/platform/graphics/opengl/ExtensionsGLOpenGLCommon.cpp	2022-05-19 05:53:40 UTC (rev 294468)
@@ -78,13 +78,13 @@
     m_renderer = String::fromLatin1(reinterpret_cast<const char*>(::glGetString(GL_RENDERER)));
 
     Vector<String> vendorComponents = m_vendor.convertToASCIILowercase().split(' ');
-    if (vendorComponents.contains("nvidia"))
+    if (vendorComponents.contains("nvidia"_s))
         m_isNVIDIA = true;
-    if (vendorComponents.contains("ati") || vendorComponents.contains("amd"))
+    if (vendorComponents.contains("ati"_s) || vendorComponents.contains("amd"_s))
         m_isAMD = true;
-    if (vendorComponents.contains("intel"))
+    if (vendorComponents.contains("intel"_s))
         m_isIntel = true;
-    if (vendorComponents.contains("imagination"))
+    if (vendorComponents.contains("imagination"_s))
         m_isImagination = true;
 
 #if PLATFORM(MAC)

Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperContextAttributes.cpp (294467 => 294468)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperContextAttributes.cpp	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperContextAttributes.cpp	2022-05-19 05:53:40 UTC (rev 294468)
@@ -55,8 +55,8 @@
         attributes.isGLES2Compliant = true;
 
         auto extensionsString = String::fromLatin1(reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)));
-        attributes.supportsNPOTTextures = extensionsString.contains("GL_OES_texture_npot");
-        attributes.supportsUnpackSubimage = extensionsString.contains("GL_EXT_unpack_subimage");
+        attributes.supportsNPOTTextures = extensionsString.contains("GL_OES_texture_npot"_s);
+        attributes.supportsUnpackSubimage = extensionsString.contains("GL_EXT_unpack_subimage"_s);
 #else
         attributes.isGLES2Compliant = false;
         attributes.supportsNPOTTextures = true;

Modified: trunk/Source/WebCore/platform/ios/UserAgentIOS.mm (294467 => 294468)


--- trunk/Source/WebCore/platform/ios/UserAgentIOS.mm	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WebCore/platform/ios/UserAgentIOS.mm	2022-05-19 05:53:40 UTC (rev 294468)
@@ -72,7 +72,7 @@
     static NeverDestroyed<String> name = [] {
         auto name = deviceName();
 #if PLATFORM(IOS_FAMILY_SIMULATOR)
-        size_t location = name.find(" Simulator");
+        size_t location = name.find(" Simulator"_s);
         if (location != notFound)
             return name.left(location);
 #endif

Modified: trunk/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp (294467 => 294468)


--- trunk/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WebCore/platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp	2022-05-19 05:53:40 UTC (rev 294468)
@@ -162,12 +162,12 @@
         return false;
     }
 
-    if (device.label().startsWith("VPAUAggregateAudioDevice")) {
+    if (device.label().startsWith("VPAUAggregateAudioDevice"_s)) {
         RELEASE_LOG(WebRTC, "Ignoring output VPAUAggregateAudioDevice device");
         return false;
     }
 
-    if (device.label().contains("WebexMediaAudioDevice")) {
+    if (device.label().contains("WebexMediaAudioDevice"_s)) {
         RELEASE_LOG(WebRTC, "Ignoring webex audio device");
         return false;
     }

Modified: trunk/Source/WebCore/rendering/style/GridPositionsResolver.cpp (294467 => 294468)


--- trunk/Source/WebCore/rendering/style/GridPositionsResolver.cpp	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WebCore/rendering/style/GridPositionsResolver.cpp	2022-05-19 05:53:40 UTC (rev 294468)
@@ -140,9 +140,9 @@
         String areaName = name;
         bool startSide = isStartSide(side);
         if (!nameIsAreaName) {
-            size_t suffix = name.find("-start");
+            size_t suffix = name.find("-start"_s);
             if (suffix == notFound) {
-                suffix = name.find("-end");
+                suffix = name.find("-end"_s);
                 ASSERT(suffix != notFound);
                 startSide = false;
             } else

Modified: trunk/Source/WebCore/style/StyleScope.cpp (294467 => 294468)


--- trunk/Source/WebCore/style/StyleScope.cpp	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WebCore/style/StyleScope.cpp	2022-05-19 05:53:40 UTC (rev 294468)
@@ -366,7 +366,7 @@
                 if (linkElement.styleSheetIsLoading()) {
                     // it is loading but we should still decide which style sheet set to use
                     if (!enabledViaScript && !title.isEmpty() && m_preferredStylesheetSetName.isEmpty()) {
-                        if (!linkElement.attributeWithoutSynchronization(relAttr).contains("alternate"))
+                        if (!linkElement.attributeWithoutSynchronization(relAttr).contains("alternate"_s))
                             m_preferredStylesheetSetName = title;
                     }
                     continue;
@@ -394,7 +394,7 @@
                     // we are NOT an alternate sheet, then establish
                     // us as the preferred set. Otherwise, just ignore
                     // this sheet.
-                    if (is<HTMLStyleElement>(element) || !rel.contains("alternate"))
+                    if (is<HTMLStyleElement>(element) || !rel.contains("alternate"_s))
                         m_preferredStylesheetSetName = title;
                 }
                 if (title != m_preferredStylesheetSetName)
@@ -401,7 +401,7 @@
                     sheet = nullptr;
             }
 
-            if (rel.contains("alternate") && title.isEmpty())
+            if (rel.contains("alternate"_s) && title.isEmpty())
                 sheet = nullptr;
 
             if (sheet)

Modified: trunk/Source/WebCore/testing/Internals.cpp (294467 => 294468)


--- trunk/Source/WebCore/testing/Internals.cpp	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WebCore/testing/Internals.cpp	2022-05-19 05:53:40 UTC (rev 294468)
@@ -1602,7 +1602,7 @@
 void Internals::isVP9VTBDeccoderUsed(RTCPeerConnection& connection, DOMPromiseDeferred<IDLBoolean>&& promise)
 {
     connection.gatherDecoderImplementationName([promise = WTFMove(promise)](auto&& name) mutable {
-        promise.resolve(name.contains("VideoToolBox"));
+        promise.resolve(name.contains("VideoToolBox"_s));
     });
 }
 

Modified: trunk/Source/WebCore/testing/MockLibWebRTCPeerConnection.cpp (294467 => 294468)


--- trunk/Source/WebCore/testing/MockLibWebRTCPeerConnection.cpp	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WebCore/testing/MockLibWebRTCPeerConnection.cpp	2022-05-19 05:53:40 UTC (rev 294468)
@@ -346,8 +346,8 @@
         sessionDescription->ToString(&sdp);
 
         m_isInitiator = false;
-        m_isReceivingAudio = sdp.find("m=audio") != std::string::npos;
-        m_isReceivingVideo = sdp.find("m=video") != std::string::npos;
+        m_isReceivingAudio = sdp.find("m=audio"_s) != std::string::npos;
+        m_isReceivingVideo = sdp.find("m=video"_s) != std::string::npos;
     }
 }
 

Modified: trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp (294467 => 294468)


--- trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp	2022-05-19 05:53:40 UTC (rev 294468)
@@ -247,7 +247,7 @@
 
 static bool needsNewCreateTableSchema(const String& schema)
 {
-    return schema.contains("REFERENCES TopLevelDomains");
+    return schema.contains("REFERENCES TopLevelDomains"_s);
 }
 
 const MemoryCompactLookupOnlyRobinHoodHashMap<String, TableAndIndexPair>& ResourceLoadStatisticsDatabaseStore::expectedTableAndIndexQueries()
@@ -789,7 +789,7 @@
             return;
     }
     
-    if (statement.contains("REPLACE")) {
+    if (statement.contains("REPLACE"_s)) {
         if (insertRelationshipStatement->bindDouble(2, WallTime::now().secondsSinceEpoch().value()) != SQLITE_OK) {
             ITP_RELEASE_LOG_ERROR(m_sessionID, "%p - ResourceLoadStatisticsDatabaseStore::insertDomainRelationshipList failed, error message: %" PRIVATE_LOG_STRING, this, m_database.lastErrorMsg());
             ASSERT_NOT_REACHED();

Modified: trunk/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp (294467 => 294468)


--- trunk/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp	2022-05-19 05:53:40 UTC (rev 294468)
@@ -852,7 +852,7 @@
 
     if (isCrossOriginPrefetch()) {
         LOADER_RELEASE_LOG("didReceiveResponse: Using response for cross-origin prefetch");
-        if (response.httpHeaderField(HTTPHeaderName::Vary).contains("Cookie")) {
+        if (response.httpHeaderField(HTTPHeaderName::Vary).contains("Cookie"_s)) {
             LOADER_RELEASE_LOG("didReceiveResponse: Canceling cross-origin prefetch for Vary: Cookie");
             abort();
             return completionHandler(PolicyAction::Ignore);

Modified: trunk/Source/WebKit/NetworkProcess/cache/PrefetchCache.cpp (294467 => 294468)


--- trunk/Source/WebKit/NetworkProcess/cache/PrefetchCache.cpp	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WebKit/NetworkProcess/cache/PrefetchCache.cpp	2022-05-19 05:53:40 UTC (rev 294468)
@@ -68,7 +68,7 @@
         return std::get<0>(tuple) == url;
     });
     auto entry = resources->take(url);
-    ASSERT(!entry || !entry->response.httpHeaderField(WebCore::HTTPHeaderName::Vary).contains("Cookie"));
+    ASSERT(!entry || !entry->response.httpHeaderField(WebCore::HTTPHeaderName::Vary).contains("Cookie"_s));
     return entry;
 }
 

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (294467 => 294468)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2022-05-19 05:53:40 UTC (rev 294468)
@@ -5927,7 +5927,7 @@
     }
 
     BOOL disableAutocorrectAndAutocapitalize = _focusedElementInformation.elementType == WebKit::InputType::Password || _focusedElementInformation.elementType == WebKit::InputType::Email
-        || _focusedElementInformation.elementType == WebKit::InputType::URL || _focusedElementInformation.formAction.contains("login");
+        || _focusedElementInformation.elementType == WebKit::InputType::URL || _focusedElementInformation.formAction.contains("login"_s);
     if ([traits respondsToSelector:@selector(setAutocapitalizationType:)])
         traits.autocapitalizationType = disableAutocorrectAndAutocapitalize ? UITextAutocapitalizationTypeNone : toUITextAutocapitalize(_focusedElementInformation.autocapitalizeType);
     if ([traits respondsToSelector:@selector(setAutocorrectionType:)])

Modified: trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (294467 => 294468)


--- trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2022-05-19 05:53:40 UTC (rev 294468)
@@ -3536,7 +3536,7 @@
             else {
                 information.elementType = InputType::Text;
                 if (!information.formAction.isEmpty()
-                    && (element.getNameAttribute().contains("search") || element.getIdAttribute().contains("search") || element.attributeWithoutSynchronization(HTMLNames::titleAttr).contains("search")))
+                    && (element.getNameAttribute().contains("search"_s) || element.getIdAttribute().contains("search"_s) || element.attributeWithoutSynchronization(HTMLNames::titleAttr).contains("search"_s)))
                     information.elementType = InputType::Search;
             }
         }

Modified: trunk/Source/WebKit/WebProcess/WebProcess.cpp (294467 => 294468)


--- trunk/Source/WebKit/WebProcess/WebProcess.cpp	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WebKit/WebProcess/WebProcess.cpp	2022-05-19 05:53:40 UTC (rev 294468)
@@ -1940,9 +1940,9 @@
     });
 
     if (isCapturingAudio)
-        ASSERT(extensionIDs.findIf([](auto& id) { return id.contains("microphone"); }) == notFound);
+        ASSERT(!extensionIDs.containsIf([](auto& id) { return id.contains("microphone"_s); }));
     if (isCapturingVideo)
-        ASSERT(extensionIDs.findIf([](auto& id) { return id.contains("camera"); }) == notFound);
+        ASSERT(!extensionIDs.containsIf([](auto& id) { return id.contains("camera"_s); }));
 #endif // ASSERT_ENABLED
 }
 

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebView.mm (294467 => 294468)


--- trunk/Source/WebKitLegacy/mac/WebView/WebView.mm	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebView.mm	2022-05-19 05:53:40 UTC (rev 294468)
@@ -9507,7 +9507,7 @@
                 RefPtr<EditingStyle> typingStyle = coreFrame->selection().typingStyle();
                 if (typingStyle && typingStyle->style()) {
                     String value = typingStyle->style()->getPropertyValue(CSSPropertyWebkitTextDecorationsInEffect);
-                    [_private->_textTouchBarItemController setTextIsUnderlined:value.contains("underline")];
+                    [_private->_textTouchBarItemController setTextIsUnderlined:value.contains("underline"_s)];
                 } else
                     [_private->_textTouchBarItemController setTextIsUnderlined:style->textDecorationsInEffect().contains(TextDecorationLine::Underline)];
 

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp (294467 => 294468)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp	2022-05-19 04:09:51 UTC (rev 294467)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp	2022-05-19 05:53:40 UTC (rev 294468)
@@ -1315,7 +1315,7 @@
 
 static StringView lastFileURLPathComponent(StringView path)
 {
-    auto pos = path.find("file://");
+    auto pos = path.find("file://"_s);
     ASSERT(WTF::notFound != pos);
 
     auto tmpPath = path.substring(pos + 7);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to