Bug 239453 - Use convertToASCIILowercase() less and more SortedArrayMap / SortedArraySet
Summary: Use convertToASCIILowercase() less and more SortedArrayMap / SortedArraySet
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-04-18 09:58 PDT by Chris Dumez
Modified: 2022-04-19 12:34 PDT (History)
10 users (show)

See Also:


Attachments
Patch (9.00 KB, patch)
2022-04-18 10:00 PDT, Chris Dumez
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (9.21 KB, patch)
2022-04-18 10:25 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2022-04-18 09:58:50 PDT
Use convertToASCIILowercase() less and more SortedArrayMap / SortedArraySet.
Comment 1 Chris Dumez 2022-04-18 10:00:25 PDT
Created attachment 457807 [details]
Patch
Comment 2 Chris Dumez 2022-04-18 10:25:24 PDT
Created attachment 457809 [details]
Patch
Comment 3 Darin Adler 2022-04-18 15:13:56 PDT
Comment on attachment 457809 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=457809&action=review

> Source/WebCore/Modules/applicationmanifest/ApplicationManifestParser.cpp:157
> +    if (auto* displayValue = displayValues.tryGet(StringView(stringValue).stripWhiteSpace()))

Not changing in this patch: Seems like this should be stripping leading and trailing *HTML* whitespace, probably a subtle and unimportant that it strips all *ASCII* whitespace, which includes one character that HTML does not. I also think it’s a little strange that the StringView function is named stripWhiteSpace, because we normally say ASCIISpace or HTMLSpace or HTTPSpace and just "space" typically means some kind of Unicode space.

> Source/WebDriver/WebDriverService.cpp:232
> +    if (auto* methodValue = httpMethods.tryGet(method))
> +        return *methodValue;
>      return std::nullopt;

Makes me wish we had a "convert pointer to optional" function you could have used here.
Comment 4 EWS 2022-04-18 15:25:34 PDT
Committed r292976 (249739@main): <https://commits.webkit.org/249739@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 457809 [details].
Comment 5 Radar WebKit Bug Importer 2022-04-18 15:26:14 PDT
<rdar://problem/91921586>
Comment 6 Sam Weinig 2022-04-19 12:34:59 PDT
Comment on attachment 457809 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=457809&action=review

> Source/WebCore/platform/graphics/MediaPlayer.cpp:1116
> +    if (!containerType.startsWithIgnoringASCIICase("video/") && !containerType.startsWithIgnoringASCIICase("audio/") && !containerType.startsWithIgnoringASCIICase("application/"))

Hm, if this is common (I am not sure it is), it makes me wonder if there is a variant of SortedArrayMap to be made that does startsWith() rather than ==.