[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

jorlow at chromium.org jorlow at chromium.org
Wed Dec 22 14:43:45 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 5ed5504b3d2ea4cb7a23ac4645894a0a2d7403d8
Author: jorlow at chromium.org <jorlow at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Oct 18 19:15:34 2010 +0000

    2010-10-18  Jeremy Orlow  <jorlow at chromium.org>
    
            Reviewed by Darin Adler.
    
            DOMStringList should return null if the index is out of range
            https://bugs.webkit.org/show_bug.cgi?id=47829
    
            Add tests for out of range behavior here since IndexedDB is the only user
            of DOMStringList.
    
            * storage/indexeddb/database-basics-expected.txt:
            * storage/indexeddb/database-basics.html:
            * storage/indexeddb/objectstore-basics-expected.txt:
            * storage/indexeddb/objectstore-basics.html:
    2010-10-18  Jeremy Orlow  <jorlow at chromium.org>
    
            Reviewed by Darin Adler.
    
            DOMStringList should return null if the index is out of range
            https://bugs.webkit.org/show_bug.cgi?id=47829
    
            When item() returns a null string, it needs to be passed to JS as
            null. The indexed getter will then magically do the right thing.
            So all that's left is having DOMStringList::item() return null when
            the index is out of bounds.
    
            * dom/DOMStringList.cpp:
            (WebCore::DOMStringList::item):
            * dom/DOMStringList.h:
            * dom/DOMStringList.idl:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69983 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 0757180..9fa6825 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
+2010-10-18  Jeremy Orlow  <jorlow at chromium.org>
+
+        Reviewed by Darin Adler.
+
+        DOMStringList should return null if the index is out of range
+        https://bugs.webkit.org/show_bug.cgi?id=47829
+
+        Add tests for out of range behavior here since IndexedDB is the only user
+        of DOMStringList.
+
+        * storage/indexeddb/database-basics-expected.txt:
+        * storage/indexeddb/database-basics.html:
+        * storage/indexeddb/objectstore-basics-expected.txt:
+        * storage/indexeddb/objectstore-basics.html:
+
 2010-10-18  Ryosuke Niwa  <rniwa at webkit.org>
 
         Reviewed by Kent Tamura.
diff --git a/LayoutTests/storage/indexeddb/database-basics-expected.txt b/LayoutTests/storage/indexeddb/database-basics-expected.txt
index b0674ad..2a5fa2f 100644
--- a/LayoutTests/storage/indexeddb/database-basics-expected.txt
+++ b/LayoutTests/storage/indexeddb/database-basics-expected.txt
@@ -82,6 +82,8 @@ PASS db.name is "name"
 PASS db.objectStores is []
 PASS db.objectStores.length is 0
 PASS db.objectStores.contains('') is false
+PASS db.objectStores[0] is null
+PASS db.objectStores.item(0) is null
 db.createObjectStore("test123")
 PASS db.objectStores is ['test123']
 PASS db.objectStores.length is 1
diff --git a/LayoutTests/storage/indexeddb/database-basics.html b/LayoutTests/storage/indexeddb/database-basics.html
index 2738c59..db2d289 100644
--- a/LayoutTests/storage/indexeddb/database-basics.html
+++ b/LayoutTests/storage/indexeddb/database-basics.html
@@ -71,6 +71,8 @@ function createObjectStore()
     shouldBe("db.objectStores", "[]");
     shouldBe("db.objectStores.length", "0");
     shouldBe("db.objectStores.contains('')", "false");
+    shouldBeNull("db.objectStores[0]");
+    shouldBeNull("db.objectStores.item(0)");
 
     objectStore = evalAndLog('db.createObjectStore("test123")');
     checkObjectStore();
diff --git a/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt b/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
index e534e2e..d22e6f0 100644
--- a/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
+++ b/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
@@ -90,6 +90,11 @@ PASS store.indexNames.length is 1
 PASS store.indexNames.contains('') is false
 PASS store.indexNames.contains('indexFail') is false
 PASS store.indexNames.contains('indexName') is true
+PASS store.indexNames[0] is "indexName"
+PASS store.indexNames[1] is null
+PASS store.indexNames[100] is null
+PASS store.indexNames.item(1) is null
+PASS store.indexNames.item(100) is null
 transaction = db.transaction()
 store = transaction.objectStore('storeName')
 store.add({x: 'value'}, 'key')
diff --git a/LayoutTests/storage/indexeddb/objectstore-basics.html b/LayoutTests/storage/indexeddb/objectstore-basics.html
index 77e33b0..957dfaa 100644
--- a/LayoutTests/storage/indexeddb/objectstore-basics.html
+++ b/LayoutTests/storage/indexeddb/objectstore-basics.html
@@ -128,6 +128,11 @@ function checkMetadata()
     shouldBe("store.indexNames.contains('')", "false");
     shouldBe("store.indexNames.contains('indexFail')", "false");
     shouldBe("store.indexNames.contains('indexName')", "true");
+    shouldBeEqualToString("store.indexNames[0]", "indexName");
+    shouldBeNull("store.indexNames[1]");
+    shouldBeNull("store.indexNames[100]");
+    shouldBeNull("store.indexNames.item(1)");
+    shouldBeNull("store.indexNames.item(100)");
     addData();
 }
 
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 3bf9911..06c6fdf 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-10-18  Jeremy Orlow  <jorlow at chromium.org>
+
+        Reviewed by Darin Adler.
+
+        DOMStringList should return null if the index is out of range
+        https://bugs.webkit.org/show_bug.cgi?id=47829
+
+        When item() returns a null string, it needs to be passed to JS as
+        null. The indexed getter will then magically do the right thing.
+        So all that's left is having DOMStringList::item() return null when
+        the index is out of bounds.
+
+        * dom/DOMStringList.cpp:
+        (WebCore::DOMStringList::item):
+        * dom/DOMStringList.h:
+        * dom/DOMStringList.idl:
+
 2010-10-18  Girish Ramakrishnan  <girish at forwardbias.in>
 
         Reviewed by Ariya Hidayat.
diff --git a/WebCore/dom/DOMStringList.cpp b/WebCore/dom/DOMStringList.cpp
index 660be92..430265a 100644
--- a/WebCore/dom/DOMStringList.cpp
+++ b/WebCore/dom/DOMStringList.cpp
@@ -28,6 +28,13 @@
 
 namespace WebCore {
 
+String DOMStringList::item(unsigned index) const
+{
+    if (index >= m_strings.size())
+        return String();
+    return m_strings[index];
+}
+
 bool DOMStringList::contains(const String& string) const
 {
     // FIXME: Currently, all consumers of DOMStringList store fairly small lists and thus an O(n)
diff --git a/WebCore/dom/DOMStringList.h b/WebCore/dom/DOMStringList.h
index a3f9b40..6719f17 100644
--- a/WebCore/dom/DOMStringList.h
+++ b/WebCore/dom/DOMStringList.h
@@ -48,7 +48,7 @@ public:
 
     // Implements the IDL.
     size_t length() const { return m_strings.size(); }
-    String item(unsigned index) const { return m_strings[index]; }
+    String item(unsigned index) const;
     bool contains(const String& str) const;
 
 private:
diff --git a/WebCore/dom/DOMStringList.idl b/WebCore/dom/DOMStringList.idl
index 271c9de..c9e5c29 100644
--- a/WebCore/dom/DOMStringList.idl
+++ b/WebCore/dom/DOMStringList.idl
@@ -30,7 +30,7 @@ module core {
         HasIndexGetter
     ] DOMStringList {
         readonly attribute unsigned long length;
-        DOMString item(in [IsIndex] unsigned long index);
+        [ConvertNullStringTo=Null] DOMString item(in [IsIndex] unsigned long index);
         boolean contains(in DOMString string);
     };
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list