Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 40b5fc57f5e1b40674c669d8e2ddfd944dac6355
      
https://github.com/WebKit/WebKit/commit/40b5fc57f5e1b40674c669d8e2ddfd944dac6355
  Author: Timothy Hatcher <timo...@apple.com>
  Date:   2024-11-19 (Tue, 19 Nov 2024)

  Changed paths:
    M Source/WTF/wtf/cocoa/LanguageCocoa.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPILocalization.mm

  Log Message:
  -----------
  Crash in WebKit::WebExtension::bestMatchLocale().
https://webkit.org/b/283387
rdar://140134905

Reviewed by Brian Weinstein.

WebExtension::bestMatchLocale() was expecting notFound from 
indexOfBestMatchingLanguageInList()
which is the case for non-Cocoa platforms, but this case was missed in the 
Cocoa implementation.

* Source/WTF/wtf/cocoa/LanguageCocoa.mm:
(WTF::indexOfBestMatchingLanguageInList): Return notFound instead of size() 
when the array is empty.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPILocalization.mm:
(TestWebKitAPI::TEST(WKWebExtensionAPILocalization, 
i18nSwedishDefaultToEnglish)): Added.

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to