Changeset 278669 in webkit
- Timestamp:
- Jun 9, 2021, 1:46:24 PM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 34 edited
-
WTF/ChangeLog (modified) (1 diff)
-
WTF/wtf/URL.cpp (modified) (6 diffs)
-
WTF/wtf/URLParser.cpp (modified) (1 diff)
-
WTF/wtf/URLParser.h (modified) (1 diff)
-
WTF/wtf/text/StringView.cpp (modified) (1 diff)
-
WTF/wtf/text/StringView.h (modified) (1 diff)
-
WTF/wtf/text/TextStream.cpp (modified) (1 diff)
-
WTF/wtf/text/TextStream.h (modified) (1 diff)
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/Modules/cache/DOMCacheEngine.cpp (modified) (1 diff)
-
WebCore/Modules/fetch/FetchBodyConsumer.cpp (modified) (1 diff)
-
WebCore/accessibility/AccessibilityRenderObject.cpp (modified) (1 diff)
-
WebCore/css/parser/CSSPropertyParser.cpp (modified) (9 diffs)
-
WebCore/css/parser/CSSPropertyParserHelpers.cpp (modified) (3 diffs)
-
WebCore/dom/ScriptElement.cpp (modified) (2 diffs)
-
WebCore/dom/StyledElement.cpp (modified) (1 diff)
-
WebCore/dom/TreeScope.cpp (modified) (1 diff)
-
WebCore/dom/TreeScope.h (modified) (1 diff)
-
WebCore/editing/cocoa/DataDetection.mm (modified) (1 diff)
-
WebCore/page/FrameView.cpp (modified) (2 diffs)
-
WebCore/page/FrameView.h (modified) (1 diff)
-
WebCore/page/SecurityOrigin.cpp (modified) (1 diff)
-
WebCore/page/csp/ContentSecurityPolicy.cpp (modified) (3 diffs)
-
WebCore/page/csp/ContentSecurityPolicy.h (modified) (2 diffs)
-
WebCore/platform/LegacySchemeRegistry.cpp (modified) (1 diff)
-
WebCore/platform/graphics/cocoa/SourceBufferParserWebM.cpp (modified) (1 diff)
-
WebCore/platform/network/ParsedContentType.cpp (modified) (1 diff)
-
WebCore/platform/text/hyphen/HyphenationLibHyphen.cpp (modified) (1 diff)
-
WebCore/rendering/RenderTreeAsText.cpp (modified) (1 diff)
-
WebCore/svg/SVGSVGElement.cpp (modified) (4 diffs)
-
WebCore/svg/SVGSVGElement.h (modified) (2 diffs)
-
WebCore/svg/SVGViewSpec.cpp (modified) (1 diff)
-
WebCore/svg/SVGViewSpec.h (modified) (1 diff)
-
WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r278655 r278669 1 2021-06-09 Chris Dumez <cdumez@apple.com> 2 3 Avoid some calls to StringView::toString() / StringView::toStringWithoutCopying() 4 https://bugs.webkit.org/show_bug.cgi?id=226803 5 6 Reviewed by Darin Adler. 7 8 Add support to TextStream for printing a StringView directly, without having to convert 9 it to a String first. 10 11 * wtf/text/TextStream.cpp: 12 (WTF::TextStream::operator<<): 13 * wtf/text/TextStream.h: 14 1 15 2021-06-09 Alicia Boya García <aboya@igalia.com> 2 16 -
trunk/Source/WTF/wtf/URL.cpp
r278253 r278669 379 379 // Firefox and IE remove everything after the first ':'. 380 380 auto newProtocolPrefix = newProtocol.substring(0, newProtocol.find(':')); 381 auto newProtocolCanonicalized = URLParser::maybeCanonicalizeScheme(newProtocolPrefix .toStringWithoutCopying());381 auto newProtocolCanonicalized = URLParser::maybeCanonicalizeScheme(newProtocolPrefix); 382 382 if (!newProtocolCanonicalized) 383 383 return false; … … 530 530 } 531 531 532 static String percentEncodeCharacters(const String& input, bool(*shouldEncode)(UChar)) 533 { 534 auto encode = [shouldEncode] (const String& input) { 532 template<typename StringType> 533 static String percentEncodeCharacters(const StringType& input, bool(*shouldEncode)(UChar)) 534 { 535 auto encode = [shouldEncode] (const StringType& input) { 535 536 CString utf8 = input.utf8(); 536 537 auto* data = utf8.data(); … … 553 554 return encode(input); 554 555 } 555 return input; 556 if constexpr (std::is_same_v<StringType, StringView>) 557 return input.toString(); 558 else 559 return input; 556 560 } 557 561 … … 585 589 StringView(m_string).left(m_userStart), 586 590 slashSlashNeeded ? "//" : "", 587 percentEncodeCharacters(newUser .toStringWithoutCopying(), URLParser::isInUserInfoEncodeSet),591 percentEncodeCharacters(newUser, URLParser::isInUserInfoEncodeSet), 588 592 needSeparator ? "@" : "", 589 593 StringView(m_string).substring(end) … … 607 611 StringView(m_string).left(m_userEnd), 608 612 needLeadingSlashes ? "//:" : ":", 609 percentEncodeCharacters(newPassword .toStringWithoutCopying(), URLParser::isInUserInfoEncodeSet),613 percentEncodeCharacters(newPassword, URLParser::isInUserInfoEncodeSet), 610 614 '@', 611 615 StringView(m_string).substring(credentialsEnd()) … … 671 675 return character == '?' || character == '#' || !isASCII(character); 672 676 }; 673 return percentEncodeCharacters(path .toStringWithoutCopying(), questionMarkOrNumberSignOrNonASCII);677 return percentEncodeCharacters(path, questionMarkOrNumberSignOrNonASCII); 674 678 } 675 679 -
trunk/Source/WTF/wtf/URLParser.cpp
r278619 r278669 699 699 } 700 700 701 std::optional<String> URLParser::maybeCanonicalizeScheme( const String&scheme)701 std::optional<String> URLParser::maybeCanonicalizeScheme(StringView scheme) 702 702 { 703 703 if (scheme.isEmpty()) -
trunk/Source/WTF/wtf/URLParser.h
r278253 r278669 47 47 48 48 WTF_EXPORT_PRIVATE static bool isSpecialScheme(const String& scheme); 49 WTF_EXPORT_PRIVATE static std::optional<String> maybeCanonicalizeScheme( const String&scheme);49 WTF_EXPORT_PRIVATE static std::optional<String> maybeCanonicalizeScheme(StringView scheme); 50 50 51 51 static const UIDNA& internationalDomainNameTranscoder(); -
trunk/Source/WTF/wtf/text/StringView.cpp
r278340 r278669 246 246 return convertASCIICase<ASCIICase::Upper>(static_cast<const LChar*>(m_characters), m_length); 247 247 return convertASCIICase<ASCIICase::Upper>(static_cast<const UChar*>(m_characters), m_length); 248 } 249 250 template<typename CharacterType> 251 static AtomString convertASCIILowercaseAtom(const CharacterType* input, unsigned length) 252 { 253 for (unsigned i = 0; i < length; ++i) { 254 if (UNLIKELY(isASCIIUpper(input[i]))) { 255 CharacterType* characters; 256 auto result = String::createUninitialized(length, characters); 257 StringImpl::copyCharacters(characters, input, i); 258 for (; i < length; ++i) 259 characters[i] = toASCIILower(input[i]); 260 return result; 261 } 262 } 263 // Fast path when the StringView is already all lowercase. 264 return AtomString(input, length); 265 } 266 267 AtomString StringView::convertToASCIILowercaseAtom() const 268 { 269 if (m_is8Bit) 270 return convertASCIILowercaseAtom(characters8(), m_length); 271 return convertASCIILowercaseAtom(characters16(), m_length); 248 272 } 249 273 -
trunk/Source/WTF/wtf/text/StringView.h
r278340 r278669 149 149 WTF_EXPORT_PRIVATE String convertToASCIILowercase() const; 150 150 WTF_EXPORT_PRIVATE String convertToASCIIUppercase() const; 151 WTF_EXPORT_PRIVATE AtomString convertToASCIILowercaseAtom() const; 151 152 152 153 bool contains(UChar) const; -
trunk/Source/WTF/wtf/text/TextStream.cpp
r277437 r278669 119 119 } 120 120 121 TextStream& TextStream::operator<<(const AtomString& string) 122 { 123 m_text.append(string); 124 return *this; 125 } 126 121 127 TextStream& TextStream::operator<<(const String& string) 128 { 129 m_text.append(string); 130 return *this; 131 } 132 133 TextStream& TextStream::operator<<(StringView string) 122 134 { 123 135 m_text.append(string); -
trunk/Source/WTF/wtf/text/TextStream.h
r278340 r278669 71 71 WTF_EXPORT_PRIVATE TextStream& operator<<(const char*); 72 72 WTF_EXPORT_PRIVATE TextStream& operator<<(const void*); 73 WTF_EXPORT_PRIVATE TextStream& operator<<(const AtomString&); 73 74 WTF_EXPORT_PRIVATE TextStream& operator<<(const String&); 75 WTF_EXPORT_PRIVATE TextStream& operator<<(StringView); 74 76 // Deprecated. Use the NumberRespectingIntegers FormattingFlag instead. 75 77 WTF_EXPORT_PRIVATE TextStream& operator<<(const FormatNumberRespectingIntegers&); -
trunk/Source/WebCore/ChangeLog
r278667 r278669 1 2021-06-09 Chris Dumez <cdumez@apple.com> 2 3 Avoid some calls to StringView::toString() / StringView::toStringWithoutCopying() 4 https://bugs.webkit.org/show_bug.cgi?id=226803 5 6 Reviewed by Darin Adler. 7 8 * css/parser/CSSPropertyParser.cpp: 9 (WebCore::consumeFontVariationTag): 10 * page/FrameView.cpp: 11 (WebCore::FrameView::scrollToFragmentInternal): 12 * platform/text/hyphen/HyphenationLibHyphen.cpp: 13 (WebCore::lastHyphenLocation): 14 * rendering/RenderTreeAsText.cpp: 15 (WebCore::writeDebugInfo): 16 1 17 2021-06-09 Tyler Wilcock <twilco.o@protonmail.com> 2 18 -
trunk/Source/WebCore/Modules/cache/DOMCacheEngine.cpp
r260707 r278669 100 100 return; 101 101 } 102 auto name = nameView.toString ();102 auto name = nameView.toStringWithoutCopying(); 103 103 isVarying = cachedRequest.httpHeaderField(name) != request.httpHeaderField(name); 104 104 }); -
trunk/Source/WebCore/Modules/fetch/FetchBodyConsumer.cpp
r278619 r278669 99 99 && isValidHTTPToken(parameterName) 100 100 && parameterValue.isAllSpecialCharacters<isHTTPQuotedStringTokenCodePoint>()) { 101 String nameString = parameterName.toString(); 102 if (!parameters.contains(nameString)) 103 parameters.set(nameString, parameterValue.toString()); 101 parameters.ensure(parameterName.toString(), [&] { return parameterValue.toString(); }); 104 102 } 105 103 } -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
r278253 r278669 1005 1005 return nullptr; 1006 1006 1007 auto linkedNode = m_renderer->document().findAnchor(fragmentIdentifier .toStringWithoutCopying());1007 auto linkedNode = m_renderer->document().findAnchor(fragmentIdentifier); 1008 1008 if (!linkedNode) 1009 1009 return nullptr; -
trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp
r278540 r278669 537 537 return nullptr; 538 538 539 auto string = range.consumeIncludingWhitespace().value() .toString();539 auto string = range.consumeIncludingWhitespace().value(); 540 540 541 541 FontTag tag; … … 2304 2304 2305 2305 CSSParserToken token = args.consumeIncludingWhitespace(); 2306 auto attrName = token.value().toAtomString();2306 AtomString attrName; 2307 2307 if (context.isHTMLDocument) 2308 attrName = attrName.convertToASCIILowercase(); 2308 attrName = token.value().convertToASCIILowercaseAtom(); 2309 else 2310 attrName = token.value().toAtomString(); 2309 2311 2310 2312 if (!args.atEnd()) … … 3330 3332 } 3331 3333 3332 static Vector<String> parseGridTemplateAreasColumnNames( const String&gridRowNames)3334 static Vector<String> parseGridTemplateAreasColumnNames(StringView gridRowNames) 3333 3335 { 3334 3336 ASSERT(!gridRowNames.isEmpty()); 3335 3337 Vector<String> columnNames; 3336 // Using StringImpl to avoid checks and indirection in every call to String::operator[].3337 StringImpl& text = *gridRowNames.impl();3338 3339 3338 StringBuilder areaName; 3340 for ( unsigned i = 0; i < text.length(); ++i) {3341 if (isCSSSpace( text[i])) {3339 for (auto character : gridRowNames.codeUnits()) { 3340 if (isCSSSpace(character)) { 3342 3341 if (!areaName.isEmpty()) { 3343 3342 columnNames.append(areaName.toString()); … … 3346 3345 continue; 3347 3346 } 3348 if ( text[i]== '.') {3347 if (character == '.') { 3349 3348 if (areaName == ".") 3350 3349 continue; … … 3354 3353 } 3355 3354 } else { 3356 if (!isNameCodePoint( text[i]))3355 if (!isNameCodePoint(character)) 3357 3356 return Vector<String>(); 3358 3357 if (areaName == ".") { … … 3362 3361 } 3363 3362 3364 areaName.append( text[i]);3363 areaName.append(character); 3365 3364 } 3366 3365 … … 3371 3370 } 3372 3371 3373 static bool parseGridTemplateAreasRow( const String&gridRowNames, NamedGridAreaMap& gridAreaMap, const size_t rowCount, size_t& columnCount)3372 static bool parseGridTemplateAreasRow(StringView gridRowNames, NamedGridAreaMap& gridAreaMap, const size_t rowCount, size_t& columnCount) 3374 3373 { 3375 3374 if (gridRowNames.isAllSpecialCharacters<isCSSSpace>()) … … 3596 3595 3597 3596 while (range.peek().type() == StringToken) { 3598 if (!parseGridTemplateAreasRow(range.consumeIncludingWhitespace().value() .toString(), gridAreaMap, rowCount, columnCount))3597 if (!parseGridTemplateAreasRow(range.consumeIncludingWhitespace().value(), gridAreaMap, rowCount, columnCount)) 3599 3598 return nullptr; 3600 3599 ++rowCount; … … 5612 5611 5613 5612 // Handle a template-area's row. 5614 if (m_range.peek().type() != StringToken || !parseGridTemplateAreasRow(m_range.consumeIncludingWhitespace().value() .toString(), gridAreaMap, rowCount, columnCount))5613 if (m_range.peek().type() != StringToken || !parseGridTemplateAreasRow(m_range.consumeIncludingWhitespace().value(), gridAreaMap, rowCount, columnCount)) 5615 5614 return false; 5616 5615 ++rowCount; -
trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp
r278540 r278669 2443 2443 if (!acceptQuirkyColors) 2444 2444 return std::nullopt; 2445 if (token.type() == IdentToken) 2446 string = token.value().toString(); // e.g. FF0000 2447 else if (token.type() == NumberToken || token.type() == DimensionToken) { 2445 if (token.type() == IdentToken) { 2446 view = token.value(); // e.g. FF0000 2447 if (view.length() != 3 && view.length() != 6) 2448 return std::nullopt; 2449 } else if (token.type() == NumberToken || token.type() == DimensionToken) { 2448 2450 if (token.numericValueType() != IntegerValueType) 2449 2451 return std::nullopt; … … 2458 2460 if (string.length() < 6) 2459 2461 string = makeString(&"000000"[string.length()], string); 2460 } 2461 if (string.length() != 3 && string.length() != 6) 2462 2463 if (string.length() != 3 && string.length() != 6) 2464 return std::nullopt; 2465 view = string; 2466 } else 2462 2467 return std::nullopt; 2463 view = string;2464 2468 } 2465 2469 auto result = CSSParser::parseHexColor(view); … … 3560 3564 return AtomString(); 3561 3565 auto name = nameToken.value(); 3562 return isPredefinedCounterStyle(nameToken.id()) ? name.convertToASCIILowercase () : name.toString();3566 return isPredefinedCounterStyle(nameToken.id()) ? name.convertToASCIILowercaseAtom() : name.toAtomString(); 3563 3567 } 3564 3568 -
trunk/Source/WebCore/dom/ScriptElement.cpp
r278253 r278669 369 369 const auto& contentSecurityPolicy = *m_element.document().contentSecurityPolicy(); 370 370 bool hasKnownNonce = contentSecurityPolicy.allowScriptWithNonce(nonce, m_element.isInUserAgentShadowTree()); 371 if (!contentSecurityPolicy.allowInlineScript(m_element.document().url().string(), m_startLineNumber, sourceCode.source() .toStringWithoutCopying(), hasKnownNonce))371 if (!contentSecurityPolicy.allowInlineScript(m_element.document().url().string(), m_startLineNumber, sourceCode.source(), hasKnownNonce)) 372 372 return false; 373 373 … … 390 390 const ContentSecurityPolicy& contentSecurityPolicy = *m_element.document().contentSecurityPolicy(); 391 391 bool hasKnownNonce = contentSecurityPolicy.allowScriptWithNonce(m_element.attributeWithoutSynchronization(HTMLNames::nonceAttr), m_element.isInUserAgentShadowTree()); 392 if (!contentSecurityPolicy.allowInlineScript(m_element.document().url().string(), m_startLineNumber, sourceCode.source() .toStringWithoutCopying(), hasKnownNonce))392 if (!contentSecurityPolicy.allowInlineScript(m_element.document().url().string(), m_startLineNumber, sourceCode.source(), hasKnownNonce)) 393 393 return; 394 394 } -
trunk/Source/WebCore/dom/StyledElement.cpp
r278277 r278669 197 197 startLineNumber = document().scriptableDocumentParser()->textPosition().m_line; 198 198 199 if (reason == ModifiedByCloning || document().contentSecurityPolicy()->allowInlineStyle(document().url().string(), startLineNumber, String(), isInUserAgentShadowTree()))199 if (reason == ModifiedByCloning || document().contentSecurityPolicy()->allowInlineStyle(document().url().string(), startLineNumber, { }, isInUserAgentShadowTree())) 200 200 setInlineStyleFromString(newStyleString); 201 201 -
trunk/Source/WebCore/dom/TreeScope.cpp
r278253 r278669 444 444 // FIXME: Would be nice to change this to take a StringView, since that's what callers have 445 445 // and there is no particular advantage to already having a String. 446 Element* TreeScope::findAnchor( const String&name)446 Element* TreeScope::findAnchor(StringView name) 447 447 { 448 448 if (name.isEmpty()) -
trunk/Source/WebCore/dom/TreeScope.h
r261028 r278669 105 105 // Anchor name matching is case sensitive in strict mode and not case sensitive in 106 106 // quirks mode for historical compatibility reasons. 107 Element* findAnchor( const String&name);107 Element* findAnchor(StringView name); 108 108 109 109 ContainerNode& rootNode() const { return m_rootNode; } -
trunk/Source/WebCore/editing/cocoa/DataDetection.mm
r278575 r278669 169 169 bool DataDetection::canBePresentedByDataDetectors(const URL& url) 170 170 { 171 return [PAL::softLink_DataDetectorsCore_DDURLTapAndHoldSchemes() containsObject:(NSString *)url.protocol(). toStringWithoutCopying().convertToASCIILowercase()];171 return [PAL::softLink_DataDetectorsCore_DDURLTapAndHoldSchemes() containsObject:(NSString *)url.protocol().convertToASCIILowercase()]; 172 172 } 173 173 -
trunk/Source/WebCore/page/FrameView.cpp
r278484 r278669 2210 2210 { 2211 2211 auto fragmentIdentifier = url.fragmentIdentifier(); 2212 if (scrollToFragmentInternal(fragmentIdentifier .toString()))2212 if (scrollToFragmentInternal(fragmentIdentifier)) 2213 2213 return true; 2214 2214 … … 2220 2220 } 2221 2221 2222 bool FrameView::scrollToFragmentInternal( const String&fragmentIdentifier)2222 bool FrameView::scrollToFragmentInternal(StringView fragmentIdentifier) 2223 2223 { 2224 2224 // If our URL has no ref, then we have no place we need to jump to. -
trunk/Source/WebCore/page/FrameView.h
r278338 r278669 810 810 void updateWidgetPositionsTimerFired(); 811 811 812 bool scrollToFragmentInternal( const String&);812 bool scrollToFragmentInternal(StringView); 813 813 void scrollToAnchor(); 814 814 void scrollPositionChanged(const ScrollPosition& oldPosition, const ScrollPosition& newPosition); -
trunk/Source/WebCore/page/SecurityOrigin.cpp
r278253 r278669 154 154 155 155 // https://w3c.github.io/webappsec-secure-contexts/#is-origin-trustworthy (Editor's Draft, 17 November 2016) 156 static bool shouldTreatAsPotentiallyTrustworthy(const String& protocol, const String&host)156 static bool shouldTreatAsPotentiallyTrustworthy(const String& protocol, StringView host) 157 157 { 158 158 if (LegacySchemeRegistry::shouldTreatURLSchemeAsSecure(protocol)) -
trunk/Source/WebCore/page/csp/ContentSecurityPolicy.cpp
r278185 r278669 323 323 324 324 template<typename Predicate> 325 ContentSecurityPolicy::HashInEnforcedAndReportOnlyPoliciesPair ContentSecurityPolicy::findHashOfContentInPolicies(Predicate&& predicate, const String&content, OptionSet<ContentSecurityPolicyHashAlgorithm> algorithms) const325 ContentSecurityPolicy::HashInEnforcedAndReportOnlyPoliciesPair ContentSecurityPolicy::findHashOfContentInPolicies(Predicate&& predicate, StringView content, OptionSet<ContentSecurityPolicyHashAlgorithm> algorithms) const 326 326 { 327 327 if (algorithms.isEmpty() || content.isEmpty()) … … 405 405 } 406 406 407 bool ContentSecurityPolicy::allowInlineScript(const String& contextURL, const WTF::OrdinalNumber& contextLine, const String&scriptContent, bool overrideContentSecurityPolicy) const407 bool ContentSecurityPolicy::allowInlineScript(const String& contextURL, const WTF::OrdinalNumber& contextLine, StringView scriptContent, bool overrideContentSecurityPolicy) const 408 408 { 409 409 if (overrideContentSecurityPolicy) … … 428 428 } 429 429 430 bool ContentSecurityPolicy::allowInlineStyle(const String& contextURL, const WTF::OrdinalNumber& contextLine, const String&styleContent, bool overrideContentSecurityPolicy) const430 bool ContentSecurityPolicy::allowInlineStyle(const String& contextURL, const WTF::OrdinalNumber& contextLine, StringView styleContent, bool overrideContentSecurityPolicy) const 431 431 { 432 432 if (overrideContentSecurityPolicy) -
trunk/Source/WebCore/page/csp/ContentSecurityPolicy.h
r278253 r278669 92 92 bool allowJavaScriptURLs(const String& contextURL, const WTF::OrdinalNumber& contextLine, bool overrideContentSecurityPolicy = false) const; 93 93 bool allowInlineEventHandlers(const String& contextURL, const WTF::OrdinalNumber& contextLine, bool overrideContentSecurityPolicy = false) const; 94 bool allowInlineScript(const String& contextURL, const WTF::OrdinalNumber& contextLine, const String&scriptContent, bool overrideContentSecurityPolicy = false) const;95 bool allowInlineStyle(const String& contextURL, const WTF::OrdinalNumber& contextLine, const String&styleContent, bool overrideContentSecurityPolicy = false) const;94 bool allowInlineScript(const String& contextURL, const WTF::OrdinalNumber& contextLine, StringView scriptContent, bool overrideContentSecurityPolicy = false) const; 95 bool allowInlineStyle(const String& contextURL, const WTF::OrdinalNumber& contextLine, StringView styleContent, bool overrideContentSecurityPolicy = false) const; 96 96 97 97 bool allowEval(JSC::JSGlobalObject*, bool overrideContentSecurityPolicy = false) const; … … 207 207 208 208 using HashInEnforcedAndReportOnlyPoliciesPair = std::pair<bool, bool>; 209 template<typename Predicate> HashInEnforcedAndReportOnlyPoliciesPair findHashOfContentInPolicies(Predicate&&, const String&content, OptionSet<ContentSecurityPolicyHashAlgorithm>) const WARN_UNUSED_RETURN;209 template<typename Predicate> HashInEnforcedAndReportOnlyPoliciesPair findHashOfContentInPolicies(Predicate&&, StringView content, OptionSet<ContentSecurityPolicyHashAlgorithm>) const WARN_UNUSED_RETURN; 210 210 211 211 void reportViolation(const String& effectiveViolatedDirective, const ContentSecurityPolicyDirective& violatedDirective, const URL& blockedURL, const String& consoleMessage, JSC::JSGlobalObject*) const; -
trunk/Source/WebCore/platform/LegacySchemeRegistry.cpp
r277958 r278669 254 254 { 255 255 Locker locker { schemeRegistryLock }; 256 return schemesHandledBySchemeHandler().contains(scheme.toString ());256 return schemesHandledBySchemeHandler().contains(scheme.toStringWithoutCopying()); 257 257 } 258 258 -
trunk/Source/WebCore/platform/graphics/cocoa/SourceBufferParserWebM.cpp
r278253 r278669 447 447 auto slashLocation = codecID.find('/'); 448 448 auto length = slashLocation == notFound ? codecID.length() - 2 : slashLocation - 2; 449 m_codec = AtomString { codecID.substring(2, length).convertToASCIILowercase() };449 m_codec = codecID.substring(2, length).convertToASCIILowercaseAtom(); 450 450 return *m_codec; 451 451 } -
trunk/Source/WebCore/platform/network/ParsedContentType.cpp
r278253 r278669 123 123 { 124 124 if (mode == Mode::MimeSniff) 125 return !isValidHTTPToken(input .toStringWithoutCopying());125 return !isValidHTTPToken(input); 126 126 for (unsigned index = 0; index < input.length(); ++index) { 127 127 if (!isTokenCharacter(input[index])) -
trunk/Source/WebCore/platform/text/hyphen/HyphenationLibHyphen.cpp
r277357 r278669 279 279 // reasons and we should consider switching to a more flexible hyphenation library 280 280 // if it is available. 281 CString utf8StringCopy = string. toStringWithoutCopying().utf8();281 CString utf8StringCopy = string.utf8(); 282 282 283 283 // WebCore often passes strings like " wordtohyphenate" to the platform layer. Since -
trunk/Source/WebCore/rendering/RenderTreeAsText.cpp
r278525 r278669 472 472 if (Element* element = is<Element>(object.node()) ? downcast<Element>(object.node()) : nullptr) { 473 473 if (element->hasID()) 474 ts << " id=\"" + element->getIdAttribute() +"\"";474 ts << " id=\"" << element->getIdAttribute() << "\""; 475 475 476 476 if (element->hasClass()) { -
trunk/Source/WebCore/svg/SVGSVGElement.cpp
r278277 r278669 547 547 } 548 548 549 SVGViewElement* SVGSVGElement::findViewAnchor( const String&fragmentIdentifier) const549 SVGViewElement* SVGSVGElement::findViewAnchor(StringView fragmentIdentifier) const 550 550 { 551 551 auto* anchorElement = document().findAnchor(fragmentIdentifier); … … 559 559 } 560 560 561 SVGSVGElement* SVGSVGElement::findRootAnchor( const String&fragmentIdentifier) const561 SVGSVGElement* SVGSVGElement::findRootAnchor(StringView fragmentIdentifier) const 562 562 { 563 563 if (auto* viewElement = findViewAnchor(fragmentIdentifier)) … … 566 566 } 567 567 568 bool SVGSVGElement::scrollToFragment( const String&fragmentIdentifier)568 bool SVGSVGElement::scrollToFragment(StringView fragmentIdentifier) 569 569 { 570 570 auto renderer = this->renderer(); … … 617 617 if (auto* renderer = rootElement->renderer()) 618 618 RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); 619 m_currentViewFragmentIdentifier = fragmentIdentifier ;619 m_currentViewFragmentIdentifier = fragmentIdentifier.toString(); 620 620 return true; 621 621 } -
trunk/Source/WebCore/svg/SVGSVGElement.h
r251527 r278669 85 85 static Ref<SVGSVGElement> create(const QualifiedName&, Document&); 86 86 static Ref<SVGSVGElement> create(Document&); 87 bool scrollToFragment( const String&fragmentIdentifier);87 bool scrollToFragment(StringView fragmentIdentifier); 88 88 void resetScrollAnchor(); 89 89 … … 142 142 Ref<NodeList> collectIntersectionOrEnclosureList(SVGRect&, SVGElement*, bool (*checkFunction)(SVGElement&, SVGRect&)); 143 143 144 SVGViewElement* findViewAnchor( const String&fragmentIdentifier) const;144 SVGViewElement* findViewAnchor(StringView fragmentIdentifier) const; 145 145 SVGSVGElement* findRootAnchor(const SVGViewElement*) const; 146 SVGSVGElement* findRootAnchor( const String&) const;146 SVGSVGElement* findRootAnchor(StringView) const; 147 147 148 148 bool m_useCurrentView { false }; -
trunk/Source/WebCore/svg/SVGViewSpec.cpp
r263617 r278669 69 69 template<typename CharacterType> static constexpr CharacterType viewTargetSpec[] = {'v', 'i', 'e', 'w', 'T', 'a', 'r', 'g', 'e', 't'}; 70 70 71 bool SVGViewSpec::parseViewSpec( const StringView&string)71 bool SVGViewSpec::parseViewSpec(StringView string) 72 72 { 73 73 return readCharactersForParsing(string, [&](auto buffer) -> bool { -
trunk/Source/WebCore/svg/SVGViewSpec.h
r263617 r278669 37 37 } 38 38 39 bool parseViewSpec( const StringView&);39 bool parseViewSpec(StringView); 40 40 void reset(); 41 41 void resetContextElement() { m_contextElement = nullptr; } -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm
r278475 r278669 566 566 [NSException raise:NSInvalidArgumentException format:@"'%@' is a URL scheme that WKWebView handles natively", urlScheme]; 567 567 568 auto canonicalScheme = WTF::URLParser::maybeCanonicalizeScheme( urlScheme);568 auto canonicalScheme = WTF::URLParser::maybeCanonicalizeScheme(String(urlScheme)); 569 569 if (!canonicalScheme) 570 570 [NSException raise:NSInvalidArgumentException format:@"'%@' is not a valid URL scheme", urlScheme]; … … 578 578 - (id <WKURLSchemeHandler>)urlSchemeHandlerForURLScheme:(NSString *)urlScheme 579 579 { 580 auto canonicalScheme = WTF::URLParser::maybeCanonicalizeScheme( urlScheme);580 auto canonicalScheme = WTF::URLParser::maybeCanonicalizeScheme(String(urlScheme)); 581 581 if (!canonicalScheme) 582 582 return nil;
Note:
See TracChangeset
for help on using the changeset viewer.