[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

eric at webkit.org eric at webkit.org
Thu Oct 29 20:41:09 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit d345fc33d14427dcfa6d381dba8cd0bfa76cbbf3
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 7 17:47:53 2009 +0000

    2009-10-07  Evan Martin  <evan at chromium.org>
    
            Reviewed by Darin Adler.
    
            Layout test for verifying that LC_NUMERIC setting doesn't affect
            the way CSS properties are stringified.
            https://bugs.webkit.org/show_bug.cgi?id=18994
    
            * fast/css/opacity-float-expected.txt: Added.
            * fast/css/opacity-float.html: Added.
    2009-10-07  Evan Martin  <evan at chromium.org>
    
            Reviewed by Darin Adler.
    
            Add API to LayoutTestController for re/setting the system locale.
            https://bugs.webkit.org/show_bug.cgi?id=18994
    
            * DumpRenderTree/LayoutTestController.cpp:
            (setLocaleCallback):
            (LayoutTestController::staticFunctions):
            (LayoutTestController::setLocale):
            * DumpRenderTree/LayoutTestController.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49253 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index ed701f8..86f65d2 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2009-10-07  Evan Martin  <evan at chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Layout test for verifying that LC_NUMERIC setting doesn't affect
+        the way CSS properties are stringified.
+        https://bugs.webkit.org/show_bug.cgi?id=18994
+
+        * fast/css/opacity-float-expected.txt: Added.
+        * fast/css/opacity-float.html: Added.
+
 2009-10-07  Xan Lopez  <xlopez at igalia.com>
 
         Skip two new tests for which we are missing results.
diff --git a/LayoutTests/fast/css/opacity-float-expected.txt b/LayoutTests/fast/css/opacity-float-expected.txt
new file mode 100644
index 0000000..f65ad1f
--- /dev/null
+++ b/LayoutTests/fast/css/opacity-float-expected.txt
@@ -0,0 +1,3 @@
+This test verifies that reading a floating-point opacity from CSS attributes gets back a properly-formatted float. Improperly handling locales that cause decimals to be written as commas might break it.
+
+PASS
diff --git a/LayoutTests/fast/css/opacity-float.html b/LayoutTests/fast/css/opacity-float.html
new file mode 100644
index 0000000..0ef0456
--- /dev/null
+++ b/LayoutTests/fast/css/opacity-float.html
@@ -0,0 +1,23 @@
+<script>
+if (window.layoutTestController) {
+    layoutTestController.dumpAsText();
+
+    // Put ourselves in a locale where 0.9 is written as "0,9".
+    layoutTestController.setPOSIXLocale("pl_PL.UTF-8");
+}
+</script>
+
+<p>This test verifies that reading a floating-point opacity from CSS
+attributes gets back a properly-formatted float.  Improperly handling
+locales that cause decimals to be written as commas might break
+it.</p>
+
+<a id='test' style='opacity:.9'></a>
+
+<script>
+var opacity = document.getElementById('test').style.opacity.toString();
+if (opacity == '0.9')
+    document.write('PASS');
+else
+    document.write('FAIL: ' + opacity);
+</script>
diff --git a/LayoutTests/platform/mac/fast/css/opacity-float-expected.txt b/LayoutTests/platform/mac/fast/css/opacity-float-expected.txt
new file mode 100644
index 0000000..b81983d
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/css/opacity-float-expected.txt
@@ -0,0 +1,3 @@
+This test verifies that reading a floating-point opacity from CSS attributes gets back a properly-formatted float. Improperly handling locales that cause decimals to be written as commas might break it.
+
+FAIL: 0,9
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index c27386b..8478baf 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,16 @@
+2009-10-07  Evan Martin  <evan at chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Add API to LayoutTestController for re/setting the system locale.
+        https://bugs.webkit.org/show_bug.cgi?id=18994
+
+        * DumpRenderTree/LayoutTestController.cpp:
+        (setLocaleCallback):
+        (LayoutTestController::staticFunctions):
+        (LayoutTestController::setLocale):
+        * DumpRenderTree/LayoutTestController.h:
+
 2009-10-06  Shinichiro Hamaji  <hamaji at chromium.org>
 
         Reviewed by Jan Alonzo.
diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/LayoutTestController.cpp
index 51253f3..1f34325 100644
--- a/WebKitTools/DumpRenderTree/LayoutTestController.cpp
+++ b/WebKitTools/DumpRenderTree/LayoutTestController.cpp
@@ -724,6 +724,19 @@ static JSValueRef setHandlesAuthenticationChallengesCallback(JSContextRef contex
     return JSValueMakeUndefined(context);
 }
 
+static JSValueRef setPOSIXLocaleCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    if (argumentCount < 1)
+        return JSValueMakeUndefined(context);
+
+    LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+    JSRetainPtr<JSStringRef> locale(Adopt, JSValueToStringCopy(context, arguments[0], exception));
+    ASSERT(!*exception);
+    controller->setPOSIXLocale(locale.get());
+
+    return JSValueMakeUndefined(context);
+}
+
 static JSValueRef setIconDatabaseEnabledCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
     // Has mac & windows implementation
@@ -1195,6 +1208,7 @@ JSStaticFunction* LayoutTestController::staticFunctions()
         { "setDatabaseQuota", setDatabaseQuotaCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 
         { "setGeolocationPermission", setGeolocationPermissionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setHandlesAuthenticationChallenges", setHandlesAuthenticationChallengesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "setPOSIXLocale", setPOSIXLocaleCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setIconDatabaseEnabled", setIconDatabaseEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setJavaScriptProfilingEnabled", setJavaScriptProfilingEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "setMainFrameIsFirstResponder", setMainFrameIsFirstResponderCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
@@ -1281,3 +1295,10 @@ void LayoutTestController::setGeolocationPermission(bool allow)
     m_isGeolocationPermissionSet = true;
     m_geolocationPermission = allow;
 }
+
+void LayoutTestController::setPOSIXLocale(JSStringRef locale)
+{
+    char localeBuf[32];
+    JSStringGetUTF8CString(locale, localeBuf, sizeof(localeBuf));
+    setlocale(LC_ALL, localeBuf);
+}
diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.h b/WebKitTools/DumpRenderTree/LayoutTestController.h
index 02f5ddb..7c829ef 100644
--- a/WebKitTools/DumpRenderTree/LayoutTestController.h
+++ b/WebKitTools/DumpRenderTree/LayoutTestController.h
@@ -207,6 +207,8 @@ public:
     void closeWebInspector();
     void evaluateInWebInspector(long callId, JSStringRef script);
 
+    void setPOSIXLocale(JSStringRef locale);
+
 private:
     bool m_dumpAsPDF;
     bool m_dumpAsText;
diff --git a/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
index 5468a4f..6ecd774 100644
--- a/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
@@ -334,6 +334,8 @@ static void resetDefaultsToConsistentValues()
     g_object_set(G_OBJECT(inspector), "javascript-profiling-enabled", FALSE, NULL);
 
     webkit_reset_origin_access_white_lists();
+
+    setlocale(LC_ALL, "");
 }
 
 void dump()
diff --git a/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm b/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
index 8d79c6e..0c33381 100644
--- a/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
+++ b/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
@@ -443,6 +443,8 @@ static void resetDefaultsToConsistentValues()
         [preferences setAcceleratedCompositingEnabled:YES];
 
     [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain];
+
+    setlocale(LC_ALL, "");
 }
 
 // Called once on DumpRenderTree startup.
diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp
index c5a1015..83626ac 100644
--- a/WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp
+++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp
@@ -286,6 +286,8 @@ void DumpRenderTree::resetToConsistentStateBeforeTesting()
 
     m_controller->reset();
     QWebSecurityOrigin::resetOriginAccessWhiteLists();
+
+    setlocale(LC_ALL, "");
 }
 
 void DumpRenderTree::open(const QUrl& aurl)
diff --git a/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp
index e47c7e8..4ff45a2 100644
--- a/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp
+++ b/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp
@@ -743,6 +743,8 @@ static void resetDefaultsToConsistentValues(IWebPreferences* preferences)
         prefsPrivate->setOfflineWebApplicationCacheEnabled(TRUE);
     }
     setAlwaysAcceptCookies(false);
+
+    setlocale(LC_ALL, "");
 }
 
 static void resetWebViewToConsistentStateBeforeTesting()

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list