[webkit-reviews] review granted: [Bug 225900] [Modern Media Controls] give more weight to tracks that are in non-default languages configured by the user : [Attachment 429031] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 19 11:26:51 PDT 2021


Darin Adler <darin at apple.com> has granted Devin Rousso <drousso at apple.com>'s
request for review:
Bug 225900: [Modern Media Controls] give more weight to tracks that are in
non-default languages configured by the user
https://bugs.webkit.org/show_bug.cgi?id=225900

Attachment 429031: Patch

https://bugs.webkit.org/attachment.cgi?id=429031&action=review




--- Comment #7 from Darin Adler <darin at apple.com> ---
Comment on attachment 429031
  --> https://bugs.webkit.org/attachment.cgi?id=429031
Patch

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

> Source/WebCore/page/CaptionUserPreferences.cpp:241
> +    Collator collator;

Thanks for taking my pointer: Does this get the correct language for the
collator? Does it run in the web process? If so, how does it inherit the
appropriate language from the UI process?

> Source/WebCore/page/CaptionUserPreferencesMediaAF.cpp:770
> +    for (auto& preferredLanguage : userPreferredLanguages()) {
> +	   String preferredLanguageDisplayName =
displayNameForLanguageLocale(languageIdentifier(preferredLanguage));
> +	   bool aIsPreferredLanguage = aLanguageDisplayName ==
preferredLanguageDisplayName;
> +	   bool bIsPreferredLanguage = bLanguageDisplayName ==
preferredLanguageDisplayName;
> +	   if (aIsPreferredLanguage != bIsPreferredLanguage)
> +	       return aIsPreferredLanguage;
> +    }

I don’t understand the rule very well.

Is the idea that we sort the preferred languages in the order they appear in
the userPreferredLanguages()? If so, then I think the code implements that
rule.

Or maybe we sort all the preferred languages to the top of the menu, but we
want them in an appropriate order.


More information about the webkit-reviews mailing list