Changeset 50244 in webkit


Ignore:
Timestamp:
Oct 28, 2009 3:42:42 PM (14 years ago)
Author:
kov@webkit.org
Message:

LayoutTests

Reviewed by Xan Lopez.

[GTK] Fails new test fast/js/navigator-language.html
https://bugs.webkit.org/show_bug.cgi?id=30440

Unskip the test that now passes.

  • platform/gtk/Skipped:

WebCore

Reviewed by Xan Lopez.

[GTK] Fails new test fast/js/navigator-language.html
https://bugs.webkit.org/show_bug.cgi?id=30440

Reimplement WebCore::defaultLanguage to account for changes in
locale done by setLocale.

Already existing test: fast/js/navigator-language.html

  • platform/gtk/Language.cpp: (WebCore::defaultLanguage):
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r50237 r50244  
     12009-10-28  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
     2
     3        Reviewed by Xan Lopez.
     4
     5        [GTK] Fails new test fast/js/navigator-language.html
     6        https://bugs.webkit.org/show_bug.cgi?id=30440
     7
     8        Unskip the test that now passes.
     9
     10        * platform/gtk/Skipped:
     11
    1122009-10-28  Jonathan Dixon  <joth@chromium.org>
    213
  • trunk/LayoutTests/platform/gtk/Skipped

    r50190 r50244  
    14601460fast/events/drag-and-drop.html
    14611461fast/events/drag-parent-node.html
    1462 
    1463 # https://bugs.webkit.org/show_bug.cgi?id=30440
    1464 fast/js/navigator-language.html
    14651462
    14661463fast/xmlhttprequest/null-document-xmlhttprequest-open.html
  • trunk/WebCore/ChangeLog

    r50242 r50244  
     12009-10-28  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
     2
     3        Reviewed by Xan Lopez.
     4
     5        [GTK] Fails new test fast/js/navigator-language.html
     6        https://bugs.webkit.org/show_bug.cgi?id=30440
     7
     8        Reimplement WebCore::defaultLanguage to account for changes in
     9        locale done by setLocale.
     10
     11        Already existing test: fast/js/navigator-language.html
     12
     13        * platform/gtk/Language.cpp:
     14        (WebCore::defaultLanguage):
     15
    1162009-10-28  Eric Carlson  <eric.carlson@apple.com>
    217
  • trunk/WebCore/platform/gtk/Language.cpp

    r46333 r50244  
    2222
    2323#include "CString.h"
     24#include "GOwnPtr.h"
    2425#include "PlatformString.h"
    2526
    2627#include <gtk/gtk.h>
     28#include <locale.h>
    2729#include <pango/pango.h>
    2830
    2931namespace WebCore {
    3032
     33// Using pango_language_get_default() here is not an option, because
     34// it doesn't support changing the locale in runtime, so it returns
     35// always the same value.
    3136String defaultLanguage()
    3237{
    33     return pango_language_to_string(gtk_get_default_language());
     38    char* localeDefault = setlocale(LC_CTYPE, NULL);
     39
     40    if (!localeDefault)
     41        return String("c");
     42
     43    GOwnPtr<gchar> normalizedDefault(g_ascii_strdown(localeDefault, -1));
     44    char* ptr = strchr(normalizedDefault.get(), '_');
     45
     46    if(ptr)
     47        *ptr = '-';
     48
     49    ptr = strchr(normalizedDefault.get(), '.');
     50
     51    if(ptr)
     52        *ptr = '\0';
     53
     54    return String(normalizedDefault.get());
    3455}
    3556
Note: See TracChangeset for help on using the changeset viewer.