Diff
Modified: trunk/Source/WebCore/ChangeLog (266119 => 266120)
--- trunk/Source/WebCore/ChangeLog 2020-08-25 16:06:08 UTC (rev 266119)
+++ trunk/Source/WebCore/ChangeLog 2020-08-25 16:08:21 UTC (rev 266120)
@@ -1,3 +1,31 @@
+2020-08-25 Youenn Fablet <[email protected]>
+
+ Generated bindings for derived dictionaries are not regenerated when the base dictionary changes
+ https://bugs.webkit.org/show_bug.cgi?id=181714
+
+ Reviewed by Darin Adler.
+
+ Add dictionary file dependencies to SupplementalDependencies.dep.
+ We add the base dictionary IDL file as a dependency to the JS cpp file of the derived dictionary.
+ We do so if we detect that a dictionary is deriving from another and both dictionaries are in their own IDL file.
+
+ Covered by updated binding tests.
+
+ * bindings/scripts/preprocess-idls.pl:
+ (updateDictionaryDependencies):
+ * bindings/scripts/test/SupplementalDependencies.dep: Added.
+ * bindings/scripts/test/TestDerivedDictionary2.idl: Added.
+ * bindings/scripts/test/TestInheritedDictionary2.idl: Added.
+ * bindings/scripts/test/JS/JSTestDerivedDictionary2.cpp: Added.
+ (WebCore::convertDictionary<TestDerivedDictionary2>):
+ (WebCore::convertDictionaryToJS):
+ (WebCore::convertDictionary<TestDerivedDictionary2::Dictionary>):
+ * bindings/scripts/test/JS/JSTestDerivedDictionary2.h: Added.
+ * bindings/scripts/test/JS/JSTestInheritedDictionary2.cpp: Added.
+ (WebCore::convertDictionary<TestInheritedDictionary2>):
+ (WebCore::convertDictionaryToJS):
+ * bindings/scripts/test/JS/JSTestInheritedDictionary2.h: Added.
+
2020-08-25 Myles C. Maxfield <[email protected]>
Fonts lie about being monospaced
Modified: trunk/Source/WebCore/bindings/scripts/preprocess-idls.pl (266119 => 266120)
--- trunk/Source/WebCore/bindings/scripts/preprocess-idls.pl 2020-08-25 16:06:08 UTC (rev 266119)
+++ trunk/Source/WebCore/bindings/scripts/preprocess-idls.pl 2020-08-25 16:08:21 UTC (rev 266120)
@@ -87,6 +87,7 @@
my %interfaceNameToIdlFile;
my %idlFileToInterfaceName;
my %supplementalDependencies;
+my %dictionaryDependencies;
my %supplementals;
my $windowConstructorsCode = "";
my $workerGlobalScopeConstructorsCode = "";
@@ -135,6 +136,8 @@
$supplementals{$fullPath} = [];
+ updateDictionaryDependencies($idlFileContents, $idlFile);
+
# Skip if the IDL file does not contain an interface, a callback interface or an exception.
# The IDL may contain a dictionary.
next unless containsInterfaceOrExceptionFromIDL($idlFileContents);
@@ -238,7 +241,7 @@
WriteFileIfChanged($supplementalDependencyFile, $dependencies);
if ($supplementalMakefileDeps) {
- my $makefileDeps = "";
+ my $makefileDeps = "# Supplemental dependencies\n";
foreach my $idlFile (sort keys %supplementals) {
my $basename = $idlFileToInterfaceName{$idlFile};
@@ -252,6 +255,11 @@
}
}
+ $makefileDeps .= "# Dictionaries dependencies\n";
+ foreach my $derivedDictionary (sort keys %dictionaryDependencies) {
+ $makefileDeps .= "JS${derivedDictionary}.cpp: $dictionaryDependencies{$derivedDictionary}\n";
+ }
+
WriteFileIfChanged($supplementalMakefileDeps, $makefileDeps);
}
@@ -446,3 +454,18 @@
return !$extendedAttributes->{"NoInterfaceObject"};
}
+
+sub updateDictionaryDependencies
+{
+ my $fileContents = shift;
+ my $idlFile = shift;
+
+ my $dictionaryName = fileparse(basename($idlFile), ".idl");
+
+ my @baseDictionaries = ();
+ while ($fileContents =~ /\s*dictionary\s+(\w+)\s+:\s+(\w+)\s*/mg) {
+ next if !$interfaceNameToIdlFile{$2} || (grep { $_ eq $2 } @baseDictionaries);
+ push(@baseDictionaries, $2);
+ }
+ $dictionaryDependencies{$dictionaryName} = (join(".idl ", @baseDictionaries) . ".idl") if @baseDictionaries;
+}
Added: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestDerivedDictionary2.cpp (0 => 266120)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestDerivedDictionary2.cpp (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestDerivedDictionary2.cpp 2020-08-25 16:08:21 UTC (rev 266120)
@@ -0,0 +1,317 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "JSTestDerivedDictionary2.h"
+
+#include "Document.h"
+#include "JSDOMConvertBoolean.h"
+#include "JSDOMConvertCallbacks.h"
+#include "JSDOMConvertNumbers.h"
+#include "JSDOMConvertStrings.h"
+#include "JSDOMGlobalObject.h"
+#include "JSVoidCallback.h"
+#include "Settings.h"
+#include <_javascript_Core/JSCInlines.h>
+#include <_javascript_Core/ObjectConstructor.h>
+
+
+namespace WebCore {
+using namespace JSC;
+
+template<> TestDerivedDictionary2 convertDictionary<TestDerivedDictionary2>(JSGlobalObject& lexicalGlobalObject, JSValue value)
+{
+ VM& vm = JSC::getVM(&lexicalGlobalObject);
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ bool isNullOrUndefined = value.isUndefinedOrNull();
+ auto* object = isNullOrUndefined ? nullptr : value.getObject();
+ if (UNLIKELY(!isNullOrUndefined && !object)) {
+ throwTypeError(&lexicalGlobalObject, throwScope);
+ return { };
+ }
+ TestDerivedDictionary2 result;
+ JSValue boolMemberValue;
+ if (isNullOrUndefined)
+ boolMemberValue = jsUndefined();
+ else {
+ boolMemberValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "boolMember"));
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ if (!boolMemberValue.isUndefined()) {
+ result.boolMember = convert<IDLBoolean>(lexicalGlobalObject, boolMemberValue);
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ JSValue callbackMemberValue;
+ if (isNullOrUndefined)
+ callbackMemberValue = jsUndefined();
+ else {
+ callbackMemberValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "callbackMember"));
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ if (!callbackMemberValue.isUndefined()) {
+ result.callbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, callbackMemberValue, *jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject));
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ JSValue stringMemberValue;
+ if (isNullOrUndefined)
+ stringMemberValue = jsUndefined();
+ else {
+ stringMemberValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "stringMember"));
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ if (!stringMemberValue.isUndefined()) {
+ result.stringMember = convert<IDLDOMString>(lexicalGlobalObject, stringMemberValue);
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ JSValue derivedBoolMember2Value;
+ if (isNullOrUndefined)
+ derivedBoolMember2Value = jsUndefined();
+ else {
+ derivedBoolMember2Value = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "derivedBoolMember2"));
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ if (!derivedBoolMember2Value.isUndefined()) {
+ result.derivedBoolMember2 = convert<IDLBoolean>(lexicalGlobalObject, derivedBoolMember2Value);
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ return result;
+}
+
+JSC::JSObject* convertDictionaryToJS(JSC::JSGlobalObject& lexicalGlobalObject, JSDOMGlobalObject& globalObject, const TestDerivedDictionary2& dictionary)
+{
+ auto& vm = JSC::getVM(&lexicalGlobalObject);
+
+ auto result = constructEmptyObject(&lexicalGlobalObject, globalObject.objectPrototype());
+
+ if (!IDLBoolean::isNullValue(dictionary.boolMember)) {
+ auto boolMemberValue = toJS<IDLBoolean>(IDLBoolean::extractValueFromNullable(dictionary.boolMember));
+ result->putDirect(vm, JSC::Identifier::fromString(vm, "boolMember"), boolMemberValue);
+ }
+ if (!IDLCallbackFunction<JSVoidCallback>::isNullValue(dictionary.callbackMember)) {
+ auto callbackMemberValue = toJS<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, globalObject, IDLCallbackFunction<JSVoidCallback>::extractValueFromNullable(dictionary.callbackMember));
+ result->putDirect(vm, JSC::Identifier::fromString(vm, "callbackMember"), callbackMemberValue);
+ }
+ if (!IDLDOMString::isNullValue(dictionary.stringMember)) {
+ auto stringMemberValue = toJS<IDLDOMString>(lexicalGlobalObject, IDLDOMString::extractValueFromNullable(dictionary.stringMember));
+ result->putDirect(vm, JSC::Identifier::fromString(vm, "stringMember"), stringMemberValue);
+ }
+ if (!IDLBoolean::isNullValue(dictionary.derivedBoolMember2)) {
+ auto derivedBoolMember2Value = toJS<IDLBoolean>(IDLBoolean::extractValueFromNullable(dictionary.derivedBoolMember2));
+ result->putDirect(vm, JSC::Identifier::fromString(vm, "derivedBoolMember2"), derivedBoolMember2Value);
+ }
+ return result;
+}
+
+template<> TestDerivedDictionary2::Dictionary convertDictionary<TestDerivedDictionary2::Dictionary>(JSGlobalObject& lexicalGlobalObject, JSValue value)
+{
+ VM& vm = JSC::getVM(&lexicalGlobalObject);
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ bool isNullOrUndefined = value.isUndefinedOrNull();
+ auto* object = isNullOrUndefined ? nullptr : value.getObject();
+ if (UNLIKELY(!isNullOrUndefined && !object)) {
+ throwTypeError(&lexicalGlobalObject, throwScope);
+ return { };
+ }
+ TestDerivedDictionary2::Dictionary result;
+ JSValue boolMemberValue;
+ if (isNullOrUndefined)
+ boolMemberValue = jsUndefined();
+ else {
+ boolMemberValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "boolMember"));
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ if (!boolMemberValue.isUndefined()) {
+ result.boolMember = convert<IDLBoolean>(lexicalGlobalObject, boolMemberValue);
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ JSValue callbackMemberValue;
+ if (isNullOrUndefined)
+ callbackMemberValue = jsUndefined();
+ else {
+ callbackMemberValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "callbackMember"));
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ if (!callbackMemberValue.isUndefined()) {
+ result.callbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, callbackMemberValue, *jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject));
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ JSValue partialBooleanMemberValue;
+ if (isNullOrUndefined)
+ partialBooleanMemberValue = jsUndefined();
+ else {
+ partialBooleanMemberValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "partialBooleanMember"));
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ if (!partialBooleanMemberValue.isUndefined()) {
+ result.partialBooleanMember = convert<IDLBoolean>(lexicalGlobalObject, partialBooleanMemberValue);
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+#if ENABLE(Conditional15)
+ JSValue partialBooleanMemberWithConditionalValue;
+ if (isNullOrUndefined)
+ partialBooleanMemberWithConditionalValue = jsUndefined();
+ else {
+ partialBooleanMemberWithConditionalValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "partialBooleanMemberWithConditional"));
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ if (!partialBooleanMemberWithConditionalValue.isUndefined()) {
+ result.partialBooleanMemberWithConditional = convert<IDLBoolean>(lexicalGlobalObject, partialBooleanMemberWithConditionalValue);
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+#endif
+ JSValue partialCallbackMemberValue;
+ if (isNullOrUndefined)
+ partialCallbackMemberValue = jsUndefined();
+ else {
+ partialCallbackMemberValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "partialCallbackMember"));
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ if (!partialCallbackMemberValue.isUndefined()) {
+ result.partialCallbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, partialCallbackMemberValue, *jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject));
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ JSValue partialRequiredLongMemberValue;
+ if (isNullOrUndefined)
+ partialRequiredLongMemberValue = jsUndefined();
+ else {
+ partialRequiredLongMemberValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "partialRequiredLongMember"));
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ if (!partialRequiredLongMemberValue.isUndefined()) {
+ result.partialRequiredLongMember = convert<IDLLong>(lexicalGlobalObject, partialRequiredLongMemberValue);
+ RETURN_IF_EXCEPTION(throwScope, { });
+ } else {
+ throwRequiredMemberTypeError(lexicalGlobalObject, throwScope, "partialRequiredLongMember", "TestDerivedDictionary", "long");
+ return { };
+ }
+ JSValue partialStringMemberValue;
+ if (isNullOrUndefined)
+ partialStringMemberValue = jsUndefined();
+ else {
+ partialStringMemberValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "partialStringMember"));
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ if (!partialStringMemberValue.isUndefined()) {
+ result.partialStringMember = convert<IDLDOMString>(lexicalGlobalObject, partialStringMemberValue);
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ JSValue partialStringMemberWithEnabledBySettingValue;
+ if (isNullOrUndefined)
+ partialStringMemberWithEnabledBySettingValue = jsUndefined();
+ else {
+ partialStringMemberWithEnabledBySettingValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "partialStringMemberWithEnabledBySetting"));
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ if (!partialStringMemberWithEnabledBySettingValue.isUndefined()) {
+ result.partialStringMemberWithEnabledBySetting = convert<IDLDOMString>(lexicalGlobalObject, partialStringMemberWithEnabledBySettingValue);
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ JSValue partialUnsignedLongMemberWithImplementedAsValue;
+ if (isNullOrUndefined)
+ partialUnsignedLongMemberWithImplementedAsValue = jsUndefined();
+ else {
+ partialUnsignedLongMemberWithImplementedAsValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "partialUnsignedLongMemberWithImplementedAs"));
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ if (!partialUnsignedLongMemberWithImplementedAsValue.isUndefined()) {
+ result.partialUnsignedLongMember = convert<IDLUnsignedLong>(lexicalGlobalObject, partialUnsignedLongMemberWithImplementedAsValue);
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ JSValue stringMemberValue;
+ if (isNullOrUndefined)
+ stringMemberValue = jsUndefined();
+ else {
+ stringMemberValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "stringMember"));
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ if (!stringMemberValue.isUndefined()) {
+ result.stringMember = convert<IDLDOMString>(lexicalGlobalObject, stringMemberValue);
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ JSValue derivedBoolMemberValue;
+ if (isNullOrUndefined)
+ derivedBoolMemberValue = jsUndefined();
+ else {
+ derivedBoolMemberValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "derivedBoolMember"));
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ if (!derivedBoolMemberValue.isUndefined()) {
+ result.derivedBoolMember = convert<IDLBoolean>(lexicalGlobalObject, derivedBoolMemberValue);
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ return result;
+}
+
+JSC::JSObject* convertDictionaryToJS(JSC::JSGlobalObject& lexicalGlobalObject, JSDOMGlobalObject& globalObject, const TestDerivedDictionary2::Dictionary& dictionary)
+{
+ auto& vm = JSC::getVM(&lexicalGlobalObject);
+
+ auto result = constructEmptyObject(&lexicalGlobalObject, globalObject.objectPrototype());
+
+ if (!IDLBoolean::isNullValue(dictionary.boolMember)) {
+ auto boolMemberValue = toJS<IDLBoolean>(IDLBoolean::extractValueFromNullable(dictionary.boolMember));
+ result->putDirect(vm, JSC::Identifier::fromString(vm, "boolMember"), boolMemberValue);
+ }
+ if (!IDLCallbackFunction<JSVoidCallback>::isNullValue(dictionary.callbackMember)) {
+ auto callbackMemberValue = toJS<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, globalObject, IDLCallbackFunction<JSVoidCallback>::extractValueFromNullable(dictionary.callbackMember));
+ result->putDirect(vm, JSC::Identifier::fromString(vm, "callbackMember"), callbackMemberValue);
+ }
+ if (!IDLBoolean::isNullValue(dictionary.partialBooleanMember)) {
+ auto partialBooleanMemberValue = toJS<IDLBoolean>(IDLBoolean::extractValueFromNullable(dictionary.partialBooleanMember));
+ result->putDirect(vm, JSC::Identifier::fromString(vm, "partialBooleanMember"), partialBooleanMemberValue);
+ }
+#if ENABLE(Conditional15)
+ if (!IDLBoolean::isNullValue(dictionary.partialBooleanMemberWithConditional)) {
+ auto partialBooleanMemberWithConditionalValue = toJS<IDLBoolean>(IDLBoolean::extractValueFromNullable(dictionary.partialBooleanMemberWithConditional));
+ result->putDirect(vm, JSC::Identifier::fromString(vm, "partialBooleanMemberWithConditional"), partialBooleanMemberWithConditionalValue);
+ }
+#endif
+ if (!IDLCallbackFunction<JSVoidCallback>::isNullValue(dictionary.partialCallbackMember)) {
+ auto partialCallbackMemberValue = toJS<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, globalObject, IDLCallbackFunction<JSVoidCallback>::extractValueFromNullable(dictionary.partialCallbackMember));
+ result->putDirect(vm, JSC::Identifier::fromString(vm, "partialCallbackMember"), partialCallbackMemberValue);
+ }
+ auto partialRequiredLongMemberValue = toJS<IDLLong>(dictionary.partialRequiredLongMember);
+ result->putDirect(vm, JSC::Identifier::fromString(vm, "partialRequiredLongMember"), partialRequiredLongMemberValue);
+ if (!IDLDOMString::isNullValue(dictionary.partialStringMember)) {
+ auto partialStringMemberValue = toJS<IDLDOMString>(lexicalGlobalObject, IDLDOMString::extractValueFromNullable(dictionary.partialStringMember));
+ result->putDirect(vm, JSC::Identifier::fromString(vm, "partialStringMember"), partialStringMemberValue);
+ }
+ if (downcast<Document>(jsCast<JSDOMGlobalObject*>(&globalObject)->scriptExecutionContext())->settings().testSettingEnabled()) {
+ if (!IDLDOMString::isNullValue(dictionary.partialStringMemberWithEnabledBySetting)) {
+ auto partialStringMemberWithEnabledBySettingValue = toJS<IDLDOMString>(lexicalGlobalObject, IDLDOMString::extractValueFromNullable(dictionary.partialStringMemberWithEnabledBySetting));
+ result->putDirect(vm, JSC::Identifier::fromString(vm, "partialStringMemberWithEnabledBySetting"), partialStringMemberWithEnabledBySettingValue);
+ }
+ }
+ if (!IDLUnsignedLong::isNullValue(dictionary.partialUnsignedLongMember)) {
+ auto partialUnsignedLongMemberWithImplementedAsValue = toJS<IDLUnsignedLong>(IDLUnsignedLong::extractValueFromNullable(dictionary.partialUnsignedLongMember));
+ result->putDirect(vm, JSC::Identifier::fromString(vm, "partialUnsignedLongMemberWithImplementedAs"), partialUnsignedLongMemberWithImplementedAsValue);
+ }
+ if (!IDLDOMString::isNullValue(dictionary.stringMember)) {
+ auto stringMemberValue = toJS<IDLDOMString>(lexicalGlobalObject, IDLDOMString::extractValueFromNullable(dictionary.stringMember));
+ result->putDirect(vm, JSC::Identifier::fromString(vm, "stringMember"), stringMemberValue);
+ }
+ if (!IDLBoolean::isNullValue(dictionary.derivedBoolMember)) {
+ auto derivedBoolMemberValue = toJS<IDLBoolean>(IDLBoolean::extractValueFromNullable(dictionary.derivedBoolMember));
+ result->putDirect(vm, JSC::Identifier::fromString(vm, "derivedBoolMember"), derivedBoolMemberValue);
+ }
+ return result;
+}
+
+} // namespace WebCore
Added: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestDerivedDictionary2.h (0 => 266120)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestDerivedDictionary2.h (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestDerivedDictionary2.h 2020-08-25 16:08:21 UTC (rev 266120)
@@ -0,0 +1,36 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#pragma once
+
+#include "JSDOMConvertDictionary.h"
+#include "TestDerivedDictionary2.h"
+
+namespace WebCore {
+
+template<> TestDerivedDictionary2 convertDictionary<TestDerivedDictionary2>(JSC::JSGlobalObject&, JSC::JSValue);
+
+JSC::JSObject* convertDictionaryToJS(JSC::JSGlobalObject&, JSDOMGlobalObject&, const TestDerivedDictionary2&);
+
+template<> TestDerivedDictionary2::Dictionary convertDictionary<TestDerivedDictionary2::Dictionary>(JSC::JSGlobalObject&, JSC::JSValue);
+
+JSC::JSObject* convertDictionaryToJS(JSC::JSGlobalObject&, JSDOMGlobalObject&, const TestDerivedDictionary2::Dictionary&);
+
+} // namespace WebCore
Added: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInheritedDictionary2.cpp (0 => 266120)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInheritedDictionary2.cpp (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInheritedDictionary2.cpp 2020-08-25 16:08:21 UTC (rev 266120)
@@ -0,0 +1,104 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "JSTestInheritedDictionary2.h"
+
+#include "JSDOMConvertBoolean.h"
+#include "JSDOMConvertCallbacks.h"
+#include "JSDOMConvertStrings.h"
+#include "JSDOMGlobalObject.h"
+#include "JSVoidCallback.h"
+#include <_javascript_Core/JSCInlines.h>
+#include <_javascript_Core/ObjectConstructor.h>
+
+
+namespace WebCore {
+using namespace JSC;
+
+template<> TestInheritedDictionary2 convertDictionary<TestInheritedDictionary2>(JSGlobalObject& lexicalGlobalObject, JSValue value)
+{
+ VM& vm = JSC::getVM(&lexicalGlobalObject);
+ auto throwScope = DECLARE_THROW_SCOPE(vm);
+ bool isNullOrUndefined = value.isUndefinedOrNull();
+ auto* object = isNullOrUndefined ? nullptr : value.getObject();
+ if (UNLIKELY(!isNullOrUndefined && !object)) {
+ throwTypeError(&lexicalGlobalObject, throwScope);
+ return { };
+ }
+ TestInheritedDictionary2 result;
+ JSValue boolMemberValue;
+ if (isNullOrUndefined)
+ boolMemberValue = jsUndefined();
+ else {
+ boolMemberValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "boolMember"));
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ if (!boolMemberValue.isUndefined()) {
+ result.boolMember = convert<IDLBoolean>(lexicalGlobalObject, boolMemberValue);
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ JSValue callbackMemberValue;
+ if (isNullOrUndefined)
+ callbackMemberValue = jsUndefined();
+ else {
+ callbackMemberValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "callbackMember"));
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ if (!callbackMemberValue.isUndefined()) {
+ result.callbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, callbackMemberValue, *jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject));
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ JSValue stringMemberValue;
+ if (isNullOrUndefined)
+ stringMemberValue = jsUndefined();
+ else {
+ stringMemberValue = object->get(&lexicalGlobalObject, Identifier::fromString(vm, "stringMember"));
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ if (!stringMemberValue.isUndefined()) {
+ result.stringMember = convert<IDLDOMString>(lexicalGlobalObject, stringMemberValue);
+ RETURN_IF_EXCEPTION(throwScope, { });
+ }
+ return result;
+}
+
+JSC::JSObject* convertDictionaryToJS(JSC::JSGlobalObject& lexicalGlobalObject, JSDOMGlobalObject& globalObject, const TestInheritedDictionary2& dictionary)
+{
+ auto& vm = JSC::getVM(&lexicalGlobalObject);
+
+ auto result = constructEmptyObject(&lexicalGlobalObject, globalObject.objectPrototype());
+
+ if (!IDLBoolean::isNullValue(dictionary.boolMember)) {
+ auto boolMemberValue = toJS<IDLBoolean>(IDLBoolean::extractValueFromNullable(dictionary.boolMember));
+ result->putDirect(vm, JSC::Identifier::fromString(vm, "boolMember"), boolMemberValue);
+ }
+ if (!IDLCallbackFunction<JSVoidCallback>::isNullValue(dictionary.callbackMember)) {
+ auto callbackMemberValue = toJS<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, globalObject, IDLCallbackFunction<JSVoidCallback>::extractValueFromNullable(dictionary.callbackMember));
+ result->putDirect(vm, JSC::Identifier::fromString(vm, "callbackMember"), callbackMemberValue);
+ }
+ if (!IDLDOMString::isNullValue(dictionary.stringMember)) {
+ auto stringMemberValue = toJS<IDLDOMString>(lexicalGlobalObject, IDLDOMString::extractValueFromNullable(dictionary.stringMember));
+ result->putDirect(vm, JSC::Identifier::fromString(vm, "stringMember"), stringMemberValue);
+ }
+ return result;
+}
+
+} // namespace WebCore
Added: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInheritedDictionary2.h (0 => 266120)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInheritedDictionary2.h (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInheritedDictionary2.h 2020-08-25 16:08:21 UTC (rev 266120)
@@ -0,0 +1,32 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#pragma once
+
+#include "JSDOMConvertDictionary.h"
+#include "TestInheritedDictionary2.h"
+
+namespace WebCore {
+
+template<> TestInheritedDictionary2 convertDictionary<TestInheritedDictionary2>(JSC::JSGlobalObject&, JSC::JSValue);
+
+JSC::JSObject* convertDictionaryToJS(JSC::JSGlobalObject&, JSDOMGlobalObject&, const TestInheritedDictionary2&);
+
+} // namespace WebCore
Added: trunk/Source/WebCore/bindings/scripts/test/SupplementalDependencies.dep (0 => 266120)
--- trunk/Source/WebCore/bindings/scripts/test/SupplementalDependencies.dep (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/SupplementalDependencies.dep 2020-08-25 16:08:21 UTC (rev 266120)
@@ -0,0 +1,241 @@
+# Supplemental dependencies
+JSTestCEReactions.h:
+DOMTestCEReactions.h:
+WebDOMTestCEReactions.h:
+JSTestCEReactionsStringifier.h:
+DOMTestCEReactionsStringifier.h:
+WebDOMTestCEReactionsStringifier.h:
+JSTestCallTracer.h:
+DOMTestCallTracer.h:
+WebDOMTestCallTracer.h:
+JSTestCallbackFunction.h:
+DOMTestCallbackFunction.h:
+WebDOMTestCallbackFunction.h:
+JSTestCallbackFunctionRethrow.h:
+DOMTestCallbackFunctionRethrow.h:
+WebDOMTestCallbackFunctionRethrow.h:
+JSTestCallbackFunctionWithThisObject.h:
+DOMTestCallbackFunctionWithThisObject.h:
+WebDOMTestCallbackFunctionWithThisObject.h:
+JSTestCallbackFunctionWithTypedefs.h:
+DOMTestCallbackFunctionWithTypedefs.h:
+WebDOMTestCallbackFunctionWithTypedefs.h:
+JSTestCallbackInterface.h:
+DOMTestCallbackInterface.h:
+WebDOMTestCallbackInterface.h:
+JSTestClassWithJSBuiltinConstructor.h:
+DOMTestClassWithJSBuiltinConstructor.h:
+WebDOMTestClassWithJSBuiltinConstructor.h:
+JSTestDOMJIT.h:
+DOMTestDOMJIT.h:
+WebDOMTestDOMJIT.h:
+JSTestDerivedDictionary.h:
+DOMTestDerivedDictionary.h:
+WebDOMTestDerivedDictionary.h:
+JSTestDerivedDictionary2.h:
+DOMTestDerivedDictionary2.h:
+WebDOMTestDerivedDictionary2.h:
+JSTestDomainSecurity.h:
+DOMTestDomainSecurity.h:
+WebDOMTestDomainSecurity.h:
+JSTestEnabledBySetting.h:
+DOMTestEnabledBySetting.h:
+WebDOMTestEnabledBySetting.h:
+JSTestEnabledForContext.h:
+DOMTestEnabledForContext.h:
+WebDOMTestEnabledForContext.h:
+JSTestEventConstructor.h:
+DOMTestEventConstructor.h:
+WebDOMTestEventConstructor.h:
+JSTestEventTarget.h:
+DOMTestEventTarget.h:
+WebDOMTestEventTarget.h:
+JSTestException.h:
+DOMTestException.h:
+WebDOMTestException.h:
+JSTestGenerateIsReachable.h:
+DOMTestGenerateIsReachable.h:
+WebDOMTestGenerateIsReachable.h:
+JSTestGlobalObject.h: BindingTestGlobalConstructors.idl
+DOMTestGlobalObject.h: BindingTestGlobalConstructors.idl
+WebDOMTestGlobalObject.h: BindingTestGlobalConstructors.idl
+BindingTestGlobalConstructors.idl:
+JSTestIndexedSetterNoIdentifier.h:
+DOMTestIndexedSetterNoIdentifier.h:
+WebDOMTestIndexedSetterNoIdentifier.h:
+JSTestIndexedSetterThrowingException.h:
+DOMTestIndexedSetterThrowingException.h:
+WebDOMTestIndexedSetterThrowingException.h:
+JSTestIndexedSetterWithIdentifier.h:
+DOMTestIndexedSetterWithIdentifier.h:
+WebDOMTestIndexedSetterWithIdentifier.h:
+JSTestInheritedDictionary.h: TestSupplemental.idl
+DOMTestInheritedDictionary.h: TestSupplemental.idl
+WebDOMTestInheritedDictionary.h: TestSupplemental.idl
+TestSupplemental.idl:
+JSTestInheritedDictionary2.h:
+DOMTestInheritedDictionary2.h:
+WebDOMTestInheritedDictionary2.h:
+JSTestInterface.h: TestImplements.idl TestSupplemental.idl
+DOMTestInterface.h: TestImplements.idl TestSupplemental.idl
+WebDOMTestInterface.h: TestImplements.idl TestSupplemental.idl
+TestImplements.idl:
+TestSupplemental.idl:
+JSTestInterfaceLeadingUnderscore.h:
+DOMTestInterfaceLeadingUnderscore.h:
+WebDOMTestInterfaceLeadingUnderscore.h:
+JSTestIterable.h:
+DOMTestIterable.h:
+WebDOMTestIterable.h:
+JSTestJSBuiltinConstructor.h:
+DOMTestJSBuiltinConstructor.h:
+WebDOMTestJSBuiltinConstructor.h:
+JSTestMapLike.h:
+DOMTestMapLike.h:
+WebDOMTestMapLike.h:
+JSTestNamedAndIndexedSetterNoIdentifier.h:
+DOMTestNamedAndIndexedSetterNoIdentifier.h:
+WebDOMTestNamedAndIndexedSetterNoIdentifier.h:
+JSTestNamedAndIndexedSetterThrowingException.h:
+DOMTestNamedAndIndexedSetterThrowingException.h:
+WebDOMTestNamedAndIndexedSetterThrowingException.h:
+JSTestNamedAndIndexedSetterWithIdentifier.h:
+DOMTestNamedAndIndexedSetterWithIdentifier.h:
+WebDOMTestNamedAndIndexedSetterWithIdentifier.h:
+JSTestNamedConstructor.h:
+DOMTestNamedConstructor.h:
+WebDOMTestNamedConstructor.h:
+JSTestNamedDeleterNoIdentifier.h:
+DOMTestNamedDeleterNoIdentifier.h:
+WebDOMTestNamedDeleterNoIdentifier.h:
+JSTestNamedDeleterThrowingException.h:
+DOMTestNamedDeleterThrowingException.h:
+WebDOMTestNamedDeleterThrowingException.h:
+JSTestNamedDeleterWithIdentifier.h:
+DOMTestNamedDeleterWithIdentifier.h:
+WebDOMTestNamedDeleterWithIdentifier.h:
+JSTestNamedDeleterWithIndexedGetter.h:
+DOMTestNamedDeleterWithIndexedGetter.h:
+WebDOMTestNamedDeleterWithIndexedGetter.h:
+JSTestNamedGetterCallWith.h:
+DOMTestNamedGetterCallWith.h:
+WebDOMTestNamedGetterCallWith.h:
+JSTestNamedGetterNoIdentifier.h:
+DOMTestNamedGetterNoIdentifier.h:
+WebDOMTestNamedGetterNoIdentifier.h:
+JSTestNamedGetterWithIdentifier.h:
+DOMTestNamedGetterWithIdentifier.h:
+WebDOMTestNamedGetterWithIdentifier.h:
+JSTestNamedSetterNoIdentifier.h:
+DOMTestNamedSetterNoIdentifier.h:
+WebDOMTestNamedSetterNoIdentifier.h:
+JSTestNamedSetterThrowingException.h:
+DOMTestNamedSetterThrowingException.h:
+WebDOMTestNamedSetterThrowingException.h:
+JSTestNamedSetterWithIdentifier.h:
+DOMTestNamedSetterWithIdentifier.h:
+WebDOMTestNamedSetterWithIdentifier.h:
+JSTestNamedSetterWithIndexedGetter.h:
+DOMTestNamedSetterWithIndexedGetter.h:
+WebDOMTestNamedSetterWithIndexedGetter.h:
+JSTestNamedSetterWithIndexedGetterAndSetter.h:
+DOMTestNamedSetterWithIndexedGetterAndSetter.h:
+WebDOMTestNamedSetterWithIndexedGetterAndSetter.h:
+JSTestNamedSetterWithOverrideBuiltins.h:
+DOMTestNamedSetterWithOverrideBuiltins.h:
+WebDOMTestNamedSetterWithOverrideBuiltins.h:
+JSTestNamedSetterWithUnforgableProperties.h:
+DOMTestNamedSetterWithUnforgableProperties.h:
+WebDOMTestNamedSetterWithUnforgableProperties.h:
+JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h:
+DOMTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h:
+WebDOMTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h:
+JSTestNode.h:
+DOMTestNode.h:
+WebDOMTestNode.h:
+JSTestObj.h:
+DOMTestObj.h:
+WebDOMTestObj.h:
+JSTestOperationConditional.h: TestOperationBase.idl
+DOMTestOperationConditional.h: TestOperationBase.idl
+WebDOMTestOperationConditional.h: TestOperationBase.idl
+TestOperationBase.idl:
+JSTestOverloadedConstructors.h:
+DOMTestOverloadedConstructors.h:
+WebDOMTestOverloadedConstructors.h:
+JSTestOverloadedConstructorsWithSequence.h:
+DOMTestOverloadedConstructorsWithSequence.h:
+WebDOMTestOverloadedConstructorsWithSequence.h:
+JSTestOverrideBuiltins.h:
+DOMTestOverrideBuiltins.h:
+WebDOMTestOverrideBuiltins.h:
+JSTestPluginInterface.h:
+DOMTestPluginInterface.h:
+WebDOMTestPluginInterface.h:
+JSTestPromiseRejectionEvent.h:
+DOMTestPromiseRejectionEvent.h:
+WebDOMTestPromiseRejectionEvent.h:
+JSTestReadOnlyMapLike.h:
+DOMTestReadOnlyMapLike.h:
+WebDOMTestReadOnlyMapLike.h:
+JSTestReadOnlySetLike.h:
+DOMTestReadOnlySetLike.h:
+WebDOMTestReadOnlySetLike.h:
+JSTestReportExtraMemoryCost.h:
+DOMTestReportExtraMemoryCost.h:
+WebDOMTestReportExtraMemoryCost.h:
+JSTestSerialization.h:
+DOMTestSerialization.h:
+WebDOMTestSerialization.h:
+JSTestSerializationIndirectInheritance.h:
+DOMTestSerializationIndirectInheritance.h:
+WebDOMTestSerializationIndirectInheritance.h:
+JSTestSerializationInherit.h:
+DOMTestSerializationInherit.h:
+WebDOMTestSerializationInherit.h:
+JSTestSerializationInheritFinal.h:
+DOMTestSerializationInheritFinal.h:
+WebDOMTestSerializationInheritFinal.h:
+JSTestSerializedScriptValueInterface.h:
+DOMTestSerializedScriptValueInterface.h:
+WebDOMTestSerializedScriptValueInterface.h:
+JSTestSetLike.h:
+DOMTestSetLike.h:
+WebDOMTestSetLike.h:
+JSTestStandaloneDictionary.h: TestSupplemental.idl
+DOMTestStandaloneDictionary.h: TestSupplemental.idl
+WebDOMTestStandaloneDictionary.h: TestSupplemental.idl
+TestSupplemental.idl:
+JSTestStandaloneEnumeration.h:
+DOMTestStandaloneEnumeration.h:
+WebDOMTestStandaloneEnumeration.h:
+JSTestStringifier.h:
+DOMTestStringifier.h:
+WebDOMTestStringifier.h:
+JSTestStringifierAnonymousOperation.h:
+DOMTestStringifierAnonymousOperation.h:
+WebDOMTestStringifierAnonymousOperation.h:
+JSTestStringifierNamedOperation.h:
+DOMTestStringifierNamedOperation.h:
+WebDOMTestStringifierNamedOperation.h:
+JSTestStringifierOperationImplementedAs.h:
+DOMTestStringifierOperationImplementedAs.h:
+WebDOMTestStringifierOperationImplementedAs.h:
+JSTestStringifierOperationNamedToString.h:
+DOMTestStringifierOperationNamedToString.h:
+WebDOMTestStringifierOperationNamedToString.h:
+JSTestStringifierReadOnlyAttribute.h:
+DOMTestStringifierReadOnlyAttribute.h:
+WebDOMTestStringifierReadOnlyAttribute.h:
+JSTestStringifierReadWriteAttribute.h:
+DOMTestStringifierReadWriteAttribute.h:
+WebDOMTestStringifierReadWriteAttribute.h:
+JSTestTypedefs.h:
+DOMTestTypedefs.h:
+WebDOMTestTypedefs.h:
+JSTestVoidCallbackFunction.h:
+DOMTestVoidCallbackFunction.h:
+WebDOMTestVoidCallbackFunction.h:
+# Dictionaries dependencies
+JSTestDerivedDictionary.cpp: TestInheritedDictionary.idl
+JSTestDerivedDictionary2.cpp: TestInheritedDictionary.idl TestInheritedDictionary2.idl
Added: trunk/Source/WebCore/bindings/scripts/test/TestDerivedDictionary2.idl (0 => 266120)
--- trunk/Source/WebCore/bindings/scripts/test/TestDerivedDictionary2.idl (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/TestDerivedDictionary2.idl 2020-08-25 16:08:21 UTC (rev 266120)
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2020 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+ JSGenerateToJSObject
+] dictionary TestDerivedDictionary : TestInheritedDictionary {
+ boolean derivedBoolMember;
+};
+
+[
+ JSGenerateToJSObject
+] dictionary TestDerivedDictionary2 : TestInheritedDictionary2 {
+ boolean derivedBoolMember2;
+};
Added: trunk/Source/WebCore/bindings/scripts/test/TestInheritedDictionary2.idl (0 => 266120)
--- trunk/Source/WebCore/bindings/scripts/test/TestInheritedDictionary2.idl (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/TestInheritedDictionary2.idl 2020-08-25 16:08:21 UTC (rev 266120)
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2020 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+ JSGenerateToJSObject
+]
+dictionary TestInheritedDictionary2 {
+ boolean boolMember;
+ DOMString stringMember;
+ VoidCallback callbackMember;
+};
Modified: trunk/Tools/ChangeLog (266119 => 266120)
--- trunk/Tools/ChangeLog 2020-08-25 16:06:08 UTC (rev 266119)
+++ trunk/Tools/ChangeLog 2020-08-25 16:08:21 UTC (rev 266120)
@@ -1,3 +1,19 @@
+2020-08-25 Youenn Fablet <[email protected]>
+
+ Generated bindings for derived dictionaries are not regenerated when the base dictionary changes
+ https://bugs.webkit.org/show_bug.cgi?id=181714
+
+ Reviewed by Darin Adler.
+
+ Add regression testing coverage for the generation of the makefile dependency file.
+
+ * Scripts/webkitpy/bindings/main.py:
+ (BindingsTests.generate_supplemental_dependency):
+ (BindingsTests.detect_changes):
+ (BindingsTests):
+ (BindingsTests.detect_file_changes):
+ (BindingsTests.main):
+
2020-08-24 Alex Christensen <[email protected]>
Fix TLSVersion.DefaultBehavior on Mojave
Modified: trunk/Tools/Scripts/webkitpy/bindings/main.py (266119 => 266120)
--- trunk/Tools/Scripts/webkitpy/bindings/main.py 2020-08-25 16:06:08 UTC (rev 266119)
+++ trunk/Tools/Scripts/webkitpy/bindings/main.py 2020-08-25 16:08:21 UTC (rev 266120)
@@ -72,7 +72,7 @@
exit_code = e.exit_code
return exit_code
- def generate_supplemental_dependency(self, input_directory, supplemental_dependency_file, window_constructors_file, workerglobalscope_constructors_file, dedicatedworkerglobalscope_constructors_file, serviceworkerglobalscope_constructors_file, workletglobalscope_constructors_file, paintworkletglobalscope_constructors_file, testglobalscope_constructors_file):
+ def generate_supplemental_dependency(self, input_directory, supplemental_dependency_file, supplemental_makefile_dependency_file, window_constructors_file, workerglobalscope_constructors_file, dedicatedworkerglobalscope_constructors_file, serviceworkerglobalscope_constructors_file, workletglobalscope_constructors_file, paintworkletglobalscope_constructors_file, testglobalscope_constructors_file):
idl_files_list = tempfile.mkstemp()
for input_file in os.listdir(input_directory):
(name, extension) = os.path.splitext(input_file)
@@ -88,6 +88,7 @@
'--testGlobalContextName', 'TestGlobalObject',
'--defines', '',
'--supplementalDependencyFile', supplemental_dependency_file,
+ '--supplementalMakefileDeps', supplemental_makefile_dependency_file,
'--windowConstructorsFile', window_constructors_file,
'--workerGlobalScopeConstructorsFile', workerglobalscope_constructors_file,
'--dedicatedWorkerGlobalScopeConstructorsFile', dedicatedworkerglobalscope_constructors_file,
@@ -109,29 +110,35 @@
def detect_changes(self, generator, work_directory, reference_directory):
changes_found = False
- for output_file in os.listdir(work_directory):
- cmd = ['diff',
- '-u',
- '-N',
- os.path.join(reference_directory, output_file),
- os.path.join(work_directory, output_file)]
+ for filename in os.listdir(work_directory):
+ if self.detect_file_changes(generator, work_directory, reference_directory, filename):
+ changes_found = True
+ return changes_found
- exit_code = 0
- try:
- output = self.executive.run_command(cmd)
- except ScriptError as e:
- output = e.output
- exit_code = e.exit_code
+ def detect_file_changes(self, generator, work_directory, reference_directory, filename):
+ changes_found = False
+ cmd = ['diff',
+ '-u',
+ '-N',
+ os.path.join(reference_directory, filename),
+ os.path.join(work_directory, filename)]
- if exit_code or output:
- print('FAIL: (%s) %s' % (generator, output_file))
- print(output)
- changes_found = True
- if self.json_file_name:
- self.failures.append("(%s) %s" % (generator, output_file))
- elif self.verbose:
- print('PASS: (%s) %s' % (generator, output_file))
- sys.stdout.flush()
+ exit_code = 0
+ try:
+ output = self.executive.run_command(cmd)
+ except ScriptError as e:
+ output = e.output
+ exit_code = e.exit_code
+
+ if exit_code or output:
+ print('FAIL: (%s) %s' % (generator, filename))
+ print(output)
+ changes_found = True
+ if self.json_file_name:
+ self.failures.append("(%s) %s" % (generator, filename))
+ elif self.verbose:
+ print('PASS: (%s) %s' % (generator, filename))
+ sys.stdout.flush()
return changes_found
def test_matches_patterns(self, test):
@@ -182,9 +189,13 @@
all_tests_passed = True
+ supplemental_dependency_filename = 'SupplementalDependencies.txt'
+ supplemental_makefile_dependency_filename = 'SupplementalDependencies.dep'
+
work_directory = tempfile.mkdtemp()
input_directory = os.path.join('WebCore', 'bindings', 'scripts', 'test')
- supplemental_dependency_file = os.path.join(work_directory, 'supplemental_dependency.tmp')
+ supplemental_dependency_file = os.path.join(work_directory, supplemental_dependency_filename)
+ supplemental_makefile_dependency_file = os.path.join(work_directory if not self.reset_results else input_directory, supplemental_makefile_dependency_filename)
window_constructors_file = os.path.join(work_directory, 'DOMWindowConstructors.idl')
workerglobalscope_constructors_file = os.path.join(work_directory, 'WorkerGlobalScopeConstructors.idl')
dedicatedworkerglobalscope_constructors_file = os.path.join(work_directory, 'DedicatedWorkerGlobalScopeConstructors.idl')
@@ -192,11 +203,16 @@
workletglobalscope_constructors_file = os.path.join(work_directory, 'WorkletGlobalScopeConstructors.idl')
paintworkletglobalscope_constructors_file = os.path.join(work_directory, 'PaintWorkletGlobalScopeConstructors.idl')
testglobalscope_constructors_file = os.path.join(work_directory, 'BindingTestGlobalConstructors.idl')
- if self.generate_supplemental_dependency(input_directory, supplemental_dependency_file, window_constructors_file, workerglobalscope_constructors_file, dedicatedworkerglobalscope_constructors_file, serviceworkerglobalscope_constructors_file, workletglobalscope_constructors_file, paintworkletglobalscope_constructors_file, testglobalscope_constructors_file):
+
+ if self.generate_supplemental_dependency(input_directory, supplemental_dependency_file, supplemental_makefile_dependency_file, window_constructors_file, workerglobalscope_constructors_file, dedicatedworkerglobalscope_constructors_file, serviceworkerglobalscope_constructors_file, workletglobalscope_constructors_file, paintworkletglobalscope_constructors_file, testglobalscope_constructors_file):
print('Failed to generate a supplemental dependency file.')
shutil.rmtree(work_directory)
return -1
+ if not self.reset_results:
+ if self.detect_file_changes('dependencies', work_directory, input_directory, supplemental_makefile_dependency_filename):
+ all_tests_passed = False
+
for generator in self.generators:
input_directory = os.path.join('WebCore', 'bindings', 'scripts', 'test')
reference_directory = os.path.join('WebCore', 'bindings', 'scripts', 'test', generator)