Location.ancestorOrigins should return a FrozenArray<USVString>
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 20 Aug 2016 14:44:52 +0000 (14:44 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 20 Aug 2016 14:44:52 +0000 (14:44 +0000)
https://bugs.webkit.org/show_bug.cgi?id=161018

Reviewed by Ryosuke Niwa and Chris Dumez.

Source/JavaScriptCore:

* runtime/ObjectConstructor.h:
(JSC::objectConstructorFreeze):
Export objectConstructorFreeze so it can be used to freeze DOM FrozenArrays.

Source/WebCore:

Updated tests: fast/dom/Window/Location/ancestor-origins.html
               fast/dom/indexed-getters-returning-string.html

* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::createObjectStore):
(WebCore::IDBDatabase::transaction):
(WebCore::IDBDatabase::deleteObjectStore):
* Modules/indexeddb/IDBDatabase.h:
Remove unused ScriptExecutionContext parameter.

* Modules/indexeddb/IDBDatabase.idl:
There is no need for a custom implementation anymore.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
Remove JSDOMStringListCustom.cpp, which is no longer needed.

* bindings/js/JSDOMBinding.cpp:
(WebCore::jsArray): Deleted.
Remove overload of jsArray that took a DOMStringList.

* bindings/js/JSDOMBinding.h:
(WebCore::jsFrozenArray):
Add jsFrozenArray which returns an JSArray which has had the moral
equivalent of Object.freeze() called on it. This follows
http://heycam.github.io/webidl/#es-frozen-array.

* bindings/js/JSDOMStringListCustom.cpp:
Removed.

* bindings/js/JSIDBDatabaseCustom.cpp:
(WebCore::JSIDBDatabase::transaction): Deleted.
Remove no longer necessary custom implementation of transaction.

* bindings/scripts/CodeGenerator.pm:
(IsRefPtrType):
(IsSVGAnimatedType):
(IsSequenceType):
(GetSequenceType):
(IsFrozenArrayType):
(GetFrozenArrayInnerType):
* bindings/scripts/CodeGeneratorJS.pm:
(AreTypesDistinguishableForOverloadResolution):
(GenerateOverloadedFunctionOrConstructor):
(GetNativeType):
(GetNativeVectorInnerType):
(GetNativeTypeForCallbacks):
(JSValueToNative):
(NativeToJSValue):
* bindings/scripts/IDLParser.pm:
(parseNonAnyType):
Add support for FrozenArray, closely matching the sequence code.

* bindings/scripts/test/JS/JSTestCallback.cpp:
* bindings/scripts/test/JS/JSTestCallback.h:
* bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
* bindings/scripts/test/JS/JSTestCallbackFunction.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
Updated bindings test results.

* dom/DOMStringList.idl:
Remove JSCustomToNativeObject, which is no longer needed.

* inspector/InspectorIndexedDBAgent.cpp:
Update calls to IDBDatabase::transaction.

* page/Location.cpp:
(WebCore::Location::ancestorOrigins):
* page/Location.h:
Change ancestorOrigins to return a Vector<String> rather than
a DOMStringList.

* page/Location.idl:
Change ancestorOrigins to return a FrozenArray<USVString>, matching
the HTML5 spec.

LayoutTests:

Update existing tests to account for the change in type of Location.ancestorOrigins.

* fast/dom/Window/Location/ancestor-origins-expected.txt:
* fast/dom/Window/Location/ancestor-origins.html:
* fast/dom/indexed-getters-returning-string-expected.txt:
* fast/dom/indexed-getters-returning-string.html:

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

33 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/Window/Location/ancestor-origins-expected.txt
LayoutTests/fast/dom/Window/Location/ancestor-origins.html
LayoutTests/fast/dom/indexed-getters-returning-string-expected.txt
LayoutTests/fast/dom/indexed-getters-returning-string.html
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/ObjectConstructor.h
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
Source/WebCore/Modules/indexeddb/IDBDatabase.h
Source/WebCore/Modules/indexeddb/IDBDatabase.idl
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSBindingsAllInOne.cpp
Source/WebCore/bindings/js/JSDOMBinding.cpp
Source/WebCore/bindings/js/JSDOMBinding.h
Source/WebCore/bindings/js/JSDOMStringListCustom.cpp [deleted file]
Source/WebCore/bindings/js/JSIDBDatabaseCustom.cpp
Source/WebCore/bindings/scripts/CodeGenerator.pm
Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/IDLParser.pm
Source/WebCore/bindings/scripts/test/JS/JSTestCallback.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestCallback.h
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.h
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp
Source/WebCore/dom/DOMStringList.idl
Source/WebCore/inspector/InspectorIndexedDBAgent.cpp
Source/WebCore/page/Location.cpp
Source/WebCore/page/Location.h
Source/WebCore/page/Location.idl

index 38ba335..4a0f54c 100644 (file)
@@ -1,3 +1,17 @@
+2016-08-19  Sam Weinig  <sam@webkit.org>
+
+        Location.ancestorOrigins should return a FrozenArray<USVString>
+        https://bugs.webkit.org/show_bug.cgi?id=161018
+
+        Reviewed by Ryosuke Niwa and Chris Dumez.
+
+        Update existing tests to account for the change in type of Location.ancestorOrigins.
+
+        * fast/dom/Window/Location/ancestor-origins-expected.txt:
+        * fast/dom/Window/Location/ancestor-origins.html:
+        * fast/dom/indexed-getters-returning-string-expected.txt:
+        * fast/dom/indexed-getters-returning-string.html:
+
 2016-08-19  Dean Jackson  <dino@apple.com>
 
         Implement preferLowPowerToHighPerformance for WebGL
index c4ea9a3..2de6d10 100644 (file)
@@ -1,7 +1,16 @@
-ancestorOrigins.length = 0 
+Test the Location object's ancestorOrigins property.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS window.location.ancestorOrigins is an instance of Array
+PASS window.location.ancestorOrigins.length is 0
+PASS Object.isFrozen(window.location.ancestorOrigins) is true
+PASS window.location.ancestorOrigins === window.location.ancestorOrigins is true
+PASS subframeOrigins is an instance of Array
+PASS subframeOrigins.length is 1
+PASS subframeOrigins[0] is 'file://'
+PASS successfullyParsed is true
+
+TEST COMPLETE
 
---------
-Frame: '<!--framePath //<!--frame0-->-->'
---------
-ancestorOrigins.length = 1
-ancestorOrigins[0] = file://
index 0017800..f9912e5 100644 (file)
@@ -1,16 +1,36 @@
+<head>
+    <script src="../../../../resources/js-test-pre.js"></script>
+    <script src="resources/location-tests-functions.js"></script>
+</head>
+
 <script>
-if (window.testRunner) {
-    testRunner.dumpAsText();
-    testRunner.dumpChildFramesAsText();
+
+self.jsTestIsAsync = true;
+
+description("Test the Location object's ancestorOrigins property.")
+
+shouldBeType("window.location.ancestorOrigins", "Array");
+shouldBe("window.location.ancestorOrigins.length", "0");
+shouldBeTrue("Object.isFrozen(window.location.ancestorOrigins)");
+shouldBeTrue("window.location.ancestorOrigins === window.location.ancestorOrigins");
+
+var subframeOrigins;
+
+window.onmessage = function(event)
+{
+    subframeOrigins = event.data;
+
+    shouldBeType("subframeOrigins", "Array");
+    shouldBe("subframeOrigins.length", "1");
+    shouldBe("subframeOrigins[0]", "'file://'");
+
+    finishJSTest();
 }
 
-var origins = location.ancestorOrigins;
-document.write('ancestorOrigins.length = ' + origins.length);
 </script>
 <iframe srcdoc="
   <script>
-  var origins = location.ancestorOrigins;
-  document.write('ancestorOrigins.length = ' + origins.length + '<br>');
-  document.write('ancestorOrigins[0] = ' + origins[0]);
+    top.postMessage(location.ancestorOrigins, '*')
   </script>
 "></iframe>
+<script src="../../../../resources/js-test-post.js"></script>
index 5b5906b..a7ee662 100644 (file)
@@ -7,9 +7,6 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 DOMTokenList.item()
 PASS document.body.classList.item(666) is null
 PASS document.body.classList[666] is undefined.
-DOMStringList.item()
-PASS location.ancestorOrigins.item(666) is null
-PASS location.ancestorOrigins[666] is undefined.
 Storage.getItem()
 PASS localStorage.getItem(666) is null
 PASS localStorage[666] is undefined.
index b71c2c6..b593ad7 100644 (file)
@@ -11,9 +11,6 @@ debug("* Indexed property getters returning a non-nullable DOMString");
 debug("DOMTokenList.item()");
 shouldBeNull("document.body.classList.item(666)");
 shouldBeUndefined("document.body.classList[666]");
-debug("DOMStringList.item()");
-shouldBeNull("location.ancestorOrigins.item(666)");
-shouldBeUndefined("location.ancestorOrigins[666]");
 debug("Storage.getItem()");
 shouldBeNull("localStorage.getItem(666)");
 shouldBeUndefined("localStorage[666]");
index 84b253a..1758723 100644 (file)
@@ -1,3 +1,14 @@
+2016-08-19  Sam Weinig  <sam@webkit.org>
+
+        Location.ancestorOrigins should return a FrozenArray<USVString>
+        https://bugs.webkit.org/show_bug.cgi?id=161018
+
+        Reviewed by Ryosuke Niwa and Chris Dumez.
+
+        * runtime/ObjectConstructor.h:
+        (JSC::objectConstructorFreeze):
+        Export objectConstructorFreeze so it can be used to freeze DOM FrozenArrays.
+
 2016-08-19  Benjamin Poulain  <bpoulain@apple.com>
 
         [JSC] ArithSqrt should work with any argument type
index 81d85ab..9ca4a1e 100644 (file)
@@ -123,7 +123,7 @@ inline JSObject* constructObjectFromPropertyDescriptor(ExecState* exec, const Pr
 }
 
 
-JSObject* objectConstructorFreeze(ExecState*, JSObject*);
+JS_EXPORT_PRIVATE JSObject* objectConstructorFreeze(ExecState*, JSObject*);
 JSValue objectConstructorGetPrototypeOf(ExecState*, JSObject*);
 JSValue objectConstructorGetOwnPropertyDescriptor(ExecState*, JSObject*, const Identifier&);
 JSValue objectConstructorGetOwnPropertyDescriptors(ExecState*, JSObject*);
index 16a5c5b..4cc426a 100644 (file)
@@ -1150,7 +1150,6 @@ set(WebCore_SOURCES
     bindings/js/JSDOMPluginArrayCustom.cpp
     bindings/js/JSDOMPluginCustom.cpp
     bindings/js/JSDOMPromise.cpp
-    bindings/js/JSDOMStringListCustom.cpp
     bindings/js/JSDOMStringMapCustom.cpp
     bindings/js/JSDOMWindowBase.cpp
     bindings/js/JSDOMWindowCustom.cpp
index 76fab87..8472140 100644 (file)
@@ -1,3 +1,87 @@
+2016-08-19  Sam Weinig  <sam@webkit.org>
+
+        Location.ancestorOrigins should return a FrozenArray<USVString>
+        https://bugs.webkit.org/show_bug.cgi?id=161018
+
+        Reviewed by Ryosuke Niwa and Chris Dumez.
+
+        Updated tests: fast/dom/Window/Location/ancestor-origins.html
+                       fast/dom/indexed-getters-returning-string.html
+
+        * Modules/indexeddb/IDBDatabase.cpp:
+        (WebCore::IDBDatabase::createObjectStore):
+        (WebCore::IDBDatabase::transaction):
+        (WebCore::IDBDatabase::deleteObjectStore):
+        * Modules/indexeddb/IDBDatabase.h:
+        Remove unused ScriptExecutionContext parameter.
+
+        * Modules/indexeddb/IDBDatabase.idl:
+        There is no need for a custom implementation anymore.
+
+        * CMakeLists.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        Remove JSDOMStringListCustom.cpp, which is no longer needed.
+
+        * bindings/js/JSDOMBinding.cpp:
+        (WebCore::jsArray): Deleted.
+        Remove overload of jsArray that took a DOMStringList.
+
+        * bindings/js/JSDOMBinding.h:
+        (WebCore::jsFrozenArray):
+        Add jsFrozenArray which returns an JSArray which has had the moral 
+        equivalent of Object.freeze() called on it. This follows 
+        http://heycam.github.io/webidl/#es-frozen-array.
+
+        * bindings/js/JSDOMStringListCustom.cpp:
+        Removed.
+
+        * bindings/js/JSIDBDatabaseCustom.cpp:
+        (WebCore::JSIDBDatabase::transaction): Deleted.
+        Remove no longer necessary custom implementation of transaction.
+
+        * bindings/scripts/CodeGenerator.pm:
+        (IsRefPtrType):
+        (IsSVGAnimatedType):
+        (IsSequenceType):
+        (GetSequenceType):
+        (IsFrozenArrayType):
+        (GetFrozenArrayInnerType):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (AreTypesDistinguishableForOverloadResolution):
+        (GenerateOverloadedFunctionOrConstructor):
+        (GetNativeType):
+        (GetNativeVectorInnerType):
+        (GetNativeTypeForCallbacks):
+        (JSValueToNative):
+        (NativeToJSValue):
+        * bindings/scripts/IDLParser.pm:
+        (parseNonAnyType):
+        Add support for FrozenArray, closely matching the sequence code.
+
+        * bindings/scripts/test/JS/JSTestCallback.cpp:
+        * bindings/scripts/test/JS/JSTestCallback.h:
+        * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
+        * bindings/scripts/test/JS/JSTestCallbackFunction.h:
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
+        Updated bindings test results.
+
+        * dom/DOMStringList.idl:
+        Remove JSCustomToNativeObject, which is no longer needed.
+
+        * inspector/InspectorIndexedDBAgent.cpp:
+        Update calls to IDBDatabase::transaction.
+
+        * page/Location.cpp:
+        (WebCore::Location::ancestorOrigins):
+        * page/Location.h:
+        Change ancestorOrigins to return a Vector<String> rather than
+        a DOMStringList.
+
+        * page/Location.idl:
+        Change ancestorOrigins to return a FrozenArray<USVString>, matching
+        the HTML5 spec.
+
 2016-08-19  Chris Dumez  <cdumez@apple.com>
 
         Mark CanvasPath operations' parameters as mandatory when they should be
index cdab15b..e48ac32 100644 (file)
@@ -158,7 +158,7 @@ RefPtr<WebCore::IDBObjectStore> IDBDatabase::createObjectStore(const String& nam
     return adoptRef(&objectStore.leakRef());
 }
 
-RefPtr<WebCore::IDBTransaction> IDBDatabase::transaction(ScriptExecutionContext*, const Vector<String>& objectStores, const String& modeString, ExceptionCodeWithMessage& ec)
+RefPtr<WebCore::IDBTransaction> IDBDatabase::transaction(const Vector<String>& objectStores, const String& modeString, ExceptionCodeWithMessage& ec)
 {
     LOG(IndexedDB, "IDBDatabase::transaction");
 
@@ -211,13 +211,13 @@ RefPtr<WebCore::IDBTransaction> IDBDatabase::transaction(ScriptExecutionContext*
     return adoptRef(&transaction.leakRef());
 }
 
-RefPtr<WebCore::IDBTransaction> IDBDatabase::transaction(ScriptExecutionContext* context, const String& objectStore, const String& mode, ExceptionCodeWithMessage& ec)
+RefPtr<WebCore::IDBTransaction> IDBDatabase::transaction(const String& objectStore, const String& mode, ExceptionCodeWithMessage& ec)
 {
     ASSERT(currentThread() == originThreadID());
 
     Vector<String> objectStores(1);
     objectStores[0] = objectStore;
-    return transaction(context, objectStores, mode, ec);
+    return transaction(objectStores, mode, ec);
 }
 
 void IDBDatabase::deleteObjectStore(const String& objectStoreName, ExceptionCodeWithMessage& ec)
index a0f8c5d..e285fd6 100644 (file)
@@ -57,8 +57,8 @@ public:
 
     RefPtr<IDBObjectStore> createObjectStore(const String& name, const Dictionary&, ExceptionCodeWithMessage&);
     RefPtr<IDBObjectStore> createObjectStore(const String& name, const IDBKeyPath&, bool autoIncrement, ExceptionCodeWithMessage&);
-    RefPtr<IDBTransaction> transaction(ScriptExecutionContext*, const Vector<String>&, const String& mode, ExceptionCodeWithMessage&);
-    RefPtr<IDBTransaction> transaction(ScriptExecutionContext*, const String&, const String& mode, ExceptionCodeWithMessage&);
+    RefPtr<IDBTransaction> transaction(const Vector<String>&, const String& mode, ExceptionCodeWithMessage&);
+    RefPtr<IDBTransaction> transaction(const String&, const String& mode, ExceptionCodeWithMessage&);
     void deleteObjectStore(const String& name, ExceptionCodeWithMessage&);
     void close();
 
index 742128d..2445d55 100644 (file)
 
     [Custom, RaisesExceptionWithMessage] IDBObjectStore createObjectStore(DOMString name, optional Dictionary options);
     [RaisesExceptionWithMessage] void deleteObjectStore(DOMString name);
-    [Custom, RaisesExceptionWithMessage] IDBTransaction transaction(DOMString storeName, optional DOMString mode);
-    [Custom, RaisesExceptionWithMessage] IDBTransaction transaction(sequence<DOMString> storeNames, optional DOMString mode);
+    [RaisesExceptionWithMessage] IDBTransaction transaction(DOMString storeName, optional DOMString mode = "readonly");
+    [RaisesExceptionWithMessage] IDBTransaction transaction(sequence<DOMString> storeNames, optional DOMString mode = "readonly");
+    // FIXME: This is not part of the spec, but is needed for compatibility.
+    // See https://github.com/w3c/IndexedDB/issues/85
+    [RaisesExceptionWithMessage] IDBTransaction transaction(DOMStringList storeNames, optional DOMString mode = "readonly");
     void close();
 
     attribute EventHandler onabort;
     attribute EventHandler onerror;
     attribute EventHandler onversionchange;
 };
-
index 69b212f..f3e8ff8 100644 (file)
                99CC0B6B18BEA1FF006CEBCC /* WebReplayInputs.h in Headers */ = {isa = PBXBuildFile; fileRef = 99CC0B6918BEA1FF006CEBCC /* WebReplayInputs.h */; };
                99E45A1718A063BE0026D88F /* EventLoopInput.h in Headers */ = {isa = PBXBuildFile; fileRef = 99E45A1618A063BE0026D88F /* EventLoopInput.h */; };
                9A1142041832D135000BB8AD /* ValueToString.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A1142031832D134000BB8AD /* ValueToString.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               9A1B6F97158869C80011A8C4 /* JSDOMStringListCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A1B6F96158869C80011A8C4 /* JSDOMStringListCustom.cpp */; };
                9A528E8317D7F52F00AA9518 /* FloatingObjects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A528E8117D7F52F00AA9518 /* FloatingObjects.cpp */; };
                9A528E8417D7F52F00AA9518 /* FloatingObjects.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A528E8217D7F52F00AA9518 /* FloatingObjects.h */; settings = {ATTRIBUTES = (Private, ); }; };
                9AB1F38018E2489A00534743 /* CSSToLengthConversionData.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AB1F37E18E2489A00534743 /* CSSToLengthConversionData.h */; };
                99CC0B6918BEA1FF006CEBCC /* WebReplayInputs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebReplayInputs.h; sourceTree = "<group>"; };
                99E45A1618A063BE0026D88F /* EventLoopInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventLoopInput.h; sourceTree = "<group>"; };
                9A1142031832D134000BB8AD /* ValueToString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ValueToString.h; sourceTree = "<group>"; };
-               9A1B6F96158869C80011A8C4 /* JSDOMStringListCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMStringListCustom.cpp; sourceTree = "<group>"; };
                9A528E8117D7F52F00AA9518 /* FloatingObjects.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FloatingObjects.cpp; sourceTree = "<group>"; };
                9A528E8217D7F52F00AA9518 /* FloatingObjects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FloatingObjects.h; sourceTree = "<group>"; };
                9AB1F37E18E2489A00534743 /* CSSToLengthConversionData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSToLengthConversionData.h; sourceTree = "<group>"; };
                                A9C6E6460D7465CA006442E9 /* JSDOMMimeTypeArrayCustom.cpp */,
                                A9C6E64A0D7465E7006442E9 /* JSDOMPluginArrayCustom.cpp */,
                                A9C6E64B0D7465E7006442E9 /* JSDOMPluginCustom.cpp */,
-                               9A1B6F96158869C80011A8C4 /* JSDOMStringListCustom.cpp */,
                                BC64649B11D8238C006455B0 /* JSDOMStringMapCustom.cpp */,
                                BCD9C25E0C17AA67005C90A2 /* JSDOMWindowCustom.cpp */,
                                652FBBBB0DE27CB60001D386 /* JSDOMWindowCustom.h */,
                                E172AF8F1811BC3700FBADB9 /* JSDOMPromise.cpp in Sources */,
                                BC5A86B50C3367E800EEA649 /* JSDOMSelection.cpp in Sources */,
                                C5137CF211A58378004ADB99 /* JSDOMStringList.cpp in Sources */,
-                               9A1B6F97158869C80011A8C4 /* JSDOMStringListCustom.cpp in Sources */,
                                BC64649711D82349006455B0 /* JSDOMStringMap.cpp in Sources */,
                                BC64649C11D8238C006455B0 /* JSDOMStringMapCustom.cpp in Sources */,
                                7694563C1214D97C0007CBAE /* JSDOMTokenList.cpp in Sources */,
index 774778d..129f449 100644 (file)
@@ -58,7 +58,6 @@
 #include "JSDOMPluginArrayCustom.cpp"
 #include "JSDOMPluginCustom.cpp"
 #include "JSDOMPromise.cpp"
-#include "JSDOMStringListCustom.cpp"
 #include "JSDOMStringMapCustom.cpp"
 #include "JSDOMWindowBase.cpp"
 #include "JSDOMWindowCustom.cpp"
index adaa959..5d91cb8 100644 (file)
@@ -24,7 +24,6 @@
 
 #include "CachedScript.h"
 #include "DOMConstructorWithDocument.h"
-#include "DOMStringList.h"
 #include "ExceptionCode.h"
 #include "ExceptionCodeDescription.h"
 #include "ExceptionHeaders.h"
@@ -186,16 +185,6 @@ double valueToDate(ExecState* exec, JSValue value)
     return static_cast<DateInstance*>(value.toObject(exec))->internalNumber();
 }
 
-JSC::JSValue jsArray(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, DOMStringList* stringList)
-{
-    JSC::MarkedArgumentBuffer list;
-    if (stringList) {
-        for (unsigned i = 0; i < stringList->length(); ++i)
-            list.append(jsStringWithCache(exec, stringList->item(i)));
-    }
-    return JSC::constructArray(exec, 0, globalObject, list);
-}
-
 void reportException(ExecState* exec, JSValue exceptionValue, CachedScript* cachedScript)
 {
     RELEASE_ASSERT(exec->vm().currentThreadIsHoldingAPILock());
index b24a69a..796f839 100644 (file)
@@ -41,6 +41,7 @@
 #include <runtime/JSCellInlines.h>
 #include <runtime/JSTypedArrays.h>
 #include <runtime/Lookup.h>
+#include <runtime/ObjectConstructor.h>
 #include <runtime/StructureInlines.h>
 #include <runtime/TypedArrayInlines.h>
 #include <runtime/TypedArrays.h>
@@ -60,7 +61,6 @@ class JSFunction;
 namespace WebCore {
 
 class CachedScript;
-class DOMStringList;
 class DOMWindow;
 class Frame;
 class URL;
@@ -269,7 +269,7 @@ JSC::JSValue toJSIteratorEnd(JSC::ExecState&);
 
 template<typename T, size_t inlineCapacity> JSC::JSValue jsArray(JSC::ExecState*, JSDOMGlobalObject*, const Vector<T, inlineCapacity>&);
 template<typename T, size_t inlineCapacity> JSC::JSValue jsArray(JSC::ExecState*, JSDOMGlobalObject*, const Vector<T, inlineCapacity>*);
-WEBCORE_EXPORT JSC::JSValue jsArray(JSC::ExecState*, JSDOMGlobalObject*, DOMStringList*);
+template<typename T, size_t inlineCapacity> JSC::JSValue jsFrozenArray(JSC::ExecState*, JSDOMGlobalObject*, const Vector<T, inlineCapacity>&);
 
 JSC::JSValue jsPair(JSC::ExecState&, JSDOMGlobalObject*, JSC::JSValue, JSC::JSValue);
 template<typename FirstType, typename SecondType> JSC::JSValue jsPair(JSC::ExecState&, JSDOMGlobalObject*, const FirstType&, const SecondType&);
@@ -631,6 +631,20 @@ template<typename T, size_t inlineCapacity> inline JSC::JSValue jsArray(JSC::Exe
     return jsArray(exec, globalObject, *vector);
 }
 
+template<typename T, size_t inlineCapacity> JSC::JSValue jsFrozenArray(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, const Vector<T, inlineCapacity>& vector)
+{
+    JSC::MarkedArgumentBuffer list;
+    for (auto& element : vector) {
+        list.append(JSValueTraits<T>::arrayJSValue(exec, globalObject, element));
+        if (UNLIKELY(exec->hadException()))
+            return JSC::jsUndefined();
+    }
+    auto* array = JSC::constructArray(exec, nullptr, globalObject, list);
+    if (UNLIKELY(exec->hadException()))
+        return JSC::jsUndefined();
+    return JSC::objectConstructorFreeze(exec, array);
+}
+
 inline JSC::JSValue jsPair(JSC::ExecState& state, JSDOMGlobalObject* globalObject, JSC::JSValue value1, JSC::JSValue value2)
 {
     JSC::MarkedArgumentBuffer args;
@@ -668,7 +682,7 @@ template<> struct NativeValueTraits<String> {
     static inline bool nativeValue(JSC::ExecState& exec, JSC::JSValue jsValue, String& indexedValue)
     {
         indexedValue = jsValue.toWTFString(&exec);
-        return true;
+        return !exec.hadException();
     }
 };
 
diff --git a/Source/WebCore/bindings/js/JSDOMStringListCustom.cpp b/Source/WebCore/bindings/js/JSDOMStringListCustom.cpp
deleted file mode 100644 (file)
index 0181de7..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- *  Copyright (C) 2012 Research In Motion Inc. All rights reserved.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#include "config.h"
-#include "JSDOMStringList.h"
-
-#include "DOMWrapperWorld.h"
-#include <runtime/JSCJSValueInlines.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-RefPtr<DOMStringList> JSDOMStringList::toWrapped(ExecState& state, JSValue value)
-{
-    if (value.inherits(JSDOMStringList::info()))
-        return &jsCast<JSDOMStringList*>(asObject(value))->wrapped();
-
-    if (!isJSArray(value))
-        return nullptr;
-
-    JSArray* array = asArray(value);
-    RefPtr<DOMStringList> stringList = DOMStringList::create();
-    for (unsigned i = 0; i < array->length(); ++i)
-        stringList->append(array->getIndex(&state, i).toString(&state)->value(&state));
-
-    return stringList;
-}
-
-} // namespace WebCore
index 2ffa2cd..039d070 100644 (file)
@@ -82,45 +82,6 @@ JSValue JSIDBDatabase::createObjectStore(ExecState& state)
     return result;
 }
 
-JSValue JSIDBDatabase::transaction(ExecState& exec)
-{
-    size_t argsCount = std::min<size_t>(2, exec.argumentCount());
-    if (argsCount < 1)
-        return exec.vm().throwException(&exec, createNotEnoughArgumentsError(&exec));
-
-    auto* scriptContext = jsCast<JSDOMGlobalObject*>(exec.lexicalGlobalObject())->scriptExecutionContext();
-    if (!scriptContext)
-        return jsUndefined();
-
-    Vector<String> scope;
-    JSValue scopeArg(exec.argument(0));
-    auto domStringList = JSDOMStringList::toWrapped(exec, scopeArg);
-    if (exec.hadException())
-        return jsUndefined();
-
-    if (domStringList)
-        scope = *domStringList;
-    else {
-        scope.append(scopeArg.toString(&exec)->value(&exec));
-        if (exec.hadException())
-            return jsUndefined();
-    }
-
-    String mode;
-    if (argsCount == 2) {
-        JSValue modeArg(exec.argument(1));
-        mode = modeArg.toString(&exec)->value(&exec);
-
-        if (exec.hadException())
-            return jsUndefined();
-    }
-
-    ExceptionCodeWithMessage ec;
-    JSValue result = toJS(&exec, globalObject(), wrapped().transaction(scriptContext, scope, mode, ec));
-    setDOMException(&exec, ec);
-    return result;
-}
-
 }
 
 #endif
index c05ddba..ecbd1b5 100644 (file)
@@ -471,7 +471,7 @@ sub IsRefPtrType
     return 0 if $object->IsPrimitiveType($type);
     return 0 if $object->IsDictionaryType($type);
     return 0 if $object->IsEnumType($type);
-    return 0 if $object->GetSequenceType($type);
+    return 0 if $object->IsSequenceOrFrozenArrayType($type);
     return 0 if $type eq "DOMString" or $type eq "USVString";
     return 0 if $type eq "any";
 
@@ -517,7 +517,15 @@ sub IsSVGAnimatedType
     return $type =~ /^SVGAnimated/;
 }
 
-sub GetSequenceType
+sub IsSequenceType
+{
+    my $object = shift;
+    my $type = shift;
+
+    return $type =~ /^sequence</;
+}
+
+sub GetSequenceInnerType
 {
     my $object = shift;
     my $type = shift;
@@ -526,6 +534,41 @@ sub GetSequenceType
     return "";
 }
 
+sub IsFrozenArrayType
+{
+    my $object = shift;
+    my $type = shift;
+
+    return $type =~ /^FrozenArray</;
+}
+
+sub GetFrozenArrayInnerType
+{
+    my $object = shift;
+    my $type = shift;
+
+    return $1 if $type =~ /^FrozenArray<([\w\d_\s]+)>.*/;
+    return "";
+}
+
+sub IsSequenceOrFrozenArrayType
+{
+    my $object = shift;
+    my $type = shift;
+
+    return $object->IsSequenceType($type) || $object->IsFrozenArrayType($type);
+}
+
+sub GetSequenceOrFrozenArrayInnerType
+{
+    my $object = shift;
+    my $type = shift;
+
+    return $object->GetSequenceInnerType($type) if $object->IsSequenceType($type);
+    return $object->GetFrozenArrayInnerType($type) if $object->IsFrozenArrayType($type);
+    return "";
+}
+
 # These match WK_lcfirst and WK_ucfirst defined in builtins_generator.py.
 # Uppercase the first letter while respecting WebKit style guidelines.
 # E.g., xmlEncoding becomes XMLEncoding, but xmlllang becomes Xmllang.
index bfb7faf..aac003d 100644 (file)
@@ -244,7 +244,7 @@ sub SkipAttribute {
 
     return 1 if $attribute->isStatic;
     return 1 if $codeGenerator->IsTypedArrayType($propType);
-    return 1 if $codeGenerator->GetSequenceType($propType);
+    return 1 if $codeGenerator->IsSequenceOrFrozenArrayType($propType);
 
     if ($codeGenerator->IsEnumType($propType)) {
         return 1;
@@ -320,7 +320,7 @@ sub SkipFunction {
         return 1 if $param->extendedAttributes->{"Clamp"};
         return 1 if $param->type eq "MediaQueryListListener";
         return 1 if $param->type eq "EventListener";
-        return 1 if $codeGenerator->GetSequenceType($param->type);
+        return 1 if $codeGenerator->IsSequenceOrFrozenArrayType($param->type);
     }
 
     # This is for DataTransferItemList.idl add(File) method
@@ -361,7 +361,7 @@ sub SkipFunction {
         return 1;
     }
 
-    if ($codeGenerator->GetSequenceType($functionReturnType)) {
+    if ($codeGenerator->IsSequenceOrFrozenArrayType($functionReturnType)) {
         return 1;
     }
 
@@ -1103,7 +1103,7 @@ sub GenerateFunction {
     my @callImplParams;
     foreach my $param (@{$function->parameters}) {
         my $paramIDLType = $param->type;
-        my $sequenceType = $codeGenerator->GetSequenceType($paramIDLType);
+        my $sequenceType = $codeGenerator->GetSequenceInnerType($paramIDLType);
         $paramIDLType = $sequenceType if $sequenceType ne "";
         my $paramType = GetGlibTypeName($paramIDLType);
         my $const = $paramType eq "gchar*" ? "const " : "";
@@ -1175,7 +1175,7 @@ sub GenerateFunction {
             last;
         }
         my $paramIDLType = $param->type;
-        my $sequenceType = $codeGenerator->GetSequenceType($paramIDLType);
+        my $sequenceType = $codeGenerator->GetSequenceInnerType($paramIDLType);
         $paramIDLType = $sequenceType if $sequenceType ne "";
         my $paramType = GetGlibTypeName($paramIDLType);
         # $paramType can have a trailing * in some cases
index 1f999cb..87d3be9 100644 (file)
@@ -202,11 +202,11 @@ sub AddIncludesForType
     # When we're finished with the one-file-per-class reorganization, we won't need these special cases.
     if ($isCallback && $codeGenerator->IsWrapperType($type)) {
         $includesRef->{"JS${type}.h"} = 1;
-    } elsif ($codeGenerator->GetSequenceType($type)) {
-        my $sequenceType = $codeGenerator->GetSequenceType($type);
-        if ($codeGenerator->IsRefPtrType($sequenceType)) {
-            $includesRef->{"JS${sequenceType}.h"} = 1;
-            $includesRef->{"${sequenceType}.h"} = 1;
+    } elsif ($codeGenerator->IsSequenceOrFrozenArrayType($type)) {
+        my $innerType = $codeGenerator->GetSequenceOrFrozenArrayInnerType($type);
+        if ($codeGenerator->IsRefPtrType($innerType)) {
+            $includesRef->{"JS${innerType}.h"} = 1;
+            $includesRef->{"${innerType}.h"} = 1;
         }
         $includesRef->{"<runtime/JSArray.h>"} = 1;
     } else {
@@ -1765,7 +1765,7 @@ sub AreTypesDistinguishableForOverloadResolution
     return 0 if &$isDictionary($typeA) && &$isDictionary($typeB);
     return 0 if $codeGenerator->IsCallbackInterface($typeA) && $codeGenerator->IsCallbackInterface($typeB);
     return 0 if &$isCallbackFunctionOrDictionary($typeA) && &$isCallbackFunctionOrDictionary($typeB);
-    return 0 if $codeGenerator->GetSequenceType($typeA) && $codeGenerator->GetSequenceType($typeB);
+    return 0 if $codeGenerator->IsSequenceOrFrozenArrayType($typeA) && $codeGenerator->IsSequenceOrFrozenArrayType($typeB);
     # FIXME: return 0 if typeA and typeB are both exception types.
     return 1;
 }
@@ -1854,9 +1854,9 @@ sub GenerateOverloadedFunctionOrConstructor
         my ($type, $optionality, $isNullable) = @_;
         return $type eq "object" || $codeGenerator->IsFunctionOnlyCallbackInterface($type);
     };
-    my $isSequenceParameter = sub {
+    my $isSequenceOrFrozenArrayParameter = sub {
         my ($type, $optionality, $isNullable) = @_;
-        return $codeGenerator->GetSequenceType($type);
+        return $codeGenerator->IsSequenceOrFrozenArrayType($type);
     };
     my $isDictionaryOrObjectOrCallbackInterfaceParameter = sub {
         my ($type, $optionality, $isNullable) = @_;
@@ -1930,7 +1930,7 @@ END
             &$generateOverloadCallIfNecessary($overload, "distinguishingArg.isFunction()");
 
             # FIXME: Avoid invoking GetMethod(object, Symbol.iterator) again in toNativeArray and toRefPtrNativeArray.
-            $overload = GetOverloadThatMatches($S, $d, \&$isSequenceParameter);
+            $overload = GetOverloadThatMatches($S, $d, \&$isSequenceOrFrozenArrayParameter);
             &$generateOverloadCallIfNecessary($overload, "hasIteratorMethod(*state, distinguishingArg)");
 
             $overload = GetOverloadThatMatches($S, $d, \&$isDictionaryOrObjectOrCallbackInterfaceParameter);
@@ -4497,7 +4497,6 @@ sub GetNativeTypeFromSignature
 my %nativeType = (
     "DOMString" => "String",
     "USVString" => "String",
-    "DOMStringList" => "RefPtr<DOMStringList>",
     "DOMTimeStamp" => "DOMTimeStamp",
     "Date" => "double",
     "Dictionary" => "Dictionary",
@@ -4534,8 +4533,7 @@ sub GetNativeType
 
     return "RefPtr<${type}>" if $codeGenerator->IsTypedArrayType($type) and $type ne "ArrayBuffer";
 
-    my $sequenceType = $codeGenerator->GetSequenceType($type);
-    return "Vector<" . GetNativeVectorInnerType($sequenceType) . ">" if $sequenceType;
+    return "Vector<" . GetNativeVectorInnerType($codeGenerator->GetSequenceOrFrozenArrayInnerType($type)) . ">" if $codeGenerator->IsSequenceOrFrozenArrayType($type);
 
     return "${type}*";
 }
@@ -4551,10 +4549,10 @@ sub ShouldPassWrapperByReference
 
 sub GetNativeVectorInnerType
 {
-    my $sequenceType = shift;
+    my $innerType = shift;
 
-    return $nativeType{$sequenceType} if exists $nativeType{$sequenceType};
-    return "RefPtr<${sequenceType}>";
+    return $nativeType{$innerType} if exists $nativeType{$innerType};
+    return "RefPtr<$innerType>";
 }
 
 sub GetNativeTypeForCallbacks
@@ -4562,7 +4560,6 @@ sub GetNativeTypeForCallbacks
     my ($interface, $type) = @_;
 
     return "RefPtr<SerializedScriptValue>&&" if $type eq "SerializedScriptValue";
-    return "RefPtr<DOMStringList>&&" if $type eq "DOMStringList";
     return "const String&" if $codeGenerator->IsStringType($type);
     return GetNativeType($interface, $type);
 }
@@ -4666,13 +4663,13 @@ sub JSValueToNative
         return ("Dictionary(state, $value)", 0);
     }
 
-    my $sequenceType = $codeGenerator->GetSequenceType($type);
-    if ($sequenceType) {
-        if ($codeGenerator->IsRefPtrType($sequenceType)) {
-            AddToImplIncludes("JS${sequenceType}.h");
-            return ("toRefPtrNativeArray<${sequenceType}, JS${sequenceType}>(*state, $value)", 1);
+    if ($codeGenerator->IsSequenceOrFrozenArrayType($type)) {
+        my $innerType = $codeGenerator->GetSequenceOrFrozenArrayInnerType($type);
+        if ($codeGenerator->IsRefPtrType($innerType)) {
+            AddToImplIncludes("JS${innerType}.h");
+            return ("toRefPtrNativeArray<${innerType}, JS${innerType}>(*state, $value)", 1);
         }
-        return ("toNativeArray<" . GetNativeVectorInnerType($sequenceType) . ">(*state, $value)", 1);
+        return ("toNativeArray<" . GetNativeVectorInnerType($innerType) . ">(*state, $value)", 1);
     }
 
     return ($value, 0) if $type eq "any";
@@ -4742,14 +4739,15 @@ sub NativeToJSValue
         AddToImplIncludes("<runtime/JSString.h>", $conditional);
         return "jsStringWithCache(state, $value)";
     }
-    
-    my $sequenceType = $codeGenerator->GetSequenceType($type);
-    if ($sequenceType) {
-        if ($codeGenerator->IsRefPtrType($sequenceType)) {
-            AddToImplIncludes("JS${sequenceType}.h", $conditional);
+
+    if ($codeGenerator->IsSequenceOrFrozenArrayType($type)) {
+        my $innerType = $codeGenerator->GetSequenceOrFrozenArrayInnerType($type);
+        if ($codeGenerator->IsRefPtrType($innerType)) {
+            AddToImplIncludes("JS${innerType}.h", $conditional);
         }
-        AddToImplIncludes("<runtime/JSArray.h>", $conditional);
-        return "jsArray(state, $globalObject, $value)";
+        
+        return "jsArray(state, $globalObject, $value)" if $codeGenerator->IsSequenceType($type);
+        return "jsFrozenArray(state, $globalObject, $value)" if $codeGenerator->IsFrozenArrayType($type);
     }
 
     if ($type eq "any") {
index db7cecf..a63b1d3 100644 (file)
@@ -2019,6 +2019,21 @@ sub parseNonAnyType
 
         return $type;
     }
+    if ($next->value() eq "FrozenArray") {
+        $self->assertTokenValue($self->getToken(), "FrozenArray", __LINE__);
+        $self->assertTokenValue($self->getToken(), "<", __LINE__);
+
+        my $subtype = $self->parseType();
+        my $subtypeName = $subtype->name;
+
+        $self->assertTokenValue($self->getToken(), ">", __LINE__);
+
+        # FIXME: This should just be "FrozenArray" when we start using domTypes in the CodeGenerators
+        $type->name("FrozenArray<${subtypeName}>");
+        push(@{$type->subtypes}, $subtype);
+
+        return $type;
+    }
     if ($next->type() == IdentifierToken) {
         my $identifier = $self->getToken();
 
index 2044159..6c6e4bf 100644 (file)
@@ -156,7 +156,7 @@ bool JSTestCallback::callbackWithSerializedScriptValueParam(RefPtr<SerializedScr
     return !returnedException;
 }
 
-bool JSTestCallback::callbackWithStringList(RefPtr<DOMStringList>&& listParam)
+bool JSTestCallback::callbackWithStringList(DOMStringList* listParam)
 {
     if (!canInvokeCallback())
         return true;
index 01e1684..9002437 100644 (file)
@@ -48,7 +48,7 @@ public:
     virtual bool callbackWithSerializedScriptValueParam(RefPtr<SerializedScriptValue>&& srzParam, const String& strArg);
     virtual int32_t callbackWithNonBoolReturnType(const String& strArg);
     virtual int32_t customCallback(Class5* class5Param, Class6* class6Param);
-    virtual bool callbackWithStringList(RefPtr<DOMStringList>&& listParam);
+    virtual bool callbackWithStringList(DOMStringList* listParam);
     virtual bool callbackWithBoolean(bool boolParam);
     virtual bool callbackRequiresThisToPass(int32_t longParam, TestNode* testNodeParam);
 
index 9a2404c..4837671 100644 (file)
@@ -123,7 +123,7 @@ bool JSTestCallbackFunction::callbackWithSerializedScriptValueParam(RefPtr<Seria
     return !returnedException;
 }
 
-bool JSTestCallbackFunction::callbackWithStringList(RefPtr<DOMStringList>&& listParam)
+bool JSTestCallbackFunction::callbackWithStringList(DOMStringList* listParam)
 {
     if (!canInvokeCallback())
         return true;
index d6433bc..6963609 100644 (file)
@@ -47,7 +47,7 @@ public:
     virtual bool callbackWithSerializedScriptValueParam(RefPtr<SerializedScriptValue>&& srzParam, const String& strArg);
     virtual int32_t callbackWithNonBoolReturnType(const String& strArg);
     virtual int32_t customCallback(Class5* class5Param, Class6* class6Param);
-    virtual bool callbackWithStringList(RefPtr<DOMStringList>&& listParam);
+    virtual bool callbackWithStringList(DOMStringList* listParam);
     virtual bool callbackWithBoolean(bool boolParam);
     virtual bool callbackRequiresThisToPass(int32_t longParam, TestNode* testNodeParam);
 
index 2cbf558..d52d08b 100644 (file)
@@ -5569,11 +5569,9 @@ static inline EncodedJSValue jsTestObjPrototypeFunctionOverloadedMethod6(ExecSta
     auto& impl = castedThis->wrapped();
     if (UNLIKELY(state->argumentCount() < 1))
         return throwVMError(state, createNotEnoughArgumentsError(state));
-    RefPtr<DOMStringList> listArg = nullptr;
+    DOMStringList* listArg = nullptr;
     if (!state->argument(0).isUndefinedOrNull()) {
-        listArg = JSDOMStringList::toWrapped(*state, state->uncheckedArgument(0));
-        if (UNLIKELY(state->hadException()))
-            return JSValue::encode(jsUndefined());
+        listArg = JSDOMStringList::toWrapped(state->uncheckedArgument(0));
         if (UNLIKELY(!listArg))
             return throwArgumentTypeError(*state, 0, "listArg", "TestObject", "overloadedMethod", "DOMStringList");
     }
@@ -5950,9 +5948,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionDomStringListFunction(Exe
     if (UNLIKELY(state->argumentCount() < 1))
         return throwVMError(state, createNotEnoughArgumentsError(state));
     ExceptionCode ec = 0;
-    auto values = JSDOMStringList::toWrapped(*state, state->argument(0));
-    if (UNLIKELY(state->hadException()))
-        return JSValue::encode(jsUndefined());
+    auto values = JSDOMStringList::toWrapped(state->argument(0));
     if (UNLIKELY(!values))
         return throwArgumentTypeError(*state, 0, "values", "TestObject", "domStringListFunction", "DOMStringList");
     JSValue result = toJS(state, castedThis->globalObject(), impl.domStringListFunction(*values, ec));
index bb428ae..f08388b 100644 (file)
@@ -29,7 +29,6 @@
 #include "JSMessagePort.h"
 #include "SerializedScriptValue.h"
 #include <runtime/FunctionPrototype.h>
-#include <runtime/JSArray.h>
 #include <wtf/GetPtr.h>
 
 using namespace JSC;
index 0d4013f..57a0b18 100644 (file)
@@ -24,8 +24,7 @@
  */
 
 [
-    JSCustomToNativeObject,
-    ImplementationLacksVTable,
+    ImplementationLacksVTable
 ] interface DOMStringList {
     readonly attribute unsigned long length;
     getter DOMString? item(unsigned long index);
index 047616a..3235fc8 100644 (file)
@@ -201,10 +201,10 @@ static RefPtr<KeyPath> keyPathFromIDBKeyPath(const IDBKeyPath& idbKeyPath)
     return keyPath;
 }
 
-static RefPtr<IDBTransaction> transactionForDatabase(ScriptExecutionContext* scriptExecutionContext, IDBDatabase* idbDatabase, const String& objectStoreName, const String& mode = IDBTransaction::modeReadOnly())
+static RefPtr<IDBTransaction> transactionForDatabase(IDBDatabase* idbDatabase, const String& objectStoreName, const String& mode = IDBTransaction::modeReadOnly())
 {
     ExceptionCodeWithMessage ec;
-    RefPtr<IDBTransaction> idbTransaction = idbDatabase->transaction(scriptExecutionContext, objectStoreName, mode, ec);
+    RefPtr<IDBTransaction> idbTransaction = idbDatabase->transaction(objectStoreName, mode, ec);
     if (ec.code)
         return nullptr;
     return idbTransaction;
@@ -472,7 +472,7 @@ public:
         if (!requestCallback().isActive())
             return;
 
-        RefPtr<IDBTransaction> idbTransaction = transactionForDatabase(context(), &database, m_objectStoreName);
+        RefPtr<IDBTransaction> idbTransaction = transactionForDatabase(&database, m_objectStoreName);
         if (!idbTransaction) {
             m_requestCallback->sendFailure("Could not get transaction");
             return;
@@ -706,7 +706,7 @@ public:
         if (!requestCallback().isActive())
             return;
 
-        RefPtr<IDBTransaction> idbTransaction = transactionForDatabase(context(), &database, m_objectStoreName);
+        RefPtr<IDBTransaction> idbTransaction = transactionForDatabase(&database, m_objectStoreName);
         if (!idbTransaction) {
             m_requestCallback->sendFailure("Could not get transaction");
             return;
index 48994f6..00e8beb 100644 (file)
@@ -132,13 +132,13 @@ String Location::origin() const
     return SecurityOrigin::create(url())->toString();
 }
 
-Ref<DOMStringList> Location::ancestorOrigins() const
+Vector<String> Location::ancestorOrigins() const
 {
-    auto origins = DOMStringList::create();
+    Vector<String> origins;
     if (!m_frame)
         return origins;
     for (Frame* frame = m_frame->tree().parent(); frame; frame = frame->tree().parent())
-        origins->append(frame->document()->securityOrigin()->toString());
+        origins.append(frame->document()->securityOrigin()->toString());
     return origins;
 }
 
index c5698b9..d8b53eb 100644 (file)
@@ -72,7 +72,7 @@ public:
 
     String toString() const { return href(); }
 
-    Ref<DOMStringList> ancestorOrigins() const;
+    Vector<String> ancestorOrigins() const;
 
 private:
     explicit Location(Frame*);
index 9905c8d..e4e63c4 100644 (file)
@@ -54,7 +54,8 @@
 
     readonly attribute USVString origin;
 
-    readonly attribute DOMStringList ancestorOrigins;
+    // FIXME: Add support for SameObject
+    [Unforgeable, CachedAttribute] readonly attribute FrozenArray<USVString> ancestorOrigins;
 
 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
     [NotEnumerable, Custom, ImplementedAs=toStringFunction] DOMString toString();