Bug 76138 - Provide access to user's list of preferred languages
Summary: Provide access to user's list of preferred languages
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Eric Carlson
URL:
Keywords: InRadar
Depends on:
Blocks: 74121
  Show dependency treegraph
 
Reported: 2012-01-11 18:40 PST by Eric Carlson
Modified: 2012-01-19 08:34 PST (History)
10 users (show)

See Also:


Attachments
Proposed patch (32.68 KB, patch)
2012-01-13 22:13 PST, Eric Carlson
webkit-ews: commit-queue-
Details | Formatted Diff | Diff
Updated patch (34.92 KB, patch)
2012-01-16 21:40 PST, Eric Carlson
gyuyoung.kim: commit-queue-
Details | Formatted Diff | Diff
Updated the poorly chosen function name. (34.93 KB, patch)
2012-01-16 21:55 PST, Eric Carlson
webkit-ews: commit-queue-
Details | Formatted Diff | Diff
A few code fixes, a few stab-in-the-dark build file changes. Maybe this one will fly. (39.08 KB, patch)
2012-01-17 07:55 PST, Eric Carlson
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff
+symbols.filter (40.51 KB, patch)
2012-01-17 08:37 PST, Eric Carlson
webkit-ews: commit-queue-
Details | Formatted Diff | Diff
Add new files to Target.pri (thanks Ossy!), fix typo in custom V8 code. (41.25 KB, patch)
2012-01-17 09:24 PST, Eric Carlson
no flags Details | Formatted Diff | Diff
+ WebCoreTestSupport.vcproj (43.49 KB, patch)
2012-01-17 10:39 PST, Eric Carlson
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff
One more time... (42.33 KB, patch)
2012-01-17 12:00 PST, Eric Carlson
no flags Details | Formatted Diff | Diff
One last version, got rid of overrideDefaultLanguage() as per request (45.32 KB, patch)
2012-01-17 21:21 PST, Eric Carlson
no flags Details | Formatted Diff | Diff
Updated patch. (45.93 KB, patch)
2012-01-18 09:48 PST, Eric Carlson
ap: review+
Details | Formatted Diff | Diff
Rebased patch for the EWS bots. (45.52 KB, patch)
2012-01-18 12:03 PST, Eric Carlson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Carlson 2012-01-11 18:40:34 PST
On some platforms, OS X at least, the user's language preference is an ordered list of languages. As noted in https://bugs.webkit.org/show_bug.cgi?id=74121, the <track> needs to consider the user's language preferences.
Comment 1 Radar WebKit Bug Importer 2012-01-11 18:41:31 PST
<rdar://problem/10681343>
Comment 2 Eric Carlson 2012-01-13 22:13:10 PST
Created attachment 122535 [details]
Proposed patch

A patch for the EWS bots to chew on because I have *no* idea if the custom V8 code is correct.
Comment 3 WebKit Review Bot 2012-01-13 22:15:33 PST
Attachment 122535 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/fast..." exit_code: 1

Source/WebCore/platform/win/LanguageWin.cpp:31:  Alphabetical sorting problem.  [build/include_order] [4]
Source/WebCore/platform/gtk/LanguageGtk.cpp:26:  Alphabetical sorting problem.  [build/include_order] [4]
Source/WebCore/ChangeLog:42:  Need whitespace between colon and description  [changelog/filechangedescriptionwhitespace] [5]
Source/WebCore/ChangeLog:46:  Need whitespace between colon and description  [changelog/filechangedescriptionwhitespace] [5]
Source/WebCore/testing/js/JSInternalsCustom.cpp:27:  You should add a blank line after implementation file's own header.  [build/include_order] [4]
Total errors found: 5 in 28 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Early Warning System Bot 2012-01-13 22:18:13 PST
Comment on attachment 122535 [details]
Proposed patch

Attachment 122535 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/11149843
Comment 5 Gustavo Noronha (kov) 2012-01-13 22:24:51 PST
Comment on attachment 122535 [details]
Proposed patch

Attachment 122535 [details] did not pass gtk-ews (gtk):
Output: http://queues.webkit.org/results/11209818
Comment 6 WebKit Review Bot 2012-01-13 22:42:59 PST
Comment on attachment 122535 [details]
Proposed patch

Attachment 122535 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/11228824
Comment 7 Alexey Proskuryakov 2012-01-13 23:27:58 PST
Comment on attachment 122535 [details]
Proposed patch

Can we remove platformDefaultLanguage() now, making defaultLanguage() take the first one from the vector?
Comment 8 Eric Carlson 2012-01-14 18:48:09 PST
(In reply to comment #7)
> (From update of attachment 122535 [details])
> Can we remove platformDefaultLanguage() now, making defaultLanguage() take the first one from the vector?

Great idea, I should have thought of that!
Comment 9 Eric Carlson 2012-01-16 21:40:01 PST
Created attachment 122711 [details]
Updated patch
Comment 10 Gyuyoung Kim 2012-01-16 21:44:58 PST
Comment on attachment 122711 [details]
Updated patch

Attachment 122711 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/11117079
Comment 11 Early Warning System Bot 2012-01-16 21:54:56 PST
Comment on attachment 122711 [details]
Updated patch

Attachment 122711 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/11117082
Comment 12 Eric Carlson 2012-01-16 21:55:01 PST
Created attachment 122712 [details]
Updated the poorly chosen function name.
Comment 13 Early Warning System Bot 2012-01-16 22:13:12 PST
Comment on attachment 122712 [details]
Updated the poorly chosen function name.

Attachment 122712 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/11111071
Comment 14 Collabora GTK+ EWS bot 2012-01-16 22:58:41 PST
Comment on attachment 122712 [details]
Updated the poorly chosen function name.

Attachment 122712 [details] did not pass gtk-ews (gtk):
Output: http://queues.webkit.org/results/11111085
Comment 15 WebKit Review Bot 2012-01-16 23:38:43 PST
Comment on attachment 122712 [details]
Updated the poorly chosen function name.

Attachment 122712 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/11269099
Comment 16 Eric Carlson 2012-01-17 07:55:03 PST
Created attachment 122770 [details]
A few code fixes, a few stab-in-the-dark build file changes. Maybe this one will fly.
Comment 17 WebKit Review Bot 2012-01-17 08:16:35 PST
Comment on attachment 122770 [details]
A few code fixes, a few stab-in-the-dark build file changes. Maybe this one will fly.

Attachment 122770 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/11267210
Comment 18 Early Warning System Bot 2012-01-17 08:18:51 PST
Comment on attachment 122770 [details]
A few code fixes, a few stab-in-the-dark build file changes. Maybe this one will fly.

Attachment 122770 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/11220018
Comment 19 Eric Carlson 2012-01-17 08:37:48 PST
Created attachment 122775 [details]
+symbols.filter
Comment 20 Early Warning System Bot 2012-01-17 08:57:44 PST
Comment on attachment 122775 [details]
+symbols.filter

Attachment 122775 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/11268227
Comment 21 WebKit Review Bot 2012-01-17 09:06:50 PST
Comment on attachment 122775 [details]
+symbols.filter

Attachment 122775 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/11262224
Comment 22 Eric Carlson 2012-01-17 09:24:37 PST
Created attachment 122777 [details]
Add new files to Target.pri (thanks Ossy!), fix typo in custom V8 code.
Comment 23 Eric Carlson 2012-01-17 10:39:03 PST
Created attachment 122783 [details]
+ WebCoreTestSupport.vcproj
Comment 24 Alexey Proskuryakov 2012-01-17 10:46:20 PST
Can we get rid of overrideDefaultLanguage() now, as well? It's confusing to have two overrides for basically the same thing.
Comment 25 Adam Roben (:aroben) 2012-01-17 11:45:08 PST
From WinEWS:

11>WebKit.exp : error LNK2001: unresolved external symbol "public: void __thiscall WebCore::JSInternals::setUserPreferredLanguages(class JSC::ExecState *,class JSC::JSValue)" (?setUserPreferredLanguages@JSInternals@WebCore@@QAEXPAVExecState@JSC@@VJSValue@4@@Z)
11>WebKit.exp : error LNK2001: unresolved external symbol "public: class JSC::JSValue __thiscall WebCore::JSInternals::userPreferredLanguages(class JSC::ExecState *)const " (?userPreferredLanguages@JSInternals@WebCore@@QBE?AVJSValue@JSC@@PAVExecState@4@@Z)

Those mangled symbols need to be added to WebKit2.def. There's a section at the bottom of that file that contains all the Internals symbols we export.
Comment 26 Adam Roben (:aroben) 2012-01-17 11:48:52 PST
(In reply to comment #25)
> From WinEWS:
> 
> 11>WebKit.exp : error LNK2001: unresolved external symbol "public: void __thiscall WebCore::JSInternals::setUserPreferredLanguages(class JSC::ExecState *,class JSC::JSValue)" (?setUserPreferredLanguages@JSInternals@WebCore@@QAEXPAVExecState@JSC@@VJSValue@4@@Z)
> 11>WebKit.exp : error LNK2001: unresolved external symbol "public: class JSC::JSValue __thiscall WebCore::JSInternals::userPreferredLanguages(class JSC::ExecState *)const " (?userPreferredLanguages@JSInternals@WebCore@@QBE?AVJSValue@JSC@@PAVExecState@4@@Z)
> 
> Those mangled symbols need to be added to WebKit2.def. There's a section at the bottom of that file that contains all the Internals symbols we export.

Oh, wait, I misread the error. These symbols are failing to be found when linking WebKit.dll. This means that the code that provides those symbols isn't being compiled for some reason.
Comment 27 WebKit Review Bot 2012-01-17 11:49:00 PST
Comment on attachment 122783 [details]
+ WebCoreTestSupport.vcproj

Attachment 122783 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/11117273

New failing tests:
inspector/protocol/runtime-agent.html
Comment 28 Adam Roben (:aroben) 2012-01-17 11:52:18 PST
It looks like those symbols correspond to functions that are in WebCoreTestSupport.lib. Those symbols shouldn't be listed in WebKit2[CFLite].def at all.
Comment 29 Eric Carlson 2012-01-17 12:00:04 PST
Created attachment 122795 [details]
One more time...
Comment 30 Eric Carlson 2012-01-17 21:21:42 PST
Created attachment 122869 [details]
One last version, got rid of overrideDefaultLanguage() as per request
Comment 31 Alexey Proskuryakov 2012-01-17 21:58:56 PST
Comment on attachment 122869 [details]
One last version, got rid of overrideDefaultLanguage() as per request

This still has separate override variables (preferredLanguagesOverride() and languageOverride()). Is that unavoidable?
Comment 32 Eric Carlson 2012-01-18 09:41:59 PST
(In reply to comment #31)
> (From update of attachment 122869 [details])
> This still has separate override variables (preferredLanguagesOverride() and languageOverride()). Is that unavoidable?

No, it is just me attaching an old version of the patch :-(

New version coming up.
Comment 33 Eric Carlson 2012-01-18 09:48:06 PST
Created attachment 122951 [details]
Updated patch.
Comment 34 Alexey Proskuryakov 2012-01-18 11:02:51 PST
Comment on attachment 122951 [details]
Updated patch.

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

Looks great, thank you!

> Source/WebCore/platform/Language.h:30
>  #include <wtf/Forward.h>
> +#include <wtf/Vector.h>

I'm surprised that this was needed - Forward.h declares Vector.
Comment 35 Alexey Proskuryakov 2012-01-18 11:03:32 PST
It's unfortunate that EWS couldn't apply this patch.
Comment 36 Eric Carlson 2012-01-18 11:22:07 PST
(In reply to comment #35)
> It's unfortunate that EWS couldn't apply this patch.

I agree. Earlier versions of this patch bounced enough times that I am going to rebase and upload again so I can make sure it works.
Comment 37 Eric Carlson 2012-01-18 12:03:17 PST
Created attachment 122973 [details]
Rebased patch for the EWS bots.
Comment 38 Eric Carlson 2012-01-18 13:53:34 PST
http://trac.webkit.org/changeset/105315
Comment 39 Eric Carlson 2012-01-18 15:31:33 PST
Plus http://trac.webkit.org/changeset/105333 to fix a bug in the original patch.
Comment 40 Gabor Rapcsanyi 2012-01-19 04:42:02 PST
It breaks these bots:
 http://build.webkit.org/waterfall?show=GTK%20Linux%2032-bit%20Release
 http://build.webkit.sed.hu/waterfall?show=ARMv7%20Linux%20Gtk%20Release%20(Build)


Can somebody fix this error?

CXXLD  Programs/DumpRenderTree
./.libs/libWebCoreInternals.a(libWebCoreInternals_la-Internals.o): In function `WebCore::Internals::setUserPreferredLanguages(WTF::Vector<WTF::String, 0u> const&)':
Internals.cpp:(.text+0x78): undefined reference to `WebCore::overrideUserPreferredLanguages(WTF::Vector<WTF::String, 0u> const&)'
collect2: ld returned 1 exit status
make[1]: *** [Programs/DumpRenderTree] Error 1
make[1]: Leaving directory `/ramdisk/arm-gtk-linux-release/build/WebKitBuild/Release'
make: *** [all] Error 2
Comment 41 Eric Carlson 2012-01-19 08:34:52 PST
(In reply to comment #40)
> It breaks these bots:
>  http://build.webkit.org/waterfall?show=GTK%20Linux%2032-bit%20Release
>  http://build.webkit.sed.hu/waterfall?show=ARMv7%20Linux%20Gtk%20Release%20(Build)
> 
> 
> Can somebody fix this error?
> 
> CXXLD  Programs/DumpRenderTree
> ./.libs/libWebCoreInternals.a(libWebCoreInternals_la-Internals.o): In function `WebCore::Internals::setUserPreferredLanguages(WTF::Vector<WTF::String, 0u> const&)':
> Internals.cpp:(.text+0x78): undefined reference to `WebCore::overrideUserPreferredLanguages(WTF::Vector<WTF::String, 0u> const&)'
> collect2: ld returned 1 exit status
> make[1]: *** [Programs/DumpRenderTree] Error 1
> make[1]: Leaving directory `/ramdisk/arm-gtk-linux-release/build/WebKitBuild/Release'
> make: *** [all] Error 2

I don't understand this, what would make the new WebCore symbol available in a Debug build but not in a Release build?