Title: [207515] trunk
Revision
207515
Author
cdu...@apple.com
Date
2016-10-18 19:26:50 -0700 (Tue, 18 Oct 2016)

Log Message

[Web IDL] Kill support for [LegacyConstructorTemplate=Event] / [LegacyInitializedByEventConstructor]
https://bugs.webkit.org/show_bug.cgi?id=163630

Reviewed by Darin Adler.

Source/WebCore:

Kill support for [LegacyConstructorTemplate=Event] / [LegacyInitializedByEventConstructor] in our
IDL now that all our events use proper constructors instead.

* bindings/scripts/CodeGenerator.pm:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateConstructorDefinition):
(GenerateConstructorHelperMethods):
(IsConstructable):
* bindings/scripts/IDLAttributes.txt:
* dom/Event.h:
(WebCore::Event::create):
* dom/Event.idl:
* dom/UIEvent.h:
(WebCore::UIEvent::create):
* dom/UIEvent.idl:

LayoutTests:

Update / rebaseline existing tests to reflect minor behavior changes.

* fast/events/constructors/event-constructors-expected.txt:
* fast/events/constructors/event-constructors.html:
* fast/events/constructors/ui-event-constructor-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (207514 => 207515)


--- trunk/LayoutTests/ChangeLog	2016-10-19 02:03:07 UTC (rev 207514)
+++ trunk/LayoutTests/ChangeLog	2016-10-19 02:26:50 UTC (rev 207515)
@@ -1,5 +1,18 @@
 2016-10-18  Chris Dumez  <cdu...@apple.com>
 
+        [Web IDL] Kill support for [LegacyConstructorTemplate=Event] / [LegacyInitializedByEventConstructor]
+        https://bugs.webkit.org/show_bug.cgi?id=163630
+
+        Reviewed by Darin Adler.
+
+        Update / rebaseline existing tests to reflect minor behavior changes.
+
+        * fast/events/constructors/event-constructors-expected.txt:
+        * fast/events/constructors/event-constructors.html:
+        * fast/events/constructors/ui-event-constructor-expected.txt:
+
+2016-10-18  Chris Dumez  <cdu...@apple.com>
+
         Changing details.open should cause a toggle event to be fired asynchronously
         https://bugs.webkit.org/show_bug.cgi?id=163568
 

Modified: trunk/LayoutTests/fast/events/constructors/event-constructors-expected.txt (207514 => 207515)


--- trunk/LayoutTests/fast/events/constructors/event-constructors-expected.txt	2016-10-19 02:03:07 UTC (rev 207514)
+++ trunk/LayoutTests/fast/events/constructors/event-constructors-expected.txt	2016-10-19 02:26:50 UTC (rev 207515)
@@ -21,8 +21,7 @@
 PASS (new Event('eventType', null)).cancelable is false
 PASS (new Event('eventType', undefined)).bubbles is false
 PASS (new Event('eventType', undefined)).cancelable is false
-PASS (new Event('eventType', 0)).bubbles is false
-PASS (new Event('eventType', 0)).cancelable is false
+PASS new Event('eventType', 0) threw exception TypeError: Type error.
 PASS (new Event('eventType', window)).bubbles is false
 PASS (new Event('eventType', window)).cancelable is false
 PASS (new Event('eventType', window)).bubbles is true

Modified: trunk/LayoutTests/fast/events/constructors/event-constructors.html (207514 => 207515)


--- trunk/LayoutTests/fast/events/constructors/event-constructors.html	2016-10-19 02:03:07 UTC (rev 207514)
+++ trunk/LayoutTests/fast/events/constructors/event-constructors.html	2016-10-19 02:26:50 UTC (rev 207515)
@@ -51,8 +51,7 @@
 test("new Event('eventType', undefined)", false, false);
 
 // A number as the initializer.
-// FIXME: Should this throw?
-test("new Event('eventType', 0)", false, false);
+shouldThrowErrorName("new Event('eventType', 0)", "TypeError");
 
 // The window as the initializer.
 test("new Event('eventType', window)", false, false);
@@ -85,4 +84,4 @@
 </script>
 <script src=""
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: trunk/LayoutTests/fast/events/constructors/ui-event-constructor-expected.txt (207514 => 207515)


--- trunk/LayoutTests/fast/events/constructors/ui-event-constructor-expected.txt	2016-10-19 02:03:07 UTC (rev 207514)
+++ trunk/LayoutTests/fast/events/constructors/ui-event-constructor-expected.txt	2016-10-19 02:26:50 UTC (rev 207515)
@@ -13,19 +13,19 @@
 PASS new UIEvent('eventType', { cancelable: true }).cancelable is true
 PASS new UIEvent('eventType', { view: window }).view is window
 PASS new UIEvent('eventType', { view: this }).view is this
-PASS new UIEvent('eventType', { view: testObject }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new UIEvent('eventType', { view: document }).view threw exception TypeError: Dictionary member is not of type Window.
+PASS new UIEvent('eventType', { view: testObject }).view threw exception TypeError: Type error.
+PASS new UIEvent('eventType', { view: document }).view threw exception TypeError: Type error.
 PASS new UIEvent('eventType', { view: undefined }).view is null
 PASS new UIEvent('eventType', { view: null }).view is null
-PASS new UIEvent('eventType', { view: false }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new UIEvent('eventType', { view: true }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new UIEvent('eventType', { view: '' }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new UIEvent('eventType', { view: 'chocolate' }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new UIEvent('eventType', { view: 12345 }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new UIEvent('eventType', { view: 18446744073709551615 }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new UIEvent('eventType', { view: NaN }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new UIEvent('eventType', { view: {valueOf: function () { return window; } } }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new UIEvent('eventType', { get view() { return 123; } }).view threw exception TypeError: Dictionary member is not of type Window.
+PASS new UIEvent('eventType', { view: false }).view threw exception TypeError: Type error.
+PASS new UIEvent('eventType', { view: true }).view threw exception TypeError: Type error.
+PASS new UIEvent('eventType', { view: '' }).view threw exception TypeError: Type error.
+PASS new UIEvent('eventType', { view: 'chocolate' }).view threw exception TypeError: Type error.
+PASS new UIEvent('eventType', { view: 12345 }).view threw exception TypeError: Type error.
+PASS new UIEvent('eventType', { view: 18446744073709551615 }).view threw exception TypeError: Type error.
+PASS new UIEvent('eventType', { view: NaN }).view threw exception TypeError: Type error.
+PASS new UIEvent('eventType', { view: {valueOf: function () { return window; } } }).view threw exception TypeError: Type error.
+PASS new UIEvent('eventType', { get view() { return 123; } }).view threw exception TypeError: Type error.
 PASS new UIEvent('eventType', { get view() { throw 'UIEvent Error'; } }) threw exception UIEvent Error.
 PASS new UIEvent('eventType', { detail: 0 }).detail is 0
 PASS new UIEvent('eventType', { detail: 2147483647 }).detail is 2147483647

Modified: trunk/Source/WebCore/ChangeLog (207514 => 207515)


--- trunk/Source/WebCore/ChangeLog	2016-10-19 02:03:07 UTC (rev 207514)
+++ trunk/Source/WebCore/ChangeLog	2016-10-19 02:26:50 UTC (rev 207515)
@@ -1,5 +1,29 @@
 2016-10-18  Chris Dumez  <cdu...@apple.com>
 
+        [Web IDL] Kill support for [LegacyConstructorTemplate=Event] / [LegacyInitializedByEventConstructor]
+        https://bugs.webkit.org/show_bug.cgi?id=163630
+
+        Reviewed by Darin Adler.
+
+        Kill support for [LegacyConstructorTemplate=Event] / [LegacyInitializedByEventConstructor] in our
+        IDL now that all our events use proper constructors instead.
+
+        * bindings/scripts/CodeGenerator.pm:
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateHeader):
+        (GenerateConstructorDefinition):
+        (GenerateConstructorHelperMethods):
+        (IsConstructable):
+        * bindings/scripts/IDLAttributes.txt:
+        * dom/Event.h:
+        (WebCore::Event::create):
+        * dom/Event.idl:
+        * dom/UIEvent.h:
+        (WebCore::UIEvent::create):
+        * dom/UIEvent.idl:
+
+2016-10-18  Chris Dumez  <cdu...@apple.com>
+
         Changing details.open should cause a toggle event to be fired asynchronously
         https://bugs.webkit.org/show_bug.cgi?id=163568
 

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (207514 => 207515)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2016-10-19 02:03:07 UTC (rev 207514)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2016-10-19 02:26:50 UTC (rev 207515)
@@ -1750,6 +1750,8 @@
 		4634592C1AC2271000ECB71C /* PowerObserverMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4634592B1AC2271000ECB71C /* PowerObserverMac.cpp */; };
 		463EB6221B8789E00096ED51 /* TagCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 463EB6201B8789CB0096ED51 /* TagCollection.cpp */; };
 		463EB6231B8789E00096ED51 /* TagCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 463EB6211B8789CB0096ED51 /* TagCollection.h */; };
+		465307D01DB6EE4800E4137C /* JSUIEventInit.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E045EF1DAA104F00B0D8B9 /* JSUIEventInit.h */; };
+		465307D11DB6EE4A00E4137C /* JSUIEventInit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83E045EE1DAA104F00B0D8B9 /* JSUIEventInit.cpp */; };
 		465A8E791C8A24CE00E7D3E4 /* RuntimeApplicationChecks.mm in Sources */ = {isa = PBXBuildFile; fileRef = 465A8E781C8A24CE00E7D3E4 /* RuntimeApplicationChecks.mm */; };
 		4669B2871B852A0B000F905F /* JSDOMNamedFlowCollectionCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46F2768E1B85297F005C2556 /* JSDOMNamedFlowCollectionCustom.cpp */; };
 		4671E0651D67A59600C6B497 /* CanvasPath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4671E0631D67A57B00C6B497 /* CanvasPath.cpp */; };
@@ -5976,7 +5978,6 @@
 		E125F83A1824104800D84CD9 /* CryptoAlgorithmAesCbcParamsDeprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = E125F8391824104800D84CD9 /* CryptoAlgorithmAesCbcParamsDeprecated.h */; };
 		E125F83D182411E700D84CD9 /* JSCryptoOperationData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E125F83B182411E700D84CD9 /* JSCryptoOperationData.cpp */; };
 		E125F83E182411E700D84CD9 /* JSCryptoOperationData.h in Headers */ = {isa = PBXBuildFile; fileRef = E125F83C182411E700D84CD9 /* JSCryptoOperationData.h */; };
-
 		E125F8411824253A00D84CD9 /* CryptoAlgorithmAES_CBC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E125F83F1824253A00D84CD9 /* CryptoAlgorithmAES_CBC.cpp */; };
 		E125F8421824253A00D84CD9 /* CryptoAlgorithmAES_CBC.h in Headers */ = {isa = PBXBuildFile; fileRef = E125F8401824253A00D84CD9 /* CryptoAlgorithmAES_CBC.h */; };
 		E125F845182425C900D84CD9 /* CryptoAlgorithmAES_CBCMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E125F843182425C900D84CD9 /* CryptoAlgorithmAES_CBCMac.cpp */; };
@@ -7327,12 +7328,12 @@
 		0F4710AC1DB56AFC002DCEC3 /* DOMRectInit.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMRectInit.idl; sourceTree = "<group>"; };
 		0F4710AD1DB56AFC002DCEC3 /* DOMRectReadOnly.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMRectReadOnly.h; sourceTree = "<group>"; };
 		0F4710AE1DB56AFC002DCEC3 /* DOMRectReadOnly.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMRectReadOnly.idl; sourceTree = "<group>"; };
-		0F4710B51DB56BE8002DCEC3 /* JSDOMRect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSDOMRect.cpp; path = JSDOMRect.cpp; sourceTree = "<group>"; };
-		0F4710B61DB56BE8002DCEC3 /* JSDOMRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSDOMRect.h; path = JSDOMRect.h; sourceTree = "<group>"; };
-		0F4710B71DB56BE8002DCEC3 /* JSDOMRectInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSDOMRectInit.cpp; path = JSDOMRectInit.cpp; sourceTree = "<group>"; };
-		0F4710B81DB56BE8002DCEC3 /* JSDOMRectInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSDOMRectInit.h; path = JSDOMRectInit.h; sourceTree = "<group>"; };
-		0F4710B91DB56BE8002DCEC3 /* JSDOMRectReadOnly.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSDOMRectReadOnly.cpp; path = JSDOMRectReadOnly.cpp; sourceTree = "<group>"; };
-		0F4710BA1DB56BE8002DCEC3 /* JSDOMRectReadOnly.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSDOMRectReadOnly.h; path = JSDOMRectReadOnly.h; sourceTree = "<group>"; };
+		0F4710B51DB56BE8002DCEC3 /* JSDOMRect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMRect.cpp; sourceTree = "<group>"; };
+		0F4710B61DB56BE8002DCEC3 /* JSDOMRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMRect.h; sourceTree = "<group>"; };
+		0F4710B71DB56BE8002DCEC3 /* JSDOMRectInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMRectInit.cpp; sourceTree = "<group>"; };
+		0F4710B81DB56BE8002DCEC3 /* JSDOMRectInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMRectInit.h; sourceTree = "<group>"; };
+		0F4710B91DB56BE8002DCEC3 /* JSDOMRectReadOnly.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMRectReadOnly.cpp; sourceTree = "<group>"; };
+		0F4710BA1DB56BE8002DCEC3 /* JSDOMRectReadOnly.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMRectReadOnly.h; sourceTree = "<group>"; };
 		0F4966991DB408C100A274BB /* DOMPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMPoint.h; sourceTree = "<group>"; };
 		0F49669A1DB408C100A274BB /* DOMPoint.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMPoint.idl; sourceTree = "<group>"; };
 		0F49669B1DB408C100A274BB /* DOMPointReadOnly.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMPointReadOnly.h; sourceTree = "<group>"; };
@@ -14696,8 +14697,8 @@
 				5EA725CD1ACABCD900EAD17B /* MediaDevices.cpp */,
 				5EA725CE1ACABCD900EAD17B /* MediaDevices.h */,
 				5EA725CF1ACABCD900EAD17B /* MediaDevices.idl */,
- 				07ABEF6B1D8A1C5800F21972 /* MediaDevicesEnumerationRequest.cpp */,
- 				07ABEF6D1D8A1C7600F21972 /* MediaDevicesEnumerationRequest.h */,
+				07ABEF6B1D8A1C5800F21972 /* MediaDevicesEnumerationRequest.cpp */,
+				07ABEF6D1D8A1C7600F21972 /* MediaDevicesEnumerationRequest.h */,
 				07394EC71BAB2CCD00BE99CD /* MediaDevicesRequest.cpp */,
 				07394EC91BAB2CD700BE99CD /* MediaDevicesRequest.h */,
 				5E16A2E21BFA64FB0029A21E /* MediaEndpointPeerConnection.cpp */,
@@ -24214,6 +24215,7 @@
 				29D7BCFA1444AF7D0070619C /* AccessibilitySpinButton.h in Headers */,
 				69A6CBAD1C6BE42C00B836E9 /* AccessibilitySVGElement.h in Headers */,
 				AAC08CF315F941FD00F1E188 /* AccessibilitySVGRoot.h in Headers */,
+				465307D01DB6EE4800E4137C /* JSUIEventInit.h in Headers */,
 				29A8122B0FBB9C1D00510293 /* AccessibilityTable.h in Headers */,
 				29A812320FBB9C1D00510293 /* AccessibilityTableCell.h in Headers */,
 				29A812410FBB9C1D00510293 /* AccessibilityTableColumn.h in Headers */,
@@ -28161,6 +28163,7 @@
 				A89943290B42338800D7C802 /* BitmapImage.cpp in Sources */,
 				1AFFC4541D5E81CB00267A66 /* BlacklistUpdater.mm in Sources */,
 				976D6C78122B8A3D001FD1F7 /* Blob.cpp in Sources */,
+				465307D11DB6EE4A00E4137C /* JSUIEventInit.cpp in Sources */,
 				2EDEF1F3121B0EFC00726DB2 /* BlobData.cpp in Sources */,
 				E1D31CDC19196020001005A3 /* BlobDataFileReference.cpp in Sources */,
 				E164A2ED191AE6350010737D /* BlobDataFileReferenceMac.mm in Sources */,

Modified: trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm (207514 => 207515)


--- trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm	2016-10-19 02:03:07 UTC (rev 207514)
+++ trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm	2016-10-19 02:26:50 UTC (rev 207515)
@@ -380,15 +380,6 @@
     return 0;
 }
 
-sub IsConstructorTemplate
-{
-    my $object = shift;
-    my $interface = shift;
-    my $template = shift;
-
-    return $interface->extendedAttributes->{"LegacyConstructorTemplate"} && $interface->extendedAttributes->{"LegacyConstructorTemplate"} eq $template;
-}
-
 sub IsNumericType
 {
     my ($object, $type) = @_;

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (207514 => 207515)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2016-10-19 02:03:07 UTC (rev 207514)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2016-10-19 02:26:50 UTC (rev 207515)
@@ -1272,7 +1272,6 @@
     }
 
     AddClassForwardIfNeeded("JSDOMWindowShell") if $interfaceName eq "DOMWindow";
-    AddClassForwardIfNeeded("JSDictionary") if $codeGenerator->IsConstructorTemplate($interface, "Event");
 
     my $exportMacro = GetExportMacroForJSClass($interface);
 
@@ -1725,10 +1724,6 @@
         push(@headerContent, "JSC::EncodedJSValue JSC_HOST_CALL construct${className}(JSC::ExecState&);\n\n");
     }
 
-    if ($codeGenerator->IsConstructorTemplate($interface, "Event")) {
-        push(@headerContent, "bool fill${interfaceName}Init(${interfaceName}Init&, JSDictionary&);\n\n");
-    }
-
     if (NeedsImplementationClass($interface)) {
         push(@headerContent, "template<> struct JSDOMWrapperConverterTraits<${implType}> {\n");
         push(@headerContent, "    using WrapperClass = ${className};\n");
@@ -5703,84 +5698,7 @@
     my $constructorClassName = $generatingNamedConstructor ? "${className}NamedConstructor" : "${className}Constructor";
 
     if (IsConstructable($interface)) {
-        if ($codeGenerator->IsConstructorTemplate($interface, "Event")) {
-            $implIncludes{"JSDictionary.h"} = 1;
-            $implIncludes{"<runtime/Error.h>"} = 1;
-
-            push(@$outputArray, <<END);
-template<> EncodedJSValue JSC_HOST_CALL ${constructorClassName}::construct(ExecState* state)
-{
-    VM& vm = state->vm();
-    auto throwScope = DECLARE_THROW_SCOPE(vm);
-    auto* jsConstructor = jsCast<${constructorClassName}*>(state->callee());
-    ASSERT(jsConstructor);
-
-    if (!jsConstructor->scriptExecutionContext())
-        return throwConstructorScriptExecutionContextUnavailableError(*state, throwScope, \"${visibleInterfaceName}\");
-
-    if (UNLIKELY(state->argumentCount() < 1))
-        return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
-
-    AtomicString eventType = state->uncheckedArgument(0).toString(state)->toAtomicString(state);
-    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
-
-    ${interfaceName}Init eventInit;
-
-    JSValue initializerValue = state->argument(1);
-    if (!initializerValue.isUndefinedOrNull()) {
-        // Given the above test, this will always yield an object.
-        JSObject* initializerObject = initializerValue.toObject(state);
-        ASSERT(!throwScope.exception());
-
-        // Create the dictionary wrapper from the initializer object.
-        JSDictionary dictionary(state, initializerObject);
-
-        // Attempt to fill in the EventInit.
-        if (!fill${interfaceName}Init(eventInit, dictionary))
-            return JSValue::encode(jsUndefined());
-    }
-
-    Ref<${interfaceName}> event = ${interfaceName}::createForBindings(eventType, eventInit);
-    return JSValue::encode(createWrapper<${interfaceName}>(jsConstructor->globalObject(), WTFMove(event)));
-}
-
-bool fill${interfaceName}Init(${interfaceName}Init& eventInit, JSDictionary& dictionary)
-{
-END
-
-            if ($interface->parent) {
-                my $interfaceBase = $interface->parent;
-                push(@implContent, <<END);
-    if (!fill${interfaceBase}Init(eventInit, dictionary))
-        return false;
-
-END
-            }
-
-            for (my $index = 0; $index < @{$interface->attributes}; $index++) {
-                my $attribute = @{$interface->attributes}[$index];
-                if ($attribute->signature->extendedAttributes->{LegacyInitializedByEventConstructor}) {
-                    my $attributeName = $attribute->signature->name;
-                    my $attributeImplName = $attribute->signature->extendedAttributes->{ImplementedAs} || $attributeName;
-                    my $conditionalString = $codeGenerator->GenerateConditionalString($attribute->signature);
-
-                    push(@implContent, "#if ${conditionalString}\n") if $conditionalString;
-
-                    push(@implContent, <<END);
-    if (!dictionary.tryGetProperty("${attributeName}", eventInit.${attributeImplName}))
-        return false;
-END
-                    push(@implContent, "#endif\n") if $conditionalString;
-
-                }
-            }
-
-            push(@$outputArray, <<END);
-    return true;
-}
-
-END
-         } elsif ($interface->extendedAttributes->{CustomConstructor}) {
+        if ($interface->extendedAttributes->{CustomConstructor}) {
             push(@$outputArray, "template<> JSC::EncodedJSValue JSC_HOST_CALL ${constructorClassName}::construct(JSC::ExecState* exec)\n");
             push(@$outputArray, "{\n");
             push(@$outputArray, "    ASSERT(exec);\n");
@@ -5904,9 +5822,7 @@
 
     my $constructorClassName = $generatingNamedConstructor ? "${className}NamedConstructor" : "${className}Constructor";
     my $leastConstructorLength = 0;
-    if ($codeGenerator->IsConstructorTemplate($interface, "Event")) {
-        $leastConstructorLength = 1;
-    } elsif ($interface->extendedAttributes->{Constructor} || $interface->extendedAttributes->{CustomConstructor}) {
+    if ($interface->extendedAttributes->{Constructor} || $interface->extendedAttributes->{CustomConstructor}) {
         my @constructors = @{$interface->constructors};
         my @customConstructors = @{$interface->customConstructors};
         $leastConstructorLength = 255;
@@ -6014,7 +5930,6 @@
     return HasCustomConstructor($interface)
         || $interface->extendedAttributes->{Constructor}
         || $interface->extendedAttributes->{NamedConstructor}
-        || $interface->extendedAttributes->{LegacyConstructorTemplate}
         || $interface->extendedAttributes->{JSBuiltinConstructor};
 }
 

Modified: trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt (207514 => 207515)


--- trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt	2016-10-19 02:03:07 UTC (rev 207514)
+++ trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt	2016-10-19 02:26:50 UTC (rev 207515)
@@ -92,8 +92,6 @@
 JSGenerateToJSObject
 JSGenerateToNativeObject
 JSLegacyParent=*
-LegacyConstructorTemplate=Event
-LegacyInitializedByEventConstructor
 LenientThis
 MasqueradesAsUndefined
 MayThrowException

Modified: trunk/Source/WebCore/dom/Event.h (207514 => 207515)


--- trunk/Source/WebCore/dom/Event.h	2016-10-19 02:03:07 UTC (rev 207514)
+++ trunk/Source/WebCore/dom/Event.h	2016-10-19 02:26:50 UTC (rev 207515)
@@ -87,9 +87,9 @@
         return adoptRef(*new Event);
     }
 
-    static Ref<Event> createForBindings(const AtomicString& type, const EventInit& initializer)
+    static Ref<Event> create(const AtomicString& type, const EventInit& initializer, IsTrusted isTrusted = IsTrusted::No)
     {
-        return adoptRef(*new Event(type, initializer));
+        return adoptRef(*new Event(type, initializer, isTrusted));
     }
 
     virtual ~Event();
@@ -193,7 +193,7 @@
     Event(IsTrusted = IsTrusted::No);
     WEBCORE_EXPORT Event(const AtomicString& type, bool canBubble, bool cancelable);
     Event(const AtomicString& type, bool canBubble, bool cancelable, double timestamp);
-    Event(const AtomicString& type, const EventInit&, IsTrusted = IsTrusted::No);
+    Event(const AtomicString& type, const EventInit&, IsTrusted);
 
     virtual void receivedTarget();
     bool dispatched() const { return m_target; }

Modified: trunk/Source/WebCore/dom/Event.idl (207514 => 207515)


--- trunk/Source/WebCore/dom/Event.idl	2016-10-19 02:03:07 UTC (rev 207514)
+++ trunk/Source/WebCore/dom/Event.idl	2016-10-19 02:26:50 UTC (rev 207515)
@@ -19,7 +19,7 @@
  */
 
 [
-    LegacyConstructorTemplate=Event,
+    Constructor(DOMString type, optional EventInit eventInitDict),
     CustomToJSObject,
     ExportToWrappedFunction,
     Exposed=(Window,Worker),
@@ -51,9 +51,9 @@
     readonly attribute EventTarget target;
     readonly attribute EventTarget currentTarget;
     readonly attribute unsigned short eventPhase;
-    [LegacyInitializedByEventConstructor] readonly attribute boolean bubbles;
-    [LegacyInitializedByEventConstructor] readonly attribute boolean cancelable;
-    [LegacyInitializedByEventConstructor, EnabledAtRuntime=ShadowDOM] readonly attribute boolean composed;
+    readonly attribute boolean bubbles;
+    readonly attribute boolean cancelable;
+    [EnabledAtRuntime=ShadowDOM] readonly attribute boolean composed;
     readonly attribute DOMTimeStamp timeStamp;
 
     [EnabledAtRuntime=ShadowDOM] sequence<Node> composedPath();

Modified: trunk/Source/WebCore/dom/UIEvent.h (207514 => 207515)


--- trunk/Source/WebCore/dom/UIEvent.h	2016-10-19 02:03:07 UTC (rev 207514)
+++ trunk/Source/WebCore/dom/UIEvent.h	2016-10-19 02:26:50 UTC (rev 207515)
@@ -42,9 +42,9 @@
     {
         return adoptRef(*new UIEvent);
     }
-    static Ref<UIEvent> createForBindings(const AtomicString& type, const UIEventInit& initializer)
+    static Ref<UIEvent> create(const AtomicString& type, const UIEventInit& initializer, IsTrusted isTrusted = IsTrusted::No)
     {
-        return adoptRef(*new UIEvent(type, initializer));
+        return adoptRef(*new UIEvent(type, initializer, isTrusted));
     }
     virtual ~UIEvent();
 
@@ -70,7 +70,7 @@
     UIEvent();
     UIEvent(const AtomicString& type, bool canBubble, bool cancelable, DOMWindow*, int detail);
     UIEvent(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, DOMWindow*, int detail);
-    UIEvent(const AtomicString&, const UIEventInit&, IsTrusted = IsTrusted::No);
+    UIEvent(const AtomicString&, const UIEventInit&, IsTrusted);
 
 private:
     bool isUIEvent() const final;

Modified: trunk/Source/WebCore/dom/UIEvent.idl (207514 => 207515)


--- trunk/Source/WebCore/dom/UIEvent.idl	2016-10-19 02:03:07 UTC (rev 207514)
+++ trunk/Source/WebCore/dom/UIEvent.idl	2016-10-19 02:26:50 UTC (rev 207515)
@@ -18,10 +18,10 @@
  */
 
 [
-    LegacyConstructorTemplate=Event,
+    Constructor(DOMString type, optional UIEventInit eventInitDict)
 ] interface UIEvent : Event {
-    [LegacyInitializedByEventConstructor] readonly attribute DOMWindow view;
-    [LegacyInitializedByEventConstructor] readonly attribute long detail;
+    readonly attribute DOMWindow view;
+    readonly attribute long detail;
     
     // FIXME: Using "undefined" as default parameter value is wrong.
     void initUIEvent(optional DOMString type = "undefined", optional boolean canBubble = false, optional boolean cancelable = false, optional DOMWindow? view = null, optional long detail = 0);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to