[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.21-584-g1e41756

dumi at chromium.org dumi at chromium.org
Fri Feb 26 22:23:16 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit dcd49476d18eb8d733dd97b5373cc26855037f03
Author: dumi at chromium.org <dumi at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Feb 17 22:29:41 2010 +0000

    WebCore: Fix Chromium's bindings for Database.transaction(): a 'null'
    callback should be treated as no callback.
    
    Reviewed by Dimitri Glazkov.
    
    Test: storage/null-callbacks.html
    
    https://bugs.webkit.org/show_bug.cgi?id=35047
    
    * bindings/v8/custom/V8DatabaseCustom.cpp:
    (WebCore::createTransaction):
    
    LayoutTests: Add a test that verifies that null transaction callbacks are
    accepted and treated as no callbacks.
    
    Reviewed by Dimitri Glazkov.
    
    https://bugs.webkit.org/show_bug.cgi?id=35047
    
    * storage/null-callbacks-expected.txt: Added.
    * storage/null-callbacks.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54910 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 61b1257..9734438 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2010-02-17  Dumitru Daniliuc  <dumi at chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Add a test that verifies that null transaction callbacks are
+        accepted and treated as no callbacks.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35047
+
+        * storage/null-callbacks-expected.txt: Added.
+        * storage/null-callbacks.html: Added.
+
 2010-02-17  Dirk Schulze  <krit at webkit.org>
 
         Reviewed by Nikolas Zimmermann.
diff --git a/LayoutTests/storage/null-callbacks-expected.txt b/LayoutTests/storage/null-callbacks-expected.txt
new file mode 100644
index 0000000..8311675
--- /dev/null
+++ b/LayoutTests/storage/null-callbacks-expected.txt
@@ -0,0 +1,2 @@
+This test checks that 'null' can be used wherever we expect an optional callback.
+PASS
diff --git a/LayoutTests/storage/null-callbacks.html b/LayoutTests/storage/null-callbacks.html
new file mode 100644
index 0000000..4ca0e1c
--- /dev/null
+++ b/LayoutTests/storage/null-callbacks.html
@@ -0,0 +1,46 @@
+<html>
+<head>
+<script>
+function finishTest()
+{
+    if (window.layoutTestController)
+        layoutTestController.notifyDone();
+}
+
+function runTest()
+{
+    if (window.layoutTestController) {
+        layoutTestController.clearAllDatabases();
+        layoutTestController.dumpAsText();
+        layoutTestController.waitUntilDone();
+    }
+
+    try {
+        var db = openDatabase("NullCallbacks", "1.0", "Test for null callbacks.", 1);
+        db.transaction(function(tx) {
+            tx.executeSql("CREATE TABLE IF NOT EXISTS Test (Foo INT)", null);
+            tx.executeSql("INSERT INTO Test VALUES (?)", [1], null, null);
+            tx.executeSql("INSERT INTO Test VALUES (?)", [2], null);
+            tx.executeSql("INSERT INTO Test VALUES (3)", null, null, null);
+            tx.executeSql("INSERT INTO Test VALUES (?)", [4], null,
+                function(tx, error) {});
+        }, null, null);
+
+        db.transaction(function(tx) {
+            tx.executeSql("INSERT INTO Test VALUES (?)", [5]);
+        }, null, function() { finishTest(); });
+    } catch(err) {
+        document.getElementById("console").innerHTML = "FAIL";
+        finishTest();
+    }
+}
+
+</script>
+</head>
+
+<body onload="runTest()">
+This test checks that 'null' can be used wherever we expect an optional callback.
+<pre id="console">PASS</pre>
+</body>
+
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index e64ca8d..335b146 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-02-17  Dumitru Daniliuc  <dumi at chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Fix Chromium's bindings for Database.transaction(): a 'null'
+        callback should be treated as no callback.
+
+        Test: storage/null-callbacks.html
+
+        https://bugs.webkit.org/show_bug.cgi?id=35047
+
+        * bindings/v8/custom/V8DatabaseCustom.cpp:
+        (WebCore::createTransaction):
+
 2010-02-17  Dirk Schulze  <krit at webkit.org>
 
         Reviewed by Nikolas Zimmermann.
diff --git a/WebCore/bindings/v8/custom/V8DatabaseCustom.cpp b/WebCore/bindings/v8/custom/V8DatabaseCustom.cpp
index abd6ff6..9915d77 100644
--- a/WebCore/bindings/v8/custom/V8DatabaseCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DatabaseCustom.cpp
@@ -104,7 +104,7 @@ static v8::Handle<v8::Value> createTransaction(const v8::Arguments& args, bool r
     RefPtr<V8CustomSQLTransactionCallback> callback = V8CustomSQLTransactionCallback::create(args[0], frame);
 
     RefPtr<V8CustomSQLTransactionErrorCallback> errorCallback;
-    if (args.Length() > 1) {
+    if (args.Length() > 1 && !isUndefinedOrNull(args[1])) {
         if (!args[1]->IsObject())
             return throwError("Transaction error callback must be of valid type.");
 
@@ -112,7 +112,7 @@ static v8::Handle<v8::Value> createTransaction(const v8::Arguments& args, bool r
     }
 
     RefPtr<V8CustomVoidCallback> successCallback;
-    if (args.Length() > 2) {
+    if (args.Length() > 2 && !isUndefinedOrNull(args[2])) {
         if (!args[2]->IsObject())
             return throwError("Transaction success callback must be of valid type.");
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list