[WebIDL] Autogenerate named getters
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Jan 2017 18:30:53 +0000 (18:30 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Jan 2017 18:30:53 +0000 (18:30 +0000)
https://bugs.webkit.org/show_bug.cgi?id=166835

Patch by Sam Weinig <sam@webkit.org> on 2017-01-12
Reviewed by Alex Christensen.

Source/WebCore:

* Modules/mediastream/RTCStatsResponse.idl:
Update type to be nullable, since generator expects that for now.

* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCustomSQLStatementErrorCallback.cpp: Removed.
* bindings/js/JSDOMMimeTypeArrayCustom.cpp: Removed.
* bindings/js/JSDOMNamedFlowCollectionCustom.cpp: Removed.
* bindings/js/JSDOMPluginArrayCustom.cpp: Removed.
* bindings/js/JSDOMPluginCustom.cpp: Removed.
* bindings/js/JSNamedNodeMapCustom.cpp: Removed.
* bindings/js/JSRTCStatsResponseCustom.cpp: Removed.
* bindings/js/JSStyleSheetListCustom.cpp: Removed.
Remove deleted files.

* bindings/js/JSSQLStatementErrorCallbackCustom.cpp:
Renamed from Source/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp for consistency.

* bindings/IDLTypes.h:
(WebCore::IDLNullable::nullValue):
(WebCore::IDLNullable::isNullValue):
(WebCore::IDLNullable::extractValueFromNullable):
Add Nullable traits for IDLNullable, that call down to the underlying type. This allows
us to more easily tests for nullability without stripping the IDLNullable off.

* bindings/js/JSDOMStringMapCustom.cpp:
(WebCore::JSDOMStringMap::getOwnPropertySlotDelegate): Deleted.
(WebCore::JSDOMStringMap::getOwnPropertyNames): Deleted.
Remove overriden getOwnPropertySlot and getOwnPropertyNames.

* bindings/js/JSHTMLCollectionCustom.cpp:
(WebCore::JSHTMLCollection::nameGetter): Deleted.
* bindings/js/JSHTMLFormElementCustom.cpp:
(WebCore::JSHTMLFormElement::nameGetter): Deleted.
* bindings/js/JSHTMLOptionsCollectionCustom.cpp:
(WebCore::JSHTMLOptionsCollection::nameGetter): Deleted.
* bindings/js/JSStorageCustom.cpp:
(WebCore::JSStorage::nameGetter): Deleted.
Remove custom name getters.

* bindings/js/JSHTMLSelectElementCustom.cpp:
(WebCore::selectElementIndexSetter):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::setItem):
(WebCore::HTMLSelectElement::setLength):
(WebCore::HTMLSelectElement::setOption): Deleted.
* html/HTMLSelectElement.h:
Add implementation of HTMLSelectElement::setItem() that does properly
removes if the option is null. Re-implement selectElementIndexSetter to
use it and switch conversion code to use JSDOMConvert.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateIndexedGetter):
(GenerateNamedGetter):
Extract typed getter generation into their own functions.

(GenerateGetOwnPropertySlotBody):
(GenerateGetOwnPropertySlotBodyByIndex):
Extract getOwnPropertySlotBody / getOwnPropertySlotBodyByIndex generation
into their own functions. Add support for generating name getters.

(GenerateGetOwnPropertyNames):
Extract getOwnPropertyNames generation into its own function, adding support
for respecting the LegacyUnenumerableNamedProperties attribute and switching
the default to not include named properties in the enumerated names.

(GeneratePut):
(GeneratePutByIndex):
Extract put / putByIndex generators into their own functions in preparation
of supporting namedSetters in the future.

(GetIndexedSetterFunction):
(GetNamedSetterFunction):
(GetNamedDeleterFunction):
Add helper getter functions to extract named/index setter/deleters.

(InstanceOverridesPut):
Add helper predicate to determine if an interface needs an implementation
of put.

(GenerateHeader):
Place custom helper functions (e.g. nameGetter/putDelegate/etc.) together
in the generated header.

(GenerateImplementation):
(GenerateCallbackImplementationContent):
Replace inline generation with calls to the new helper generator functions.

(NativeToJSValueUsingReferences):
(NativeToJSValueUsingPointers):
(NativeToJSValue):
Remove unused inFunctionCall parameter, and add new suppressExceptionCheck
parameter, which is used for nameGetters.

* bindings/scripts/IDLAttributes.txt:
Add LegacyUnenumerableNamedProperties.

* css/StyleSheetList.cpp:
(WebCore::StyleSheetList::namedItem):
(WebCore::StyleSheetList::getNamedItem): Deleted.
* css/StyleSheetList.h:
* css/StyleSheetList.idl:
Rename getNamedItem to namedItem, and make it return a CSSStyleSheet*
which is what the bindings specify.

* dom/DOMNamedFlowCollection.idl:
Add LegacyUnenumerableNamedProperties to match existing behavior.

* dom/DOMStringMap.h:
Switch from typedef to type alias.

* dom/DOMStringMap.idl:
Remove CustomEnumerateProperty and JSCustomGetOwnPropertySlotAndDescriptor
and add the getter. Also add the missing setter and deleter commented out.

* dom/DatasetDOMStringMap.h:
* dom/DatasetDOMStringMap.cpp:
(WebCore::DatasetDOMStringMap::supportedPropertyNames):
(WebCore::DatasetDOMStringMap::names): Deleted.
Rename names to supportedPropertyNames to support the bindings.

(WebCore::DatasetDOMStringMap::item):
(WebCore::DatasetDOMStringMap::namedItem):
Add namedItems (to support the bindings), and rework item to return
an optional rather than using a bool out parameter.

* dom/NamedNodeMap.idl:
Add LegacyUnenumerableNamedProperties matching the spec.

* html/HTMLAllCollection.idl:
Add CustomNamedGetter and LegacyUnenumerableNamedProperties. Update signatures
to match the spec. Commenting out ones not implemented yet.

* html/HTMLCollection.idl:
Add LegacyUnenumerableNamedProperties matching the spec.

* html/HTMLFormControlsCollection.idl:
Add CustomNamedGetter. Update signature of the getter to match the spec.
The reason this can't be generated yet is that we don't have a good strategy
for functions with differing return types that shadow each other.

* html/HTMLFormElement.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::namedItem):
(WebCore::HTMLFormElement::supportedPropertyNames):
Add implementation of namedItem and stub of supportedPropertyNames.

* html/HTMLFormElement.idl:
Add LegacyUnenumerableNamedProperties and remove CustomNamedGetter. Update
the signatures to match the spec.

* page/DOMWindow.idl:
Add LegacyUnenumerableNamedProperties matching the spec.

* plugins/DOMMimeTypeArray.idl:
* plugins/DOMPlugin.idl:
* plugins/DOMPluginArray.idl:
Add LegacyUnenumerableNamedProperties and add nullability to return types.

LayoutTests:

* fast/dom/HTMLSelectElement/select-selectedIndex-expected.txt:
* fast/dom/HTMLSelectElement/select-selectedIndex-multiple-expected.txt:
* js/dom/reflect-set-onto-dom-expected.txt:
Update exception text.

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

46 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/HTMLSelectElement/select-selectedIndex-expected.txt
LayoutTests/fast/dom/HTMLSelectElement/select-selectedIndex-multiple-expected.txt
LayoutTests/js/dom/reflect-set-onto-dom-expected.txt
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/RTCStatsResponse.idl
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/IDLTypes.h
Source/WebCore/bindings/js/JSBindingsAllInOne.cpp
Source/WebCore/bindings/js/JSDOMMimeTypeArrayCustom.cpp [deleted file]
Source/WebCore/bindings/js/JSDOMNamedFlowCollectionCustom.cpp [deleted file]
Source/WebCore/bindings/js/JSDOMPluginArrayCustom.cpp [deleted file]
Source/WebCore/bindings/js/JSDOMPluginCustom.cpp [deleted file]
Source/WebCore/bindings/js/JSDOMStringMapCustom.cpp
Source/WebCore/bindings/js/JSHTMLCollectionCustom.cpp
Source/WebCore/bindings/js/JSHTMLFormElementCustom.cpp [deleted file]
Source/WebCore/bindings/js/JSHTMLOptionsCollectionCustom.cpp
Source/WebCore/bindings/js/JSHTMLSelectElementCustom.cpp
Source/WebCore/bindings/js/JSNamedNodeMapCustom.cpp [deleted file]
Source/WebCore/bindings/js/JSRTCStatsResponseCustom.cpp [deleted file]
Source/WebCore/bindings/js/JSStorageCustom.cpp
Source/WebCore/bindings/js/JSStyleSheetListCustom.cpp [deleted file]
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/IDLAttributes.txt
Source/WebCore/css/StyleSheetList.cpp
Source/WebCore/css/StyleSheetList.h
Source/WebCore/css/StyleSheetList.idl
Source/WebCore/dom/DOMNamedFlowCollection.idl
Source/WebCore/dom/DOMStringMap.h
Source/WebCore/dom/DOMStringMap.idl
Source/WebCore/dom/DatasetDOMStringMap.cpp
Source/WebCore/dom/DatasetDOMStringMap.h
Source/WebCore/dom/NamedNodeMap.idl
Source/WebCore/html/HTMLAllCollection.idl
Source/WebCore/html/HTMLCollection.idl
Source/WebCore/html/HTMLFormControlsCollection.idl
Source/WebCore/html/HTMLFormElement.cpp
Source/WebCore/html/HTMLFormElement.h
Source/WebCore/html/HTMLFormElement.idl
Source/WebCore/html/HTMLSelectElement.cpp
Source/WebCore/html/HTMLSelectElement.h
Source/WebCore/page/DOMWindow.idl
Source/WebCore/plugins/DOMMimeTypeArray.idl
Source/WebCore/plugins/DOMPlugin.idl
Source/WebCore/plugins/DOMPluginArray.idl

index c4b6647..bcc33a3 100644 (file)
@@ -1,3 +1,15 @@
+2017-01-12  Sam Weinig  <sam@webkit.org>
+
+        [WebIDL] Autogenerate named getters
+        https://bugs.webkit.org/show_bug.cgi?id=166835
+
+        Reviewed by Alex Christensen.
+
+        * fast/dom/HTMLSelectElement/select-selectedIndex-expected.txt:
+        * fast/dom/HTMLSelectElement/select-selectedIndex-multiple-expected.txt:
+        * js/dom/reflect-set-onto-dom-expected.txt:
+        Update exception text.
+
 2017-01-12  Ryan Haddad  <ryanhaddad@apple.com>
 
         Rebaseline inspector/dom/getAccessibilityPropertiesForNode.html after r210605.
index 85139d5..bd3451b 100644 (file)
@@ -57,7 +57,7 @@ PASS mySelect.selectedIndex is -1
 PASS mySelect.options.length is 10
 PASS mySelect.selectedIndex is -1
 19) trying to set an element that's not an option: select element
-PASS mySelect.options[10] = mySelect; threw exception TypeMismatchError (DOM Exception 17): The type of an object was incompatible with the expected type of the parameter associated to the object..
+PASS mySelect.options[10] = mySelect; threw exception TypeError: Type error.
 PASS mySelect.options.length is 10
 PASS mySelect.selectedIndex is -1
 20) trying to set a option element using an invalid index: negative infinity
index dad83c7..6f432b3 100644 (file)
@@ -57,7 +57,7 @@ PASS mySelect.selectedIndex is 0
 PASS mySelect.options.length is 10
 PASS mySelect.selectedIndex is 0
 19) trying to set an element that's not an option: select element
-PASS mySelect.options[10] = mySelect; threw exception TypeMismatchError (DOM Exception 17): The type of an object was incompatible with the expected type of the parameter associated to the object..
+PASS mySelect.options[10] = mySelect; threw exception TypeError: Type error.
 PASS mySelect.options.length is 10
 PASS mySelect.selectedIndex is 0
 20) trying to set a option element using an invalid index: negative infinity
index 4eca8cd..05bc517 100644 (file)
@@ -110,7 +110,7 @@ PASS Reflect.set(select, 42, option) is true
 PASS Reflect.get(select, "length") is 42
 PASS Reflect.set(select, 44, option2) is true
 PASS Reflect.get(select, 44).value is "kilimanjaro"
-PASS Reflect.set(select, 20, "Kilimanjaro") threw exception TypeMismatchError (DOM Exception 17): The type of an object was incompatible with the expected type of the parameter associated to the object..
+PASS Reflect.set(select, 20, "Kilimanjaro") threw exception TypeError: Type error.
 CustomIndexedSetter ignores the receiver. These methods only work with ::put (not ::defineOwnProperty). So they behave as the special setter, we should not fallback to the OrdinarySet.
 PASS Reflect.set(select, 0, option3, receiver) is true
 PASS Reflect.get(receiver, 0) is undefined
index 588b6bd..3891e64 100644 (file)
@@ -1101,10 +1101,6 @@ set(WebCore_SOURCES
     bindings/js/JSDOMBinding.cpp
     bindings/js/JSDOMGlobalObject.cpp
     bindings/js/JSDOMGlobalObjectTask.cpp
-    bindings/js/JSDOMMimeTypeArrayCustom.cpp
-    bindings/js/JSDOMNamedFlowCollectionCustom.cpp
-    bindings/js/JSDOMPluginArrayCustom.cpp
-    bindings/js/JSDOMPluginCustom.cpp
     bindings/js/JSDOMPromise.cpp
     bindings/js/JSDOMStringMapCustom.cpp
     bindings/js/JSDOMWindowBase.cpp
@@ -1130,7 +1126,6 @@ set(WebCore_SOURCES
     bindings/js/JSHTMLElementCustom.cpp
     bindings/js/JSHTMLEmbedElementCustom.cpp
     bindings/js/JSHTMLFormControlsCollectionCustom.cpp
-    bindings/js/JSHTMLFormElementCustom.cpp
     bindings/js/JSHTMLFrameElementCustom.cpp
     bindings/js/JSHTMLFrameSetElementCustom.cpp
     bindings/js/JSHTMLInputElementCustom.cpp
@@ -1156,7 +1151,6 @@ set(WebCore_SOURCES
     bindings/js/JSMessagePortCustom.cpp
     bindings/js/JSMutationCallback.cpp
     bindings/js/JSMutationObserverCustom.cpp
-    bindings/js/JSNamedNodeMapCustom.cpp
     bindings/js/JSNodeCustom.cpp
     bindings/js/JSNodeFilterCustom.cpp
     bindings/js/JSNodeIteratorCustom.cpp
@@ -1166,12 +1160,10 @@ set(WebCore_SOURCES
     bindings/js/JSPopStateEventCustom.cpp
     bindings/js/JSReadableStreamPrivateConstructors.cpp
     bindings/js/JSReadableStreamSourceCustom.cpp
-    bindings/js/JSRTCStatsResponseCustom.cpp
     bindings/js/JSSQLStatementErrorCallbackCustom.cpp
     bindings/js/JSSVGPathSegCustom.cpp
     bindings/js/JSStorageCustom.cpp
     bindings/js/JSStyleSheetCustom.cpp
-    bindings/js/JSStyleSheetListCustom.cpp
     bindings/js/JSSubtleCryptoCustom.cpp
     bindings/js/JSTextCustom.cpp
     bindings/js/JSTextTrackCueCustom.cpp
index 1703f82..6288d5a 100644 (file)
@@ -1,3 +1,168 @@
+2017-01-12  Sam Weinig  <sam@webkit.org>
+
+        [WebIDL] Autogenerate named getters
+        https://bugs.webkit.org/show_bug.cgi?id=166835
+
+        Reviewed by Alex Christensen.
+
+        * Modules/mediastream/RTCStatsResponse.idl:
+        Update type to be nullable, since generator expects that for now.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSCustomSQLStatementErrorCallback.cpp: Removed.
+        * bindings/js/JSDOMMimeTypeArrayCustom.cpp: Removed.
+        * bindings/js/JSDOMNamedFlowCollectionCustom.cpp: Removed.
+        * bindings/js/JSDOMPluginArrayCustom.cpp: Removed.
+        * bindings/js/JSDOMPluginCustom.cpp: Removed.
+        * bindings/js/JSNamedNodeMapCustom.cpp: Removed.
+        * bindings/js/JSRTCStatsResponseCustom.cpp: Removed.
+        * bindings/js/JSStyleSheetListCustom.cpp: Removed.
+        Remove deleted files.
+
+        * bindings/js/JSSQLStatementErrorCallbackCustom.cpp: 
+        Renamed from Source/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp for consistency.
+
+        * bindings/IDLTypes.h:
+        (WebCore::IDLNullable::nullValue):
+        (WebCore::IDLNullable::isNullValue):
+        (WebCore::IDLNullable::extractValueFromNullable):
+        Add Nullable traits for IDLNullable, that call down to the underlying type. This allows
+        us to more easily tests for nullability without stripping the IDLNullable off.
+
+        * bindings/js/JSDOMStringMapCustom.cpp:
+        (WebCore::JSDOMStringMap::getOwnPropertySlotDelegate): Deleted.
+        (WebCore::JSDOMStringMap::getOwnPropertyNames): Deleted.
+        Remove overriden getOwnPropertySlot and getOwnPropertyNames.
+
+        * bindings/js/JSHTMLCollectionCustom.cpp:
+        (WebCore::JSHTMLCollection::nameGetter): Deleted.
+        * bindings/js/JSHTMLFormElementCustom.cpp:
+        (WebCore::JSHTMLFormElement::nameGetter): Deleted.
+        * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
+        (WebCore::JSHTMLOptionsCollection::nameGetter): Deleted.
+        * bindings/js/JSStorageCustom.cpp:
+        (WebCore::JSStorage::nameGetter): Deleted.
+        Remove custom name getters.
+
+        * bindings/js/JSHTMLSelectElementCustom.cpp:
+        (WebCore::selectElementIndexSetter):
+        * html/HTMLSelectElement.cpp:
+        (WebCore::HTMLSelectElement::setItem):
+        (WebCore::HTMLSelectElement::setLength):
+        (WebCore::HTMLSelectElement::setOption): Deleted.
+        * html/HTMLSelectElement.h:
+        Add implementation of HTMLSelectElement::setItem() that does properly
+        removes if the option is null. Re-implement selectElementIndexSetter to
+        use it and switch conversion code to use JSDOMConvert.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateIndexedGetter):
+        (GenerateNamedGetter):
+        Extract typed getter generation into their own functions.
+
+        (GenerateGetOwnPropertySlotBody):
+        (GenerateGetOwnPropertySlotBodyByIndex):
+        Extract getOwnPropertySlotBody / getOwnPropertySlotBodyByIndex generation
+        into their own functions. Add support for generating name getters.
+
+        (GenerateGetOwnPropertyNames):
+        Extract getOwnPropertyNames generation into its own function, adding support
+        for respecting the LegacyUnenumerableNamedProperties attribute and switching
+        the default to not include named properties in the enumerated names.
+
+        (GeneratePut):
+        (GeneratePutByIndex):
+        Extract put / putByIndex generators into their own functions in preparation
+        of supporting namedSetters in the future.
+
+        (GetIndexedSetterFunction):
+        (GetNamedSetterFunction):
+        (GetNamedDeleterFunction):
+        Add helper getter functions to extract named/index setter/deleters.
+
+        (InstanceOverridesPut):
+        Add helper predicate to determine if an interface needs an implementation
+        of put.
+
+        (GenerateHeader):
+        Place custom helper functions (e.g. nameGetter/putDelegate/etc.) together
+        in the generated header.
+
+        (GenerateImplementation):
+        (GenerateCallbackImplementationContent):
+        Replace inline generation with calls to the new helper generator functions.
+
+        (NativeToJSValueUsingReferences):
+        (NativeToJSValueUsingPointers):
+        (NativeToJSValue):
+        Remove unused inFunctionCall parameter, and add new suppressExceptionCheck
+        parameter, which is used for nameGetters.
+
+        * bindings/scripts/IDLAttributes.txt:
+        Add LegacyUnenumerableNamedProperties.
+    
+        * css/StyleSheetList.cpp:
+        (WebCore::StyleSheetList::namedItem):
+        (WebCore::StyleSheetList::getNamedItem): Deleted.
+        * css/StyleSheetList.h:
+        * css/StyleSheetList.idl:
+        Rename getNamedItem to namedItem, and make it return a CSSStyleSheet*
+        which is what the bindings specify.
+
+        * dom/DOMNamedFlowCollection.idl:
+        Add LegacyUnenumerableNamedProperties to match existing behavior.
+
+        * dom/DOMStringMap.h:
+        Switch from typedef to type alias.
+
+        * dom/DOMStringMap.idl:
+        Remove CustomEnumerateProperty and JSCustomGetOwnPropertySlotAndDescriptor
+        and add the getter. Also add the missing setter and deleter commented out.
+
+        * dom/DatasetDOMStringMap.h:
+        * dom/DatasetDOMStringMap.cpp:
+        (WebCore::DatasetDOMStringMap::supportedPropertyNames):
+        (WebCore::DatasetDOMStringMap::names): Deleted.
+        Rename names to supportedPropertyNames to support the bindings.
+
+        (WebCore::DatasetDOMStringMap::item):
+        (WebCore::DatasetDOMStringMap::namedItem):
+        Add namedItems (to support the bindings), and rework item to return
+        an optional rather than using a bool out parameter.
+
+        * dom/NamedNodeMap.idl:
+        Add LegacyUnenumerableNamedProperties matching the spec.
+
+        * html/HTMLAllCollection.idl:
+        Add CustomNamedGetter and LegacyUnenumerableNamedProperties. Update signatures
+        to match the spec. Commenting out ones not implemented yet.
+
+        * html/HTMLCollection.idl:
+        Add LegacyUnenumerableNamedProperties matching the spec.
+
+        * html/HTMLFormControlsCollection.idl:
+        Add CustomNamedGetter. Update signature of the getter to match the spec.
+        The reason this can't be generated yet is that we don't have a good strategy
+        for functions with differing return types that shadow each other.
+
+        * html/HTMLFormElement.h:
+        * html/HTMLFormElement.cpp:
+        (WebCore::HTMLFormElement::namedItem):
+        (WebCore::HTMLFormElement::supportedPropertyNames):
+        Add implementation of namedItem and stub of supportedPropertyNames.
+
+        * html/HTMLFormElement.idl:
+        Add LegacyUnenumerableNamedProperties and remove CustomNamedGetter. Update
+        the signatures to match the spec.
+
+        * page/DOMWindow.idl:
+        Add LegacyUnenumerableNamedProperties matching the spec.
+
+        * plugins/DOMMimeTypeArray.idl:
+        * plugins/DOMPlugin.idl:
+        * plugins/DOMPluginArray.idl:
+        Add LegacyUnenumerableNamedProperties and add nullability to return types.
+
 2017-01-12  Said Abou-Hallawa  <sabouhallawa@apple.com>
 
         [iOS][WK1] Fix initialization of CADisplayLink::preferredFramesPerSecond
index 6a4ee30..26460f5 100644 (file)
@@ -27,5 +27,5 @@
     Conditional=WEB_RTC,
 ] interface RTCStatsResponse {
     sequence<RTCStatsReport> result();
-    getter RTCStatsReport namedItem(DOMString name);
+    getter RTCStatsReport? namedItem(DOMString name);
 };
index 2aef9bf..489f436 100644 (file)
                07D6A4F31BED5F8800174146 /* MockRealtimeAudioSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07D6A4F11BED5F8800174146 /* MockRealtimeAudioSource.cpp */; };
                07D6A4F41BED5F8800174146 /* MockRealtimeAudioSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 07D6A4F21BED5F8800174146 /* MockRealtimeAudioSource.h */; };
                07D6A4F81BF2307D00174146 /* AudioTrackPrivateMediaStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 07D6A4F61BF2307D00174146 /* AudioTrackPrivateMediaStream.h */; };
-               07DC5FD417D3EEE90099F890 /* JSRTCStatsResponseCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07DC5FD317D3EEE90099F890 /* JSRTCStatsResponseCustom.cpp */; };
                07E116B11489C9A100EC5ACE /* JSTextTrackCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07E116B01489C9A100EC5ACE /* JSTextTrackCustom.cpp */; };
                07E117071489EBEB00EC5ACE /* JSTextTrackCueCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07E117061489EBEB00EC5ACE /* JSTextTrackCueCustom.cpp */; };
                07E3DFD11A9E786500764CA8 /* MediaPlaybackTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 07E3DFD01A9E786500764CA8 /* MediaPlaybackTarget.h */; settings = {ATTRIBUTES = (Private, ); }; };
                465307D01DB6EE4800E4137C /* JSUIEventInit.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E045EF1DAA104F00B0D8B9 /* JSUIEventInit.h */; };
                465307D11DB6EE4A00E4137C /* JSUIEventInit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83E045EE1DAA104F00B0D8B9 /* JSUIEventInit.cpp */; };
                465A8E791C8A24CE00E7D3E4 /* RuntimeApplicationChecks.mm in Sources */ = {isa = PBXBuildFile; fileRef = 465A8E781C8A24CE00E7D3E4 /* RuntimeApplicationChecks.mm */; };
-               4669B2871B852A0B000F905F /* JSDOMNamedFlowCollectionCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46F2768E1B85297F005C2556 /* JSDOMNamedFlowCollectionCustom.cpp */; };
                4671E0651D67A59600C6B497 /* CanvasPath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4671E0631D67A57B00C6B497 /* CanvasPath.cpp */; };
                4671E0661D67A59600C6B497 /* CanvasPath.h in Headers */ = {isa = PBXBuildFile; fileRef = 4671E0641D67A57B00C6B497 /* CanvasPath.h */; };
                467302021C4EFE7800BCB357 /* IgnoreOpensDuringUnloadCountIncrementer.h in Headers */ = {isa = PBXBuildFile; fileRef = 467302011C4EFE6600BCB357 /* IgnoreOpensDuringUnloadCountIncrementer.h */; };
                A84D827C11D333ED00972990 /* RawDataDocumentParser.h in Headers */ = {isa = PBXBuildFile; fileRef = A84D827B11D333ED00972990 /* RawDataDocumentParser.h */; };
                A84D82C111D3474800972990 /* ScriptableDocumentParser.h in Headers */ = {isa = PBXBuildFile; fileRef = A84D82BF11D3474800972990 /* ScriptableDocumentParser.h */; };
                A84D82C211D3474800972990 /* ScriptableDocumentParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A84D82C011D3474800972990 /* ScriptableDocumentParser.cpp */; };
-               A84EBD780CB8C89200079609 /* JSStyleSheetListCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A84EBD770CB8C89200079609 /* JSStyleSheetListCustom.cpp */; };
                A84EBD830CB8C97700079609 /* JSStyleSheetList.h in Headers */ = {isa = PBXBuildFile; fileRef = A84EBD810CB8C97700079609 /* JSStyleSheetList.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A84EBD840CB8C97700079609 /* JSStyleSheetList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A84EBD820CB8C97700079609 /* JSStyleSheetList.cpp */; };
                A853123D11D0471B00D4D077 /* FragmentScriptingPermission.h in Headers */ = {isa = PBXBuildFile; fileRef = A853123C11D0471B00D4D077 /* FragmentScriptingPermission.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A8D05FA80A23B301005E7203 /* JSCSSRuleList.h in Headers */ = {isa = PBXBuildFile; fileRef = A8D05FA60A23B301005E7203 /* JSCSSRuleList.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A8D064FB0A23C0CC005E7203 /* JSHTMLFormElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8D064F90A23C0CC005E7203 /* JSHTMLFormElement.cpp */; };
                A8D064FC0A23C0CC005E7203 /* JSHTMLFormElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8D064FA0A23C0CC005E7203 /* JSHTMLFormElement.h */; };
-               A8D065AE0A2446CD005E7203 /* JSHTMLFormElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8D065AD0A2446CD005E7203 /* JSHTMLFormElementCustom.cpp */; };
                A8D06B390A265DCD005E7203 /* HTMLNames.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = A8D06B370A265DCD005E7203 /* HTMLNames.h */; settings = {ATTRIBUTES = (); }; };
                A8D06B3A0A265DCD005E7203 /* HTMLNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8D06B380A265DCD005E7203 /* HTMLNames.cpp */; };
                A8D223FD16B52E4E00157288 /* HTMLResourcePreloader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8D223FB16B52E4E00157288 /* HTMLResourcePreloader.cpp */; };
                A9C6E4F40D745E48006442E9 /* PluginData.h in Headers */ = {isa = PBXBuildFile; fileRef = A9C6E4F20D745E48006442E9 /* PluginData.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A9C6E5A50D746458006442E9 /* Navigator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9C6E5A30D746458006442E9 /* Navigator.cpp */; };
                A9C6E5A60D746458006442E9 /* Navigator.h in Headers */ = {isa = PBXBuildFile; fileRef = A9C6E5A40D746458006442E9 /* Navigator.h */; };
-               A9C6E6470D7465CA006442E9 /* JSDOMMimeTypeArrayCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9C6E6460D7465CA006442E9 /* JSDOMMimeTypeArrayCustom.cpp */; };
-               A9C6E64C0D7465E7006442E9 /* JSDOMPluginArrayCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9C6E64A0D7465E7006442E9 /* JSDOMPluginArrayCustom.cpp */; };
-               A9C6E64D0D7465E7006442E9 /* JSDOMPluginCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9C6E64B0D7465E7006442E9 /* JSDOMPluginCustom.cpp */; };
                A9D247F70D757E3400FDF959 /* JSNavigator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9D247F50D757E3300FDF959 /* JSNavigator.cpp */; };
                A9D247F80D757E3400FDF959 /* JSNavigator.h in Headers */ = {isa = PBXBuildFile; fileRef = A9D247F60D757E3300FDF959 /* JSNavigator.h */; };
                A9D247FE0D757E6900FDF959 /* JSDOMPlugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9D247FA0D757E6900FDF959 /* JSDOMPlugin.cpp */; };
                BCD41ABB0C060DE800C0E446 /* JSHTMLFrameSetElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD41ABA0C060DE800C0E446 /* JSHTMLFrameSetElementCustom.cpp */; };
                BCD533640ED6848900887468 /* CachedScriptSourceProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD533630ED6848900887468 /* CachedScriptSourceProvider.h */; };
                BCD9C2620C17AA67005C90A2 /* JSDOMWindowCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD9C25E0C17AA67005C90A2 /* JSDOMWindowCustom.cpp */; };
-               BCD9C2630C17AA67005C90A2 /* JSNamedNodeMapCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD9C25F0C17AA67005C90A2 /* JSNamedNodeMapCustom.cpp */; };
                BCD9C2640C17AA67005C90A2 /* JSNodeCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD9C2600C17AA67005C90A2 /* JSNodeCustom.cpp */; };
                BCD9C2650C17AA67005C90A2 /* JSNodeListCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD9C2610C17AA67005C90A2 /* JSNodeListCustom.cpp */; };
                BCD9C2C00C17B69E005C90A2 /* JSNamedNodeMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD9C2BC0C17B69E005C90A2 /* JSNamedNodeMap.cpp */; };
                07D6A4F11BED5F8800174146 /* MockRealtimeAudioSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MockRealtimeAudioSource.cpp; sourceTree = "<group>"; };
                07D6A4F21BED5F8800174146 /* MockRealtimeAudioSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MockRealtimeAudioSource.h; sourceTree = "<group>"; };
                07D6A4F61BF2307D00174146 /* AudioTrackPrivateMediaStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AudioTrackPrivateMediaStream.h; path = platform/mediastream/AudioTrackPrivateMediaStream.h; sourceTree = SOURCE_ROOT; };
-               07DC5FD317D3EEE90099F890 /* JSRTCStatsResponseCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSRTCStatsResponseCustom.cpp; sourceTree = "<group>"; };
                07E116B01489C9A100EC5ACE /* JSTextTrackCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTextTrackCustom.cpp; sourceTree = "<group>"; };
                07E117061489EBEB00EC5ACE /* JSTextTrackCueCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTextTrackCueCustom.cpp; sourceTree = "<group>"; };
                07E3DFD01A9E786500764CA8 /* MediaPlaybackTarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaPlaybackTarget.h; sourceTree = "<group>"; };
                46DFF4991DC261F900B80B48 /* JSShadowRootMode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSShadowRootMode.cpp; sourceTree = "<group>"; };
                46DFF49A1DC261F900B80B48 /* JSShadowRootMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSShadowRootMode.h; sourceTree = "<group>"; };
                46EBEA011B7D4D5D00BE4941 /* CollectionTraversal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CollectionTraversal.h; sourceTree = "<group>"; };
-               46F2768E1B85297F005C2556 /* JSDOMNamedFlowCollectionCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMNamedFlowCollectionCustom.cpp; sourceTree = "<group>"; };
                490707E41219C04300D90E51 /* ANGLEWebKitBridge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ANGLEWebKitBridge.cpp; sourceTree = "<group>"; };
                490707E51219C04300D90E51 /* ANGLEWebKitBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ANGLEWebKitBridge.h; sourceTree = "<group>"; };
                49291E4A134172C800E753DE /* ImageRenderingMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageRenderingMode.h; sourceTree = "<group>"; };
                A84D827B11D333ED00972990 /* RawDataDocumentParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RawDataDocumentParser.h; sourceTree = "<group>"; };
                A84D82BF11D3474800972990 /* ScriptableDocumentParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptableDocumentParser.h; sourceTree = "<group>"; };
                A84D82C011D3474800972990 /* ScriptableDocumentParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptableDocumentParser.cpp; sourceTree = "<group>"; };
-               A84EBD770CB8C89200079609 /* JSStyleSheetListCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSStyleSheetListCustom.cpp; sourceTree = "<group>"; };
                A84EBD810CB8C97700079609 /* JSStyleSheetList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStyleSheetList.h; sourceTree = "<group>"; };
                A84EBD820CB8C97700079609 /* JSStyleSheetList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSStyleSheetList.cpp; sourceTree = "<group>"; };
                A853123C11D0471B00D4D077 /* FragmentScriptingPermission.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FragmentScriptingPermission.h; sourceTree = "<group>"; };
                A8D064FA0A23C0CC005E7203 /* JSHTMLFormElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLFormElement.h; sourceTree = "<group>"; };
                A8D0651B0A23C1FE005E7203 /* CSSRuleList.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CSSRuleList.idl; sourceTree = "<group>"; };
                A8D0651C0A23C1FE005E7203 /* DeprecatedCSSOMValueList.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = DeprecatedCSSOMValueList.idl; sourceTree = "<group>"; };
-               A8D065AD0A2446CD005E7203 /* JSHTMLFormElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLFormElementCustom.cpp; sourceTree = "<group>"; };
                A8D06B370A265DCD005E7203 /* HTMLNames.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTMLNames.h; sourceTree = "<group>"; };
                A8D06B380A265DCD005E7203 /* HTMLNames.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLNames.cpp; sourceTree = "<group>"; };
                A8D223FB16B52E4E00157288 /* HTMLResourcePreloader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLResourcePreloader.cpp; sourceTree = "<group>"; };
                A9C6E4F20D745E48006442E9 /* PluginData.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PluginData.h; sourceTree = "<group>"; };
                A9C6E5A30D746458006442E9 /* Navigator.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Navigator.cpp; sourceTree = "<group>"; };
                A9C6E5A40D746458006442E9 /* Navigator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Navigator.h; sourceTree = "<group>"; };
-               A9C6E6460D7465CA006442E9 /* JSDOMMimeTypeArrayCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMMimeTypeArrayCustom.cpp; sourceTree = "<group>"; };
-               A9C6E64A0D7465E7006442E9 /* JSDOMPluginArrayCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMPluginArrayCustom.cpp; sourceTree = "<group>"; };
-               A9C6E64B0D7465E7006442E9 /* JSDOMPluginCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMPluginCustom.cpp; sourceTree = "<group>"; };
                A9C6E65D0D746694006442E9 /* Navigator.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Navigator.idl; sourceTree = "<group>"; };
                A9C6E65E0D7466F2006442E9 /* DOMMimeType.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = DOMMimeType.idl; sourceTree = "<group>"; };
                A9C6E65F0D746700006442E9 /* DOMMimeTypeArray.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = DOMMimeTypeArray.idl; sourceTree = "<group>"; };
                BCD41ABA0C060DE800C0E446 /* JSHTMLFrameSetElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLFrameSetElementCustom.cpp; sourceTree = "<group>"; };
                BCD533630ED6848900887468 /* CachedScriptSourceProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedScriptSourceProvider.h; sourceTree = "<group>"; };
                BCD9C25E0C17AA67005C90A2 /* JSDOMWindowCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMWindowCustom.cpp; sourceTree = "<group>"; };
-               BCD9C25F0C17AA67005C90A2 /* JSNamedNodeMapCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSNamedNodeMapCustom.cpp; sourceTree = "<group>"; };
                BCD9C2600C17AA67005C90A2 /* JSNodeCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSNodeCustom.cpp; sourceTree = "<group>"; };
                BCD9C2610C17AA67005C90A2 /* JSNodeListCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSNodeListCustom.cpp; sourceTree = "<group>"; };
                BCD9C2BC0C17B69E005C90A2 /* JSNamedNodeMap.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSNamedNodeMap.cpp; sourceTree = "<group>"; };
                                ADEC78F718EE5308001315C2 /* JSElementCustom.h */,
                                BCEFAF4D0C317E6900FA81F6 /* JSEventCustom.cpp */,
                                E34EE49F1DC2D57500EAA9D3 /* JSEventCustom.h */,
+                               BCCBAD3A0C18BFF800CE890F /* JSHTMLCollectionCustom.cpp */,
                                512BDB4C1C46B0FF006494DF /* JSIDBCursorCustom.cpp */,
                                5141298D1C5FD7E90059E714 /* JSIDBCursorWithValueCustom.cpp */,
                                5141299A1C6C166D0059E714 /* JSIDBIndexCustom.cpp */,
                                590E1B4A11E4EF700069F784 /* JSDeviceOrientationEventCustom.cpp */,
                                49C7BA8C1042F5B10009D447 /* JSDocumentCustom.cpp */,
                                ADDA94BF19686F8000453029 /* JSDocumentCustom.h */,
-                               A9C6E6460D7465CA006442E9 /* JSDOMMimeTypeArrayCustom.cpp */,
-                               46F2768E1B85297F005C2556 /* JSDOMNamedFlowCollectionCustom.cpp */,
-                               A9C6E64A0D7465E7006442E9 /* JSDOMPluginArrayCustom.cpp */,
-                               A9C6E64B0D7465E7006442E9 /* JSDOMPluginCustom.cpp */,
                                BC64649B11D8238C006455B0 /* JSDOMStringMapCustom.cpp */,
                                BCD9C25E0C17AA67005C90A2 /* JSDOMWindowCustom.cpp */,
                                652FBBBB0DE27CB60001D386 /* JSDOMWindowCustom.h */,
                                BC97E42B10915B060010D361 /* JSHTMLAllCollectionCustom.cpp */,
                                BC4EDEF30C08F3FB007EDD49 /* JSHTMLAppletElementCustom.cpp */,
                                9392262C1032107B006E7D5D /* JSHTMLCanvasElementCustom.cpp */,
-                               BCCBAD3A0C18BFF800CE890F /* JSHTMLCollectionCustom.cpp */,
                                BC51580A0C03D404008BB0EE /* JSHTMLDocumentCustom.cpp */,
                                BC5823F40C0A98DF0053F1B5 /* JSHTMLElementCustom.cpp */,
                                BC6D44BD0C07EFB60072D2C9 /* JSHTMLEmbedElementCustom.cpp */,
                                9B1AB07B1648C7C40051F3F2 /* JSHTMLFormControlsCollectionCustom.cpp */,
-                               A8D065AD0A2446CD005E7203 /* JSHTMLFormElementCustom.cpp */,
                                BC2ED7A40C6C0F3600920BFF /* JSHTMLFrameElementCustom.cpp */,
                                BCD41ABA0C060DE800C0E446 /* JSHTMLFrameSetElementCustom.cpp */,
                                BCC438770E886CC700533DD5 /* JSHTMLInputElementCustom.cpp */,
                                410B7E711045FAB000D8224F /* JSMessageEventCustom.cpp */,
                                A1E5B31D1AAD1DA4006EBEFB /* JSMockContentFilterSettingsCustom.cpp */,
                                C6F0917E143A2BB900685849 /* JSMutationObserverCustom.cpp */,
-                               BCD9C25F0C17AA67005C90A2 /* JSNamedNodeMapCustom.cpp */,
                                BCD9C2600C17AA67005C90A2 /* JSNodeCustom.cpp */,
                                BC9439C2116CF4940048C750 /* JSNodeCustom.h */,
                                83F1206A1B8C103600D75F63 /* JSNodeFilterCustom.cpp */,
                                A85F22081430377D007CC884 /* JSPopStateEventCustom.cpp */,
                                418C395D1C8F0AAB0051C8A3 /* JSReadableStreamSourceCustom.cpp */,
-                               07DC5FD317D3EEE90099F890 /* JSRTCStatsResponseCustom.cpp */,
                                51D0C5150DAA90B7003B3831 /* JSStorageCustom.cpp */,
-                               A84EBD770CB8C89200079609 /* JSStyleSheetListCustom.cpp */,
                                57A9C88D1DA70BF800BC7305 /* JSSubtleCryptoCustom.cpp */,
                                07E116B01489C9A100EC5ACE /* JSTextTrackCustom.cpp */,
                                7C73FB17191EF808007DE061 /* JSUserMessageHandlersNamespaceCustom.cpp */,
                                4138F8571D253F08001CB61E /* JSDOMIterator.cpp in Sources */,
                                A9D248060D757E7D00FDF959 /* JSDOMMimeType.cpp in Sources */,
                                A9D248080D757E7D00FDF959 /* JSDOMMimeTypeArray.cpp in Sources */,
-                               A9C6E6470D7465CA006442E9 /* JSDOMMimeTypeArrayCustom.cpp in Sources */,
                                52CCA9E215E3F62C0053C77F /* JSDOMNamedFlowCollection.cpp in Sources */,
-                               4669B2871B852A0B000F905F /* JSDOMNamedFlowCollectionCustom.cpp in Sources */,
                                1ACE53DF0A8D18810022947D /* JSDOMParser.cpp in Sources */,
                                FB91392B16AE4FC0001FE682 /* JSDOMPath.cpp in Sources */,
                                A9D247FE0D757E6900FDF959 /* JSDOMPlugin.cpp in Sources */,
                                A9D248000D757E6900FDF959 /* JSDOMPluginArray.cpp in Sources */,
-                               A9C6E64C0D7465E7006442E9 /* JSDOMPluginArrayCustom.cpp in Sources */,
-                               A9C6E64D0D7465E7006442E9 /* JSDOMPluginCustom.cpp in Sources */,
                                0F4966AA1DB40C4300A274BB /* JSDOMPoint.cpp in Sources */,
                                0F4966AC1DB40C4300A274BB /* JSDOMPointInit.cpp in Sources */,
                                0F4966AE1DB40C4300A274BB /* JSDOMPointReadOnly.cpp in Sources */,
                                9BF9A8801648DD2F001C6B23 /* JSHTMLFormControlsCollection.cpp in Sources */,
                                9B1AB07C1648C7C40051F3F2 /* JSHTMLFormControlsCollectionCustom.cpp in Sources */,
                                A8D064FB0A23C0CC005E7203 /* JSHTMLFormElement.cpp in Sources */,
-                               A8D065AE0A2446CD005E7203 /* JSHTMLFormElementCustom.cpp in Sources */,
                                BC4918C60BFEA050009D6316 /* JSHTMLFrameElement.cpp in Sources */,
                                BC2ED7A50C6C0F3600920BFF /* JSHTMLFrameElementCustom.cpp in Sources */,
                                BC926F800C0552470082776B /* JSHTMLFrameSetElement.cpp in Sources */,
                                C6F0917F143A2BB900685849 /* JSMutationObserverCustom.cpp in Sources */,
                                C6F08FC91431000D00685849 /* JSMutationRecord.cpp in Sources */,
                                BCD9C2C00C17B69E005C90A2 /* JSNamedNodeMap.cpp in Sources */,
-                               BCD9C2630C17AA67005C90A2 /* JSNamedNodeMapCustom.cpp in Sources */,
                                A9D247F70D757E3400FDF959 /* JSNavigator.cpp in Sources */,
                                073BE34017D17E01002BD431 /* JSNavigatorUserMedia.cpp in Sources */,
                                14DC0D3709FED073007B0235 /* JSNode.cpp in Sources */,
                                07969DBB17D14151007FF842 /* JSRTCSessionDescription.cpp in Sources */,
                                07969DC117D14151007FF842 /* JSRTCStatsReport.cpp in Sources */,
                                07969DC317D14151007FF842 /* JSRTCStatsResponse.cpp in Sources */,
-                               07DC5FD417D3EEE90099F890 /* JSRTCStatsResponseCustom.cpp in Sources */,
                                5E2C436B1BCF071E0001E2BC /* JSRTCTrackEvent.cpp in Sources */,
                                BCEC01C20C274DDD009F4EC9 /* JSScreen.cpp in Sources */,
                                FDA15ECD12B03F61003A583A /* JSScriptProcessorNode.cpp in Sources */,
                                BCE0139A0C0BEF180043860A /* JSStyleSheet.cpp in Sources */,
                                BC98A27D0C0C9950004BEBF7 /* JSStyleSheetCustom.cpp in Sources */,
                                A84EBD840CB8C97700079609 /* JSStyleSheetList.cpp in Sources */,
-                               A84EBD780CB8C89200079609 /* JSStyleSheetListCustom.cpp in Sources */,
                                571F218B1DA57C7B005C9EFD /* JSSubtleCrypto.cpp in Sources */,
                                57A9C88E1DA70BF800BC7305 /* JSSubtleCryptoCustom.cpp in Sources */,
                                B20111070AB7740500DB0E68 /* JSSVGAElement.cpp in Sources */,
index 07bf19f..6542c8b 100644 (file)
@@ -137,6 +137,11 @@ template<typename T> struct IDLEnumeration : IDLType<T> { };
 
 template<typename T> struct IDLNullable : IDLType<typename T::NullableType> {
     using InnerType = T;
+
+    using NullableType = typename T::NullableType;
+    static inline decltype(T::nullValue()) nullValue() { return T::nullValue(); }
+    template<typename U> static inline bool isNullValue(U&& value) { return T::isNullValue(std::forward<U>(value)); }
+    template<typename U> static inline U&& extractValueFromNullable(U&& value) { return T::extractValueFromNullable(std::forward<U>(value)); }
 };
 
 template<typename T> struct IDLSequence : IDLType<Vector<typename T::ImplementationType>> {
index b39b9ab..aa81f3a 100644 (file)
 #include "JSDOMBinding.cpp"
 #include "JSDOMGlobalObject.cpp"
 #include "JSDOMGlobalObjectTask.cpp"
-#include "JSDOMMimeTypeArrayCustom.cpp"
-#include "JSDOMNamedFlowCollectionCustom.cpp"
-#include "JSDOMPluginArrayCustom.cpp"
-#include "JSDOMPluginCustom.cpp"
 #include "JSDOMPromise.cpp"
 #include "JSDOMStringMapCustom.cpp"
 #include "JSDOMWindowBase.cpp"
@@ -77,7 +73,6 @@
 #include "JSHTMLElementCustom.cpp"
 #include "JSHTMLEmbedElementCustom.cpp"
 #include "JSHTMLFormControlsCollectionCustom.cpp"
-#include "JSHTMLFormElementCustom.cpp"
 #include "JSHTMLFrameElementCustom.cpp"
 #include "JSHTMLFrameSetElementCustom.cpp"
 #include "JSHTMLInputElementCustom.cpp"
@@ -97,7 +92,6 @@
 #include "JSMessagePortCustom.cpp"
 #include "JSMutationCallback.cpp"
 #include "JSMutationObserverCustom.cpp"
-#include "JSNamedNodeMapCustom.cpp"
 #include "JSNodeCustom.cpp"
 #include "JSNodeFilterCustom.cpp"
 #include "JSNodeIteratorCustom.cpp"
 #include "JSSVGPathSegCustom.cpp"
 #include "JSStorageCustom.cpp"
 #include "JSStyleSheetCustom.cpp"
-#include "JSStyleSheetListCustom.cpp"
 #include "JSTextCustom.cpp"
 #include "JSTextTrackCueCustom.cpp"
 #include "JSTextTrackCustom.cpp"
diff --git a/Source/WebCore/bindings/js/JSDOMMimeTypeArrayCustom.cpp b/Source/WebCore/bindings/js/JSDOMMimeTypeArrayCustom.cpp
deleted file mode 100644 (file)
index 25de85d..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *  Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
- *  Copyright (C) 2008 Apple Inc. All rights reserved.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#include "config.h"
-#include "JSDOMMimeTypeArray.h"
-
-#include "DOMMimeTypeArray.h"
-#include "JSDOMBinding.h"
-#include "JSDOMMimeType.h"
-#include <wtf/text/AtomicString.h>
-
-namespace WebCore {
-
-using namespace JSC;
-
-bool JSDOMMimeTypeArray::nameGetter(ExecState* exec, PropertyName propertyName, JSValue& value)
-{
-    auto item = wrapped().namedItem(propertyNameToAtomicString(propertyName));
-    if (!item)
-        return false;
-
-    value = toJS(exec, globalObject(), *item);
-    return true;
-}
-
-} // namespace WebCore
diff --git a/Source/WebCore/bindings/js/JSDOMNamedFlowCollectionCustom.cpp b/Source/WebCore/bindings/js/JSDOMNamedFlowCollectionCustom.cpp
deleted file mode 100644 (file)
index 9072b9f..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2015 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.
- */
-
-#include "config.h"
-#include "JSDOMNamedFlowCollection.h"
-
-#if ENABLE(CSS_REGIONS)
-
-#include "DOMNamedFlowCollection.h"
-#include "JSDOMBinding.h"
-#include "JSWebKitNamedFlow.h"
-
-namespace WebCore {
-
-using namespace JSC;
-
-bool JSDOMNamedFlowCollection::nameGetter(ExecState* exec, PropertyName propertyName, JSValue& value)
-{
-    auto item = wrapped().namedItem(propertyNameToAtomicString(propertyName));
-    if (!item)
-        return false;
-
-    value = toJS(exec, globalObject(), *item);
-    return true;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(CSS_REGIONS)
diff --git a/Source/WebCore/bindings/js/JSDOMPluginArrayCustom.cpp b/Source/WebCore/bindings/js/JSDOMPluginArrayCustom.cpp
deleted file mode 100644 (file)
index af741e3..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *  Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
- *  Copyright (C) 2008 Apple Inc. All rights reserved.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#include "config.h"
-#include "JSDOMPluginArray.h"
-
-#include "DOMPluginArray.h"
-#include "JSDOMBinding.h"
-#include "JSDOMPlugin.h"
-#include <wtf/text/AtomicString.h>
-
-namespace WebCore {
-
-using namespace JSC;
-
-bool JSDOMPluginArray::nameGetter(ExecState* exec, PropertyName propertyName, JSValue& value)
-{
-    auto item = wrapped().namedItem(propertyNameToAtomicString(propertyName));
-    if (!item)
-        return false;
-
-    value = toJS(exec, globalObject(), *item);
-    return true;
-}
-
-} // namespace WebCore
diff --git a/Source/WebCore/bindings/js/JSDOMPluginCustom.cpp b/Source/WebCore/bindings/js/JSDOMPluginCustom.cpp
deleted file mode 100644 (file)
index ecef650..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *  Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#include "config.h"
-#include "JSDOMPlugin.h"
-
-#include "JSDOMBinding.h"
-#include "JSDOMMimeType.h"
-#include <wtf/text/AtomicString.h>
-
-namespace WebCore {
-
-using namespace JSC;
-
-bool JSDOMPlugin::nameGetter(ExecState* exec, PropertyName propertyName, JSValue& value)
-{
-    auto item = wrapped().namedItem(propertyNameToAtomicString(propertyName));
-    if (!item)
-        return false;
-
-    value = toJS(exec, globalObject(), *item);
-    return true;
-}
-
-} // namespace WebCore
index 6ad13d7..b3cc70d 100644 (file)
@@ -37,26 +37,6 @@ using namespace JSC;
 
 namespace WebCore {
 
-bool JSDOMStringMap::getOwnPropertySlotDelegate(ExecState* state, PropertyName propertyName, PropertySlot& slot)
-{
-    if (propertyName.isSymbol())
-        return false;
-    bool nameIsValid;
-    const AtomicString& item = wrapped().item(propertyNameToString(propertyName), nameIsValid);
-    if (nameIsValid) {
-        slot.setValue(this, 0, toJS<IDLDOMString>(*state, item));
-        return true;
-    }
-    return false;
-}
-
-void JSDOMStringMap::getOwnPropertyNames(JSObject* object, ExecState* state, PropertyNameArray& propertyNames, EnumerationMode mode)
-{
-    for (auto& name : jsCast<JSDOMStringMap*>(object)->wrapped().names())
-        propertyNames.add(Identifier::fromString(state, name));
-    Base::getOwnPropertyNames(object, state, propertyNames, mode);
-}
-
 bool JSDOMStringMap::deleteProperty(JSCell* cell, ExecState* state, PropertyName propertyName)
 {
     CustomElementReactionStack customElementReactionStack;
index e398a85..6c8c74d 100644 (file)
 #include "config.h"
 #include "JSHTMLCollection.h"
 
-#include "HTMLAllCollection.h"
-#include "HTMLCollection.h"
-#include "HTMLFormControlsCollection.h"
-#include "HTMLOptionsCollection.h"
 #include "JSDOMBinding.h"
 #include "JSHTMLAllCollection.h"
 #include "JSHTMLFormControlsCollection.h"
 #include "JSHTMLOptionsCollection.h"
-#include "JSNode.h"
-#include "JSNodeList.h"
-#include "JSRadioNodeList.h"
-#include "Node.h"
-#include "RadioNodeList.h"
-#include <wtf/text/AtomicString.h>
 
 using namespace JSC;
 
 namespace WebCore {
 
-bool JSHTMLCollection::nameGetter(ExecState* exec, PropertyName propertyName, JSValue& value)
-{
-    ASSERT_WITH_MESSAGE(wrapped().type() != FormControls, "Should call the subclass' nameGetter");
-    ASSERT_WITH_MESSAGE(wrapped().type() != SelectOptions, "Should call the subclass' nameGetter");
-
-    auto item = wrapped().namedItem(propertyNameToAtomicString(propertyName));
-    if (!item)
-        return false;
-
-    value = toJS(exec, globalObject(), *item);
-    return true;
-}
-
 JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, Ref<HTMLCollection>&& collection)
 {
     switch (collection->type()) {
diff --git a/Source/WebCore/bindings/js/JSHTMLFormElementCustom.cpp b/Source/WebCore/bindings/js/JSHTMLFormElementCustom.cpp
deleted file mode 100644 (file)
index 407d5cf..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2006, 2007, 2008 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. ``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
- * 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. 
- */
-
-#include "config.h"
-#include "JSHTMLFormElement.h"
-
-#include "Frame.h"
-#include "HTMLCollection.h"
-#include "HTMLFormElement.h"
-#include "JSDOMWindowCustom.h"
-#include "JSRadioNodeList.h"
-
-using namespace JSC;
-
-namespace WebCore {
-
-bool JSHTMLFormElement::nameGetter(ExecState* exec, PropertyName propertyName, JSValue& value)
-{
-    Vector<Ref<Element>> namedItems = wrapped().namedElements(propertyNameToAtomicString(propertyName));
-    
-    if (namedItems.isEmpty())
-        return false;
-    if (namedItems.size() == 1) {
-        value = toJS(exec, globalObject(), namedItems[0]);
-        return true;
-    }
-
-    value = toJS(exec, globalObject(), wrapped().radioNodeList(propertyNameToAtomicString(propertyName)).get());
-    return true;
-}
-
-}
index 7355f31..2b04cc5 100644 (file)
 
 #include "CustomElementReactionQueue.h"
 #include "ExceptionCode.h"
-#include "HTMLNames.h"
-#include "HTMLOptionElement.h"
-#include "HTMLOptionsCollection.h"
-#include "HTMLSelectElement.h"
 #include "JSHTMLOptionElement.h"
 #include "JSHTMLSelectElement.h"
 #include "JSHTMLSelectElementCustom.h"
-#include "JSNodeList.h"
-#include "StaticNodeList.h"
-
 #include <wtf/MathExtras.h>
 
 using namespace JSC;
 
 namespace WebCore {
 
-bool JSHTMLOptionsCollection::nameGetter(ExecState* exec, PropertyName propertyName, JSValue& value)
-{
-    auto item = wrapped().namedItem(propertyNameToAtomicString(propertyName));
-    if (!item)
-        return false;
-
-    value = toJS(exec, globalObject(), *item);
-    return true;
-}
-
 void JSHTMLOptionsCollection::setLength(ExecState& state, JSValue value)
 {
     CustomElementReactionStack customElementReactionStack;
index 90384ad..c74aed3 100644 (file)
@@ -39,18 +39,10 @@ void selectElementIndexSetter(JSC::ExecState& state, HTMLSelectElement& element,
     VM& vm = state.vm();
     auto throwScope = DECLARE_THROW_SCOPE(vm);
 
-    if (value.isUndefinedOrNull()) {
-        element.remove(index);
-        return;
-    }
-
-    auto* option = JSHTMLOptionElement::toWrapped(value);
-    if (!option) {
-        throwTypeMismatchError(state, throwScope);
-        return;
-    }
-
-    propagateException(state, throwScope, element.setOption(index, *option));
+    auto* option = convert<IDLNullable<IDLInterface<HTMLOptionElement>>>(state, value);
+    RETURN_IF_EXCEPTION(throwScope, void());
+
+    propagateException(state, throwScope, element.setItem(index, option));
 }
 
 void JSHTMLSelectElement::indexSetter(JSC::ExecState* state, unsigned index, JSC::JSValue value)
diff --git a/Source/WebCore/bindings/js/JSNamedNodeMapCustom.cpp b/Source/WebCore/bindings/js/JSNamedNodeMapCustom.cpp
deleted file mode 100644 (file)
index 94cb159..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2007, 2008, 2009, 2013 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. ``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
- * 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. 
- */
-
-#include "config.h"
-#include "JSNamedNodeMap.h"
-
-#include "Attr.h"
-#include "JSAttr.h"
-#include "NamedNodeMap.h"
-
-using namespace JSC;
-
-namespace WebCore {
-
-bool JSNamedNodeMap::nameGetter(ExecState* exec, PropertyName propertyName, JSValue& value)
-{
-    auto item = wrapped().getNamedItem(propertyNameToAtomicString(propertyName));
-    if (!item)
-        return false;
-    value = toJS(exec, globalObject(), *item);
-    return true;
-}
-
-} // namespace WebCore
diff --git a/Source/WebCore/bindings/js/JSRTCStatsResponseCustom.cpp b/Source/WebCore/bindings/js/JSRTCStatsResponseCustom.cpp
deleted file mode 100644 (file)
index a59c6d2..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) Research In Motion Limited 2013. 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. ``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
- * 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.
- */
-
-#include "config.h"
-
-#if ENABLE(WEB_RTC)
-#include "JSRTCStatsResponse.h"
-
-#include "JSDOMBinding.h"
-#include "JSRTCStatsReport.h"
-#include <wtf/text/AtomicString.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-bool JSRTCStatsResponse::nameGetter(ExecState* exec, PropertyName propertyName, JSValue& value)
-{
-    auto item = wrapped().namedItem(propertyNameToAtomicString(propertyName));
-    if (!item)
-        return false;
-
-    value = toJS(exec, globalObject(), *item);
-    return true;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(WEB_RTC)
index 7cbb6f5..6a2c46c 100644 (file)
@@ -35,27 +35,6 @@ using namespace JSC;
 
 namespace WebCore {
 
-bool JSStorage::nameGetter(ExecState* state, PropertyName propertyName, JSValue& value)
-{
-    if (propertyName.isSymbol())
-        return false;
-
-    auto item = wrapped().getItem(propertyNameToString(propertyName));
-    if (item.hasException()) {
-        auto& vm = state->vm();
-        auto scope = DECLARE_THROW_SCOPE(vm);
-        propagateException(*state, scope, item.releaseException());
-        return false;
-    }
-
-    auto string = item.releaseReturnValue();
-    if (string.isNull())
-        return false;
-
-    value = jsStringWithCache(state, string);
-    return true;
-}
-
 bool JSStorage::deleteProperty(JSCell* cell, ExecState* state, PropertyName propertyName)
 {
     auto& thisObject = *jsCast<JSStorage*>(cell);
diff --git a/Source/WebCore/bindings/js/JSStyleSheetListCustom.cpp b/Source/WebCore/bindings/js/JSStyleSheetListCustom.cpp
deleted file mode 100644 (file)
index c4222a9..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2007, 2009 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. ``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
- * 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. 
- */
-
-#include "config.h"
-#include "JSStyleSheetList.h"
-
-#include "HTMLStyleElement.h"
-#include "JSStyleSheet.h"
-#include "StyleSheet.h"
-#include "StyleSheetList.h"
-
-using namespace JSC;
-
-namespace WebCore {
-
-bool JSStyleSheetList::nameGetter(ExecState* exec, PropertyName propertyName, JSValue& value)
-{
-    if (propertyName.isSymbol())
-        return false;
-
-    auto* item = wrapped().getNamedItem(propertyNameToString(propertyName));
-    if (!item)
-        return false;
-
-    value = toJS(exec, globalObject(), item->sheet());
-    return true;
-}
-
-} // namespace WebCore
index 9f80bdc..b05e4fd 100644 (file)
@@ -381,52 +381,103 @@ sub ShouldUseGlobalObjectPrototype
     return IsDOMGlobalObject($interface);
 }
 
-sub GenerateGetOwnPropertySlotBody
+sub GenerateIndexedGetter
 {
-    my ($interface, $className, $inlined) = @_;
+    my ($interface, $indexedGetterFunction) = @_;
 
-    my $namespaceMaybe = ($inlined ? "JSC::" : "");
-    my $namedGetterFunction = GetNamedGetterFunction($interface);
-    my $indexedGetterFunction = GetIndexedGetterFunction($interface);
+    my @output = ();
+
+    my @attributes = ();
+    push(@attributes, "ReadOnly") if !$interface->extendedAttributes->{CustomNamedSetter};
+
+    my $attributeString = ((@attributes > 0) ? join(" | ", @attributes) : "0");
+
+    my $indexedGetterFunctionName = $indexedGetterFunction->name || "item";
+    my $nativeToJSConversion = NativeToJSValueUsingPointers($indexedGetterFunction, $interface, "thisObject->wrapped().${indexedGetterFunctionName}(index)", "thisObject");
+
+    push(@output, "        slot.setValue(thisObject, ${attributeString}, ${nativeToJSConversion});\n");
+    push(@output, "        return true;\n");
+
+    return @output;
+}
+
+sub GenerateNamedGetter
+{
+    my ($interface, $namedGetterFunction) = @_;
+
+    my @output = ();
 
-    my @getOwnPropertySlotImpl = ();
+    my @attributes = ();
+    push(@attributes, "ReadOnly") if !$interface->extendedAttributes->{CustomNamedSetter};
+    push(@attributes, "DontEnum") if $interface->extendedAttributes->{LegacyUnenumerableNamedProperties};
+
+    my $attributeString = ((@attributes > 0) ? join(" | ", @attributes) : "0");
+
+    if ($interface->extendedAttributes->{CustomNamedGetter}) {
+        push(@output, "        JSValue value;\n");
+        push(@output, "        if (thisObject->nameGetter(state, propertyName, value)) {\n");
+        push(@output, "            slot.setValue(thisObject, ${attributeString}, value);\n");
+    } else {
+        my $namedGetterFunctionName = $namedGetterFunction->name || "namedItem";
+        my $itemVariable = "item";
+        push(@output, "        auto item = thisObject->wrapped().${namedGetterFunctionName}(propertyNameToAtomicString(propertyName));\n");
+
+        if ($namedGetterFunction->extendedAttributes->{MayThrowException}) {
+            push(@output, "        if (item.hasException()) {\n");
+            push(@output, "            auto throwScope = DECLARE_THROW_SCOPE(state->vm());\n");
+            push(@output, "            propagateException(*state, throwScope, item.releaseException());\n");
+            push(@output, "            return true;\n");
+            push(@output, "        }\n\n");
+            push(@output, "        auto itemValue = item.releaseReturnValue();\n");
+
+            $itemVariable = "itemValue";
+        }
+
+        my $IDLType = GetIDLType($interface, $namedGetterFunction->type);
+        push(@output, "        if (!${IDLType}::isNullValue(${itemVariable})) {\n");
+
+        my $nativeToJSConversion = NativeToJSValueUsingPointers($namedGetterFunction, $interface, $itemVariable, "thisObject", 1);
+        push(@output, "            slot.setValue(thisObject, ${attributeString}, ${nativeToJSConversion});\n");
+    }
+    
+    push(@output, "            return true;\n");
+    push(@output, "        }\n");
+
+    return @output;
+}
+
+sub GenerateGetOwnPropertySlotBody
+{
+    my ($interface, $className, $indexedGetterFunction, $namedGetterFunction) = @_;
+
+    my @output = ();
 
     my $ownPropertyCheck = sub {
-        push(@getOwnPropertySlotImpl, "    if (Base::getOwnPropertySlot(thisObject, state, propertyName, slot))\n");
-        push(@getOwnPropertySlotImpl, "        return true;\n");
+        push(@output, "    if (Base::getOwnPropertySlot(thisObject, state, propertyName, slot))\n");
+        push(@output, "        return true;\n");
     };
 
     # FIXME: As per the Web IDL specification, the prototype check is supposed to skip "named properties objects":
     # https://heycam.github.io/webidl/#dfn-named-property-visibility
     # https://heycam.github.io/webidl/#dfn-named-properties-object
     my $prototypeCheck = sub {
-        push(@getOwnPropertySlotImpl, "    ${namespaceMaybe}JSValue proto = thisObject->getPrototypeDirect();\n");
-        push(@getOwnPropertySlotImpl, "    if (proto.isObject() && jsCast<${namespaceMaybe}JSObject*>(proto)->hasProperty(state, propertyName))\n");
-        push(@getOwnPropertySlotImpl, "        return false;\n\n");
+        push(@output, "    JSValue proto = thisObject->getPrototypeDirect();\n");
+        push(@output, "    if (proto.isObject() && jsCast<JSObject*>(proto)->hasProperty(state, propertyName))\n");
+        push(@output, "        return false;\n\n");
     };
 
-    if ($indexedGetterFunction) {
-        push(@getOwnPropertySlotImpl, "    std::optional<uint32_t> optionalIndex = parseIndex(propertyName);\n");
+    push(@output, "bool ${className}::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)\n");
+    push(@output, "{\n");
+    push(@output, "    auto* thisObject = jsCast<${className}*>(object);\n");
+    push(@output, "    ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n");
 
-        # If the item function returns a string then we let the TreatReturnedNullStringAs handle the cases
-        # where the index is out of range.
-        
-        # FIXME: Should this work for all string types?
-        if ($indexedGetterFunction->type->name eq "DOMString") {
-            push(@getOwnPropertySlotImpl, "    if (optionalIndex) {\n");
-        } else {
-            push(@getOwnPropertySlotImpl, "    if (optionalIndex && optionalIndex.value() < thisObject->wrapped().length()) {\n");
-        }
-        push(@getOwnPropertySlotImpl, "        unsigned index = optionalIndex.value();\n");
-        # Assume that if there's a setter, the index will be writable
-        if ($interface->extendedAttributes->{CustomIndexedSetter}) {
-            push(@getOwnPropertySlotImpl, "        unsigned attributes = 0;\n");
-        } else {
-            push(@getOwnPropertySlotImpl, "        unsigned attributes = ${namespaceMaybe}ReadOnly;\n");
-        }
-        push(@getOwnPropertySlotImpl, "        slot.setValue(thisObject, attributes, " . GetIndexedGetterExpression($indexedGetterFunction) . ");\n");
-        push(@getOwnPropertySlotImpl, "        return true;\n");
-        push(@getOwnPropertySlotImpl, "    }\n");
+
+    if ($indexedGetterFunction) {
+        push(@output, "    auto optionalIndex = parseIndex(propertyName);\n");
+        push(@output, "    if (optionalIndex && optionalIndex.value() < thisObject->wrapped().length()) {\n");
+        push(@output, "        auto index = optionalIndex.value();\n");
+        push(@output, GenerateIndexedGetter($interface, $indexedGetterFunction));
+        push(@output, "    }\n");
     }
 
     my $hasNamedGetter = $namedGetterFunction || $interface->extendedAttributes->{CustomNamedGetter};
@@ -435,41 +486,225 @@ sub GenerateGetOwnPropertySlotBody
             &$ownPropertyCheck();
             &$prototypeCheck();
         }
-
-        # The "thisObject->classInfo() == info()" check is to make sure we use the subclass' named getter
-        # instead of the base class one when possible.
         if ($indexedGetterFunction) {
-            # Indexing an object with an integer that is not a supported property index should not call the named property getter.
-            # https://heycam.github.io/webidl/#idl-indexed-properties
-            push(@getOwnPropertySlotImpl, "    if (!optionalIndex && thisObject->classInfo() == info()) {\n");
+            push(@output, "    if (!optionalIndex && thisObject->classInfo() == info() && !propertyName.isSymbol()) {\n");
         } else {
-            push(@getOwnPropertySlotImpl, "    if (thisObject->classInfo() == info()) {\n");
-        }
-        push(@getOwnPropertySlotImpl, "        JSValue value;\n");
-        push(@getOwnPropertySlotImpl, "        if (thisObject->nameGetter(state, propertyName, value)) {\n");
-        push(@getOwnPropertySlotImpl, "            slot.setValue(thisObject, ReadOnly | DontEnum, value);\n");
-        push(@getOwnPropertySlotImpl, "            return true;\n");
-        push(@getOwnPropertySlotImpl, "        }\n");
-        push(@getOwnPropertySlotImpl, "    }\n");
-        if ($inlined) {
-            $headerIncludes{"wtf/text/AtomicString.h"} = 1;
-        } else {
-            $implIncludes{"wtf/text/AtomicString.h"} = 1;
+            push(@output, "    if (thisObject->classInfo() == info() && !propertyName.isSymbol()) {\n");
         }
+        push(@output, GenerateNamedGetter($interface, $namedGetterFunction));
+        push(@output, "    }\n");
     }
 
     if ($interface->extendedAttributes->{JSCustomGetOwnPropertySlotAndDescriptor}) {
-        push(@getOwnPropertySlotImpl, "    if (thisObject->getOwnPropertySlotDelegate(state, propertyName, slot))\n");
-        push(@getOwnPropertySlotImpl, "        return true;\n");
+        push(@output, "    if (thisObject->getOwnPropertySlotDelegate(state, propertyName, slot))\n");
+        push(@output, "        return true;\n");
     }
 
     if (!$hasNamedGetter || $interface->extendedAttributes->{OverrideBuiltins}) {
         &$ownPropertyCheck();
     }
 
-    push(@getOwnPropertySlotImpl, "    return false;\n");
+    push(@output, "    return false;\n");
+    push(@output, "}\n\n");
 
-    return @getOwnPropertySlotImpl;
+    return @output;
+}
+
+sub GenerateGetOwnPropertySlotBodyByIndex
+{
+    my ($interface, $className, $indexedGetterFunction, $namedGetterFunction) = @_;
+
+    my @output = ();
+
+    push(@output, "bool ${className}::getOwnPropertySlotByIndex(JSObject* object, ExecState* state, unsigned index, PropertySlot& slot)\n");
+    push(@output, "{\n");
+    push(@output, "    auto* thisObject = jsCast<${className}*>(object);\n");
+    push(@output, "    ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n");
+    
+    # Sink the int-to-string conversion that happens when we create a PropertyName
+    # to the point where we actually need it.
+    my $generatedPropertyName = 0;
+    my $propertyNameGeneration = sub {
+        if ($generatedPropertyName) {
+            return;
+        }
+        push(@output, "    Identifier propertyName = Identifier::from(state, index);\n");
+        $generatedPropertyName = 1;
+    };
+    
+    if ($indexedGetterFunction) {
+        push(@output, "    if (LIKELY(index < thisObject->wrapped().length())) {\n");
+        push(@output, GenerateIndexedGetter($interface, $indexedGetterFunction));
+        push(@output, "    }\n");
+    }
+
+    # Indexing an object with an integer that is not a supported property index should not call the named property getter.
+    # https://heycam.github.io/webidl/#idl-indexed-properties
+    if (!$indexedGetterFunction && ($namedGetterFunction || $interface->extendedAttributes->{CustomNamedGetter})) {
+        &$propertyNameGeneration();
+        push(@output, "    if (thisObject->classInfo() == info()) {\n");
+        push(@output, GenerateNamedGetter($interface, $namedGetterFunction));
+        push(@output, "    }\n");
+    }
+
+    if ($interface->extendedAttributes->{JSCustomGetOwnPropertySlotAndDescriptor}) {
+        &$propertyNameGeneration();
+        push(@output, "    if (thisObject->getOwnPropertySlotDelegate(state, propertyName, slot))\n");
+        push(@output, "        return true;\n");
+    }
+
+    push(@output, "    return Base::getOwnPropertySlotByIndex(thisObject, state, index, slot);\n");
+    push(@output, "}\n\n");
+
+    return @output;
+}
+
+sub GenerateGetOwnPropertyNames
+{
+    my ($interface, $className, $indexedGetterFunction, $namedGetterFunction) = @_;
+
+    my @output = ();
+
+    # Property enumeration - https://heycam.github.io/webidl/#legacy-platform-object-property-enumeration
+
+    push(@implContent, "void ${className}::getOwnPropertyNames(JSObject* object, ExecState* state, PropertyNameArray& propertyNames, EnumerationMode mode)\n");
+    push(@implContent, "{\n");
+    push(@implContent, "    auto* thisObject = jsCast<${className}*>(object);\n");
+    push(@implContent, "    ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n");
+
+    # 1. If the object supports indexed properties, then the object’s supported
+    #    property indices are enumerated first, in numerical order.
+    if ($indexedGetterFunction) {
+        push(@implContent, "    for (unsigned i = 0, count = thisObject->wrapped().length(); i < count; ++i)\n");
+        push(@implContent, "        propertyNames.add(Identifier::from(state, i));\n");
+    }
+
+    # 2. If the object supports named properties and doesn’t implement an interface
+    #    with the [LegacyUnenumerableNamedProperties] extended attribute, then the
+    #    object’s supported property names that are visible according to the named
+    #    property visibility algorithm are enumerated next, in the order given in
+    #    the definition of the set of supported property names.
+    if ($namedGetterFunction) {
+        if (!$interface->extendedAttributes->{LegacyUnenumerableNamedProperties}) {
+            push(@implContent, "    for (auto& propertyName : thisObject->wrapped().supportedPropertyNames())\n");
+            push(@implContent, "        propertyNames.add(Identifier::fromString(state, propertyName));\n");
+        } else {
+            push(@implContent, "    if (mode.includeDontEnumProperties()) {\n");
+            push(@implContent, "        for (auto& propertyName : thisObject->wrapped().supportedPropertyNames())\n");
+            push(@implContent, "            propertyNames.add(Identifier::fromString(state, propertyName));\n");
+            push(@implContent, "    }\n");
+        }
+    }
+    # 3. Finally, any enumerable own properties or properties from the object’s
+    #    prototype chain are then enumerated, in no defined order.
+    push(@implContent, "    Base::getOwnPropertyNames(thisObject, state, propertyNames, mode);\n");
+    push(@implContent, "}\n\n");
+
+    return @output;
+}
+
+sub GeneratePut
+{
+    my ($interface, $className, $indexedSetterFunction, $namedSetterFunction) = @_;
+
+    assert("Named setters are not supported.") if $namedSetterFunction;
+
+    my @output = ();
+
+    push(@output, "bool ${className}::put(JSCell* cell, ExecState* state, PropertyName propertyName, JSValue value, PutPropertySlot& slot)\n");
+    push(@output, "{\n");
+    push(@output, "    auto* thisObject = jsCast<${className}*>(cell);\n");
+    push(@output, "    ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n");
+    
+    if ($indexedSetterFunction || $interface->extendedAttributes->{CustomIndexedSetter}) {
+        if ($interface->extendedAttributes->{CustomIndexedSetter}) {
+            push(@output, "    if (auto index = parseIndex(propertyName)) {\n");
+            push(@output, "        thisObject->indexSetter(state, index.value(), value);\n");
+            push(@output, "        return true;\n");
+            push(@output, "    }\n");
+        } else {
+            # The second argument of the indexed setter function is the argument being converted.
+            my $argument = @{$indexedSetterFunction->arguments}[1];
+            my ($nativeValue, $mayThrowException) = JSValueToNative($interface, $argument, "value", $indexedSetterFunction->extendedAttributes->{Conditional}, "state", "*state", "thisObject", "", "");
+
+            push(@output, "    if (auto index = parseIndex(propertyName)) {\n");
+            push(@output, "        auto throwScope = DECLARE_THROW_SCOPE(state->vm());\n");
+            push(@output, "        auto nativeValue = ${nativeValue};\n");
+            push(@output, "        RETURN_IF_EXCEPTION(throwScope, true);\n") if $mayThrowException;
+
+            my $indexedSetterFunctionName = $indexedSetterFunction->name || "setItem";
+            my $functionString = "${indexedSetterFunctionName}(index, WTFMove(nativeValue))";
+            $functionString = "propagateException(*state, throwScope, ${functionString})" if NeedsExplicitPropagateExceptionCall($indexedSetterFunction);
+
+            push(@output, "        ${functionString};\n");
+            push(@output, "        return true;\n");
+            push(@output, "    }\n");
+        }
+    }
+    
+    if ($interface->extendedAttributes->{CustomNamedSetter}) {
+        push(@output, "    bool putResult = false;\n");
+        push(@output, "    if (thisObject->putDelegate(state, propertyName, value, slot, putResult))\n");
+        push(@output, "        return putResult;\n");
+    }
+
+    push(@output, "    return Base::put(thisObject, state, propertyName, value, slot);\n");
+    push(@output, "}\n\n");
+
+    return @output;
+}
+
+sub GeneratePutByIndex
+{
+    my ($interface, $className, $indexedSetterFunction, $namedSetterFunction) = @_;
+
+    assert("Named setters are not supported.") if $namedSetterFunction;
+
+    my @output = ();
+
+    push(@output, "bool ${className}::putByIndex(JSCell* cell, ExecState* state, unsigned index, JSValue value, bool shouldThrow)\n");
+    push(@output, "{\n");
+    push(@output, "    auto* thisObject = jsCast<${className}*>(cell);\n");
+    push(@output, "    ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n");
+
+    if ($indexedSetterFunction || $interface->extendedAttributes->{CustomIndexedSetter}) {
+        if ($interface->extendedAttributes->{CustomIndexedSetter}) {
+            push(@output, "    if (LIKELY(index <= MAX_ARRAY_INDEX)) {\n");
+            push(@output, "        thisObject->indexSetter(state, index, value);\n");
+            push(@output, "        return true;\n");
+            push(@output, "    }\n");
+        } else {
+            # The second argument of the indexed setter function is the argument being converted.
+            my $argument = @{$indexedSetterFunction->arguments}[1];
+            my ($nativeValue, $mayThrowException) = JSValueToNative($interface, $argument, "value", $indexedSetterFunction->extendedAttributes->{Conditional}, "state", "*state", "thisObject", "", "");
+
+            push(@output, "    if (LIKELY(index <= MAX_ARRAY_INDEX)) {\n");
+            push(@output, "        auto throwScope = DECLARE_THROW_SCOPE(state->vm());\n");
+            push(@output, "        auto nativeValue = ${nativeValue};\n");
+            push(@output, "        RETURN_IF_EXCEPTION(throwScope, true);\n") if $mayThrowException;
+
+            my $indexedSetterFunctionName = $indexedSetterFunction->name || "setItem";
+            my $functionString = "${indexedSetterFunctionName}(index, WTFMove(nativeValue))";
+            $functionString = "propagateException(*state, throwScope, ${functionString})" if NeedsExplicitPropagateExceptionCall($indexedSetterFunction);
+
+            push(@output, "        ${functionString};\n");
+            push(@output, "        return true;\n");
+            push(@output, "    }\n");
+        }
+    }
+
+    if ($interface->extendedAttributes->{CustomNamedSetter}) {
+        push(@output, "    Identifier propertyName = Identifier::from(state, index);\n");
+        push(@output, "    PutPropertySlot slot(thisObject, shouldThrow);\n");
+        push(@output, "    bool putResult = false;\n");
+        push(@output, "    if (thisObject->putDelegate(state, propertyName, value, slot, putResult))\n");
+        push(@output, "        return putResult;\n");
+    }
+
+    push(@output, "    return Base::putByIndex(cell, state, index, value, shouldThrow);\n");
+    push(@output, "}\n\n");
+
+    return @output;
 }
 
 sub GenerateHeaderContentHeader
@@ -783,12 +1018,30 @@ sub GetIndexedGetterFunction
     return GetSpecialAccessorFunctionForType($interface, "getter", "unsigned long", 1);
 }
 
+sub GetIndexedSetterFunction
+{
+    my $interface = shift;
+    return GetSpecialAccessorFunctionForType($interface, "setter", "unsigned long", 2);
+}
+
 sub GetNamedGetterFunction
 {
     my $interface = shift;
     return GetSpecialAccessorFunctionForType($interface, "getter", "DOMString", 1);
 }
 
+sub GetNamedSetterFunction
+{
+    my $interface = shift;
+    return GetSpecialAccessorFunctionForType($interface, "setter", "DOMString", 2);
+}
+
+sub GetNamedDeleterFunction
+{
+    my $interface = shift;
+    return GetSpecialAccessorFunctionForType($interface, "deleter", "DOMString", 1);
+}
+
 sub InstanceFunctionCount
 {
     my $interface = shift;
@@ -849,6 +1102,15 @@ sub InstanceOverridesGetOwnPropertySlot
         || GetNamedGetterFunction($interface);
 }
 
+sub InstanceOverridesPut
+{
+    my $interface = shift;
+    return $interface->extendedAttributes->{CustomNamedSetter}
+        || $interface->extendedAttributes->{CustomIndexedSetter}
+        || GetIndexedSetterFunction($interface)
+        || GetNamedSetterFunction($interface);
+}
+
 sub PrototypeHasStaticPropertyTable
 {
     my $interface = shift;
@@ -1579,7 +1841,6 @@ sub GenerateHeader
     # Getters
     if ($hasGetter) {
         push(@headerContent, "    static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);\n");
-        push(@headerContent, "    bool getOwnPropertySlotDelegate(JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);\n") if $interface->extendedAttributes->{JSCustomGetOwnPropertySlotAndDescriptor};
         $structureFlags{"JSC::OverridesGetOwnPropertySlot"} = 1;
 
         if ($hasComplexGetter) {
@@ -1594,7 +1855,6 @@ sub GenerateHeader
     if ($overridesPut) {
         push(@headerContent, "    static bool put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);\n");
         push(@headerContent, "    static bool putByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::JSValue, bool shouldThrow);\n");
-        push(@headerContent, "    bool putDelegate(JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&, bool& putResult);\n") if $interface->extendedAttributes->{CustomNamedSetter};
     }
 
     if (!$hasParent) {
@@ -1799,13 +2059,22 @@ sub GenerateHeader
         push(@headerContent, "    void finishCreation(JSC::VM&);\n");
     }
 
-    push(@headerContent, "    void indexSetter(JSC::ExecState*, unsigned index, JSC::JSValue);\n") if $interface->extendedAttributes->{CustomIndexedSetter};
+    if ($interface->extendedAttributes->{JSCustomGetOwnPropertySlotAndDescriptor}) {
+        push(@headerContent, "    bool getOwnPropertySlotDelegate(JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);\n");
+    }
 
-    if ($namedGetterFunction || $interface->extendedAttributes->{CustomNamedGetter}) {
-        push(@headerContent, "private:\n");
+    if ($interface->extendedAttributes->{CustomNamedGetter}) {
         push(@headerContent, "    bool nameGetter(JSC::ExecState*, JSC::PropertyName, JSC::JSValue&);\n");
     }
 
+    if ($interface->extendedAttributes->{CustomNamedSetter}) {
+        push(@headerContent, "    bool putDelegate(JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&, bool& putResult);\n");
+    }
+
+    if ($interface->extendedAttributes->{CustomIndexedSetter}) {
+        push(@headerContent, "    void indexSetter(JSC::ExecState*, unsigned index, JSC::JSValue);\n");
+    }
+
     push(@headerContent, "};\n\n");
 
     if (ShouldGenerateWrapperOwnerCode($hasParent, $interface)) {
@@ -2640,15 +2909,6 @@ sub GetCastingHelperForThisObject
     return "jsDynamicDowncast<JS$interfaceName*>";
 }
 
-sub GetIndexedGetterExpression
-{
-    my $indexedGetterFunction = shift;
-    
-    # FIXME: Should this work for all string types?
-    return "jsStringOrUndefined(state, thisObject->wrapped().item(index))" if $indexedGetterFunction->type->name eq "DOMString";
-    return "toJS(state, thisObject->globalObject(), thisObject->wrapped().item(index))";
-}
-
 # http://heycam.github.io/webidl/#Unscopable
 sub addUnscopableProperties
 {
@@ -3204,77 +3464,34 @@ sub GenerateImplementation
     # Attributes
     if ($hasGetter) {
         if (!$interface->extendedAttributes->{CustomGetOwnPropertySlot}) {
-            push(@implContent, "bool ${className}::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)\n");
-            push(@implContent, "{\n");
-            push(@implContent, "    auto* thisObject = jsCast<${className}*>(object);\n");
-            push(@implContent, "    ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n");
-            push(@implContent, GenerateGetOwnPropertySlotBody($interface, $className, 0));
-            push(@implContent, "}\n\n");
+            push(@implContent, GenerateGetOwnPropertySlotBody($interface, $className, $indexedGetterFunction, $namedGetterFunction));
         }
 
         if ($indexedGetterFunction || $namedGetterFunction
                 || $interface->extendedAttributes->{CustomNamedGetter}
                 || $interface->extendedAttributes->{JSCustomGetOwnPropertySlotAndDescriptor}) {
-            push(@implContent, "bool ${className}::getOwnPropertySlotByIndex(JSObject* object, ExecState* state, unsigned index, PropertySlot& slot)\n");
-            push(@implContent, "{\n");
-            push(@implContent, "    auto* thisObject = jsCast<${className}*>(object);\n");
-            push(@implContent, "    ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n");
-
-            # Sink the int-to-string conversion that happens when we create a PropertyName
-            # to the point where we actually need it.
-            my $generatedPropertyName = 0;
-            my $propertyNameGeneration = sub {
-                if ($generatedPropertyName) {
-                    return;
-                }
-                push(@implContent, "    Identifier propertyName = Identifier::from(state, index);\n");
-                $generatedPropertyName = 1;
-            };
-
-            if ($indexedGetterFunction) {
-                # FIXME: Should this work for all string types?
-                if ($indexedGetterFunction->type->name eq "DOMString") {
-                    push(@implContent, "    if (LIKELY(index <= MAX_ARRAY_INDEX)) {\n");
-                } else {
-                    push(@implContent, "    if (LIKELY(index < thisObject->wrapped().length())) {\n");
-                }
-                # Assume that if there's a setter, the index will be writable
-                if ($interface->extendedAttributes->{CustomIndexedSetter}) {
-                    push(@implContent, "        unsigned attributes = DontDelete;\n");
-                } else {
-                    push(@implContent, "        unsigned attributes = DontDelete | ReadOnly;\n");
-                }
-                push(@implContent, "        slot.setValue(thisObject, attributes, " . GetIndexedGetterExpression($indexedGetterFunction) . ");\n");
-                push(@implContent, "        return true;\n");
-                push(@implContent, "    }\n");
-            }
+            push(@implContent, GenerateGetOwnPropertySlotBodyByIndex($interface, $className, $indexedGetterFunction, $namedGetterFunction));
+        }
 
-            # Indexing an object with an integer that is not a supported property index should not call the named property getter.
-            # https://heycam.github.io/webidl/#idl-indexed-properties
-            if (!$indexedGetterFunction && ($namedGetterFunction || $interface->extendedAttributes->{CustomNamedGetter})) {
-                &$propertyNameGeneration();
-
-                # This condition is to make sure we use the subclass' named getter instead of the base class one when possible.
-                push(@implContent, "    if (thisObject->classInfo() == info()) {\n");
-                push(@implContent, "        JSValue value;\n");
-                push(@implContent, "        if (thisObject->nameGetter(state, propertyName, value)) {\n");
-                push(@implContent, "            slot.setValue(thisObject, ReadOnly | DontDelete | DontEnum, value);\n");
-                push(@implContent, "            return true;\n");
-                push(@implContent, "        }\n");
-                push(@implContent, "    }\n");
-                $implIncludes{"wtf/text/AtomicString.h"} = 1;
-            }
+    }
 
-            if ($interface->extendedAttributes->{JSCustomGetOwnPropertySlotAndDescriptor}) {
-                &$propertyNameGeneration();
-                push(@implContent, "    if (thisObject->getOwnPropertySlotDelegate(state, propertyName, slot))\n");
-                push(@implContent, "        return true;\n");
-            }
 
-            push(@implContent, "    return Base::getOwnPropertySlotByIndex(thisObject, state, index, slot);\n");
-            push(@implContent, "}\n\n");
-        }
+    if (($indexedGetterFunction || $namedGetterFunction) && !$interface->extendedAttributes->{CustomEnumerateProperty}) {
+        push(@implContent, GenerateGetOwnPropertyNames($interface, $className, $indexedGetterFunction, $namedGetterFunction));
+    }
 
+    my $namedSetterFunction = GetNamedSetterFunction($interface);
+    my $indexedSetterFunction = GetIndexedSetterFunction($interface);
+
+    my $hasSetter = InstanceOverridesPut($interface);
+    if ($hasSetter) {
+        if (!$interface->extendedAttributes->{CustomPutFunction}) {
+            push(@implContent, GeneratePut($interface, $className, $indexedSetterFunction, $namedSetterFunction));
+            
+            if ($interface->extendedAttributes->{CustomIndexedSetter} || $interface->extendedAttributes->{CustomNamedSetter}) {
+                push(@implContent, GeneratePutByIndex($interface, $className, $indexedSetterFunction, $namedSetterFunction));
+            }
+        }
     }
 
     if ($numAttributes > 0) {
@@ -3421,7 +3638,7 @@ sub GenerateImplementation
                 }
 
                 unshift(@arguments, @callWithArgs);
-                my $jsType = NativeToJSValueUsingReferences($attribute, 0, $interface, "${functionName}(" . join(", ", @arguments) . ")", "thisObject");
+                my $jsType = NativeToJSValueUsingReferences($attribute, $interface, "${functionName}(" . join(", ", @arguments) . ")", "thisObject");
                 push(@implContent, "    auto& impl = thisObject.wrapped();\n") if !$attribute->isStatic;
                 push(@implContent, "    JSValue result = $jsType;\n");
 
@@ -3497,55 +3714,6 @@ sub GenerateImplementation
         push(@implContent, "}\n\n");
     }
 
-    my $hasCustomSetter = $interface->extendedAttributes->{CustomNamedSetter} || $interface->extendedAttributes->{CustomIndexedSetter};
-    if ($hasCustomSetter) {
-        if (!$interface->extendedAttributes->{CustomPutFunction}) {
-            push(@implContent, "bool ${className}::put(JSCell* cell, ExecState* state, PropertyName propertyName, JSValue value, PutPropertySlot& slot)\n");
-            push(@implContent, "{\n");
-            push(@implContent, "    auto* thisObject = jsCast<${className}*>(cell);\n");
-            push(@implContent, "    ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n");
-            if ($interface->extendedAttributes->{CustomIndexedSetter}) {
-                push(@implContent, "    if (std::optional<uint32_t> index = parseIndex(propertyName)) {\n");
-                push(@implContent, "        thisObject->indexSetter(state, index.value(), value);\n");
-                push(@implContent, "        return true;\n");
-                push(@implContent, "    }\n");
-            }
-            if ($interface->extendedAttributes->{CustomNamedSetter}) {
-                push(@implContent, "    bool putResult = false;\n");
-                push(@implContent, "    if (thisObject->putDelegate(state, propertyName, value, slot, putResult))\n");
-                push(@implContent, "        return putResult;\n");
-            }
-
-            push(@implContent, "    return Base::put(thisObject, state, propertyName, value, slot);\n");
-            push(@implContent, "}\n\n");
-
-            if ($interface->extendedAttributes->{CustomIndexedSetter} || $interface->extendedAttributes->{CustomNamedSetter}) {
-                push(@implContent, "bool ${className}::putByIndex(JSCell* cell, ExecState* state, unsigned index, JSValue value, bool shouldThrow)\n");
-                push(@implContent, "{\n");
-                push(@implContent, "    auto* thisObject = jsCast<${className}*>(cell);\n");
-                push(@implContent, "    ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n");
-
-                if ($interface->extendedAttributes->{CustomIndexedSetter}) {
-                    push(@implContent, "    if (LIKELY(index <= MAX_ARRAY_INDEX)) {\n");
-                    push(@implContent, "        thisObject->indexSetter(state, index, value);\n");
-                    push(@implContent, "        return true;\n");
-                    push(@implContent, "    }\n");
-                }
-
-                if ($interface->extendedAttributes->{CustomNamedSetter}) {
-                    push(@implContent, "    Identifier propertyName = Identifier::from(state, index);\n");
-                    push(@implContent, "    PutPropertySlot slot(thisObject, shouldThrow);\n");
-                    push(@implContent, "    bool putResult = false;\n");
-                    push(@implContent, "    if (thisObject->putDelegate(state, propertyName, value, slot, putResult))\n");
-                    push(@implContent, "        return putResult;\n");
-                }
-
-                push(@implContent, "    return Base::putByIndex(cell, state, index, value, shouldThrow);\n");
-                push(@implContent, "}\n\n");
-            }
-        }
-    }
-
     foreach my $attribute (@{$interface->attributes}) {
         if (!IsReadonly($attribute)) {
             next if IsJSBuiltin($interface, $attribute);
@@ -3706,26 +3874,6 @@ sub GenerateImplementation
         }
     }
 
-    if (($indexedGetterFunction || $namedGetterFunction) && !$interface->extendedAttributes->{CustomEnumerateProperty}) {
-        push(@implContent, "void ${className}::getOwnPropertyNames(JSObject* object, ExecState* state, PropertyNameArray& propertyNames, EnumerationMode mode)\n");
-        push(@implContent, "{\n");
-        push(@implContent, "    auto* thisObject = jsCast<${className}*>(object);\n");
-        push(@implContent, "    ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n");
-        if ($indexedGetterFunction) {
-            push(@implContent, "    for (unsigned i = 0, count = thisObject->wrapped().length(); i < count; ++i)\n");
-            push(@implContent, "        propertyNames.add(Identifier::from(state, i));\n");
-        }
-        if ($namedGetterFunction) {
-            # FIXME: We may need to add an IDL extended attribute at some point if an interface needs enumerable named properties.
-            push(@implContent, "    if (mode.includeDontEnumProperties()) {\n");
-            push(@implContent, "        for (auto& propertyName : thisObject->wrapped().supportedPropertyNames())\n");
-            push(@implContent, "            propertyNames.add(Identifier::fromString(state, propertyName));\n");
-            push(@implContent, "    }\n");
-        }
-        push(@implContent, "    Base::getOwnPropertyNames(thisObject, state, propertyNames, mode);\n");
-        push(@implContent, "}\n\n");
-    }
-
     if (!$interface->extendedAttributes->{NoInterfaceObject}) {
         push(@implContent, "JSValue ${className}::getConstructor(VM& vm, const JSGlobalObject* globalObject)\n{\n");
         push(@implContent, "    return getDOMConstructor<${className}Constructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));\n");
@@ -3941,7 +4089,7 @@ END
                 }
                 my $functionString = "$implFunctionName(" . join(", ", @arguments) . ")";
                 $functionString = "propagateException(*state, throwScope, $functionString)" if NeedsExplicitPropagateExceptionCall($function);
-                push(@implContent, "    return JSValue::encode(" . NativeToJSValueUsingPointers($function, 1, $interface, $functionString, "castedThis") . ");\n");
+                push(@implContent, "    return JSValue::encode(" . NativeToJSValueUsingPointers($function, $interface, $functionString, "castedThis") . ");\n");
                 push(@implContent, "}\n\n");
             }
 
@@ -4002,7 +4150,6 @@ END
     # die "Can't generate binding for class with cached attribute and custom mark." if $numCachedAttributes > 0 and $interface->extendedAttributes->{JSCustomMarkFunction};
 
     if ($indexedGetterFunction) {
-        # FIXME: Should this work for all string types.
         $implIncludes{"URL.h"} = 1 if $indexedGetterFunction->type->name eq "DOMString";
         if ($interfaceName =~ /^HTML\w*Collection$/ or $interfaceName eq "RadioNodeList") {
             $implIncludes{"JSNode.h"} = 1;
@@ -4851,7 +4998,7 @@ sub GenerateCallbackImplementationContent
             push(@$contentRef, "    MarkedArgumentBuffer args;\n");
 
             foreach my $argument (@{$function->arguments}) {
-                push(@$contentRef, "    args.append(" . NativeToJSValueUsingPointers($argument, 1, $interfaceOrCallback, $argument->name, "m_data") . ");\n");
+                push(@$contentRef, "    args.append(" . NativeToJSValueUsingPointers($argument, $interfaceOrCallback, $argument->name, "m_data") . ");\n");
             }
 
             push(@$contentRef, "\n    NakedPtr<JSC::Exception> returnedException;\n");
@@ -4890,7 +5037,7 @@ sub GenerateImplementationFunctionCall()
         push(@implContent, $indent . "return JSValue::encode(jsUndefined());\n");
     } else {
         my $thisObject = $function->isStatic ? 0 : "castedThis";
-        push(@implContent, $indent . "return JSValue::encode(" . NativeToJSValueUsingPointers($function, 1, $interface, $functionString, $thisObject) . ");\n");
+        push(@implContent, $indent . "return JSValue::encode(" . NativeToJSValueUsingPointers($function, $interface, $functionString, $thisObject) . ");\n");
     }
 }
 
@@ -5385,23 +5532,23 @@ sub NativeToJSValueDOMConvertNeedsGlobalObject
 
 sub NativeToJSValueUsingReferences
 {
-    my ($context, $inFunctionCall, $interface, $value, $thisValue) = @_;
+    my ($context, $interface, $value, $thisValue, $suppressExceptionCheck) = @_;
     my $stateReference = "state";
     my $wrapped = "$thisValue.wrapped()";
     my $globalObjectReference = $thisValue ? "*$thisValue.globalObject()" : "*jsCast<JSDOMGlobalObject*>(state.lexicalGlobalObject())";
 
-    return NativeToJSValue($context, $inFunctionCall, $interface, $value, $stateReference, $wrapped, $globalObjectReference);
+    return NativeToJSValue($context, $interface, $value, $stateReference, $wrapped, $globalObjectReference, $suppressExceptionCheck);
 }
 
 # FIXME: We should remove NativeToJSValueUsingPointers and combine NativeToJSValueUsingReferences and NativeToJSValue
 sub NativeToJSValueUsingPointers
 {
-    my ($context, $inFunctionCall, $interface, $value, $thisValue) = @_;
+    my ($context, $interface, $value, $thisValue, $suppressExceptionCheck) = @_;
     my $stateReference = "*state";
     my $wrapped = "$thisValue->wrapped()";
     my $globalObjectReference = $thisValue ? "*$thisValue->globalObject()" : "*jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())";
 
-    return NativeToJSValue($context, $inFunctionCall, $interface, $value, $stateReference, $wrapped, $globalObjectReference);
+    return NativeToJSValue($context, $interface, $value, $stateReference, $wrapped, $globalObjectReference, $suppressExceptionCheck);
 }
 
 sub IsValidContextForNativeToJSValue
@@ -5413,13 +5560,13 @@ sub IsValidContextForNativeToJSValue
 
 sub NativeToJSValue
 {
-    my ($context, $inFunctionCall, $interface, $value, $stateReference, $wrapped, $globalObjectReference) = @_;
+    my ($context, $interface, $value, $stateReference, $wrapped, $globalObjectReference, $suppressExceptionCheck) = @_;
 
     assert("Invalid context type") if !IsValidContextForNativeToJSValue($context);
 
     my $conditional = $context->extendedAttributes->{Conditional};
     my $type = $context->type;
-    my $mayThrowException = $context->extendedAttributes->{GetterMayThrowException} || $context->extendedAttributes->{MayThrowException};
+    my $mayThrowException = $context->extendedAttributes->{GetterMayThrowException} || $context->extendedAttributes->{MayThrowException} && !$suppressExceptionCheck;
 
     # We could instead overload a function to work with optional as well as non-optional numbers, but this
     # is slightly better because it guarantees we will fail to compile if the IDL file doesn't match the C++.
index ad0e494..5354b11 100644 (file)
@@ -90,6 +90,7 @@ JSCustomToNativeObject
 JSGenerateToJSObject
 JSGenerateToNativeObject
 JSLegacyParent=*
+LegacyUnenumerableNamedProperties
 LenientThis
 MasqueradesAsUndefined
 MayThrowException
index 2d8945f..e33d7a5 100644 (file)
@@ -65,7 +65,7 @@ StyleSheet* StyleSheetList::item(unsigned index)
     return index < sheets.size() ? sheets[index].get() : 0;
 }
 
-HTMLStyleElement* StyleSheetList::getNamedItem(const String& name) const
+CSSStyleSheet* StyleSheetList::namedItem(const AtomicString& name) const
 {
     if (!m_document)
         return nullptr;
@@ -77,7 +77,7 @@ HTMLStyleElement* StyleSheetList::getNamedItem(const String& name) const
     // But unicity of stylesheet ids is good practice anyway ;)
     Element* element = m_document->getElementById(name);
     if (is<HTMLStyleElement>(element))
-        return downcast<HTMLStyleElement>(element);
+        return downcast<HTMLStyleElement>(element)->sheet();
     return nullptr;
 }
 
index c4971ea..341adff 100644 (file)
@@ -29,6 +29,7 @@ namespace WebCore {
 class Document;
 class HTMLStyleElement;
 class StyleSheet;
+class CSSStyleSheet;
 
 class StyleSheetList final : public RefCounted<StyleSheetList> {
 public:
@@ -38,7 +39,7 @@ public:
     WEBCORE_EXPORT unsigned length() const;
     WEBCORE_EXPORT StyleSheet* item(unsigned index);
 
-    HTMLStyleElement* getNamedItem(const String&) const;
+    CSSStyleSheet* namedItem(const AtomicString&) const;
     Vector<AtomicString> supportedPropertyNames();
 
     Document* document() { return m_document; }
index 7571dfa..af128a9 100644 (file)
@@ -24,6 +24,9 @@
     ImplementationLacksVTable,
 ] interface StyleSheetList {
     readonly attribute unsigned long length;
-    getter StyleSheet item(unsigned long index);
+    getter StyleSheet? item(unsigned long index);
+
+    // FIXME: https://drafts.csswg.org/cssom/#the-stylesheetlist-interface does not
+    // specify a named getter for StyleSheetList. We should investigate removing this.
     getter CSSStyleSheet (DOMString name);
 };
index 35e7bc2..ea3dae5 100644 (file)
  */
 
 [
-    NoInterfaceObject,
     Conditional=CSS_REGIONS,
+    ImplementationLacksVTable,
     InterfaceName=WebKitNamedFlowCollection,
     JSGenerateToJSObject,
-    ImplementationLacksVTable,
+    LegacyUnenumerableNamedProperties,
+    NoInterfaceObject
 ] interface DOMNamedFlowCollection {
     readonly attribute unsigned long length;
     getter WebKitNamedFlow? item(unsigned long index);
index 748194f..947e17b 100644 (file)
@@ -29,6 +29,6 @@
 
 namespace WebCore {
 
-typedef DatasetDOMStringMap DOMStringMap;
+using DOMStringMap = DatasetDOMStringMap;
 
 } // namespace WebCore
index 3932ba9..cbfa3fd 100644 (file)
 [
     GenerateIsReachable=ImplElementRoot,
     CustomDeleteProperty,
-    CustomEnumerateProperty,
     CustomNamedSetter,
-    JSCustomGetOwnPropertySlotAndDescriptor,
     OverrideBuiltins,
     SkipVTableValidation,
 ] interface DOMStringMap {
+    getter DOMString (DOMString name);
+
+    // FIXME: Add support for the setter and deleter specials.
+    // [CEReactions] setter void (DOMString name, DOMString value);
+    // [CEReactions] deleter void (DOMString name);
 };
 
index 53f520e..5f01ecf 100644 (file)
@@ -151,7 +151,7 @@ void DatasetDOMStringMap::deref()
     m_element.deref();
 }
 
-Vector<String> DatasetDOMStringMap::names() const
+Vector<String> DatasetDOMStringMap::supportedPropertyNames() const
 {
     Vector<String> names;
 
@@ -165,9 +165,8 @@ Vector<String> DatasetDOMStringMap::names() const
     return names;
 }
 
-const AtomicString& DatasetDOMStringMap::item(const String& propertyName, bool& isValid) const
+std::optional<const AtomicString&> DatasetDOMStringMap::item(const String& propertyName) const
 {
-    isValid = false;
     if (m_element.hasAttributes()) {
         AttributeIteratorAccessor attributeIteratorAccessor = m_element.attributesIterator();
 
@@ -175,22 +174,23 @@ const AtomicString& DatasetDOMStringMap::item(const String& propertyName, bool&
             // If the node has a single attribute, it is the dataset member accessed in most cases.
             // Building a new AtomicString in that case is overkill so we do a direct character comparison.
             const Attribute& attribute = *attributeIteratorAccessor.begin();
-            if (propertyNameMatchesAttributeName(propertyName, attribute.localName())) {
-                isValid = true;
+            if (propertyNameMatchesAttributeName(propertyName, attribute.localName()))
                 return attribute.value();
-            }
         } else {
             AtomicString attributeName = convertPropertyNameToAttributeName(propertyName);
             for (const Attribute& attribute : attributeIteratorAccessor) {
-                if (attribute.localName() == attributeName) {
-                    isValid = true;
+                if (attribute.localName() == attributeName)
                     return attribute.value();
-                }
             }
         }
     }
 
-    return nullAtom;
+    return std::nullopt;
+}
+
+String DatasetDOMStringMap::namedItem(const AtomicString& name) const
+{
+    return item(name).value_or(String { });
 }
 
 ExceptionOr<void> DatasetDOMStringMap::setItem(const String& name, const String& value)
index 1a9bc45..a3914fd 100644 (file)
@@ -43,14 +43,17 @@ public:
     void ref();
     void deref();
 
-    Vector<String> names() const;
-    const AtomicString& item(const String& name, bool& isValid) const;
+    Vector<String> supportedPropertyNames() const;
+
+    String namedItem(const AtomicString& name) const;
     ExceptionOr<void> setItem(const String& name, const String& value);
     bool deleteItem(const String& name);
 
     Element& element() { return m_element; }
 
 private:
+    std::optional<const AtomicString&> item(const String& name) const;
+
     Element& m_element;
 };
 
index 83d28e7..3635fe5 100644 (file)
@@ -22,6 +22,7 @@
     ExportToWrappedFunction,
     GenerateIsReachable=ImplElementRoot,
     ImplementationLacksVTable,
+    LegacyUnenumerableNamedProperties
 ] interface NamedNodeMap {
     readonly attribute unsigned long length;
     getter Attr? item(unsigned long index);
index 355cc6d..eb35047 100644 (file)
 
 [
     CustomCall,
+    CustomNamedGetter,
+    LegacyUnenumerableNamedProperties,
     MasqueradesAsUndefined,
     GenerateIsReachable=ImplOwnerNodeRoot,
 ] interface HTMLAllCollection {
     readonly attribute unsigned long length;
-    [Custom] getter Element item(unsigned long index);
-    [Custom] getter Element namedItem(DOMString name);
-    // FIXME: This should return an HTMLAllCollection.
+
+    [Custom] getter Element? item(unsigned long index);
+    [Custom] getter (HTMLCollection or Element)? namedItem(DOMString name);
+    // [Custom] legacycaller (HTMLCollection or Element)? item(optional DOMString nameOrIndex);
+
+    // FIXME: This is not in the standard. Can we remove it?
     NodeList tags(DOMString name);
 };
 
index 1941f0c..6dfae8b 100644 (file)
     CustomToJSObject,
     ExportToWrappedFunction,
     GenerateIsReachable=ImplOwnerNodeRoot,
+    LegacyUnenumerableNamedProperties,
     ReportExtraMemoryCost,
 ] interface HTMLCollection {
     readonly attribute unsigned long length;
-
     getter Element? item(unsigned long index);
     getter Element? namedItem(DOMString name);
 };
index fa218d4..036d244 100644 (file)
@@ -19,8 +19,9 @@
  */
 
 [
+    CustomNamedGetter,
     GenerateIsReachable=ImplOwnerNodeRoot,
 ] interface HTMLFormControlsCollection : HTMLCollection {
     getter HTMLElement? (unsigned long index);
-    [Custom] getter HTMLElement? namedItem(DOMString name);
+    [Custom] getter (RadioNodeList or Element)? namedItem(DOMString name); // shadows inherited namedItem()
 };
index ef45c86..7475f64 100644 (file)
@@ -46,6 +46,7 @@
 #include "HTMLTableElement.h"
 #include "NodeRareData.h"
 #include "Page.h"
+#include "RadioNodeList.h"
 #include "RenderTextControl.h"
 #include "ScriptController.h"
 #include "Settings.h"
@@ -174,6 +175,25 @@ HTMLElement* HTMLFormElement::item(unsigned index)
     return elements()->item(index);
 }
 
+std::optional<Variant<RefPtr<RadioNodeList>, RefPtr<Element>>> HTMLFormElement::namedItem(const AtomicString& name)
+{
+    auto namedItems = namedElements(name);
+
+    if (namedItems.isEmpty())
+        return std::nullopt;
+    if (namedItems.size() == 1)
+        return Variant<RefPtr<RadioNodeList>, RefPtr<Element>> { RefPtr<Element> { WTFMove(namedItems[0]) } };
+
+    return Variant<RefPtr<RadioNodeList>, RefPtr<Element>> { RefPtr<RadioNodeList> { radioNodeList(name) } };
+}
+
+Vector<AtomicString> HTMLFormElement::supportedPropertyNames() const
+{
+    // FIXME: Should be implemented (only needed for enumeration with includeDontEnumProperties mode
+    // since this class is annotated with LegacyUnenumerableNamedProperties).
+    return { };
+}
+
 void HTMLFormElement::submitImplicitly(Event& event, bool fromImplicitSubmissionTrigger)
 {
     unsigned submissionTriggerCount = 0;
index 944a0ac..bb51798 100644 (file)
@@ -53,6 +53,8 @@ public:
 
     WEBCORE_EXPORT unsigned length() const;
     HTMLElement* item(unsigned index);
+    std::optional<Variant<RefPtr<RadioNodeList>, RefPtr<Element>>> namedItem(const AtomicString&);
+    Vector<AtomicString> supportedPropertyNames() const;
 
     String enctype() const { return m_attributes.encodingType(); }
     WEBCORE_EXPORT void setEnctype(const String&);
index ee1f124..4d4b533 100644 (file)
  */
 
 [
-    CustomNamedGetter,
+    LegacyUnenumerableNamedProperties,
     OverrideBuiltins,
     JSGenerateToNativeObject,
 ] interface HTMLFormElement : HTMLElement {
     [Reflect=accept_charset] attribute DOMString acceptCharset;
     [Reflect, URL] attribute USVString action;
     attribute DOMString autocomplete;
-
     attribute DOMString enctype;
     [ImplementedAs=enctype] attribute DOMString encoding;
     attribute DOMString method;
-
     [Reflect] attribute DOMString name;
     [Reflect] attribute boolean noValidate;
     [Reflect] attribute DOMString target;
 
     readonly attribute HTMLFormControlsCollection elements;
-    readonly attribute long length;
-
-    getter Element (unsigned long index);
+    readonly attribute unsigned long length;
+    getter Element? (unsigned long index);
+    getter (RadioNodeList or Element)? (DOMString name);
 
     [ImplementedAs=submitFromJavaScript] void submit();
     void reset();
index 6c37e76..ad2a31f 100644 (file)
@@ -425,11 +425,18 @@ HTMLOptionElement* HTMLSelectElement::item(unsigned index)
     return options()->item(index);
 }
 
-ExceptionOr<void> HTMLSelectElement::setOption(unsigned index, HTMLOptionElement& option)
+ExceptionOr<void> HTMLSelectElement::setItem(unsigned index, HTMLOptionElement* option)
 {
+    if (!option) {
+        remove(index);
+        return { };
+    }
+
     if (index > maxSelectItems - 1)
         index = maxSelectItems - 1;
+
     int diff = index - length();
+    
     RefPtr<HTMLOptionElement> before;
     // Out of array bounds? First insert empty dummies.
     if (diff > 0) {
@@ -441,12 +448,15 @@ ExceptionOr<void> HTMLSelectElement::setOption(unsigned index, HTMLOptionElement
         before = item(index + 1);
         remove(index);
     }
+
     // Finally add the new element.
-    auto result = add(&option, HTMLElementOrInt { before.get() });
+    auto result = add(option, HTMLElementOrInt { before.get() });
     if (result.hasException())
         return result;
-    if (diff >= 0 && option.selected())
-        optionSelectionStateChanged(option, true);
+
+    if (diff >= 0 && option->selected())
+        optionSelectionStateChanged(*option, true);
+
     return { };
 }
 
@@ -454,6 +464,7 @@ ExceptionOr<void> HTMLSelectElement::setLength(unsigned newLength)
 {
     if (newLength > maxSelectItems)
         newLength = maxSelectItems;
+
     int diff = length() - newLength;
 
     if (diff < 0) { // Add dummy elements.
index 63c488d..7d5dcef 100644 (file)
@@ -80,7 +80,8 @@ public:
 
     WEBCORE_EXPORT void setSize(unsigned);
 
-    ExceptionOr<void> setOption(unsigned index, HTMLOptionElement&);
+    // Called by the bindings for the unnamed index-setter.
+    ExceptionOr<void> setItem(unsigned index, HTMLOptionElement*);
     ExceptionOr<void> setLength(unsigned);
 
     WEBCORE_EXPORT HTMLOptionElement* namedItem(const AtomicString& name);
index 9721296..613829a 100644 (file)
@@ -42,6 +42,7 @@
     JSCustomMarkFunction,
     JSCustomToNativeObject,
     JSLegacyParent=JSDOMWindowBase,
+    LegacyUnenumerableNamedProperties,
     PrimaryGlobal,
 ] interface DOMWindow : EventTarget {
     [Replaceable] readonly attribute Screen screen;
index e2dae7a..e5efc56 100644 (file)
 
 [
     GenerateIsReachable=ImplFrame,
+    LegacyUnenumerableNamedProperties,
     InterfaceName=MimeTypeArray,
 ] interface DOMMimeTypeArray {
     readonly attribute unsigned long length;
-    getter DOMMimeType item(unsigned long index);
-    getter DOMMimeType namedItem(DOMString name);
+    getter DOMMimeType? item(unsigned long index);
+    getter DOMMimeType? namedItem(DOMString name);
 };
-
index 7c81e20..0f5a0b2 100644 (file)
 
 [
     InterfaceName=Plugin,
+    LegacyUnenumerableNamedProperties
 ] interface DOMPlugin {
     readonly attribute DOMString name;
     readonly attribute DOMString filename;
     readonly attribute DOMString description;
     readonly attribute unsigned long length;
-    getter DOMMimeType item(unsigned long index);
-    getter DOMMimeType namedItem(DOMString name);
+    getter DOMMimeType? item(unsigned long index);
+    getter DOMMimeType? namedItem(DOMString name);
 };
 
index e370bd1..6946ff5 100644 (file)
 
 [
     GenerateIsReachable=ImplFrame,
+    LegacyUnenumerableNamedProperties,
     InterfaceName=PluginArray,
 ] interface DOMPluginArray {
     readonly attribute unsigned long length;
-    getter DOMPlugin item(unsigned long index);
-    getter DOMPlugin namedItem(DOMString name);
+    getter DOMPlugin? item(unsigned long index);
+    getter DOMPlugin? namedItem(DOMString name);
 
     void refresh(optional boolean reload = false);
 };