Title: [206974] trunk/Source/WebCore
Revision
206974
Author
[email protected]
Date
2016-10-09 18:16:05 -0700 (Sun, 09 Oct 2016)

Log Message

Update generated bindings code so that dictionary structures no longer need explicit constructors
https://bugs.webkit.org/show_bug.cgi?id=163188

Reviewed by Darin Adler.

Update generated bindings code so that dictionary structures no longer
need explicit constructors. We now call the default constructor and
then initialize the members one by one.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::Dictionary>):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
(WebCore::convertDictionary<AlternateDictionaryName>):
(WebCore::convertDictionary<TestObj::ParentDictionary>):
(WebCore::convertDictionary<TestObj::ChildDictionary>):
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
(WebCore::convertDictionary<TestStandaloneDictionary>):
* dom/ClipboardEvent.h:
* dom/CustomEvent.h:
* dom/EventInit.h:
(WebCore::EventInit::EventInit): Deleted.
* dom/EventModifierInit.h:
(WebCore::EventModifierInit::EventModifierInit): Deleted.
* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
* dom/KeyboardEvent.h:
* dom/KeyboardEvent.idl:
* dom/UIEventInit.h:
(WebCore::UIEventInit::UIEventInit): Deleted.
* editing/Editor.cpp:
(WebCore::Editor::dispatchCPPEvent):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (206973 => 206974)


--- trunk/Source/WebCore/ChangeLog	2016-10-10 00:45:20 UTC (rev 206973)
+++ trunk/Source/WebCore/ChangeLog	2016-10-10 01:16:05 UTC (rev 206974)
@@ -1,3 +1,40 @@
+2016-10-09  Chris Dumez  <[email protected]>
+
+        Update generated bindings code so that dictionary structures no longer need explicit constructors
+        https://bugs.webkit.org/show_bug.cgi?id=163188
+
+        Reviewed by Darin Adler.
+
+        Update generated bindings code so that dictionary structures no longer
+        need explicit constructors. We now call the default constructor and
+        then initialize the members one by one.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateDictionaryImplementationContent):
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::convertDictionary<TestObj::Dictionary>):
+        (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
+        (WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
+        (WebCore::convertDictionary<AlternateDictionaryName>):
+        (WebCore::convertDictionary<TestObj::ParentDictionary>):
+        (WebCore::convertDictionary<TestObj::ChildDictionary>):
+        * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
+        (WebCore::convertDictionary<TestStandaloneDictionary>):
+        * dom/ClipboardEvent.h:
+        * dom/CustomEvent.h:
+        * dom/EventInit.h:
+        (WebCore::EventInit::EventInit): Deleted.
+        * dom/EventModifierInit.h:
+        (WebCore::EventModifierInit::EventModifierInit): Deleted.
+        * dom/KeyboardEvent.cpp:
+        (WebCore::KeyboardEvent::KeyboardEvent):
+        * dom/KeyboardEvent.h:
+        * dom/KeyboardEvent.idl:
+        * dom/UIEventInit.h:
+        (WebCore::UIEventInit::UIEventInit): Deleted.
+        * editing/Editor.cpp:
+        (WebCore::Editor::dispatchCPPEvent):
+
 2016-10-09  Fujii Hironori  <[email protected]>
 
         [CMake] CMake does not support the dep files for implicit dependency

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (206973 => 206974)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2016-10-10 00:45:20 UTC (rev 206973)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2016-10-10 01:16:05 UTC (rev 206974)
@@ -1086,6 +1086,8 @@
     my $arguments = "";
     my $comma = "";
 
+    $result .= "    $className result;\n";
+
     # 5. For each dictionary dictionary in dictionaries, in order:
     foreach my $dictionary (@dictionaries) {
         # For each dictionary member member declared on dictionary, in lexicographical order:
@@ -1102,11 +1104,6 @@
             $result .= "    JSValue ${key}Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, \"${key}\"));\n";
 
             my $nativeType = GetNativeTypeFromSignature($interface, $member);
-            if ($member->isOptional && !defined $member->default) {
-                $result .= "    Converter<$nativeType>::OptionalValue $key;\n";
-            } else {
-                $result .= "    $nativeType $key;\n";
-            }
 
             # 5.3. If value is not undefined, then:
             $result .= "    if (!${key}Value.isUndefined()) {\n";
@@ -1115,20 +1112,23 @@
                 AddToImplIncludes("JS${type}.h");
                 die "Dictionary members of non-nullable wrapper types must be marked as required" if !$member->isNullable && $member->isOptional;
                 my $nullableParameter = $member->isNullable ? "IsNullable::Yes" : "IsNullable::No";
-                $result .= "        $key = convertWrapperType<$type, JS${type}>(state, ${key}Value, $nullableParameter);\n";
+                $result .= "        result.$key = convertWrapperType<$type, JS${type}>(state, ${key}Value, $nullableParameter);\n";
+                $result .= "        RETURN_IF_EXCEPTION(throwScope, Nullopt);\n";
             } elsif ($codeGenerator->IsDictionaryType($type)) {
                 my $nativeType = GetNativeType($interface, $type);
-                $result .= "        $key = convertDictionary<${nativeType}>(state, ${key}Value);\n";
+                $result .= "        Optional<${nativeType}> $key = convertDictionary<${nativeType}>(state, ${key}Value).value();\n";
+                $result .= "        RETURN_IF_EXCEPTION(throwScope, Nullopt);\n";
+                $result .= "        result.$key = $key.value();\n";
             } else {
                 my $conversionRuleWithLeadingComma = GenerateConversionRuleWithLeadingComma($interface, $member);
-                $result .= "        $key = convert<${nativeType}>(state, ${key}Value${conversionRuleWithLeadingComma});\n";
+                $result .= "        result.$key = convert<${nativeType}>(state, ${key}Value${conversionRuleWithLeadingComma});\n";
+                $result .= "        RETURN_IF_EXCEPTION(throwScope, Nullopt);\n";
             }
-            $result .= "        RETURN_IF_EXCEPTION(throwScope, Nullopt);\n";
             # Value is undefined.
             # 5.4. Otherwise, if value is undefined but the dictionary member has a default value, then:
             if ($member->isOptional && defined $member->default) {
                 $result .= "    } else\n";
-                $result .= "        $key = " . GenerateDefaultValue($interface, $member) . ";\n";
+                $result .= "        result.$key = " . GenerateDefaultValue($interface, $member) . ";\n";
             } elsif (!$member->isOptional) {
                 # 5.5. Otherwise, if value is undefined and the dictionary member is a required dictionary member, then throw a TypeError.
                 $result .= "    } else {\n";
@@ -1139,23 +1139,9 @@
                 $result .= "    }\n";
             }
         }
-
-        # 6. Return dict.
-        foreach my $member (@{$dictionary->members}) {
-            my $value;
-            if ($codeGenerator->IsWrapperType($member->type) && !$member->isNullable) {
-                $value = "*" . $member->name;
-            } elsif ($codeGenerator->IsDictionaryType($member->type)) {
-                $value = $member->name . ".value()";
-            } else {
-                $value = "WTFMove(" . $member->name . ")";
-            }
-            $arguments .= $comma . $value;
-            $comma = ", ";
-        }
     }
 
-    $result .= "    return $className { " . $arguments . " };\n";
+    $result .= "    return WTFMove(result);\n";
     $result .= "}\n\n";
     $result .= "#endif\n\n" if $conditionalString;
 

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (206973 => 206974)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2016-10-10 00:45:20 UTC (rev 206973)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp	2016-10-10 01:16:05 UTC (rev 206974)
@@ -475,222 +475,191 @@
         throwTypeError(&state, throwScope);
         return Nullopt;
     }
+    TestObj::Dictionary result;
     JSValue anyTypedefValueValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "anyTypedefValue"));
-    JSC::JSValue anyTypedefValue;
     if (!anyTypedefValueValue.isUndefined()) {
-        anyTypedefValue = convert<JSC::JSValue>(state, anyTypedefValueValue);
+        result.anyTypedefValue = convert<JSC::JSValue>(state, anyTypedefValueValue);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     } else
-        anyTypedefValue = jsUndefined();
+        result.anyTypedefValue = jsUndefined();
     JSValue anyValueValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "anyValue"));
-    JSC::JSValue anyValue;
     if (!anyValueValue.isUndefined()) {
-        anyValue = convert<JSC::JSValue>(state, anyValueValue);
+        result.anyValue = convert<JSC::JSValue>(state, anyValueValue);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     } else
-        anyValue = jsUndefined();
+        result.anyValue = jsUndefined();
     JSValue anyValueWithNullDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "anyValueWithNullDefault"));
-    JSC::JSValue anyValueWithNullDefault;
     if (!anyValueWithNullDefaultValue.isUndefined()) {
-        anyValueWithNullDefault = convert<JSC::JSValue>(state, anyValueWithNullDefaultValue);
+        result.anyValueWithNullDefault = convert<JSC::JSValue>(state, anyValueWithNullDefaultValue);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     } else
-        anyValueWithNullDefault = jsNull();
+        result.anyValueWithNullDefault = jsNull();
     JSValue booleanWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "booleanWithDefault"));
-    bool booleanWithDefault;
     if (!booleanWithDefaultValue.isUndefined()) {
-        booleanWithDefault = convert<bool>(state, booleanWithDefaultValue);
+        result.booleanWithDefault = convert<bool>(state, booleanWithDefaultValue);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     } else
-        booleanWithDefault = false;
+        result.booleanWithDefault = false;
     JSValue booleanWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "booleanWithoutDefault"));
-    Converter<bool>::OptionalValue booleanWithoutDefault;
     if (!booleanWithoutDefaultValue.isUndefined()) {
-        booleanWithoutDefault = convert<bool>(state, booleanWithoutDefaultValue);
+        result.booleanWithoutDefault = convert<bool>(state, booleanWithoutDefaultValue);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     }
     JSValue dictionaryMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "dictionaryMember"));
-    Converter<TestObj::DictionaryThatShouldTolerateNull>::OptionalValue dictionaryMember;
     if (!dictionaryMemberValue.isUndefined()) {
-        dictionaryMember = convertDictionary<TestObj::DictionaryThatShouldTolerateNull>(state, dictionaryMemberValue);
+        Optional<TestObj::DictionaryThatShouldTolerateNull> dictionaryMember = convertDictionary<TestObj::DictionaryThatShouldTolerateNull>(state, dictionaryMemberValue).value();
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
+        result.dictionaryMember = dictionaryMember.value();
     }
     JSValue enumerationValueWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "enumerationValueWithDefault"));
-    TestObj::EnumType enumerationValueWithDefault;
     if (!enumerationValueWithDefaultValue.isUndefined()) {
-        enumerationValueWithDefault = convert<TestObj::EnumType>(state, enumerationValueWithDefaultValue);
+        result.enumerationValueWithDefault = convert<TestObj::EnumType>(state, enumerationValueWithDefaultValue);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     } else
-        enumerationValueWithDefault = TestObj::EnumType::EnumValue1;
+        result.enumerationValueWithDefault = TestObj::EnumType::EnumValue1;
     JSValue enumerationValueWithEmptyStringDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "enumerationValueWithEmptyStringDefault"));
-    TestObj::EnumType enumerationValueWithEmptyStringDefault;
     if (!enumerationValueWithEmptyStringDefaultValue.isUndefined()) {
-        enumerationValueWithEmptyStringDefault = convert<TestObj::EnumType>(state, enumerationValueWithEmptyStringDefaultValue);
+        result.enumerationValueWithEmptyStringDefault = convert<TestObj::EnumType>(state, enumerationValueWithEmptyStringDefaultValue);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     } else
-        enumerationValueWithEmptyStringDefault = TestObj::EnumType::EmptyString;
+        result.enumerationValueWithEmptyStringDefault = TestObj::EnumType::EmptyString;
     JSValue enumerationValueWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "enumerationValueWithoutDefault"));
-    Converter<TestObj::EnumType>::OptionalValue enumerationValueWithoutDefault;
     if (!enumerationValueWithoutDefaultValue.isUndefined()) {
-        enumerationValueWithoutDefault = convert<TestObj::EnumType>(state, enumerationValueWithoutDefaultValue);
+        result.enumerationValueWithoutDefault = convert<TestObj::EnumType>(state, enumerationValueWithoutDefaultValue);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     }
     JSValue integerValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "integer"));
-    Converter<int32_t>::OptionalValue integer;
     if (!integerValue.isUndefined()) {
-        integer = convert<int32_t>(state, integerValue, NormalConversion);
+        result.integer = convert<int32_t>(state, integerValue, NormalConversion);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     }
     JSValue integerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "integerWithDefault"));
-    int32_t integerWithDefault;
     if (!integerWithDefaultValue.isUndefined()) {
-        integerWithDefault = convert<int32_t>(state, integerWithDefaultValue, NormalConversion);
+        result.integerWithDefault = convert<int32_t>(state, integerWithDefaultValue, NormalConversion);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     } else
-        integerWithDefault = 0;
+        result.integerWithDefault = 0;
     JSValue largeIntegerValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "largeInteger"));
-    Converter<int64_t>::OptionalValue largeInteger;
     if (!largeIntegerValue.isUndefined()) {
-        largeInteger = convert<int64_t>(state, largeIntegerValue, NormalConversion);
+        result.largeInteger = convert<int64_t>(state, largeIntegerValue, NormalConversion);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     }
     JSValue largeIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "largeIntegerWithDefault"));
-    int64_t largeIntegerWithDefault;
     if (!largeIntegerWithDefaultValue.isUndefined()) {
-        largeIntegerWithDefault = convert<int64_t>(state, largeIntegerWithDefaultValue, NormalConversion);
+        result.largeIntegerWithDefault = convert<int64_t>(state, largeIntegerWithDefaultValue, NormalConversion);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     } else
-        largeIntegerWithDefault = 0;
+        result.largeIntegerWithDefault = 0;
     JSValue nullableNodeValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "nullableNode"));
-    Node* nullableNode;
     if (!nullableNodeValue.isUndefined()) {
-        nullableNode = convertWrapperType<Node, JSNode>(state, nullableNodeValue, IsNullable::Yes);
+        result.nullableNode = convertWrapperType<Node, JSNode>(state, nullableNodeValue, IsNullable::Yes);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     } else
-        nullableNode = nullptr;
+        result.nullableNode = nullptr;
     JSValue restrictedDoubleValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "restrictedDouble"));
-    Converter<double>::OptionalValue restrictedDouble;
     if (!restrictedDoubleValue.isUndefined()) {
-        restrictedDouble = convert<double>(state, restrictedDoubleValue, ShouldAllowNonFinite::No);
+        result.restrictedDouble = convert<double>(state, restrictedDoubleValue, ShouldAllowNonFinite::No);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     }
     JSValue restrictedDoubleWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "restrictedDoubleWithDefault"));
-    double restrictedDoubleWithDefault;
     if (!restrictedDoubleWithDefaultValue.isUndefined()) {
-        restrictedDoubleWithDefault = convert<double>(state, restrictedDoubleWithDefaultValue, ShouldAllowNonFinite::No);
+        result.restrictedDoubleWithDefault = convert<double>(state, restrictedDoubleWithDefaultValue, ShouldAllowNonFinite::No);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     } else
-        restrictedDoubleWithDefault = 0;
+        result.restrictedDoubleWithDefault = 0;
     JSValue restrictedFloatValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "restrictedFloat"));
-    Converter<float>::OptionalValue restrictedFloat;
     if (!restrictedFloatValue.isUndefined()) {
-        restrictedFloat = convert<float>(state, restrictedFloatValue, ShouldAllowNonFinite::No);
+        result.restrictedFloat = convert<float>(state, restrictedFloatValue, ShouldAllowNonFinite::No);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     }
     JSValue restrictedFloatWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "restrictedFloatWithDefault"));
-    float restrictedFloatWithDefault;
     if (!restrictedFloatWithDefaultValue.isUndefined()) {
-        restrictedFloatWithDefault = convert<float>(state, restrictedFloatWithDefaultValue, ShouldAllowNonFinite::No);
+        result.restrictedFloatWithDefault = convert<float>(state, restrictedFloatWithDefaultValue, ShouldAllowNonFinite::No);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     } else
-        restrictedFloatWithDefault = 0;
+        result.restrictedFloatWithDefault = 0;
     JSValue sequenceOfStringsValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "sequenceOfStrings"));
-    Converter<Vector<String>>::OptionalValue sequenceOfStrings;
     if (!sequenceOfStringsValue.isUndefined()) {
-        sequenceOfStrings = convert<Vector<String>>(state, sequenceOfStringsValue);
+        result.sequenceOfStrings = convert<Vector<String>>(state, sequenceOfStringsValue);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     }
     JSValue smallIntegerClampedValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "smallIntegerClamped"));
-    Converter<int8_t>::OptionalValue smallIntegerClamped;
     if (!smallIntegerClampedValue.isUndefined()) {
-        smallIntegerClamped = convert<int8_t>(state, smallIntegerClampedValue, Clamp);
+        result.smallIntegerClamped = convert<int8_t>(state, smallIntegerClampedValue, Clamp);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     }
     JSValue smallIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "smallIntegerWithDefault"));
-    Converter<int8_t>::OptionalValue smallIntegerWithDefault;
     if (!smallIntegerWithDefaultValue.isUndefined()) {
-        smallIntegerWithDefault = convert<int8_t>(state, smallIntegerWithDefaultValue, NormalConversion);
+        result.smallIntegerWithDefault = convert<int8_t>(state, smallIntegerWithDefaultValue, NormalConversion);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     }
     JSValue smallUnsignedIntegerEnforcedRangeValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "smallUnsignedIntegerEnforcedRange"));
-    Converter<uint8_t>::OptionalValue smallUnsignedIntegerEnforcedRange;
     if (!smallUnsignedIntegerEnforcedRangeValue.isUndefined()) {
-        smallUnsignedIntegerEnforcedRange = convert<uint8_t>(state, smallUnsignedIntegerEnforcedRangeValue, EnforceRange);
+        result.smallUnsignedIntegerEnforcedRange = convert<uint8_t>(state, smallUnsignedIntegerEnforcedRangeValue, EnforceRange);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     }
     JSValue smallUnsignedIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "smallUnsignedIntegerWithDefault"));
-    uint8_t smallUnsignedIntegerWithDefault;
     if (!smallUnsignedIntegerWithDefaultValue.isUndefined()) {
-        smallUnsignedIntegerWithDefault = convert<uint8_t>(state, smallUnsignedIntegerWithDefaultValue, NormalConversion);
+        result.smallUnsignedIntegerWithDefault = convert<uint8_t>(state, smallUnsignedIntegerWithDefaultValue, NormalConversion);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     } else
-        smallUnsignedIntegerWithDefault = 0;
+        result.smallUnsignedIntegerWithDefault = 0;
     JSValue stringWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "stringWithDefault"));
-    String stringWithDefault;
     if (!stringWithDefaultValue.isUndefined()) {
-        stringWithDefault = convert<String>(state, stringWithDefaultValue);
+        result.stringWithDefault = convert<String>(state, stringWithDefaultValue);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     } else
-        stringWithDefault = "defaultString";
+        result.stringWithDefault = "defaultString";
     JSValue stringWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "stringWithoutDefault"));
-    Converter<String>::OptionalValue stringWithoutDefault;
     if (!stringWithoutDefaultValue.isUndefined()) {
-        stringWithoutDefault = convert<String>(state, stringWithoutDefaultValue);
+        result.stringWithoutDefault = convert<String>(state, stringWithoutDefaultValue);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     }
     JSValue unrestrictedDoubleValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unrestrictedDouble"));
-    Converter<double>::OptionalValue unrestrictedDouble;
     if (!unrestrictedDoubleValue.isUndefined()) {
-        unrestrictedDouble = convert<double>(state, unrestrictedDoubleValue, ShouldAllowNonFinite::Yes);
+        result.unrestrictedDouble = convert<double>(state, unrestrictedDoubleValue, ShouldAllowNonFinite::Yes);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     }
     JSValue unrestrictedDoubleWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unrestrictedDoubleWithDefault"));
-    double unrestrictedDoubleWithDefault;
     if (!unrestrictedDoubleWithDefaultValue.isUndefined()) {
-        unrestrictedDoubleWithDefault = convert<double>(state, unrestrictedDoubleWithDefaultValue, ShouldAllowNonFinite::Yes);
+        result.unrestrictedDoubleWithDefault = convert<double>(state, unrestrictedDoubleWithDefaultValue, ShouldAllowNonFinite::Yes);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     } else
-        unrestrictedDoubleWithDefault = 0;
+        result.unrestrictedDoubleWithDefault = 0;
     JSValue unrestrictedFloatValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unrestrictedFloat"));
-    Converter<float>::OptionalValue unrestrictedFloat;
     if (!unrestrictedFloatValue.isUndefined()) {
-        unrestrictedFloat = convert<float>(state, unrestrictedFloatValue, ShouldAllowNonFinite::Yes);
+        result.unrestrictedFloat = convert<float>(state, unrestrictedFloatValue, ShouldAllowNonFinite::Yes);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     }
     JSValue unrestrictedFloatWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unrestrictedFloatWithDefault"));
-    float unrestrictedFloatWithDefault;
     if (!unrestrictedFloatWithDefaultValue.isUndefined()) {
-        unrestrictedFloatWithDefault = convert<float>(state, unrestrictedFloatWithDefaultValue, ShouldAllowNonFinite::Yes);
+        result.unrestrictedFloatWithDefault = convert<float>(state, unrestrictedFloatWithDefaultValue, ShouldAllowNonFinite::Yes);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     } else
-        unrestrictedFloatWithDefault = 0;
+        result.unrestrictedFloatWithDefault = 0;
     JSValue unsignedIntegerValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unsignedInteger"));
-    Converter<uint32_t>::OptionalValue unsignedInteger;
     if (!unsignedIntegerValue.isUndefined()) {
-        unsignedInteger = convert<uint32_t>(state, unsignedIntegerValue, NormalConversion);
+        result.unsignedInteger = convert<uint32_t>(state, unsignedIntegerValue, NormalConversion);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     }
     JSValue unsignedIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unsignedIntegerWithDefault"));
-    uint32_t unsignedIntegerWithDefault;
     if (!unsignedIntegerWithDefaultValue.isUndefined()) {
-        unsignedIntegerWithDefault = convert<uint32_t>(state, unsignedIntegerWithDefaultValue, NormalConversion);
+        result.unsignedIntegerWithDefault = convert<uint32_t>(state, unsignedIntegerWithDefaultValue, NormalConversion);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     } else
-        unsignedIntegerWithDefault = 0;
+        result.unsignedIntegerWithDefault = 0;
     JSValue unsignedLargeIntegerValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unsignedLargeInteger"));
-    Converter<uint64_t>::OptionalValue unsignedLargeInteger;
     if (!unsignedLargeIntegerValue.isUndefined()) {
-        unsignedLargeInteger = convert<uint64_t>(state, unsignedLargeIntegerValue, NormalConversion);
+        result.unsignedLargeInteger = convert<uint64_t>(state, unsignedLargeIntegerValue, NormalConversion);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     }
     JSValue unsignedLargeIntegerWithDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "unsignedLargeIntegerWithDefault"));
-    uint64_t unsignedLargeIntegerWithDefault;
     if (!unsignedLargeIntegerWithDefaultValue.isUndefined()) {
-        unsignedLargeIntegerWithDefault = convert<uint64_t>(state, unsignedLargeIntegerWithDefaultValue, NormalConversion);
+        result.unsignedLargeIntegerWithDefault = convert<uint64_t>(state, unsignedLargeIntegerWithDefaultValue, NormalConversion);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     } else
-        unsignedLargeIntegerWithDefault = 0;
-    return TestObj::Dictionary { WTFMove(enumerationValueWithoutDefault), WTFMove(enumerationValueWithDefault), WTFMove(enumerationValueWithEmptyStringDefault), WTFMove(stringWithDefault), WTFMove(stringWithoutDefault), WTFMove(booleanWithDefault), WTFMove(booleanWithoutDefault), WTFMove(sequenceOfStrings), WTFMove(restrictedDouble), WTFMove(unrestrictedDouble), WTFMove(restrictedDoubleWithDefault), WTFMove(unrestrictedDoubleWithDefault), WTFMove(restrictedFloat), WTFMove(unrestrictedFloat), WTFMove(restrictedFloatWithDefault), WTFMove(unrestrictedFloatWithDefault), WTFMove(smallIntegerClamped), WTFMove(smallIntegerWithDefault), WTFMove(smallUnsignedIntegerEnforcedRange), WTFMove(smallUnsignedIntegerWithDefault), WTFMove(integer), WTFMove(integerWithDefault), WTFMove(unsignedInteger), WTFMove(unsignedIntegerWithDefault), WTFMove(largeInteger), WTFMove(largeIntegerWithDefault), WTFMove(unsignedLargeInteger), WTFMove(unsignedLargeIntegerWithDefault), WTFMove(nullableNode), WTF
 Move(anyValue), WTFMove(anyValueWithNullDefault), WTFMove(anyTypedefValue), dictionaryMember.value() };
+        result.unsignedLargeIntegerWithDefault = 0;
+    return WTFMove(result);
 }
 
 template<> Optional<TestObj::DictionaryThatShouldNotTolerateNull> convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>(ExecState& state, JSValue value)
@@ -707,16 +676,15 @@
         throwTypeError(&state, throwScope);
         return Nullopt;
     }
+    TestObj::DictionaryThatShouldNotTolerateNull result;
     JSValue booleanWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "booleanWithoutDefault"));
-    Converter<bool>::OptionalValue booleanWithoutDefault;
     if (!booleanWithoutDefaultValue.isUndefined()) {
-        booleanWithoutDefault = convert<bool>(state, booleanWithoutDefaultValue);
+        result.booleanWithoutDefault = convert<bool>(state, booleanWithoutDefaultValue);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     }
     JSValue nonNullableNodeValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "nonNullableNode"));
-    Node* nonNullableNode;
     if (!nonNullableNodeValue.isUndefined()) {
-        nonNullableNode = convertWrapperType<Node, JSNode>(state, nonNullableNodeValue, IsNullable::No);
+        result.nonNullableNode = convertWrapperType<Node, JSNode>(state, nonNullableNodeValue, IsNullable::No);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     } else {
         throwTypeError(&state, throwScope);
@@ -723,24 +691,23 @@
         return Nullopt;
     }
     JSValue requiredDictionaryMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "requiredDictionaryMember"));
-    TestObj::Dictionary requiredDictionaryMember;
     if (!requiredDictionaryMemberValue.isUndefined()) {
-        requiredDictionaryMember = convertDictionary<TestObj::Dictionary>(state, requiredDictionaryMemberValue);
+        Optional<TestObj::Dictionary> requiredDictionaryMember = convertDictionary<TestObj::Dictionary>(state, requiredDictionaryMemberValue).value();
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
+        result.requiredDictionaryMember = requiredDictionaryMember.value();
     } else {
         throwTypeError(&state, throwScope);
         return Nullopt;
     }
     JSValue requiredEnumerationValueValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "requiredEnumerationValue"));
-    TestObj::EnumType requiredEnumerationValue;
     if (!requiredEnumerationValueValue.isUndefined()) {
-        requiredEnumerationValue = convert<TestObj::EnumType>(state, requiredEnumerationValueValue);
+        result.requiredEnumerationValue = convert<TestObj::EnumType>(state, requiredEnumerationValueValue);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     } else {
         throwTypeError(&state, throwScope);
         return Nullopt;
     }
-    return TestObj::DictionaryThatShouldNotTolerateNull { WTFMove(requiredEnumerationValue), WTFMove(booleanWithoutDefault), *nonNullableNode, requiredDictionaryMember.value() };
+    return WTFMove(result);
 }
 
 template<> Optional<TestObj::DictionaryThatShouldTolerateNull> convertDictionary<TestObj::DictionaryThatShouldTolerateNull>(ExecState& state, JSValue value)
@@ -757,19 +724,18 @@
         throwTypeError(&state, throwScope);
         return Nullopt;
     }
+    TestObj::DictionaryThatShouldTolerateNull result;
     JSValue booleanWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "booleanWithoutDefault"));
-    Converter<bool>::OptionalValue booleanWithoutDefault;
     if (!booleanWithoutDefaultValue.isUndefined()) {
-        booleanWithoutDefault = convert<bool>(state, booleanWithoutDefaultValue);
+        result.booleanWithoutDefault = convert<bool>(state, booleanWithoutDefaultValue);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     }
     JSValue enumerationValueValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "enumerationValue"));
-    Converter<TestObj::EnumType>::OptionalValue enumerationValue;
     if (!enumerationValueValue.isUndefined()) {
-        enumerationValue = convert<TestObj::EnumType>(state, enumerationValueValue);
+        result.enumerationValue = convert<TestObj::EnumType>(state, enumerationValueValue);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     }
-    return TestObj::DictionaryThatShouldTolerateNull { WTFMove(enumerationValue), WTFMove(booleanWithoutDefault) };
+    return WTFMove(result);
 }
 
 template<> Optional<AlternateDictionaryName> convertDictionary<AlternateDictionaryName>(ExecState& state, JSValue value)
@@ -786,19 +752,18 @@
         throwTypeError(&state, throwScope);
         return Nullopt;
     }
+    AlternateDictionaryName result;
     JSValue booleanWithoutDefaultValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "booleanWithoutDefault"));
-    Converter<bool>::OptionalValue booleanWithoutDefault;
     if (!booleanWithoutDefaultValue.isUndefined()) {
-        booleanWithoutDefault = convert<bool>(state, booleanWithoutDefaultValue);
+        result.booleanWithoutDefault = convert<bool>(state, booleanWithoutDefaultValue);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     }
     JSValue enumerationValueValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "enumerationValue"));
-    Converter<TestObj::EnumType>::OptionalValue enumerationValue;
     if (!enumerationValueValue.isUndefined()) {
-        enumerationValue = convert<TestObj::EnumType>(state, enumerationValueValue);
+        result.enumerationValue = convert<TestObj::EnumType>(state, enumerationValueValue);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     }
-    return AlternateDictionaryName { WTFMove(enumerationValue), WTFMove(booleanWithoutDefault) };
+    return WTFMove(result);
 }
 
 template<> Optional<TestObj::ParentDictionary> convertDictionary<TestObj::ParentDictionary>(ExecState& state, JSValue value)
@@ -815,19 +780,18 @@
         throwTypeError(&state, throwScope);
         return Nullopt;
     }
+    TestObj::ParentDictionary result;
     JSValue parentMember1Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "parentMember1"));
-    Converter<bool>::OptionalValue parentMember1;
     if (!parentMember1Value.isUndefined()) {
-        parentMember1 = convert<bool>(state, parentMember1Value);
+        result.parentMember1 = convert<bool>(state, parentMember1Value);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     }
     JSValue parentMember2Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "parentMember2"));
-    Converter<bool>::OptionalValue parentMember2;
     if (!parentMember2Value.isUndefined()) {
-        parentMember2 = convert<bool>(state, parentMember2Value);
+        result.parentMember2 = convert<bool>(state, parentMember2Value);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     }
-    return TestObj::ParentDictionary { WTFMove(parentMember2), WTFMove(parentMember1) };
+    return WTFMove(result);
 }
 
 template<> Optional<TestObj::ChildDictionary> convertDictionary<TestObj::ChildDictionary>(ExecState& state, JSValue value)
@@ -844,31 +808,28 @@
         throwTypeError(&state, throwScope);
         return Nullopt;
     }
+    TestObj::ChildDictionary result;
     JSValue parentMember1Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "parentMember1"));
-    Converter<bool>::OptionalValue parentMember1;
     if (!parentMember1Value.isUndefined()) {
-        parentMember1 = convert<bool>(state, parentMember1Value);
+        result.parentMember1 = convert<bool>(state, parentMember1Value);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     }
     JSValue parentMember2Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "parentMember2"));
-    Converter<bool>::OptionalValue parentMember2;
     if (!parentMember2Value.isUndefined()) {
-        parentMember2 = convert<bool>(state, parentMember2Value);
+        result.parentMember2 = convert<bool>(state, parentMember2Value);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     }
     JSValue childMember1Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "childMember1"));
-    Converter<bool>::OptionalValue childMember1;
     if (!childMember1Value.isUndefined()) {
-        childMember1 = convert<bool>(state, childMember1Value);
+        result.childMember1 = convert<bool>(state, childMember1Value);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     }
     JSValue childMember2Value = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "childMember2"));
-    Converter<bool>::OptionalValue childMember2;
     if (!childMember2Value.isUndefined()) {
-        childMember2 = convert<bool>(state, childMember2Value);
+        result.childMember2 = convert<bool>(state, childMember2Value);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     }
-    return TestObj::ChildDictionary { WTFMove(parentMember2), WTFMove(parentMember1), WTFMove(childMember2), WTFMove(childMember1) };
+    return WTFMove(result);
 }
 
 // Functions

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp (206973 => 206974)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp	2016-10-10 00:45:20 UTC (rev 206973)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp	2016-10-10 01:16:05 UTC (rev 206974)
@@ -40,19 +40,18 @@
         throwTypeError(&state, throwScope);
         return Nullopt;
     }
+    TestStandaloneDictionary result;
     JSValue boolMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "boolMember"));
-    Converter<bool>::OptionalValue boolMember;
     if (!boolMemberValue.isUndefined()) {
-        boolMember = convert<bool>(state, boolMemberValue);
+        result.boolMember = convert<bool>(state, boolMemberValue);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     }
     JSValue stringMemberValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "stringMember"));
-    Converter<String>::OptionalValue stringMember;
     if (!stringMemberValue.isUndefined()) {
-        stringMember = convert<String>(state, stringMemberValue);
+        result.stringMember = convert<String>(state, stringMemberValue);
         RETURN_IF_EXCEPTION(throwScope, Nullopt);
     }
-    return TestStandaloneDictionary { WTFMove(boolMember), WTFMove(stringMember) };
+    return WTFMove(result);
 }
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/dom/ClipboardEvent.h (206973 => 206974)


--- trunk/Source/WebCore/dom/ClipboardEvent.h	2016-10-10 00:45:20 UTC (rev 206973)
+++ trunk/Source/WebCore/dom/ClipboardEvent.h	2016-10-10 01:16:05 UTC (rev 206974)
@@ -34,13 +34,7 @@
 public:
     virtual ~ClipboardEvent();
 
-    struct Init : public EventInit {
-        Init(bool bubbles, bool cancelable, bool composed, RefPtr<DataTransfer>&& clipboardData)
-            : EventInit(bubbles, cancelable, composed)
-            , clipboardData(WTFMove(clipboardData))
-        {
-        }
-
+    struct Init : EventInit {
         RefPtr<DataTransfer> clipboardData;
     };
 

Modified: trunk/Source/WebCore/dom/CustomEvent.h (206973 => 206974)


--- trunk/Source/WebCore/dom/CustomEvent.h	2016-10-10 00:45:20 UTC (rev 206973)
+++ trunk/Source/WebCore/dom/CustomEvent.h	2016-10-10 01:16:05 UTC (rev 206974)
@@ -41,12 +41,7 @@
         return adoptRef(*new CustomEvent(isTrusted));
     }
 
-    struct Init : public EventInit {
-        Init(bool bubbles, bool cancelable, bool composed, JSC::JSValue detail)
-            : EventInit(bubbles, cancelable, composed)
-            , detail(detail)
-        { }
-
+    struct Init : EventInit {
         JSC::JSValue detail;
     };
 

Modified: trunk/Source/WebCore/dom/EventInit.h (206973 => 206974)


--- trunk/Source/WebCore/dom/EventInit.h	2016-10-10 00:45:20 UTC (rev 206973)
+++ trunk/Source/WebCore/dom/EventInit.h	2016-10-10 01:16:05 UTC (rev 206974)
@@ -28,13 +28,6 @@
 namespace WebCore {
 
 struct EventInit {
-    EventInit() = default;
-    EventInit(bool bubbles, bool cancelable, bool composed)
-        : bubbles(bubbles)
-        , cancelable(cancelable)
-        , composed(composed)
-    { }
-
     bool bubbles { false };
     bool cancelable { false };
     bool composed { false };

Modified: trunk/Source/WebCore/dom/EventModifierInit.h (206973 => 206974)


--- trunk/Source/WebCore/dom/EventModifierInit.h	2016-10-10 00:45:20 UTC (rev 206973)
+++ trunk/Source/WebCore/dom/EventModifierInit.h	2016-10-10 01:16:05 UTC (rev 206974)
@@ -29,20 +29,7 @@
 
 namespace WebCore {
 
-struct EventModifierInit : public UIEventInit {
-    EventModifierInit() = default;
-
-    EventModifierInit(bool bubbles, bool cancelable, bool composed, RefPtr<DOMWindow>&& view, int detail,
-        bool ctrlKey, bool shiftKey, bool altKey, bool metaKey, bool modifierAltGraph, bool modifierCapsLock)
-            : UIEventInit(bubbles, cancelable, composed, WTFMove(view), detail)
-            , ctrlKey(ctrlKey)
-            , shiftKey(shiftKey)
-            , altKey(altKey)
-            , metaKey(metaKey)
-            , modifierAltGraph(modifierAltGraph)
-            , modifierCapsLock(modifierCapsLock)
-        { }
-
+struct EventModifierInit : UIEventInit {
     bool ctrlKey { false };
     bool shiftKey { false };
     bool altKey { false };

Modified: trunk/Source/WebCore/dom/KeyboardEvent.cpp (206973 => 206974)


--- trunk/Source/WebCore/dom/KeyboardEvent.cpp	2016-10-10 00:45:20 UTC (rev 206973)
+++ trunk/Source/WebCore/dom/KeyboardEvent.cpp	2016-10-10 01:16:05 UTC (rev 206974)
@@ -135,7 +135,7 @@
     , m_code(initializer.code)
 #endif
     , m_keyIdentifier(initializer.keyIdentifier)
-    , m_location(initializer.location)
+    , m_location(initializer.keyLocation ? *initializer.keyLocation : initializer.location)
     , m_repeat(initializer.repeat)
     , m_isComposing(initializer.isComposing)
 #if PLATFORM(COCOA)

Modified: trunk/Source/WebCore/dom/KeyboardEvent.h (206973 => 206974)


--- trunk/Source/WebCore/dom/KeyboardEvent.h	2016-10-10 00:45:20 UTC (rev 206973)
+++ trunk/Source/WebCore/dom/KeyboardEvent.h	2016-10-10 01:16:05 UTC (rev 206974)
@@ -54,19 +54,6 @@
     }
 
     struct Init : public EventModifierInit {
-        Init(bool bubbles, bool cancelable, bool composed, RefPtr<DOMWindow>&& view, int detail,
-            bool ctrlKey, bool shiftKey, bool altKey, bool metaKey, bool modifierAltGraph, bool modifierCapsLock,
-            String key, String code, Optional<unsigned> location, bool repeat, bool isComposing, String keyIdentifier,
-            Optional<unsigned> keyLocation)
-                : EventModifierInit(bubbles, cancelable, composed, WTFMove(view), detail, ctrlKey, shiftKey, altKey, metaKey, modifierAltGraph, modifierCapsLock)
-                , key(key)
-                , code(code)
-                , location(location ? *location : keyLocation.valueOr(DOM_KEY_LOCATION_STANDARD))
-                , repeat(repeat)
-                , isComposing(isComposing)
-                , keyIdentifier(keyIdentifier)
-            { }
-
         String key;
         String code;
         unsigned location;
@@ -75,6 +62,7 @@
 
         // Legacy.
         String keyIdentifier;
+        Optional<unsigned> keyLocation;
     };
 
     static Ref<KeyboardEvent> create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No)

Modified: trunk/Source/WebCore/dom/KeyboardEvent.idl (206973 => 206974)


--- trunk/Source/WebCore/dom/KeyboardEvent.idl	2016-10-10 00:45:20 UTC (rev 206973)
+++ trunk/Source/WebCore/dom/KeyboardEvent.idl	2016-10-10 01:16:05 UTC (rev 206974)
@@ -56,7 +56,7 @@
 dictionary KeyboardEventInit : EventModifierInit {
     DOMString key = "";
     DOMString code = "";
-    unsigned long location;
+    unsigned long location = 0;
     boolean repeat = false;
     boolean isComposing = false;
 

Modified: trunk/Source/WebCore/dom/UIEventInit.h (206973 => 206974)


--- trunk/Source/WebCore/dom/UIEventInit.h	2016-10-10 00:45:20 UTC (rev 206973)
+++ trunk/Source/WebCore/dom/UIEventInit.h	2016-10-10 01:16:05 UTC (rev 206974)
@@ -32,13 +32,6 @@
 namespace WebCore {
 
 struct UIEventInit : public EventInit {
-    UIEventInit() = default;
-    UIEventInit(bool bubbles, bool cancelable, bool composed, RefPtr<DOMWindow>&& view, int detail)
-        : EventInit(bubbles, cancelable, composed)
-        , view(WTFMove(view))
-        , detail(detail)
-    { }
-
     RefPtr<DOMWindow> view;
     int detail { 0 };
 };

Modified: trunk/Source/WebCore/editing/Editor.cpp (206973 => 206974)


--- trunk/Source/WebCore/editing/Editor.cpp	2016-10-10 00:45:20 UTC (rev 206973)
+++ trunk/Source/WebCore/editing/Editor.cpp	2016-10-10 01:16:05 UTC (rev 206974)
@@ -881,9 +881,13 @@
     if (!target)
         return true;
 
-    RefPtr<DataTransfer> dataTransfer = DataTransfer::createForCopyAndPaste(policy);
+    auto dataTransfer = DataTransfer::createForCopyAndPaste(policy);
 
-    auto event = ClipboardEvent::create(eventType, { true, true, false, dataTransfer.get() }, Event::IsTrusted::Yes);
+    ClipboardEvent::Init init;
+    init.bubbles = true;
+    init.cancelable = true;
+    init.clipboardData = dataTransfer.ptr();
+    auto event = ClipboardEvent::create(eventType, init, Event::IsTrusted::Yes);
     target->dispatchEvent(event);
     bool noDefaultProcessing = event->defaultPrevented();
     if (noDefaultProcessing && policy == DataTransferAccessPolicy::Writable) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to