2011-02-09 Nebojsa Ciric <cira@chromium.org>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Feb 2011 19:43:37 +0000 (19:43 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Feb 2011 19:43:37 +0000 (19:43 +0000)
        Reviewed by Darin Fisher.

        Implements Locale object of JavaScript internationalization API proposal, as an
        v8 extension. Extension code is hosted in v8 project (src/extensions/experimental/i18n-extension.{cc,h})
        and in this patch we just provide flags, tests and build rules for chromium port.
        https://bugs.webkit.org/show_bug.cgi?id=49414

        * fast/js/i18n-bindings-locale-expected.txt: Added.
        * fast/js/i18n-bindings-locale.html: Added.
        * fast/js/script-tests/i18n-bindings-locale.js: Added.
        (reportResult):
        (localeTests.this.defaultLocale):
        (localeTests.this.baseLocale):
        (localeTests.this.languageScriptLocale):
        (localeTests.this.languageScriptRegionLocale):
        (localeTests.this.languageScriptRegionExtensionLocale):
        (localeTests.this.languageScriptRegionDashUExtensionLocale):
        (localeTests.this.availableLocales):
        (localeTests.this.maximizedLocale):
        (localeTests.this.maximizedLocaleWithExtension):
        (localeTests.this.minimizedLocale):
        (localeTests.this.minimizedLocaleWithExtension):
        (localeTests.this.displayForBaseLocale):
        (localeTests.this.displayInSameLocale):
        (localeTests.this.displayInDifferentLocale):
        (localeTests.this.displayInCyrillicScript):
        (localeTests.this.displayInHebrewScript):
        (localeTests):
        * platform/gtk/Skipped:
        * platform/mac/Skipped:
        * platform/qt/Skipped:
        * platform/win/Skipped:
2011-02-09  Nebojsa Ciric  <cira@chromium.org>

        Reviewed by Darin Fisher.

        Implements Locale object of JavaScript internationalization API proposal, as an
        v8 extension. Extension code is hosted in v8 project (src/extensions/experimental/i18n-extension.{cc,h})
        and in this patch we just provide flags, tests and build rules for chromium port.
        https://bugs.webkit.org/show_bug.cgi?id=49414

        Test: fast/js/i18n-bindings-locale.html

        * WebCore.gyp/WebCore.gyp:
        * bindings/generic/RuntimeEnabledFeatures.cpp:
        (WebCore::RuntimeEnabledFeatures::experimentalI18NAPIEnabled):
        * bindings/generic/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::setExperimentalI18NAPIEnabled):
        * bindings/v8/V8DOMWindowShell.cpp:
        (WebCore::V8DOMWindowShell::createNewContext):
2011-02-09  Nebojsa Ciric  <cira@chromium.org>

        Reviewed by Darin Fisher.

        Implements Locale object of JavaScript internationalization API proposal, as an
        v8 extension. Extension code is hosted in v8 project (src/extensions/experimental/i18n-extension.{cc,h})
        and in this patch we just provide flags, tests and build rules for chromium port.
        https://bugs.webkit.org/show_bug.cgi?id=49414

        * features.gypi:
        * public/WebRuntimeFeatures.h:
        * src/WebRuntimeFeatures.cpp:
        (WebKit::WebRuntimeFeatures::enableExperimentalI18NAPI):
        (WebKit::WebRuntimeFeatures::isExperimentalI18NAPIEnabled):
2011-02-09  Nebojsa Ciric  <cira@chromium.org>

        Reviewed by Darin Fisher.

        Implements Locale object of JavaScript internationalization API proposal, as an
        v8 extension. Extension code is hosted in v8 project (src/extensions/experimental/i18n-extension.{cc,h})
        and in this patch we just provide flags, tests and build rules for chromium port.
        https://bugs.webkit.org/show_bug.cgi?id=49414

        * DumpRenderTree/chromium/TestShell.cpp:
        (TestShell::TestShell):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@78095 268f45cc-cd09-0410-ab3c-d52691b4dbfc

19 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/js/i18n-bindings-locale-expected.txt [new file with mode: 0644]
LayoutTests/fast/js/i18n-bindings-locale.html [new file with mode: 0644]
LayoutTests/fast/js/script-tests/i18n-bindings-locale.js [new file with mode: 0644]
LayoutTests/platform/gtk/Skipped
LayoutTests/platform/mac/Skipped
LayoutTests/platform/qt/Skipped
LayoutTests/platform/win/Skipped
Source/WebCore/ChangeLog
Source/WebCore/WebCore.gyp/WebCore.gyp
Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h
Source/WebCore/bindings/v8/V8DOMWindowShell.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/features.gypi
Source/WebKit/chromium/public/WebRuntimeFeatures.h
Source/WebKit/chromium/src/WebRuntimeFeatures.cpp
Tools/ChangeLog
Tools/DumpRenderTree/chromium/TestShell.cpp

index 9b02eb1..87e8c34 100644 (file)
@@ -1,3 +1,38 @@
+2011-02-09  Nebojsa Ciric  <cira@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Implements Locale object of JavaScript internationalization API proposal, as an
+        v8 extension. Extension code is hosted in v8 project (src/extensions/experimental/i18n-extension.{cc,h})
+        and in this patch we just provide flags, tests and build rules for chromium port.
+        https://bugs.webkit.org/show_bug.cgi?id=49414
+
+        * fast/js/i18n-bindings-locale-expected.txt: Added.
+        * fast/js/i18n-bindings-locale.html: Added.
+        * fast/js/script-tests/i18n-bindings-locale.js: Added.
+        (reportResult):
+        (localeTests.this.defaultLocale):
+        (localeTests.this.baseLocale):
+        (localeTests.this.languageScriptLocale):
+        (localeTests.this.languageScriptRegionLocale):
+        (localeTests.this.languageScriptRegionExtensionLocale):
+        (localeTests.this.languageScriptRegionDashUExtensionLocale):
+        (localeTests.this.availableLocales):
+        (localeTests.this.maximizedLocale):
+        (localeTests.this.maximizedLocaleWithExtension):
+        (localeTests.this.minimizedLocale):
+        (localeTests.this.minimizedLocaleWithExtension):
+        (localeTests.this.displayForBaseLocale):
+        (localeTests.this.displayInSameLocale):
+        (localeTests.this.displayInDifferentLocale):
+        (localeTests.this.displayInCyrillicScript):
+        (localeTests.this.displayInHebrewScript):
+        (localeTests):
+        * platform/gtk/Skipped:
+        * platform/mac/Skipped:
+        * platform/qt/Skipped:
+        * platform/win/Skipped:
+
 2011-02-09  Zhenyao Mo  <zmo@google.com>
 
         Unreviewed, fix a bug in test_expectations.txt.
diff --git a/LayoutTests/fast/js/i18n-bindings-locale-expected.txt b/LayoutTests/fast/js/i18n-bindings-locale-expected.txt
new file mode 100644 (file)
index 0000000..0229f08
--- /dev/null
@@ -0,0 +1,71 @@
+This test checks properties and methods of Locale object.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS en-US is en-US
+PASS en is en
+PASS undefined is undefined
+PASS US is US
+PASS sr is sr
+PASS sr is sr
+PASS undefined is undefined
+PASS undefined is undefined
+PASS zh-Hans is zh-Hans
+PASS zh is zh
+PASS Hans is Hans
+PASS undefined is undefined
+PASS zh-Hans-CN is zh-Hans-CN
+PASS zh is zh
+PASS Hans is Hans
+PASS CN is CN
+PASS de-DE@collation=phone is de-DE@collation=phone
+PASS de is de
+PASS undefined is undefined
+PASS DE is DE
+PASS de-DE-u-co-phonebook is de-DE-u-co-phonebook
+PASS de is de
+PASS undefined is undefined
+PASS DE is DE
+PASS true is true
+PASS true is true
+PASS sr-Cyrl-RS is sr-Cyrl-RS
+PASS sr is sr
+PASS Cyrl is Cyrl
+PASS RS is RS
+PASS de-Latn-DE@collation=phone is de-Latn-DE@collation=phone
+PASS de is de
+PASS Latn is Latn
+PASS DE is DE
+PASS sr is sr
+PASS sr is sr
+PASS undefined is undefined
+PASS undefined is undefined
+PASS de-@collation=phone is de-@collation=phone
+PASS de is de
+PASS undefined is undefined
+PASS undefined is undefined
+PASS English is English
+PASS undefined is undefined
+PASS undefined is undefined
+PASS English is English
+PASS English is English
+PASS Latin is Latin
+PASS United States is United States
+PASS English (Latin, United States) is English (Latin, United States)
+PASS Serbian is Serbian
+PASS Cyrillic is Cyrillic
+PASS Serbia is Serbia
+PASS Serbian (Cyrillic, Serbia) is Serbian (Cyrillic, Serbia)
+PASS Српски is Српски
+PASS Ћирилица is Ћирилица
+PASS Србија is Србија
+PASS Српски (Ћирилица, Србија) is Српски (Ћирилица, Србија)
+PASS עברית is עברית
+PASS עברי is עברי
+PASS ישראל is ישראל
+PASS עברית (עברי, ישראל) is עברית (עברי, ישראל)
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/js/i18n-bindings-locale.html b/LayoutTests/fast/js/i18n-bindings-locale.html
new file mode 100644 (file)
index 0000000..c874805
--- /dev/null
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="stylesheet" href="resources/js-test-style.css">
+<script src="resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/i18n-bindings-locale.js"></script>
+<script src="resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/js/script-tests/i18n-bindings-locale.js b/LayoutTests/fast/js/script-tests/i18n-bindings-locale.js
new file mode 100644 (file)
index 0000000..d4bd4b8
--- /dev/null
@@ -0,0 +1,151 @@
+description(
+
+"This test checks properties and methods of Locale object."
+
+);
+
+function reportResult(_actual, _expected) {
+    if (isResultCorrect(_actual, _expected))
+        testPassed(_actual + ' is ' + _expected);
+    else
+        testFailed(_actual + ' should be ' + _expected);
+}
+
+localeTests = function() {
+    this.defaultLocale = function() {
+        var locale = new v8Locale();
+        reportResult(locale.locale, 'en-US');
+        reportResult(locale.language, 'en');
+        reportResult(locale.script, undefined);
+        reportResult(locale.region, 'US');
+    };
+
+    this.baseLocale = function() {
+        var locale = new v8Locale('sr');
+        reportResult(locale.locale, 'sr');
+        reportResult(locale.language, 'sr');
+        reportResult(locale.script, undefined);
+        reportResult(locale.region, undefined);
+    };
+
+    this.languageScriptLocale = function() {
+        var locale = new v8Locale('zh-Hans');
+        reportResult(locale.locale, 'zh-Hans');
+        reportResult(locale.language, 'zh');
+        reportResult(locale.script, 'Hans');
+        reportResult(locale.region, undefined);
+    };
+
+    this.languageScriptRegionLocale = function() {
+        var locale = new v8Locale('zh-Hans-CN');
+        reportResult(locale.locale, 'zh-Hans-CN');
+        reportResult(locale.language, 'zh');
+        reportResult(locale.script, 'Hans');
+        reportResult(locale.region, 'CN');
+    };
+
+    this.languageScriptRegionExtensionLocale = function() {
+        var locale = new v8Locale('de-DE@collation=phone');
+        reportResult(locale.locale, 'de-DE@collation=phone');
+        reportResult(locale.language, 'de');
+        reportResult(locale.script, undefined);
+        reportResult(locale.region, 'DE');
+    };
+
+    this.languageScriptRegionDashUExtensionLocale = function() {
+        var locale = new v8Locale('de-DE-u-co-phonebook');
+        reportResult(locale.locale, 'de-DE-u-co-phonebook');
+        reportResult(locale.language, 'de');
+        reportResult(locale.script, undefined);
+        reportResult(locale.region, 'DE');
+    };
+  
+    this.availableLocales = function() {
+        var locales = v8Locale.availableLocales();
+        reportResult(locales.length > 100, true);
+        reportResult(locales.join().indexOf('sr') >= 0, true);
+    };
+  
+    this.maximizedLocale = function() {
+        var locale = new v8Locale('sr').maximizedLocale();
+        reportResult(locale.locale, 'sr-Cyrl-RS');
+        reportResult(locale.language, 'sr');
+        reportResult(locale.script, 'Cyrl');
+        reportResult(locale.region, 'RS');
+    };
+  
+    this.maximizedLocaleWithExtension = function() {
+        var locale = new v8Locale('de@collation=phone').maximizedLocale();
+        reportResult(locale.locale, 'de-Latn-DE@collation=phone');
+        reportResult(locale.language, 'de');
+        reportResult(locale.script, 'Latn');
+        reportResult(locale.region, 'DE');
+    };
+  
+    this.minimizedLocale = function() {
+        var locale = new v8Locale('sr-Cyrl-RS').minimizedLocale();
+        reportResult(locale.locale, 'sr');
+        reportResult(locale.language, 'sr');
+        reportResult(locale.script, undefined);
+        reportResult(locale.region, undefined);
+    };
+  
+    this.minimizedLocaleWithExtension = function() {
+        var locale = new v8Locale('de-Latn-DE@collation=phone').minimizedLocale();
+        // FIXME: Fix ICU to return de@collation=phone.
+        reportResult(locale.locale, 'de-@collation=phone');
+        reportResult(locale.language, 'de');
+        reportResult(locale.script, undefined);
+        reportResult(locale.region, undefined);
+    };
+    
+    this.displayForBaseLocale = function() {
+        var locale = new v8Locale('en');
+        reportResult(locale.displayLanguage(), 'English');
+        reportResult(locale.displayScript(), undefined);
+        reportResult(locale.displayRegion(), undefined);
+        reportResult(locale.displayName(), 'English');
+    };
+  
+    this.displayInSameLocale = function() {
+        var locale = new v8Locale('en').maximizedLocale();
+        reportResult(locale.displayLanguage(), 'English');
+        reportResult(locale.displayScript(), 'Latin');
+        reportResult(locale.displayRegion(), 'United States');
+        reportResult(locale.displayName(), 'English (Latin, United States)');
+    };
+  
+    this.displayInDifferentLocale = function() {
+        var locale = new v8Locale('sr').maximizedLocale();
+        var displayLocale = new v8Locale('en');
+        reportResult(locale.displayLanguage(displayLocale), 'Serbian');
+        reportResult(locale.displayScript(displayLocale), 'Cyrillic');
+        reportResult(locale.displayRegion(displayLocale), 'Serbia');
+        reportResult(locale.displayName(displayLocale), 'Serbian (Cyrillic, Serbia)');
+    };
+  
+    this.displayInCyrillicScript = function() {
+        var locale = new v8Locale('sr').maximizedLocale();
+        reportResult(locale.displayLanguage(), 'Српски');
+        reportResult(locale.displayScript(), 'Ћирилица');
+        reportResult(locale.displayRegion(), 'Србија');
+        reportResult(locale.displayName(), 'Српски (Ћирилица, Србија)');
+    };
+  
+    this.displayInHebrewScript = function() {
+        var locale = new v8Locale('he').maximizedLocale();
+        reportResult(locale.displayLanguage(), 'עברית');
+        reportResult(locale.displayScript(), 'עברי');
+        reportResult(locale.displayRegion(), 'ישראל');
+        reportResult(locale.displayName(), 'עברית (עברי, ישראל)');
+    };
+};
+
+(function() {
+    var allTests = new localeTests();
+    for (var test in allTests) {
+        allTests[test]();
+    }
+})();
+
+var successfullyParsed = true;
\ No newline at end of file
index acbcc4a..20fdc9a 100644 (file)
@@ -1387,6 +1387,9 @@ fast/xsl/xslt-missing-namespace-in-xslt.xml
 fast/xsl/xslt-relative-path.xml
 fast/xsl/xslt_unicode.xml
 
+# This port doesn't support v8 i18n extension.
+fast/js/i18n-bindings-locale.html
+
 # Tests in http/ directory
 #   Tests failing
 http/tests/appcache/crash-when-navigating-away-then-back.html
index 939ba42..1627c67 100644 (file)
@@ -281,6 +281,12 @@ animations/stop-animation-on-suspend.html
 # DRT does not support toggling caret browsing on / off
 editing/selection/caret-mode-paragraph-keys-navigation.html
 
+# This test is failing on the Leopard Intel Debug buildbot
+# https://bugs.webkit.org/show_bug.cgi?id=51807
+fast/blockflow/broken-ideograph-small-caps.html
+
 # Request ENABLE(REQUEST_ANIMATION_FRAME) support
 fast/animation
 
+# This port doesn't support v8 i18n extension.
+fast/js/i18n-bindings-locale.html
index 8c68465..61df521 100644 (file)
@@ -102,6 +102,9 @@ fast/text/hyphens.html
 # https://bugs.webkit.org/show_bug.cgi?id=43332
 inspector/dom-breakpoints.html
 
+# This port doesn't support v8 i18n extension.
+fast/js/i18n-bindings-locale.html
+
 # =========================================================================== #
 #       Drag and Drop Support in DRT.                                         #
 # =========================================================================== #
index 22c09af..ff9aa16 100644 (file)
@@ -1131,3 +1131,5 @@ http/tests/loading/cross-origin-XHR-willLoadRequest.html
 # Request ENABLE(REQUEST_ANIMATION_FRAME) support
 fast/animation
 
+# This port doesn't support v8 i18n extension.
+fast/js/i18n-bindings-locale.html
index 1336870..3224ca9 100644 (file)
@@ -1,3 +1,22 @@
+2011-02-09  Nebojsa Ciric  <cira@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Implements Locale object of JavaScript internationalization API proposal, as an
+        v8 extension. Extension code is hosted in v8 project (src/extensions/experimental/i18n-extension.{cc,h})
+        and in this patch we just provide flags, tests and build rules for chromium port.
+        https://bugs.webkit.org/show_bug.cgi?id=49414
+
+        Test: fast/js/i18n-bindings-locale.html
+
+        * WebCore.gyp/WebCore.gyp:
+        * bindings/generic/RuntimeEnabledFeatures.cpp:
+        (WebCore::RuntimeEnabledFeatures::experimentalI18NAPIEnabled):
+        * bindings/generic/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::setExperimentalI18NAPIEnabled):
+        * bindings/v8/V8DOMWindowShell.cpp:
+        (WebCore::V8DOMWindowShell::createNewContext):
+
 2011-02-08  Dimitri Glazkov  <dglazkov@chromium.org>
 
         Reviewed by Darin Adler.
index 8542ad5..0d8d06b 100644 (file)
@@ -45,7 +45,9 @@
       },
     },{
       # WebKit is checked out in src/chromium/third_party/WebKit
-      'variables': {'chromium_src_dir': '../../../../..'},
+      'variables': {
+        'chromium_src_dir': '../../../../..',
+      },
     }],
     ['OS == "mac"', {
       'targets': [
     # binary and increasing the speed of gdb.
     'enable_svg%': 1,
 
+    # Use v8 as default JavaScript engine. This makes sure that javascript_engine variable
+    # is set for both inside_chromium_build 0 and 1 cases.
+    'javascript_engine%': 'v8',
+
     'webcore_include_dirs': [
       '../',
       '../accessibility',
             ['exclude', '/(Windows|Uniscribe)[^/]*\\.cpp$']
           ],
         }],
+        ['javascript_engine=="v8"', {
+          'dependencies': [
+            '<(chromium_src_dir)/v8/src/extensions/experimental/experimental.gyp:i18n_api',
+          ],
+        }],
       ],
     },
     {
index dadcc1c..14e4ac8 100644 (file)
@@ -69,6 +69,15 @@ bool RuntimeEnabledFeatures::fileSystemEnabled()
 }
 #endif
 
+#if ENABLE(JAVASCRIPT_I18N_API)
+bool RuntimeEnabledFeatures::isJavaScriptI18NAPIEnabled = false;
+
+bool RuntimeEnabledFeatures::javaScriptI18NAPIEnabled()
+{
+    return isJavaScriptI18NAPIEnabled;
+}
+#endif
+
 #if ENABLE(VIDEO)
 
 bool RuntimeEnabledFeatures::audioEnabled()
index f2249c7..4775634 100644 (file)
@@ -169,6 +169,11 @@ public:
     static void setFileSystemEnabled(bool isEnabled) { isFileSystemEnabled = isEnabled; }
 #endif
 
+#if ENABLE(JAVASCRIPT_I18N_API)
+    static bool javaScriptI18NAPIEnabled();
+    static void setJavaScriptI18NAPIEnabled(bool isEnabled) { isJavaScriptI18NAPIEnabled = isEnabled; }
+#endif
+
 private:
     // Never instantiate.
     RuntimeEnabledFeatures() { }
@@ -193,6 +198,10 @@ private:
 #if ENABLE(FILE_SYSTEM)
     static bool isFileSystemEnabled;
 #endif
+
+#if ENABLE(JAVASCRIPT_I18N_API)
+    static bool isJavaScriptI18NAPIEnabled;
+#endif
 };
 
 } // namespace WebCore
index 1ef3680..40312da 100644 (file)
@@ -39,6 +39,7 @@
 #include "FrameLoaderClient.h"
 #include "Page.h"
 #include "PageGroup.h"
+#include "RuntimeEnabledFeatures.h"
 #include "ScriptCallStack.h"
 #include "ScriptCallStackFactory.h"
 #include "ScriptController.h"
 #include <utility>
 #include <v8-debug.h>
 #include <v8.h>
+
+#if ENABLE(JAVASCRIPT_I18N_API)
+#include <v8/src/extensions/experimental/i18n-extension.h>
+#endif
+
 #include <wtf/Assertions.h>
 #include <wtf/OwnArrayPtr.h>
 #include <wtf/StdLibExtras.h>
@@ -356,6 +362,12 @@ v8::Persistent<v8::Context> V8DOMWindowShell::createNewContext(v8::Handle<v8::Ob
     if (!V8Proxy::registeredExtensionWithV8(DateExtension::get()))
         V8Proxy::registerExtension(DateExtension::get());
 
+#if ENABLE(JAVASCRIPT_I18N_API)
+    // Enables experimental i18n API in V8.
+    if (RuntimeEnabledFeatures::javaScriptI18NAPIEnabled() && !V8Proxy::registeredExtensionWithV8(v8::internal::I18NExtension::get()))
+        V8Proxy::registerExtension(v8::internal::I18NExtension::get());
+#endif
+
     // Dynamically tell v8 about our extensions now.
     const V8Extensions& extensions = V8Proxy::extensions();
     OwnArrayPtr<const char*> extensionNames = adoptArrayPtr(new const char*[extensions.size()]);
index 0b69480..5603035 100644 (file)
@@ -1,3 +1,18 @@
+2011-02-09  Nebojsa Ciric  <cira@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Implements Locale object of JavaScript internationalization API proposal, as an
+        v8 extension. Extension code is hosted in v8 project (src/extensions/experimental/i18n-extension.{cc,h})
+        and in this patch we just provide flags, tests and build rules for chromium port.
+        https://bugs.webkit.org/show_bug.cgi?id=49414
+
+        * features.gypi:
+        * public/WebRuntimeFeatures.h:
+        * src/WebRuntimeFeatures.cpp:
+        (WebKit::WebRuntimeFeatures::enableExperimentalI18NAPI):
+        (WebKit::WebRuntimeFeatures::isExperimentalI18NAPIEnabled):
+
 2011-02-09  MORITA Hajime  <morrita@google.com>
 
         Reviewed by Shinichiro Hamaji.
index d2184cf..8944fde 100644 (file)
@@ -53,6 +53,7 @@
         'ENABLE_DIRECTORY_UPLOAD=1',
         'ENABLE_DOM_STORAGE=1',
         'ENABLE_EVENTSOURCE=1',
+        'ENABLE_JAVASCRIPT_I18N_API=1',
         'ENABLE_FILE_SYSTEM=1',
         'ENABLE_FILTERS=1',
         'ENABLE_GEOLOCATION=1',
index a078923..c9e32f5 100644 (file)
@@ -96,6 +96,9 @@ public:
 
     WEBKIT_API static void enableFileSystem(bool);
     WEBKIT_API static bool isFileSystemEnabled();
+    
+    WEBKIT_API static void enableJavaScriptI18NAPI(bool);
+    WEBKIT_API static bool isJavaScriptI18NAPIEnabled();
 
 private:
     WebRuntimeFeatures();
index 6d2bbd4..e3ece6e 100644 (file)
@@ -304,4 +304,20 @@ bool WebRuntimeFeatures::isFileSystemEnabled()
 #endif
 }
 
+void WebRuntimeFeatures::enableJavaScriptI18NAPI(bool enable)
+{
+#if ENABLE(JAVASCRIPT_I18N_API)
+    RuntimeEnabledFeatures::setJavaScriptI18NAPIEnabled(enable);
+#endif
+}
+
+bool WebRuntimeFeatures::isJavaScriptI18NAPIEnabled()
+{
+#if ENABLE(JAVASCRIPT_I18N_API)
+    return RuntimeEnabledFeatures::javaScriptI18NAPIEnabled();
+#else
+    return false;
+#endif
+}
+
 } // namespace WebKit
index 75e473d..56b2571 100644 (file)
@@ -1,3 +1,15 @@
+2011-02-09  Nebojsa Ciric  <cira@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Implements Locale object of JavaScript internationalization API proposal, as an
+        v8 extension. Extension code is hosted in v8 project (src/extensions/experimental/i18n-extension.{cc,h})
+        and in this patch we just provide flags, tests and build rules for chromium port.
+        https://bugs.webkit.org/show_bug.cgi?id=49414
+
+        * DumpRenderTree/chromium/TestShell.cpp:
+        (TestShell::TestShell):
+
 2011-02-09  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
 
         Reviewed by Kenneth Rohde Christiansen.
index ec6a502..11a598f 100644 (file)
@@ -93,6 +93,7 @@ TestShell::TestShell(bool testShellMode)
     WebRuntimeFeatures::enableGeolocation(true);
     WebRuntimeFeatures::enableIndexedDatabase(true);
     WebRuntimeFeatures::enableFileSystem(true);
+    WebRuntimeFeatures::enableJavaScriptI18NAPI(true);
     m_accessibilityController.set(new AccessibilityController(this));
     m_layoutTestController.set(new LayoutTestController(this));
     m_eventSender.set(new EventSender(this));