Bug 225461 - Regression(r254389?) navigator.languages returns all lowercase languages for ports using CF
Summary: Regression(r254389?) navigator.languages returns all lowercase languages for ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-05-06 09:35 PDT by Chris Dumez
Modified: 2021-05-07 10:43 PDT (History)
9 users (show)

See Also:


Attachments
Patch (30.61 KB, patch)
2021-05-06 10:26 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (46.83 KB, patch)
2021-05-06 11:31 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (51.92 KB, patch)
2021-05-06 13:55 PDT, Chris Dumez
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2021-05-06 09:35:14 PDT
navigator.languages now says "en-us" instead of "en-US". The case does not match the specification not other browsers.
Comment 1 Chris Dumez 2021-05-06 10:26:01 PDT
Created attachment 427902 [details]
Patch
Comment 2 Chris Dumez 2021-05-06 11:31:10 PDT
Created attachment 427910 [details]
Patch
Comment 3 Darin Adler 2021-05-06 13:31:33 PDT
Comment on attachment 427910 [details]
Patch

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

> Source/WTF/wtf/cf/LanguageCF.cpp:-88
> -    CFStringLowercase(mutableLanguageCode.get(), nullptr);

So this is a CoreFoundation-only regression, not affecting non-CoreFoundation-using WebKit ports?

> LayoutTests/ChangeLog:11
> +        * fast/text/international/system-language/navigator-language/navigator-language-en-GB-expected.txt:
> +        * fast/text/international/system-language/navigator-language/navigator-language-en-GB.html:

How can a CoreFoundation-only fix affect non-platform-specific expected.txt files?

> LayoutTests/ChangeLog:45
> +        * js/dom/navigator-language-expected.txt:
> +        * js/dom/navigator-language.html:

I don’t see changes to these two files in the patch.
Comment 4 Chris Dumez 2021-05-06 13:34:57 PDT
Comment on attachment 427910 [details]
Patch

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

>> LayoutTests/ChangeLog:11
>> +        * fast/text/international/system-language/navigator-language/navigator-language-en-GB.html:
> 
> How can a CoreFoundation-only fix affect non-platform-specific expected.txt files?

I will check what's the story for other ports.

>> LayoutTests/ChangeLog:45
>> +        * js/dom/navigator-language.html:
> 
> I don’t see changes to these two files in the patch.

Oh, my latest iteration only modifies the latter one.

> LayoutTests/js/dom/navigator-language.html:18
> +if (language == "en" || language == "en-US")

The change is here.
Comment 5 Chris Dumez 2021-05-06 13:37:17 PDT
(In reply to Chris Dumez from comment #4)
> Comment on attachment 427910 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=427910&action=review
> 
> >> LayoutTests/ChangeLog:11
> >> +        * fast/text/international/system-language/navigator-language/navigator-language-en-GB.html:
> > 
> > How can a CoreFoundation-only fix affect non-platform-specific expected.txt files?
> 
> I will check what's the story for other ports.

Where it seems they are skipped and masked as failing:
LayoutTests/platform/win/TestExpectations:fast/text/international/system-language [ Skip ]
LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618 fast/text/international/system-language/navigator-language/navigator-language-en-GB.html [ Failure ]
LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618 fast/text/international/system-language/navigator-language/navigator-language-en.html [ Failure ]
LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618 fast/text/international/system-language/navigator-language/navigator-language-en-US.html [ Failure ]
LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618 fast/text/international/system-language/navigator-language/navigator-language-es-419.html [ Failure ]
LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618 fast/text/international/system-language/navigator-language/navigator-language-es-ES.html [ Failure ]
LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618 fast/text/international/system-language/navigator-language/navigator-language-es.html [ Failure ]
LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618 fast/text/international/system-language/navigator-language/navigator-language-es-MX.html [ Failure ]
LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618 fast/text/international/system-language/navigator-language/navigator-language-fr-CA.html [ Failure ]
LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618 fast/text/international/system-language/navigator-language/navigator-language-fr.html [ Failure ]
LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618 fast/text/international/system-language/navigator-language/navigator-language-hi.html [ Failure ]
LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618 fast/text/international/system-language/navigator-language/navigator-language-ja.html [ Failure ]
LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618 fast/text/international/system-language/navigator-language/navigator-language-pt-BR.html [ Failure ]
LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618 fast/text/international/system-language/navigator-language/navigator-language-pt-PT.html [ Failure ]
LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618 fast/text/international/system-language/navigator-language/navigator-language-ru.html [ Failure ]
LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618 fast/text/international/system-language/navigator-language/navigator-language-zh-Hans.html [ Failure ]
LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618 fast/text/international/system-language/navigator-language/navigator-language-zh-Hant-HK.html [ Failure ]
LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618 fast/text/international/system-language/navigator-language/navigator-language-zh-Hant.html [ Failure ]
LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618 fast/text/international/system-language/navigator-language/navigator-language-zh-HK.html [ Failure ]
LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618 fast/text/international/system-language/navigator-language/navigator-language-zh-TW.html [ Failure ]
LayoutTests/platform/gtk/TestExpectations:webkit.org/b/158472 fast/text/international/system-language/han-quotes.html [ ImageOnlyFailure Pass ]
Comment 6 Chris Dumez 2021-05-06 13:46:54 PDT
(In reply to Chris Dumez from comment #5)
> (In reply to Chris Dumez from comment #4)
> > Comment on attachment 427910 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=427910&action=review
> > 
> > >> LayoutTests/ChangeLog:11
> > >> +        * fast/text/international/system-language/navigator-language/navigator-language-en-GB.html:
> > > 
> > > How can a CoreFoundation-only fix affect non-platform-specific expected.txt files?
> > 
> > I will check what's the story for other ports.
> 
> Where it seems they are skipped and masked as failing:
> LayoutTests/platform/win/TestExpectations:fast/text/international/system-
> language [ Skip ]
> LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618
> fast/text/international/system-language/navigator-language/navigator-
> language-en-GB.html [ Failure ]
> LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618
> fast/text/international/system-language/navigator-language/navigator-
> language-en.html [ Failure ]
> LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618
> fast/text/international/system-language/navigator-language/navigator-
> language-en-US.html [ Failure ]
> LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618
> fast/text/international/system-language/navigator-language/navigator-
> language-es-419.html [ Failure ]
> LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618
> fast/text/international/system-language/navigator-language/navigator-
> language-es-ES.html [ Failure ]
> LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618
> fast/text/international/system-language/navigator-language/navigator-
> language-es.html [ Failure ]
> LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618
> fast/text/international/system-language/navigator-language/navigator-
> language-es-MX.html [ Failure ]
> LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618
> fast/text/international/system-language/navigator-language/navigator-
> language-fr-CA.html [ Failure ]
> LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618
> fast/text/international/system-language/navigator-language/navigator-
> language-fr.html [ Failure ]
> LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618
> fast/text/international/system-language/navigator-language/navigator-
> language-hi.html [ Failure ]
> LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618
> fast/text/international/system-language/navigator-language/navigator-
> language-ja.html [ Failure ]
> LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618
> fast/text/international/system-language/navigator-language/navigator-
> language-pt-BR.html [ Failure ]
> LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618
> fast/text/international/system-language/navigator-language/navigator-
> language-pt-PT.html [ Failure ]
> LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618
> fast/text/international/system-language/navigator-language/navigator-
> language-ru.html [ Failure ]
> LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618
> fast/text/international/system-language/navigator-language/navigator-
> language-zh-Hans.html [ Failure ]
> LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618
> fast/text/international/system-language/navigator-language/navigator-
> language-zh-Hant-HK.html [ Failure ]
> LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618
> fast/text/international/system-language/navigator-language/navigator-
> language-zh-Hant.html [ Failure ]
> LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618
> fast/text/international/system-language/navigator-language/navigator-
> language-zh-HK.html [ Failure ]
> LayoutTests/platform/glib/TestExpectations:webkit.org/b/152618
> fast/text/international/system-language/navigator-language/navigator-
> language-zh-TW.html [ Failure ]
> LayoutTests/platform/gtk/TestExpectations:webkit.org/b/158472
> fast/text/international/system-language/han-quotes.html [ ImageOnlyFailure
> Pass ]

Looks like the other ports are missing test infrastructure to change the system language. For this reason, the tests are skipped or marked as failing.
Comment 7 Chris Dumez 2021-05-06 13:55:20 PDT
Created attachment 427933 [details]
Patch
Comment 8 EWS 2021-05-06 16:01:25 PDT
Committed r277135 (237424@main): <https://commits.webkit.org/237424@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 427933 [details].
Comment 9 Radar WebKit Bug Importer 2021-05-06 16:02:17 PDT
<rdar://problem/77629484>
Comment 10 Myles C. Maxfield 2021-05-07 10:43:07 PDT
Thanks for fixing this!