| Differences between
and this patch
- a/Source/WebCore/ChangeLog +57 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2020-02-14  Alexey Shvayka  <shvaikalesh@gmail.com>
2
3
        Implement EventTarget constructor
4
        https://bugs.webkit.org/show_bug.cgi?id=174313
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Currently, EventTarget can't be directly constructed or be subclassed in JavaScript.
9
        The spec for EventTarget was updated (https://github.com/whatwg/dom/pull/467) to allow
10
        constructing and subclassing EventTarget. This feature was shipped in Chrome 64 and Firefox 59.
11
12
        This patch introduces EventTargetConcrete class, a user-constructable version of EventTarget,
13
        exposed as "EventTarget" to JavaScript. We don't use EventTarget directly because it is an abstract
14
        class and making it non-abstract is unfavorable due to size increase of EventTarget and all of its
15
        subclasses with code that is mostly unnecessary for them, resulting in a performance decrease.
16
17
        To allow subclassing, non-custom constructors replace structures of newly created wrapper objects
18
        with ones returned by InternalFunction::createSubclassStructure. Per WebIDL spec [1],
19
        `setSubclassStructureIfNeeded` helper uses realm of `newTarget` for default prototypes.
20
21
        This approach was chosen because a) detecting [[Construct]] with callFrame->newTarget() is
22
        unreliable outside constructor, and b) passing `newTarget` down to `createWrapper` via
23
        `toJSNewlyCreated` is quite awkward and would result in massive code change.
24
25
        To prevent definition of EventTargetConcrete-specific `toJS` and `toJSNewlyCreated` functions,
26
        we don't define EventTargetConcrete interface type, but rather tweak make_event_factory.pl to
27
        default to base interface (like it does for Event).
28
29
        [1] https://heycam.github.io/webidl/#internally-create-a-new-object-implementing-the-interface
30
        (step 3.3.2)
31
32
        Tests: fast/dom/dom-constructors.html
33
               imported/w3c/web-platform-tests/dom/events/Event-subclasses-constructors.html
34
               imported/w3c/web-platform-tests/dom/events/EventTarget-constructible.any.html
35
               imported/w3c/web-platform-tests/dom/idlharness.window.html
36
37
        * Headers.cmake:
38
        * Sources.txt:
39
        * WebCore.xcodeproj/project.pbxproj:
40
        * bindings/js/JSDOMWrapperCache.h:
41
        (WebCore::setSubclassStructureIfNeeded):
42
        * bindings/js/JSEventTargetCustom.cpp:
43
        (WebCore::toJSNewlyCreated):
44
        * bindings/scripts/CodeGeneratorJS.pm:
45
        (GenerateConstructorDefinition):
46
        * bindings/scripts/InFilesCompiler.pm:
47
        (generateInterfacesHeader): Add base interface type.
48
        * bindings/scripts/test/JS/*: Adjust bindings expectations.
49
        * dom/EventTarget.cpp:
50
        (WebCore::EventTarget::create):
51
        * dom/EventTarget.h:
52
        * dom/EventTarget.idl:
53
        * dom/EventTargetConcrete.cpp: Added.
54
        * dom/EventTargetConcrete.h: Added.
55
        * dom/make_event_factory.pl:
56
        (generateImplementation): Wrap base interface type.
57
1
2020-02-12  Basuke Suzuki  <basuke.suzuki@sony.com>
58
2020-02-12  Basuke Suzuki  <basuke.suzuki@sony.com>
2
59
3
        [Curl] Force HTTP/1.1 for WebSocket connection
60
        [Curl] Force HTTP/1.1 for WebSocket connection
- a/Source/WebCore/Headers.cmake +1 lines
Lines 402-407 set(WebCore_PRIVATE_FRAMEWORK_HEADERS a/Source/WebCore/Headers.cmake_sec1
402
    dom/EventNames.h
402
    dom/EventNames.h
403
    dom/EventQueue.h
403
    dom/EventQueue.h
404
    dom/EventTarget.h
404
    dom/EventTarget.h
405
    dom/EventTargetConcrete.h
405
    dom/Exception.h
406
    dom/Exception.h
406
    dom/ExceptionCode.h
407
    dom/ExceptionCode.h
407
    dom/ExceptionData.h
408
    dom/ExceptionData.h
- a/Source/WebCore/Sources.txt +1 lines
Lines 881-886 dom/EventLoop.cpp a/Source/WebCore/Sources.txt_sec1
881
dom/EventNames.cpp
881
dom/EventNames.cpp
882
dom/EventPath.cpp
882
dom/EventPath.cpp
883
dom/EventTarget.cpp
883
dom/EventTarget.cpp
884
dom/EventTargetConcrete.cpp
884
dom/ExceptionData.cpp
885
dom/ExceptionData.cpp
885
dom/ExtensionStyleSheets.cpp
886
dom/ExtensionStyleSheets.cpp
886
dom/FocusEvent.cpp
887
dom/FocusEvent.cpp
- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj +6 lines
Lines 2520-2525 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec1
2520
		849F77760EFEC6200090849D /* StrokeStyleApplier.h in Headers */ = {isa = PBXBuildFile; fileRef = 849F77750EFEC6200090849D /* StrokeStyleApplier.h */; };
2520
		849F77760EFEC6200090849D /* StrokeStyleApplier.h in Headers */ = {isa = PBXBuildFile; fileRef = 849F77750EFEC6200090849D /* StrokeStyleApplier.h */; };
2521
		84A81F3E0FC7DFF000955300 /* SourceAlpha.h in Headers */ = {isa = PBXBuildFile; fileRef = 84A81F3C0FC7DFF000955300 /* SourceAlpha.h */; };
2521
		84A81F3E0FC7DFF000955300 /* SourceAlpha.h in Headers */ = {isa = PBXBuildFile; fileRef = 84A81F3C0FC7DFF000955300 /* SourceAlpha.h */; };
2522
		84A81F420FC7E02700955300 /* SourceGraphic.h in Headers */ = {isa = PBXBuildFile; fileRef = 84A81F400FC7E02700955300 /* SourceGraphic.h */; };
2522
		84A81F420FC7E02700955300 /* SourceGraphic.h in Headers */ = {isa = PBXBuildFile; fileRef = 84A81F400FC7E02700955300 /* SourceGraphic.h */; };
2523
		84B349A222F86E7500D47BCF /* EventTargetConcrete.h in Headers */ = {isa = PBXBuildFile; fileRef = 84B349A022F86E7400D47BCF /* EventTargetConcrete.h */; };
2523
		84B6B978120F13E500B8EFAF /* SVGPathSegListSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 84B6B976120F13E500B8EFAF /* SVGPathSegListSource.h */; };
2524
		84B6B978120F13E500B8EFAF /* SVGPathSegListSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 84B6B976120F13E500B8EFAF /* SVGPathSegListSource.h */; };
2524
		84C5B2FB1216DC810088B53A /* SVGPathTraversalStateBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 84C5B2F91216DC810088B53A /* SVGPathTraversalStateBuilder.h */; };
2525
		84C5B2FB1216DC810088B53A /* SVGPathTraversalStateBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 84C5B2F91216DC810088B53A /* SVGPathTraversalStateBuilder.h */; };
2525
		84C6784D1214814700A92902 /* SVGPathBlender.h in Headers */ = {isa = PBXBuildFile; fileRef = 84C6784B1214814700A92902 /* SVGPathBlender.h */; };
2526
		84C6784D1214814700A92902 /* SVGPathBlender.h in Headers */ = {isa = PBXBuildFile; fileRef = 84C6784B1214814700A92902 /* SVGPathBlender.h */; };
Lines 10400-10405 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec2
10400
		84A81F3F0FC7E02700955300 /* SourceGraphic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SourceGraphic.cpp; sourceTree = "<group>"; };
10401
		84A81F3F0FC7E02700955300 /* SourceGraphic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SourceGraphic.cpp; sourceTree = "<group>"; };
10401
		84A81F400FC7E02700955300 /* SourceGraphic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceGraphic.h; sourceTree = "<group>"; };
10402
		84A81F400FC7E02700955300 /* SourceGraphic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceGraphic.h; sourceTree = "<group>"; };
10402
		84B2B24F056BF15F00D2B771 /* SSLKeyGeneratorMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SSLKeyGeneratorMac.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
10403
		84B2B24F056BF15F00D2B771 /* SSLKeyGeneratorMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SSLKeyGeneratorMac.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
10404
		84B349A022F86E7400D47BCF /* EventTargetConcrete.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventTargetConcrete.h; sourceTree = "<group>"; };
10405
		84B349A322F86E8200D47BCF /* EventTargetConcrete.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventTargetConcrete.cpp; sourceTree = "<group>"; };
10403
		84B62684133138F90095A489 /* FontPlatformData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontPlatformData.cpp; sourceTree = "<group>"; };
10406
		84B62684133138F90095A489 /* FontPlatformData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontPlatformData.cpp; sourceTree = "<group>"; };
10404
		84B6B975120F13E500B8EFAF /* SVGPathSegListSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathSegListSource.cpp; sourceTree = "<group>"; };
10407
		84B6B975120F13E500B8EFAF /* SVGPathSegListSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathSegListSource.cpp; sourceTree = "<group>"; };
10405
		84B6B976120F13E500B8EFAF /* SVGPathSegListSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegListSource.h; sourceTree = "<group>"; };
10408
		84B6B976120F13E500B8EFAF /* SVGPathSegListSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegListSource.h; sourceTree = "<group>"; };
Lines 28138-28143 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec3
28138
				E12EDBE90B308E0B002704B6 /* EventTarget.cpp */,
28141
				E12EDBE90B308E0B002704B6 /* EventTarget.cpp */,
28139
				E12EDB7A0B308A78002704B6 /* EventTarget.h */,
28142
				E12EDB7A0B308A78002704B6 /* EventTarget.h */,
28140
				85AFA7420AAF298400E84305 /* EventTarget.idl */,
28143
				85AFA7420AAF298400E84305 /* EventTarget.idl */,
28144
				84B349A322F86E8200D47BCF /* EventTargetConcrete.cpp */,
28145
				84B349A022F86E7400D47BCF /* EventTargetConcrete.h */,
28141
				CDCE5CD014633BC900D47CCA /* EventTargetFactory.in */,
28146
				CDCE5CD014633BC900D47CCA /* EventTargetFactory.in */,
28142
				93D196321D6CAB8200FC7E47 /* Exception.h */,
28147
				93D196321D6CAB8200FC7E47 /* Exception.h */,
28143
				935FBCF109BA143B00E230B1 /* ExceptionCode.h */,
28148
				935FBCF109BA143B00E230B1 /* ExceptionCode.h */,
Lines 29799-29804 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec4
29799
				E4A8D21622578DB700A8463C /* EventRegion.h in Headers */,
29804
				E4A8D21622578DB700A8463C /* EventRegion.h in Headers */,
29800
				E0FEF372B17C53EAC1C1FBEE /* EventSource.h in Headers */,
29805
				E0FEF372B17C53EAC1C1FBEE /* EventSource.h in Headers */,
29801
				E12EDB7B0B308A78002704B6 /* EventTarget.h in Headers */,
29806
				E12EDB7B0B308A78002704B6 /* EventTarget.h in Headers */,
29807
				84B349A222F86E7500D47BCF /* EventTargetConcrete.h in Headers */,
29802
				97AA3CA5145237CC003E1DA6 /* EventTargetHeaders.h in Headers */,
29808
				97AA3CA5145237CC003E1DA6 /* EventTargetHeaders.h in Headers */,
29803
				97AA3CA6145237CC003E1DA6 /* EventTargetInterfaces.h in Headers */,
29809
				97AA3CA6145237CC003E1DA6 /* EventTargetInterfaces.h in Headers */,
29804
				262EC41A1D078FB900BA78FC /* EventTrackingRegions.h in Headers */,
29810
				262EC41A1D078FB900BA78FC /* EventTrackingRegions.h in Headers */,
- a/Source/WebCore/bindings/js/JSDOMWrapperCache.h +19 lines
Lines 201-204 template<typename DOMClass> inline JSC::JSValue wrap(JSC::JSGlobalObject* lexica a/Source/WebCore/bindings/js/JSDOMWrapperCache.h_sec1
201
    return toJSNewlyCreated(lexicalGlobalObject, globalObject, Ref<DOMClass>(domObject));
201
    return toJSNewlyCreated(lexicalGlobalObject, globalObject, Ref<DOMClass>(domObject));
202
}
202
}
203
203
204
template<typename DOMClass> inline void setSubclassStructureIfNeeded(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, JSC::JSValue jsValue)
205
{
206
    JSC::JSValue newTarget = callFrame->newTarget();
207
    JSC::JSObject* constructor = callFrame->jsCallee();
208
    if (!newTarget || newTarget == constructor)
209
        return;
210
211
    using WrapperClass = typename JSDOMWrapperConverterTraits<DOMClass>::WrapperClass;
212
213
    JSC::VM& vm = lexicalGlobalObject->vm();
214
    auto scope = DECLARE_THROW_SCOPE(vm);
215
216
    auto* newTargetGlobalObject = JSC::jsCast<JSDOMGlobalObject*>(asObject(newTarget)->globalObject(vm));
217
    auto* baseStructure = getDOMStructure<WrapperClass>(vm, *newTargetGlobalObject);
218
    auto* subclassStructure = JSC::InternalFunction::createSubclassStructure(lexicalGlobalObject, constructor, newTarget, baseStructure);
219
    RETURN_IF_EXCEPTION(scope, void());
220
    asObject(jsValue)->setStructure(vm, subclassStructure);
221
}
222
204
} // namespace WebCore
223
} // namespace WebCore
- a/Source/WebCore/bindings/js/JSEventTargetCustom.cpp +5 lines
Lines 43-48 a/Source/WebCore/bindings/js/JSEventTargetCustom.cpp_sec1
43
namespace WebCore {
43
namespace WebCore {
44
using namespace JSC;
44
using namespace JSC;
45
45
46
JSValue toJSNewlyCreated(JSGlobalObject*, JSDOMGlobalObject* globalObject, Ref<EventTarget>&& value)
47
{
48
    return createWrapper<EventTarget>(globalObject, WTFMove(value));
49
}
50
46
EventTarget* JSEventTarget::toWrapped(VM& vm, JSValue value)
51
EventTarget* JSEventTarget::toWrapped(VM& vm, JSValue value)
47
{
52
{
48
    if (value.inherits<JSWindowProxy>(vm))
53
    if (value.inherits<JSWindowProxy>(vm))
- a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm -2 / +5 lines
Lines 7333-7339 sub GenerateConstructorDefinition a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm_sec1
7333
            push(@$outputArray, "{\n");
7333
            push(@$outputArray, "{\n");
7334
            push(@$outputArray, "    VM& vm = lexicalGlobalObject->vm();\n");
7334
            push(@$outputArray, "    VM& vm = lexicalGlobalObject->vm();\n");
7335
            push(@$outputArray, "    auto throwScope = DECLARE_THROW_SCOPE(vm);\n");
7335
            push(@$outputArray, "    auto throwScope = DECLARE_THROW_SCOPE(vm);\n");
7336
            push(@$outputArray, "    UNUSED_PARAM(throwScope);\n");
7337
            push(@$outputArray, "    auto* castedThis = jsCast<${constructorClassName}*>(callFrame->jsCallee());\n");
7336
            push(@$outputArray, "    auto* castedThis = jsCast<${constructorClassName}*>(callFrame->jsCallee());\n");
7338
            push(@$outputArray, "    ASSERT(castedThis);\n");
7337
            push(@$outputArray, "    ASSERT(castedThis);\n");
7339
7338
Lines 7354-7359 sub GenerateConstructorDefinition a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm_sec2
7354
            push(@$outputArray, "    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());\n") if $codeGenerator->ExtendedAttributeContains($interface->extendedAttributes->{ConstructorCallWith}, "ExecState");
7353
            push(@$outputArray, "    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());\n") if $codeGenerator->ExtendedAttributeContains($interface->extendedAttributes->{ConstructorCallWith}, "ExecState");
7355
7354
7356
            my $IDLType = GetIDLType($interface, $interface->type);
7355
            my $IDLType = GetIDLType($interface, $interface->type);
7356
            my $implType = GetImplClassName($interface);
7357
7357
7358
            AddToImplIncludes("JSDOMConvertInterface.h");
7358
            AddToImplIncludes("JSDOMConvertInterface.h");
7359
7359
Lines 7363-7369 sub GenerateConstructorDefinition a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm_sec3
7363
            push(@constructionConversionArguments, "throwScope") if $interface->extendedAttributes->{ConstructorMayThrowException};
7363
            push(@constructionConversionArguments, "throwScope") if $interface->extendedAttributes->{ConstructorMayThrowException};
7364
            push(@constructionConversionArguments, "WTFMove(object)");
7364
            push(@constructionConversionArguments, "WTFMove(object)");
7365
7365
7366
            push(@$outputArray, "    return JSValue::encode(toJSNewlyCreated<${IDLType}>(" . join(", ", @constructionConversionArguments) . "));\n");
7366
            push(@$outputArray, "    auto jsValue = toJSNewlyCreated<${IDLType}>(" . join(", ", @constructionConversionArguments) . ");\n");
7367
            push(@$outputArray, "    setSubclassStructureIfNeeded<${implType}>(lexicalGlobalObject, callFrame, jsValue);\n");
7368
            push(@$outputArray, "    RETURN_IF_EXCEPTION(throwScope, { });\n");
7369
            push(@$outputArray, "    return JSValue::encode(jsValue);\n");
7367
            push(@$outputArray, "}\n\n");
7370
            push(@$outputArray, "}\n\n");
7368
        }
7371
        }
7369
    }
7372
    }
- a/Source/WebCore/bindings/scripts/InFilesCompiler.pm +5 lines
Lines 243-248 sub generateInterfacesHeader() a/Source/WebCore/bindings/scripts/InFilesCompiler.pm_sec1
243
        print F "#endif\n";
243
        print F "#endif\n";
244
    }
244
    }
245
245
246
    if ($namespace eq "EventTarget") {
247
        print F "    ${suffix} = $count,\n";
248
        $count++;
249
    }
250
246
    for my $interface (sort keys %unconditionalInterfaces) {
251
    for my $interface (sort keys %unconditionalInterfaces) {
247
        print F "    ${interface}${suffix} = $count,\n";
252
        print F "    ${interface}${suffix} = $count,\n";
248
        $count++;
253
        $count++;
- a/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp -2 / +4 lines
Lines 159-165 template<> EncodedJSValue JSC_HOST_CALL JSTestEventConstructorConstructor::const a/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp_sec1
159
{
159
{
160
    VM& vm = lexicalGlobalObject->vm();
160
    VM& vm = lexicalGlobalObject->vm();
161
    auto throwScope = DECLARE_THROW_SCOPE(vm);
161
    auto throwScope = DECLARE_THROW_SCOPE(vm);
162
    UNUSED_PARAM(throwScope);
163
    auto* castedThis = jsCast<JSTestEventConstructorConstructor*>(callFrame->jsCallee());
162
    auto* castedThis = jsCast<JSTestEventConstructorConstructor*>(callFrame->jsCallee());
164
    ASSERT(castedThis);
163
    ASSERT(castedThis);
165
    if (UNLIKELY(callFrame->argumentCount() < 1))
164
    if (UNLIKELY(callFrame->argumentCount() < 1))
Lines 169-175 template<> EncodedJSValue JSC_HOST_CALL JSTestEventConstructorConstructor::const a/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp_sec2
169
    auto eventInitDict = convert<IDLDictionary<TestEventConstructor::Init>>(*lexicalGlobalObject, callFrame->argument(1));
168
    auto eventInitDict = convert<IDLDictionary<TestEventConstructor::Init>>(*lexicalGlobalObject, callFrame->argument(1));
170
    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
169
    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
171
    auto object = TestEventConstructor::create(WTFMove(type), WTFMove(eventInitDict));
170
    auto object = TestEventConstructor::create(WTFMove(type), WTFMove(eventInitDict));
172
    return JSValue::encode(toJSNewlyCreated<IDLInterface<TestEventConstructor>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)));
171
    auto jsValue = toJSNewlyCreated<IDLInterface<TestEventConstructor>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object));
172
    setSubclassStructureIfNeeded<TestEventConstructor>(lexicalGlobalObject, callFrame, jsValue);
173
    RETURN_IF_EXCEPTION(throwScope, { });
174
    return JSValue::encode(jsValue);
173
}
175
}
174
176
175
template<> JSValue JSTestEventConstructorConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
177
template<> JSValue JSTestEventConstructorConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
- a/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp -2 / +4 lines
Lines 258-264 template<> EncodedJSValue JSC_HOST_CALL JSTestInterfaceConstructor::construct(JS a/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp_sec1
258
{
258
{
259
    VM& vm = lexicalGlobalObject->vm();
259
    VM& vm = lexicalGlobalObject->vm();
260
    auto throwScope = DECLARE_THROW_SCOPE(vm);
260
    auto throwScope = DECLARE_THROW_SCOPE(vm);
261
    UNUSED_PARAM(throwScope);
262
    auto* castedThis = jsCast<JSTestInterfaceConstructor*>(callFrame->jsCallee());
261
    auto* castedThis = jsCast<JSTestInterfaceConstructor*>(callFrame->jsCallee());
263
    ASSERT(castedThis);
262
    ASSERT(castedThis);
264
    if (UNLIKELY(callFrame->argumentCount() < 1))
263
    if (UNLIKELY(callFrame->argumentCount() < 1))
Lines 271-277 template<> EncodedJSValue JSC_HOST_CALL JSTestInterfaceConstructor::construct(JS a/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp_sec2
271
    auto str2 = callFrame->argument(1).isUndefined() ? "defaultString"_s : convert<IDLDOMString>(*lexicalGlobalObject, callFrame->uncheckedArgument(1));
270
    auto str2 = callFrame->argument(1).isUndefined() ? "defaultString"_s : convert<IDLDOMString>(*lexicalGlobalObject, callFrame->uncheckedArgument(1));
272
    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
271
    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
273
    auto object = TestInterface::create(*context, WTFMove(str1), WTFMove(str2));
272
    auto object = TestInterface::create(*context, WTFMove(str1), WTFMove(str2));
274
    return JSValue::encode(toJSNewlyCreated<IDLInterface<TestInterface>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)));
273
    auto jsValue = toJSNewlyCreated<IDLInterface<TestInterface>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object));
274
    setSubclassStructureIfNeeded<TestInterface>(lexicalGlobalObject, callFrame, jsValue);
275
    RETURN_IF_EXCEPTION(throwScope, { });
276
    return JSValue::encode(jsValue);
275
}
277
}
276
278
277
template<> JSValue JSTestInterfaceConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
279
template<> JSValue JSTestInterfaceConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
- a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp -2 / +4 lines
Lines 94-100 template<> EncodedJSValue JSC_HOST_CALL JSTestNamedConstructorNamedConstructor:: a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp_sec1
94
{
94
{
95
    VM& vm = lexicalGlobalObject->vm();
95
    VM& vm = lexicalGlobalObject->vm();
96
    auto throwScope = DECLARE_THROW_SCOPE(vm);
96
    auto throwScope = DECLARE_THROW_SCOPE(vm);
97
    UNUSED_PARAM(throwScope);
98
    auto* castedThis = jsCast<JSTestNamedConstructorNamedConstructor*>(callFrame->jsCallee());
97
    auto* castedThis = jsCast<JSTestNamedConstructorNamedConstructor*>(callFrame->jsCallee());
99
    ASSERT(castedThis);
98
    ASSERT(castedThis);
100
    if (UNLIKELY(callFrame->argumentCount() < 1))
99
    if (UNLIKELY(callFrame->argumentCount() < 1))
Lines 106-112 template<> EncodedJSValue JSC_HOST_CALL JSTestNamedConstructorNamedConstructor:: a/Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp_sec2
106
    auto str3 = callFrame->argument(2).isUndefined() ? String() : convert<IDLDOMString>(*lexicalGlobalObject, callFrame->uncheckedArgument(2));
105
    auto str3 = callFrame->argument(2).isUndefined() ? String() : convert<IDLDOMString>(*lexicalGlobalObject, callFrame->uncheckedArgument(2));
107
    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
106
    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
108
    auto object = TestNamedConstructor::createForJSConstructor(WTFMove(str1), WTFMove(str2), WTFMove(str3));
107
    auto object = TestNamedConstructor::createForJSConstructor(WTFMove(str1), WTFMove(str2), WTFMove(str3));
109
    return JSValue::encode(toJSNewlyCreated<IDLInterface<TestNamedConstructor>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)));
108
    auto jsValue = toJSNewlyCreated<IDLInterface<TestNamedConstructor>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object));
109
    setSubclassStructureIfNeeded<TestNamedConstructor>(lexicalGlobalObject, callFrame, jsValue);
110
    RETURN_IF_EXCEPTION(throwScope, { });
111
    return JSValue::encode(jsValue);
110
}
112
}
111
113
112
template<> JSValue JSTestNamedConstructorNamedConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
114
template<> JSValue JSTestNamedConstructorNamedConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
- a/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp -2 / +4 lines
Lines 102-112 template<> EncodedJSValue JSC_HOST_CALL JSTestNodeConstructor::construct(JSGloba a/Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp_sec1
102
{
102
{
103
    VM& vm = lexicalGlobalObject->vm();
103
    VM& vm = lexicalGlobalObject->vm();
104
    auto throwScope = DECLARE_THROW_SCOPE(vm);
104
    auto throwScope = DECLARE_THROW_SCOPE(vm);
105
    UNUSED_PARAM(throwScope);
106
    auto* castedThis = jsCast<JSTestNodeConstructor*>(callFrame->jsCallee());
105
    auto* castedThis = jsCast<JSTestNodeConstructor*>(callFrame->jsCallee());
107
    ASSERT(castedThis);
106
    ASSERT(castedThis);
108
    auto object = TestNode::create();
107
    auto object = TestNode::create();
109
    return JSValue::encode(toJSNewlyCreated<IDLInterface<TestNode>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)));
108
    auto jsValue = toJSNewlyCreated<IDLInterface<TestNode>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object));
109
    setSubclassStructureIfNeeded<TestNode>(lexicalGlobalObject, callFrame, jsValue);
110
    RETURN_IF_EXCEPTION(throwScope, { });
111
    return JSValue::encode(jsValue);
110
}
112
}
111
113
112
template<> JSValue JSTestNodeConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
114
template<> JSValue JSTestNodeConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
- a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp -2 / +4 lines
Lines 1948-1954 template<> EncodedJSValue JSC_HOST_CALL JSTestObjConstructor::construct(JSGlobal a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp_sec1
1948
{
1948
{
1949
    VM& vm = lexicalGlobalObject->vm();
1949
    VM& vm = lexicalGlobalObject->vm();
1950
    auto throwScope = DECLARE_THROW_SCOPE(vm);
1950
    auto throwScope = DECLARE_THROW_SCOPE(vm);
1951
    UNUSED_PARAM(throwScope);
1952
    auto* castedThis = jsCast<JSTestObjConstructor*>(callFrame->jsCallee());
1951
    auto* castedThis = jsCast<JSTestObjConstructor*>(callFrame->jsCallee());
1953
    ASSERT(castedThis);
1952
    ASSERT(castedThis);
1954
    if (UNLIKELY(callFrame->argumentCount() < 2))
1953
    if (UNLIKELY(callFrame->argumentCount() < 2))
Lines 1963-1969 template<> EncodedJSValue JSC_HOST_CALL JSTestObjConstructor::construct(JSGlobal a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp_sec2
1963
    auto testCallbackFunction = convert<IDLCallbackFunction<JSTestCallbackFunction>>(*lexicalGlobalObject, callFrame->uncheckedArgument(1), *castedThis->globalObject(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(lexicalGlobalObject, scope, 1, "testCallbackFunction", "TestObject", nullptr); });
1962
    auto testCallbackFunction = convert<IDLCallbackFunction<JSTestCallbackFunction>>(*lexicalGlobalObject, callFrame->uncheckedArgument(1), *castedThis->globalObject(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(lexicalGlobalObject, scope, 1, "testCallbackFunction", "TestObject", nullptr); });
1964
    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
1963
    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
1965
    auto object = TestObj::create(document, testCallback.releaseNonNull(), testCallbackFunction.releaseNonNull());
1964
    auto object = TestObj::create(document, testCallback.releaseNonNull(), testCallbackFunction.releaseNonNull());
1966
    return JSValue::encode(toJSNewlyCreated<IDLInterface<TestObj>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)));
1965
    auto jsValue = toJSNewlyCreated<IDLInterface<TestObj>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object));
1966
    setSubclassStructureIfNeeded<TestObj>(lexicalGlobalObject, callFrame, jsValue);
1967
    RETURN_IF_EXCEPTION(throwScope, { });
1968
    return JSValue::encode(jsValue);
1967
}
1969
}
1968
1970
1969
template<> JSValue JSTestObjConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
1971
template<> JSValue JSTestObjConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
- a/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp -10 / +20 lines
Lines 81-145 static inline EncodedJSValue constructJSTestOverloadedConstructors1(JSGlobalObje a/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp_sec1
81
{
81
{
82
    VM& vm = lexicalGlobalObject->vm();
82
    VM& vm = lexicalGlobalObject->vm();
83
    auto throwScope = DECLARE_THROW_SCOPE(vm);
83
    auto throwScope = DECLARE_THROW_SCOPE(vm);
84
    UNUSED_PARAM(throwScope);
85
    auto* castedThis = jsCast<JSTestOverloadedConstructorsConstructor*>(callFrame->jsCallee());
84
    auto* castedThis = jsCast<JSTestOverloadedConstructorsConstructor*>(callFrame->jsCallee());
86
    ASSERT(castedThis);
85
    ASSERT(castedThis);
87
    auto arrayBuffer = convert<IDLArrayBuffer>(*lexicalGlobalObject, callFrame->uncheckedArgument(0), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentTypeError(lexicalGlobalObject, scope, 0, "arrayBuffer", "TestOverloadedConstructors", nullptr, "ArrayBuffer"); });
86
    auto arrayBuffer = convert<IDLArrayBuffer>(*lexicalGlobalObject, callFrame->uncheckedArgument(0), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentTypeError(lexicalGlobalObject, scope, 0, "arrayBuffer", "TestOverloadedConstructors", nullptr, "ArrayBuffer"); });
88
    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
87
    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
89
    auto object = TestOverloadedConstructors::create(*arrayBuffer);
88
    auto object = TestOverloadedConstructors::create(*arrayBuffer);
90
    return JSValue::encode(toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)));
89
    auto jsValue = toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object));
90
    setSubclassStructureIfNeeded<TestOverloadedConstructors>(lexicalGlobalObject, callFrame, jsValue);
91
    RETURN_IF_EXCEPTION(throwScope, { });
92
    return JSValue::encode(jsValue);
91
}
93
}
92
94
93
static inline EncodedJSValue constructJSTestOverloadedConstructors2(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)
95
static inline EncodedJSValue constructJSTestOverloadedConstructors2(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)
94
{
96
{
95
    VM& vm = lexicalGlobalObject->vm();
97
    VM& vm = lexicalGlobalObject->vm();
96
    auto throwScope = DECLARE_THROW_SCOPE(vm);
98
    auto throwScope = DECLARE_THROW_SCOPE(vm);
97
    UNUSED_PARAM(throwScope);
98
    auto* castedThis = jsCast<JSTestOverloadedConstructorsConstructor*>(callFrame->jsCallee());
99
    auto* castedThis = jsCast<JSTestOverloadedConstructorsConstructor*>(callFrame->jsCallee());
99
    ASSERT(castedThis);
100
    ASSERT(castedThis);
100
    auto arrayBufferView = convert<IDLArrayBufferView>(*lexicalGlobalObject, callFrame->uncheckedArgument(0), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentTypeError(lexicalGlobalObject, scope, 0, "arrayBufferView", "TestOverloadedConstructors", nullptr, "ArrayBufferView"); });
101
    auto arrayBufferView = convert<IDLArrayBufferView>(*lexicalGlobalObject, callFrame->uncheckedArgument(0), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentTypeError(lexicalGlobalObject, scope, 0, "arrayBufferView", "TestOverloadedConstructors", nullptr, "ArrayBufferView"); });
101
    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
102
    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
102
    auto object = TestOverloadedConstructors::create(arrayBufferView.releaseNonNull());
103
    auto object = TestOverloadedConstructors::create(arrayBufferView.releaseNonNull());
103
    return JSValue::encode(toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)));
104
    auto jsValue = toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object));
105
    setSubclassStructureIfNeeded<TestOverloadedConstructors>(lexicalGlobalObject, callFrame, jsValue);
106
    RETURN_IF_EXCEPTION(throwScope, { });
107
    return JSValue::encode(jsValue);
104
}
108
}
105
109
106
static inline EncodedJSValue constructJSTestOverloadedConstructors3(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)
110
static inline EncodedJSValue constructJSTestOverloadedConstructors3(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)
107
{
111
{
108
    VM& vm = lexicalGlobalObject->vm();
112
    VM& vm = lexicalGlobalObject->vm();
109
    auto throwScope = DECLARE_THROW_SCOPE(vm);
113
    auto throwScope = DECLARE_THROW_SCOPE(vm);
110
    UNUSED_PARAM(throwScope);
111
    auto* castedThis = jsCast<JSTestOverloadedConstructorsConstructor*>(callFrame->jsCallee());
114
    auto* castedThis = jsCast<JSTestOverloadedConstructorsConstructor*>(callFrame->jsCallee());
112
    ASSERT(castedThis);
115
    ASSERT(castedThis);
113
    auto blob = convert<IDLInterface<Blob>>(*lexicalGlobalObject, callFrame->uncheckedArgument(0), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentTypeError(lexicalGlobalObject, scope, 0, "blob", "TestOverloadedConstructors", nullptr, "Blob"); });
116
    auto blob = convert<IDLInterface<Blob>>(*lexicalGlobalObject, callFrame->uncheckedArgument(0), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentTypeError(lexicalGlobalObject, scope, 0, "blob", "TestOverloadedConstructors", nullptr, "Blob"); });
114
    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
117
    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
115
    auto object = TestOverloadedConstructors::create(*blob);
118
    auto object = TestOverloadedConstructors::create(*blob);
116
    return JSValue::encode(toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)));
119
    auto jsValue = toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object));
120
    setSubclassStructureIfNeeded<TestOverloadedConstructors>(lexicalGlobalObject, callFrame, jsValue);
121
    RETURN_IF_EXCEPTION(throwScope, { });
122
    return JSValue::encode(jsValue);
117
}
123
}
118
124
119
static inline EncodedJSValue constructJSTestOverloadedConstructors4(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)
125
static inline EncodedJSValue constructJSTestOverloadedConstructors4(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)
120
{
126
{
121
    VM& vm = lexicalGlobalObject->vm();
127
    VM& vm = lexicalGlobalObject->vm();
122
    auto throwScope = DECLARE_THROW_SCOPE(vm);
128
    auto throwScope = DECLARE_THROW_SCOPE(vm);
123
    UNUSED_PARAM(throwScope);
124
    auto* castedThis = jsCast<JSTestOverloadedConstructorsConstructor*>(callFrame->jsCallee());
129
    auto* castedThis = jsCast<JSTestOverloadedConstructorsConstructor*>(callFrame->jsCallee());
125
    ASSERT(castedThis);
130
    ASSERT(castedThis);
126
    auto string = convert<IDLDOMString>(*lexicalGlobalObject, callFrame->uncheckedArgument(0));
131
    auto string = convert<IDLDOMString>(*lexicalGlobalObject, callFrame->uncheckedArgument(0));
127
    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
132
    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
128
    auto object = TestOverloadedConstructors::create(WTFMove(string));
133
    auto object = TestOverloadedConstructors::create(WTFMove(string));
129
    return JSValue::encode(toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)));
134
    auto jsValue = toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object));
135
    setSubclassStructureIfNeeded<TestOverloadedConstructors>(lexicalGlobalObject, callFrame, jsValue);
136
    RETURN_IF_EXCEPTION(throwScope, { });
137
    return JSValue::encode(jsValue);
130
}
138
}
131
139
132
static inline EncodedJSValue constructJSTestOverloadedConstructors5(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)
140
static inline EncodedJSValue constructJSTestOverloadedConstructors5(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)
133
{
141
{
134
    VM& vm = lexicalGlobalObject->vm();
142
    VM& vm = lexicalGlobalObject->vm();
135
    auto throwScope = DECLARE_THROW_SCOPE(vm);
143
    auto throwScope = DECLARE_THROW_SCOPE(vm);
136
    UNUSED_PARAM(throwScope);
137
    auto* castedThis = jsCast<JSTestOverloadedConstructorsConstructor*>(callFrame->jsCallee());
144
    auto* castedThis = jsCast<JSTestOverloadedConstructorsConstructor*>(callFrame->jsCallee());
138
    ASSERT(castedThis);
145
    ASSERT(castedThis);
139
    auto longArgs = convertVariadicArguments<IDLLong>(*lexicalGlobalObject, *callFrame, 0);
146
    auto longArgs = convertVariadicArguments<IDLLong>(*lexicalGlobalObject, *callFrame, 0);
140
    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
147
    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
141
    auto object = TestOverloadedConstructors::create(WTFMove(longArgs));
148
    auto object = TestOverloadedConstructors::create(WTFMove(longArgs));
142
    return JSValue::encode(toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)));
149
    auto jsValue = toJSNewlyCreated<IDLInterface<TestOverloadedConstructors>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object));
150
    setSubclassStructureIfNeeded<TestOverloadedConstructors>(lexicalGlobalObject, callFrame, jsValue);
151
    RETURN_IF_EXCEPTION(throwScope, { });
152
    return JSValue::encode(jsValue);
143
}
153
}
144
154
145
template<> EncodedJSValue JSC_HOST_CALL JSTestOverloadedConstructorsConstructor::construct(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)
155
template<> EncodedJSValue JSC_HOST_CALL JSTestOverloadedConstructorsConstructor::construct(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)
- a/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp -4 / +8 lines
Lines 80-105 static inline EncodedJSValue constructJSTestOverloadedConstructorsWithSequence1( a/Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp_sec1
80
{
80
{
81
    VM& vm = lexicalGlobalObject->vm();
81
    VM& vm = lexicalGlobalObject->vm();
82
    auto throwScope = DECLARE_THROW_SCOPE(vm);
82
    auto throwScope = DECLARE_THROW_SCOPE(vm);
83
    UNUSED_PARAM(throwScope);
84
    auto* castedThis = jsCast<JSTestOverloadedConstructorsWithSequenceConstructor*>(callFrame->jsCallee());
83
    auto* castedThis = jsCast<JSTestOverloadedConstructorsWithSequenceConstructor*>(callFrame->jsCallee());
85
    ASSERT(castedThis);
84
    ASSERT(castedThis);
86
    auto sequenceOfStrings = callFrame->argument(0).isUndefined() ? Converter<IDLSequence<IDLDOMString>>::ReturnType{ } : convert<IDLSequence<IDLDOMString>>(*lexicalGlobalObject, callFrame->uncheckedArgument(0));
85
    auto sequenceOfStrings = callFrame->argument(0).isUndefined() ? Converter<IDLSequence<IDLDOMString>>::ReturnType{ } : convert<IDLSequence<IDLDOMString>>(*lexicalGlobalObject, callFrame->uncheckedArgument(0));
87
    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
86
    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
88
    auto object = TestOverloadedConstructorsWithSequence::create(WTFMove(sequenceOfStrings));
87
    auto object = TestOverloadedConstructorsWithSequence::create(WTFMove(sequenceOfStrings));
89
    return JSValue::encode(toJSNewlyCreated<IDLInterface<TestOverloadedConstructorsWithSequence>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)));
88
    auto jsValue = toJSNewlyCreated<IDLInterface<TestOverloadedConstructorsWithSequence>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object));
89
    setSubclassStructureIfNeeded<TestOverloadedConstructorsWithSequence>(lexicalGlobalObject, callFrame, jsValue);
90
    RETURN_IF_EXCEPTION(throwScope, { });
91
    return JSValue::encode(jsValue);
90
}
92
}
91
93
92
static inline EncodedJSValue constructJSTestOverloadedConstructorsWithSequence2(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)
94
static inline EncodedJSValue constructJSTestOverloadedConstructorsWithSequence2(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)
93
{
95
{
94
    VM& vm = lexicalGlobalObject->vm();
96
    VM& vm = lexicalGlobalObject->vm();
95
    auto throwScope = DECLARE_THROW_SCOPE(vm);
97
    auto throwScope = DECLARE_THROW_SCOPE(vm);
96
    UNUSED_PARAM(throwScope);
97
    auto* castedThis = jsCast<JSTestOverloadedConstructorsWithSequenceConstructor*>(callFrame->jsCallee());
98
    auto* castedThis = jsCast<JSTestOverloadedConstructorsWithSequenceConstructor*>(callFrame->jsCallee());
98
    ASSERT(castedThis);
99
    ASSERT(castedThis);
99
    auto string = convert<IDLDOMString>(*lexicalGlobalObject, callFrame->uncheckedArgument(0));
100
    auto string = convert<IDLDOMString>(*lexicalGlobalObject, callFrame->uncheckedArgument(0));
100
    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
101
    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
101
    auto object = TestOverloadedConstructorsWithSequence::create(WTFMove(string));
102
    auto object = TestOverloadedConstructorsWithSequence::create(WTFMove(string));
102
    return JSValue::encode(toJSNewlyCreated<IDLInterface<TestOverloadedConstructorsWithSequence>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)));
103
    auto jsValue = toJSNewlyCreated<IDLInterface<TestOverloadedConstructorsWithSequence>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object));
104
    setSubclassStructureIfNeeded<TestOverloadedConstructorsWithSequence>(lexicalGlobalObject, callFrame, jsValue);
105
    RETURN_IF_EXCEPTION(throwScope, { });
106
    return JSValue::encode(jsValue);
103
}
107
}
104
108
105
template<> EncodedJSValue JSC_HOST_CALL JSTestOverloadedConstructorsWithSequenceConstructor::construct(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)
109
template<> EncodedJSValue JSC_HOST_CALL JSTestOverloadedConstructorsWithSequenceConstructor::construct(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)
- a/Source/WebCore/bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp -2 / +4 lines
Lines 160-166 template<> EncodedJSValue JSC_HOST_CALL JSTestPromiseRejectionEventConstructor:: a/Source/WebCore/bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp_sec1
160
{
160
{
161
    VM& vm = lexicalGlobalObject->vm();
161
    VM& vm = lexicalGlobalObject->vm();
162
    auto throwScope = DECLARE_THROW_SCOPE(vm);
162
    auto throwScope = DECLARE_THROW_SCOPE(vm);
163
    UNUSED_PARAM(throwScope);
164
    auto* castedThis = jsCast<JSTestPromiseRejectionEventConstructor*>(callFrame->jsCallee());
163
    auto* castedThis = jsCast<JSTestPromiseRejectionEventConstructor*>(callFrame->jsCallee());
165
    ASSERT(castedThis);
164
    ASSERT(castedThis);
166
    if (UNLIKELY(callFrame->argumentCount() < 2))
165
    if (UNLIKELY(callFrame->argumentCount() < 2))
Lines 170-176 template<> EncodedJSValue JSC_HOST_CALL JSTestPromiseRejectionEventConstructor:: a/Source/WebCore/bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp_sec2
170
    auto eventInitDict = convert<IDLDictionary<TestPromiseRejectionEvent::Init>>(*lexicalGlobalObject, callFrame->uncheckedArgument(1));
169
    auto eventInitDict = convert<IDLDictionary<TestPromiseRejectionEvent::Init>>(*lexicalGlobalObject, callFrame->uncheckedArgument(1));
171
    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
170
    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
172
    auto object = TestPromiseRejectionEvent::create(*castedThis->globalObject(), WTFMove(type), WTFMove(eventInitDict));
171
    auto object = TestPromiseRejectionEvent::create(*castedThis->globalObject(), WTFMove(type), WTFMove(eventInitDict));
173
    return JSValue::encode(toJSNewlyCreated<IDLInterface<TestPromiseRejectionEvent>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)));
172
    auto jsValue = toJSNewlyCreated<IDLInterface<TestPromiseRejectionEvent>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object));
173
    setSubclassStructureIfNeeded<TestPromiseRejectionEvent>(lexicalGlobalObject, callFrame, jsValue);
174
    RETURN_IF_EXCEPTION(throwScope, { });
175
    return JSValue::encode(jsValue);
174
}
176
}
175
177
176
template<> JSValue JSTestPromiseRejectionEventConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
178
template<> JSValue JSTestPromiseRejectionEventConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
- a/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp -2 / +4 lines
Lines 148-154 template<> EncodedJSValue JSC_HOST_CALL JSTestTypedefsConstructor::construct(JSG a/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp_sec1
148
{
148
{
149
    VM& vm = lexicalGlobalObject->vm();
149
    VM& vm = lexicalGlobalObject->vm();
150
    auto throwScope = DECLARE_THROW_SCOPE(vm);
150
    auto throwScope = DECLARE_THROW_SCOPE(vm);
151
    UNUSED_PARAM(throwScope);
152
    auto* castedThis = jsCast<JSTestTypedefsConstructor*>(callFrame->jsCallee());
151
    auto* castedThis = jsCast<JSTestTypedefsConstructor*>(callFrame->jsCallee());
153
    ASSERT(castedThis);
152
    ASSERT(castedThis);
154
    if (UNLIKELY(callFrame->argumentCount() < 3))
153
    if (UNLIKELY(callFrame->argumentCount() < 3))
Lines 160-166 template<> EncodedJSValue JSC_HOST_CALL JSTestTypedefsConstructor::construct(JSG a/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp_sec2
160
    auto testCallbackInterface = convert<IDLCallbackInterface<JSTestCallbackInterface>>(*lexicalGlobalObject, callFrame->uncheckedArgument(2), *castedThis->globalObject(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(lexicalGlobalObject, scope, 2, "testCallbackInterface", "TestTypedefs", nullptr); });
159
    auto testCallbackInterface = convert<IDLCallbackInterface<JSTestCallbackInterface>>(*lexicalGlobalObject, callFrame->uncheckedArgument(2), *castedThis->globalObject(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(lexicalGlobalObject, scope, 2, "testCallbackInterface", "TestTypedefs", nullptr); });
161
    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
160
    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
162
    auto object = TestTypedefs::create(WTFMove(hello), testCallbackFunction.releaseNonNull(), testCallbackInterface.releaseNonNull());
161
    auto object = TestTypedefs::create(WTFMove(hello), testCallbackFunction.releaseNonNull(), testCallbackInterface.releaseNonNull());
163
    return JSValue::encode(toJSNewlyCreated<IDLInterface<TestTypedefs>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)));
162
    auto jsValue = toJSNewlyCreated<IDLInterface<TestTypedefs>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object));
163
    setSubclassStructureIfNeeded<TestTypedefs>(lexicalGlobalObject, callFrame, jsValue);
164
    RETURN_IF_EXCEPTION(throwScope, { });
165
    return JSValue::encode(jsValue);
164
}
166
}
165
167
166
template<> JSValue JSTestTypedefsConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
168
template<> JSValue JSTestTypedefsConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
- a/Source/WebCore/dom/EventTarget.cpp +6 lines
Lines 34-39 a/Source/WebCore/dom/EventTarget.cpp_sec1
34
34
35
#include "DOMWrapperWorld.h"
35
#include "DOMWrapperWorld.h"
36
#include "EventNames.h"
36
#include "EventNames.h"
37
#include "EventTargetConcrete.h"
37
#include "HTMLBodyElement.h"
38
#include "HTMLBodyElement.h"
38
#include "HTMLHtmlElement.h"
39
#include "HTMLHtmlElement.h"
39
#include "InspectorInstrumentation.h"
40
#include "InspectorInstrumentation.h"
Lines 58-63 namespace WebCore { a/Source/WebCore/dom/EventTarget.cpp_sec2
58
WTF_MAKE_ISO_ALLOCATED_IMPL(EventTarget);
59
WTF_MAKE_ISO_ALLOCATED_IMPL(EventTarget);
59
WTF_MAKE_ISO_ALLOCATED_IMPL(EventTargetWithInlineData);
60
WTF_MAKE_ISO_ALLOCATED_IMPL(EventTargetWithInlineData);
60
61
62
Ref<EventTarget> EventTarget::create(ScriptExecutionContext& context)
63
{
64
    return EventTargetConcrete::create(context);
65
}
66
61
bool EventTarget::isNode() const
67
bool EventTarget::isNode() const
62
{
68
{
63
    return false;
69
    return false;
- a/Source/WebCore/dom/EventTarget.h +2 lines
Lines 54-59 public: a/Source/WebCore/dom/EventTarget.h_sec1
54
class EventTarget : public ScriptWrappable {
54
class EventTarget : public ScriptWrappable {
55
    WTF_MAKE_ISO_ALLOCATED(EventTarget);
55
    WTF_MAKE_ISO_ALLOCATED(EventTarget);
56
public:
56
public:
57
    static Ref<EventTarget> create(ScriptExecutionContext&);
58
57
    void ref() { refEventTarget(); }
59
    void ref() { refEventTarget(); }
58
    void deref() { derefEventTarget(); }
60
    void deref() { derefEventTarget(); }
59
61
- a/Source/WebCore/dom/EventTarget.idl +2 lines
Lines 19-24 a/Source/WebCore/dom/EventTarget.idl_sec1
19
 */
19
 */
20
20
21
[
21
[
22
    Constructor,
23
    ConstructorCallWith=ScriptExecutionContext,
22
    CustomToJSObject,
24
    CustomToJSObject,
23
    Exposed=(Window,Worker),
25
    Exposed=(Window,Worker),
24
    IsImmutablePrototypeExoticObjectOnPrototype,
26
    IsImmutablePrototypeExoticObjectOnPrototype,
- a/Source/WebCore/dom/EventTargetConcrete.cpp +43 lines
Line 0 a/Source/WebCore/dom/EventTargetConcrete.cpp_sec1
1
/*
2
 * Copyright (C) 2020 Alexey Shvayka <shvaikalesh@gmail.com>.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23
 * THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#include "config.h"
27
#include "EventTargetConcrete.h"
28
29
namespace WebCore {
30
31
WTF_MAKE_ISO_ALLOCATED_IMPL(EventTargetConcrete);
32
33
Ref<EventTargetConcrete> EventTargetConcrete::create(ScriptExecutionContext& context)
34
{
35
    return adoptRef(*new EventTargetConcrete(context));
36
}
37
38
EventTargetConcrete::EventTargetConcrete(ScriptExecutionContext& context)
39
    : ContextDestructionObserver(&context)
40
{
41
}
42
43
} // namespace WebCore
- a/Source/WebCore/dom/EventTargetConcrete.h +55 lines
Line 0 a/Source/WebCore/dom/EventTargetConcrete.h_sec1
1
/*
2
 * Copyright (C) 2020 Alexey Shvayka <shvaikalesh@gmail.com>.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23
 * THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#pragma once
27
28
#include "ContextDestructionObserver.h"
29
#include "EventTarget.h"
30
#include "EventTargetInterfaces.h"
31
#include "ScriptExecutionContext.h"
32
#include <wtf/IsoMallocInlines.h>
33
#include <wtf/RefCounted.h>
34
35
namespace WebCore {
36
37
class EventTargetConcrete final : public RefCounted<EventTargetConcrete>, public EventTargetWithInlineData, private ContextDestructionObserver {
38
    WTF_MAKE_ISO_ALLOCATED(EventTargetConcrete);
39
public:
40
    static Ref<EventTargetConcrete> create(ScriptExecutionContext&);
41
42
    using RefCounted::ref;
43
    using RefCounted::deref;
44
45
private:
46
    explicit EventTargetConcrete(ScriptExecutionContext&);
47
48
    EventTargetInterface eventTargetInterface() const final { return EventTargetInterfaceType; }
49
    ScriptExecutionContext* scriptExecutionContext() const final { return ContextDestructionObserver::scriptExecutionContext(); }
50
51
    void refEventTarget() final { ref(); }
52
    void derefEventTarget() final { deref(); }
53
};
54
55
} // namespace WebCore
- a/Source/WebCore/dom/make_event_factory.pl -4 / +5 lines
Lines 135-147 sub generateImplementation() a/Source/WebCore/dom/make_event_factory.pl_sec1
135
        print F "#endif\n" if $conditional;
135
        print F "#endif\n" if $conditional;
136
    }
136
    }
137
137
138
    print F "    }\n";
138
    print F "    default:\n";
139
    if ($factoryFunction eq "toNewlyCreated") {
139
    if ($factoryFunction eq "toNewlyCreated") {
140
        print F "    return createWrapper<$namespace>(globalObject, WTFMove(impl));\n";
140
        print F "        return createWrapper<$namespace>(globalObject, WTFMove(impl));\n";
141
    } else {
141
    } else {
142
        print F "    ASSERT_NOT_REACHED();\n";
142
        print F "        return wrap(state, globalObject, impl);\n";
143
        print F "    return JSC::jsNull();\n";
144
    }
143
    }
144
145
    print F "    }\n";
145
    print F "}\n";
146
    print F "}\n";
146
    print F "\n";
147
    print F "\n";
147
    print F "} // namespace WebCore\n";
148
    print F "} // namespace WebCore\n";
- a/LayoutTests/ChangeLog +11 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2020-02-14  Alexey Shvayka  <shvaikalesh@gmail.com>
2
3
        Implement EventTarget constructor
4
        https://bugs.webkit.org/show_bug.cgi?id=174313
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        * fast/dom/dom-constructors-expected.txt:
9
        * fast/dom/dom-constructors.html:
10
        * platform/ios/imported/w3c/web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt: Removed.
11
1
2020-02-12  Jason Lawrence  <lawrence.j@apple.com>
12
2020-02-12  Jason Lawrence  <lawrence.j@apple.com>
2
13
3
        [Mac wk2 ] fast/dom/attr_dead_doc.html is flaky failing.
14
        [Mac wk2 ] fast/dom/attr_dead_doc.html is flaky failing.
- a/LayoutTests/imported/w3c/ChangeLog +14 lines
Lines 1-3 a/LayoutTests/imported/w3c/ChangeLog_sec1
1
2020-02-14  Alexey Shvayka  <shvaikalesh@gmail.com>
2
3
        Implement EventTarget constructor
4
        https://bugs.webkit.org/show_bug.cgi?id=174313
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        * web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt:
9
        * web-platform-tests/dom/events/EventTarget-constructible.any-expected.txt:
10
        * web-platform-tests/dom/events/EventTarget-constructible.any.worker-expected.txt:
11
        * web-platform-tests/dom/events/event-global-extra.window-expected.txt:
12
        * web-platform-tests/dom/idlharness.any.worker-expected.txt:
13
        * web-platform-tests/dom/idlharness.window-expected.txt:
14
1
2020-02-12  Rossana Monteriso  <rmonteriso@igalia.com>
15
2020-02-12  Rossana Monteriso  <rmonteriso@igalia.com>
2
16
3
        [css-grid] Move grid-item-auto-margins-alignment tests to WPT folder
17
        [css-grid] Move grid-item-auto-margins-alignment tests to WPT folder
- a/LayoutTests/fast/dom/dom-constructors-expected.txt -1 / +3 lines
Lines 8-14 PASS TryAllocate('CharacterData') is 'exception' a/LayoutTests/fast/dom/dom-constructors-expected.txt_sec1
8
PASS TryAllocate('CDATASection') is 'exception'
8
PASS TryAllocate('CDATASection') is 'exception'
9
PASS TryAllocate('DocumentType') is 'exception'
9
PASS TryAllocate('DocumentType') is 'exception'
10
PASS TryAllocate('Element') is 'exception'
10
PASS TryAllocate('Element') is 'exception'
11
PASS TryAllocate('EventTarget') is 'exception'
12
PASS TryAllocate('HTMLDocument') is 'exception'
11
PASS TryAllocate('HTMLDocument') is 'exception'
13
PASS TryAllocate('Node') is 'exception'
12
PASS TryAllocate('Node') is 'exception'
14
PASS TryAllocate('ProcessingInstruction') is 'exception'
13
PASS TryAllocate('ProcessingInstruction') is 'exception'
Lines 131-136 PASS TryAllocate('Document') is '[object Document]' a/LayoutTests/fast/dom/dom-constructors-expected.txt_sec2
131
PASS TryAllocate('DocumentFragment') is '[object DocumentFragment]'
130
PASS TryAllocate('DocumentFragment') is '[object DocumentFragment]'
132
PASS TryAllocate('DocumentFragment') is '[object DocumentFragment]'
131
PASS TryAllocate('DocumentFragment') is '[object DocumentFragment]'
133
PASS TryAllocate('DocumentFragment') is '[object DocumentFragment]'
132
PASS TryAllocate('DocumentFragment') is '[object DocumentFragment]'
133
PASS TryAllocate('EventTarget') is '[object EventTarget]'
134
PASS TryAllocate('EventTarget') is '[object EventTarget]'
135
PASS TryAllocate('EventTarget') is '[object EventTarget]'
134
PASS TryAllocate('Range') is '[object Range]'
136
PASS TryAllocate('Range') is '[object Range]'
135
PASS TryAllocate('Range') is '[object Range]'
137
PASS TryAllocate('Range') is '[object Range]'
136
PASS TryAllocate('Range') is '[object Range]'
138
PASS TryAllocate('Range') is '[object Range]'
- a/LayoutTests/fast/dom/dom-constructors.html -1 / +1 lines
Lines 18-24 var objects_exception = [ a/LayoutTests/fast/dom/dom-constructors.html_sec1
18
    'CDATASection',
18
    'CDATASection',
19
    'DocumentType',
19
    'DocumentType',
20
    'Element',
20
    'Element',
21
    'EventTarget',
22
    'HTMLDocument',
21
    'HTMLDocument',
23
    'Node',
22
    'Node',
24
    'ProcessingInstruction',
23
    'ProcessingInstruction',
Lines 132-137 var objects_constructor = [ a/LayoutTests/fast/dom/dom-constructors.html_sec2
132
    'DOMParser',
131
    'DOMParser',
133
    'Document',
132
    'Document',
134
    'DocumentFragment',
133
    'DocumentFragment',
134
    'EventTarget',
135
    'Range',
135
    'Range',
136
    'Text',
136
    'Text',
137
    'XMLHttpRequest',
137
    'XMLHttpRequest',
- a/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt -6 / +6 lines
Lines 41-51 PASS CompositionEvent constructor (null argument) a/LayoutTests/imported/w3c/web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt_sec1
41
PASS CompositionEvent constructor (empty argument) 
41
PASS CompositionEvent constructor (empty argument) 
42
PASS CompositionEvent constructor (argument with default values) 
42
PASS CompositionEvent constructor (argument with default values) 
43
PASS CompositionEvent constructor (argument with non-default values) 
43
PASS CompositionEvent constructor (argument with non-default values) 
44
FAIL SubclassedEvent constructor (no argument) assert_true: expected true got false
44
PASS SubclassedEvent constructor (no argument) 
45
FAIL SubclassedEvent constructor (undefined argument) assert_true: expected true got false
45
PASS SubclassedEvent constructor (undefined argument) 
46
FAIL SubclassedEvent constructor (null argument) assert_true: expected true got false
46
PASS SubclassedEvent constructor (null argument) 
47
FAIL SubclassedEvent constructor (empty argument) assert_true: expected true got false
47
PASS SubclassedEvent constructor (empty argument) 
48
FAIL SubclassedEvent constructor (argument with default values) assert_true: expected true got false
48
PASS SubclassedEvent constructor (argument with default values) 
49
FAIL SubclassedEvent constructor (argument with non-default values) assert_true: expected true got false
49
PASS SubclassedEvent constructor (argument with non-default values) 
50
PASS UIEvent constructor (view argument with wrong type) 
50
PASS UIEvent constructor (view argument with wrong type) 
51
51
- a/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventTarget-constructible.any-expected.txt -2 / +2 lines
Lines 1-4 a/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventTarget-constructible.any-expected.txt_sec1
1
1
2
FAIL A constructed EventTarget can be used as expected function is not a constructor (evaluating 'new EventTarget()')
2
PASS A constructed EventTarget can be used as expected 
3
FAIL EventTarget can be subclassed function is not a constructor (evaluating 'super(...args)')
3
PASS EventTarget can be subclassed 
4
4
- a/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventTarget-constructible.any.worker-expected.txt -2 / +2 lines
Lines 1-4 a/LayoutTests/imported/w3c/web-platform-tests/dom/events/EventTarget-constructible.any.worker-expected.txt_sec1
1
1
2
FAIL A constructed EventTarget can be used as expected function is not a constructor (evaluating 'new EventTarget()')
2
PASS A constructed EventTarget can be used as expected 
3
FAIL EventTarget can be subclassed function is not a constructor (evaluating 'super(...args)')
3
PASS EventTarget can be subclassed 
4
4
- a/LayoutTests/imported/w3c/web-platform-tests/dom/events/event-global-extra.window-expected.txt -1 / +1 lines
Lines 1-5 a/LayoutTests/imported/w3c/web-platform-tests/dom/events/event-global-extra.window-expected.txt_sec1
1
1
2
FAIL window.event for constructors from another global: EventTarget function is not a constructor (evaluating 'new otherWindow[constructorName]()')
2
FAIL window.event for constructors from another global: EventTarget assert_equals: expected (undefined) undefined but got (object) object "[object Event]"
3
FAIL window.event for constructors from another global: XMLHttpRequest assert_equals: expected (undefined) undefined but got (object) object "[object Event]"
3
FAIL window.event for constructors from another global: XMLHttpRequest assert_equals: expected (undefined) undefined but got (object) object "[object Event]"
4
PASS window.event and element from another document 
4
PASS window.event and element from another document 
5
FAIL window.event and moving an element post-dispatch assert_equals: expected (object) object "[object Event]" but got (undefined) undefined
5
FAIL window.event and moving an element post-dispatch assert_equals: expected (object) object "[object Event]" but got (undefined) undefined
- a/LayoutTests/imported/w3c/web-platform-tests/dom/idlharness.any.worker-expected.txt -8 / +8 lines
Lines 133-146 PASS EventTarget interface: existence and properties of interface prototype obje a/LayoutTests/imported/w3c/web-platform-tests/dom/idlharness.any.worker-expected.txt_sec1
133
PASS EventTarget interface: operation addEventListener(DOMString, EventListener, [object Object],[object Object]) 
133
PASS EventTarget interface: operation addEventListener(DOMString, EventListener, [object Object],[object Object]) 
134
PASS EventTarget interface: operation removeEventListener(DOMString, EventListener, [object Object],[object Object]) 
134
PASS EventTarget interface: operation removeEventListener(DOMString, EventListener, [object Object],[object Object]) 
135
PASS EventTarget interface: operation dispatchEvent(Event) 
135
PASS EventTarget interface: operation dispatchEvent(Event) 
136
FAIL EventTarget must be primary interface of new EventTarget() assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new EventTarget()')"
136
PASS EventTarget must be primary interface of new EventTarget() 
137
FAIL Stringification of new EventTarget() assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new EventTarget()')"
137
PASS Stringification of new EventTarget() 
138
FAIL EventTarget interface: new EventTarget() must inherit property "addEventListener(DOMString, EventListener, [object Object],[object Object])" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new EventTarget()')"
138
PASS EventTarget interface: new EventTarget() must inherit property "addEventListener(DOMString, EventListener, [object Object],[object Object])" with the proper type 
139
FAIL EventTarget interface: calling addEventListener(DOMString, EventListener, [object Object],[object Object]) on new EventTarget() with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new EventTarget()')"
139
PASS EventTarget interface: calling addEventListener(DOMString, EventListener, [object Object],[object Object]) on new EventTarget() with too few arguments must throw TypeError 
140
FAIL EventTarget interface: new EventTarget() must inherit property "removeEventListener(DOMString, EventListener, [object Object],[object Object])" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new EventTarget()')"
140
PASS EventTarget interface: new EventTarget() must inherit property "removeEventListener(DOMString, EventListener, [object Object],[object Object])" with the proper type 
141
FAIL EventTarget interface: calling removeEventListener(DOMString, EventListener, [object Object],[object Object]) on new EventTarget() with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new EventTarget()')"
141
PASS EventTarget interface: calling removeEventListener(DOMString, EventListener, [object Object],[object Object]) on new EventTarget() with too few arguments must throw TypeError 
142
FAIL EventTarget interface: new EventTarget() must inherit property "dispatchEvent(Event)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new EventTarget()')"
142
PASS EventTarget interface: new EventTarget() must inherit property "dispatchEvent(Event)" with the proper type 
143
FAIL EventTarget interface: calling dispatchEvent(Event) on new EventTarget() with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new EventTarget()')"
143
PASS EventTarget interface: calling dispatchEvent(Event) on new EventTarget() with too few arguments must throw TypeError 
144
PASS EventListener interface: existence and properties of interface object 
144
PASS EventListener interface: existence and properties of interface object 
145
PASS AbortController interface: existence and properties of interface object 
145
PASS AbortController interface: existence and properties of interface object 
146
PASS AbortController interface object length 
146
PASS AbortController interface object length 
- a/LayoutTests/imported/w3c/web-platform-tests/dom/idlharness.window-expected.txt -8 / +8 lines
Lines 158-171 PASS EventTarget interface: existence and properties of interface prototype obje a/LayoutTests/imported/w3c/web-platform-tests/dom/idlharness.window-expected.txt_sec1
158
PASS EventTarget interface: operation addEventListener(DOMString, EventListener, [object Object],[object Object]) 
158
PASS EventTarget interface: operation addEventListener(DOMString, EventListener, [object Object],[object Object]) 
159
PASS EventTarget interface: operation removeEventListener(DOMString, EventListener, [object Object],[object Object]) 
159
PASS EventTarget interface: operation removeEventListener(DOMString, EventListener, [object Object],[object Object]) 
160
PASS EventTarget interface: operation dispatchEvent(Event) 
160
PASS EventTarget interface: operation dispatchEvent(Event) 
161
FAIL EventTarget must be primary interface of new EventTarget() assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new EventTarget()')"
161
PASS EventTarget must be primary interface of new EventTarget() 
162
FAIL Stringification of new EventTarget() assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new EventTarget()')"
162
PASS Stringification of new EventTarget() 
163
FAIL EventTarget interface: new EventTarget() must inherit property "addEventListener(DOMString, EventListener, [object Object],[object Object])" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new EventTarget()')"
163
PASS EventTarget interface: new EventTarget() must inherit property "addEventListener(DOMString, EventListener, [object Object],[object Object])" with the proper type 
164
FAIL EventTarget interface: calling addEventListener(DOMString, EventListener, [object Object],[object Object]) on new EventTarget() with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new EventTarget()')"
164
PASS EventTarget interface: calling addEventListener(DOMString, EventListener, [object Object],[object Object]) on new EventTarget() with too few arguments must throw TypeError 
165
FAIL EventTarget interface: new EventTarget() must inherit property "removeEventListener(DOMString, EventListener, [object Object],[object Object])" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new EventTarget()')"
165
PASS EventTarget interface: new EventTarget() must inherit property "removeEventListener(DOMString, EventListener, [object Object],[object Object])" with the proper type 
166
FAIL EventTarget interface: calling removeEventListener(DOMString, EventListener, [object Object],[object Object]) on new EventTarget() with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new EventTarget()')"
166
PASS EventTarget interface: calling removeEventListener(DOMString, EventListener, [object Object],[object Object]) on new EventTarget() with too few arguments must throw TypeError 
167
FAIL EventTarget interface: new EventTarget() must inherit property "dispatchEvent(Event)" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new EventTarget()')"
167
PASS EventTarget interface: new EventTarget() must inherit property "dispatchEvent(Event)" with the proper type 
168
FAIL EventTarget interface: calling dispatchEvent(Event) on new EventTarget() with too few arguments must throw TypeError assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: function is not a constructor (evaluating 'new EventTarget()')"
168
PASS EventTarget interface: calling dispatchEvent(Event) on new EventTarget() with too few arguments must throw TypeError 
169
PASS EventListener interface: existence and properties of interface object 
169
PASS EventListener interface: existence and properties of interface object 
170
PASS EventListener interface: existence and properties of interface prototype object 
170
PASS EventListener interface: existence and properties of interface prototype object 
171
PASS EventListener interface: existence and properties of interface prototype object's "constructor" property 
171
PASS EventListener interface: existence and properties of interface prototype object's "constructor" property 
- a/LayoutTests/platform/ios/imported/w3c/web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt -51 lines
Lines 1-51 a/LayoutTests/platform/ios/imported/w3c/web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt_sec1
1
2
PASS Event constructor (no argument) 
3
PASS Event constructor (undefined argument) 
4
PASS Event constructor (null argument) 
5
PASS Event constructor (empty argument) 
6
PASS Event constructor (argument with default values) 
7
PASS Event constructor (argument with non-default values) 
8
PASS UIEvent constructor (no argument) 
9
PASS UIEvent constructor (undefined argument) 
10
PASS UIEvent constructor (null argument) 
11
PASS UIEvent constructor (empty argument) 
12
PASS UIEvent constructor (argument with default values) 
13
PASS UIEvent constructor (argument with non-default values) 
14
PASS FocusEvent constructor (no argument) 
15
PASS FocusEvent constructor (undefined argument) 
16
PASS FocusEvent constructor (null argument) 
17
PASS FocusEvent constructor (empty argument) 
18
PASS FocusEvent constructor (argument with default values) 
19
PASS FocusEvent constructor (argument with non-default values) 
20
PASS MouseEvent constructor (no argument) 
21
PASS MouseEvent constructor (undefined argument) 
22
PASS MouseEvent constructor (null argument) 
23
PASS MouseEvent constructor (empty argument) 
24
PASS MouseEvent constructor (argument with default values) 
25
PASS MouseEvent constructor (argument with non-default values) 
26
PASS WheelEvent constructor (no argument) 
27
PASS WheelEvent constructor (undefined argument) 
28
PASS WheelEvent constructor (null argument) 
29
PASS WheelEvent constructor (empty argument) 
30
PASS WheelEvent constructor (argument with default values) 
31
PASS WheelEvent constructor (argument with non-default values) 
32
PASS KeyboardEvent constructor (no argument) 
33
PASS KeyboardEvent constructor (undefined argument) 
34
PASS KeyboardEvent constructor (null argument) 
35
PASS KeyboardEvent constructor (empty argument) 
36
PASS KeyboardEvent constructor (argument with default values) 
37
PASS KeyboardEvent constructor (argument with non-default values) 
38
PASS CompositionEvent constructor (no argument) 
39
PASS CompositionEvent constructor (undefined argument) 
40
PASS CompositionEvent constructor (null argument) 
41
PASS CompositionEvent constructor (empty argument) 
42
PASS CompositionEvent constructor (argument with default values) 
43
PASS CompositionEvent constructor (argument with non-default values) 
44
FAIL SubclassedEvent constructor (no argument) assert_true: expected true got false
45
FAIL SubclassedEvent constructor (undefined argument) assert_true: expected true got false
46
FAIL SubclassedEvent constructor (null argument) assert_true: expected true got false
47
FAIL SubclassedEvent constructor (empty argument) assert_true: expected true got false
48
FAIL SubclassedEvent constructor (argument with default values) assert_true: expected true got false
49
FAIL SubclassedEvent constructor (argument with non-default values) assert_true: expected true got false
50
PASS UIEvent constructor (view argument with wrong type) 
51

Return to Bug 174313