From 2cadbcdc45c13b651e7a83bc2c3f8555807ff2f2 Mon Sep 17 00:00:00 2001 From: Freddy Harris Date: Mon, 16 Mar 2026 12:16:37 +0100 Subject: [PATCH 1/2] remove htmlCollectionOf --- src/DOMAPI.res | 48 +++++++++-------------- src/DOMAPI/Document.res | 7 ++-- src/DOMAPI/Element.res | 6 +-- src/DOMAPI/HTMLCollection.res | 4 +- src/DOMAPI/HTMLCollectionOf.res | 16 -------- src/DOMAPI/HTMLFormControlsCollection.res | 2 +- 6 files changed, 29 insertions(+), 54 deletions(-) delete mode 100644 src/DOMAPI/HTMLCollectionOf.res diff --git a/src/DOMAPI.res b/src/DOMAPI.res index 80fdb61..2d223d9 100644 --- a/src/DOMAPI.res +++ b/src/DOMAPI.res @@ -2663,7 +2663,7 @@ Element is the most general base class from which all objects in a Document inhe Returns the child elements. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/children) */ - children: htmlCollection, + children: htmlCollection, /** Returns the first child that is an element, and null otherwise. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/firstElementChild) @@ -3001,7 +3001,7 @@ Similarly, when the focused element is in a different node tree than documentOrS A generic collection (array-like object similar to arguments) of elements (in document order) and offers methods and properties for selecting from the list. [See HTMLCollection on MDN](https://developer.mozilla.org/docs/Web/API/HTMLCollection) */ -@editor.completeFrom(HTMLCollection) and htmlCollection = { +@editor.completeFrom(HTMLCollection) and htmlCollection<'t> = { /** Sets or retrieves the number of objects in a collection. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLCollection/length) @@ -3009,16 +3009,6 @@ A generic collection (array-like object similar to arguments) of elements (in do length: int, } -and htmlCollectionOf<'t> = { - // Base properties from HTMLCollection - /** - Sets or retrieves the number of objects in a collection. - [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLCollection/length) - */ - length: int, - // End base properties from HTMLCollection -} - /** A collection of HTML form control elements. [See HTMLFormControlsCollection on MDN](https://developer.mozilla.org/docs/Web/API/HTMLFormControlsCollection) @@ -5808,32 +5798,32 @@ If the contents are sandboxed into a unique origin (e.g. in an iframe with the s Retrieves a collection, in source order, of img objects in the document. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/images) */ - images: htmlCollectionOf, + images: htmlCollection, /** Retrieves a collection of all embed objects in the document. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/embeds) */ - embeds: htmlCollectionOf, + embeds: htmlCollection, /** Return an HTMLCollection of the embed elements in the Document. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/plugins) */ - plugins: htmlCollectionOf, + plugins: htmlCollection, /** Retrieves a collection of all a objects that specify the href property and all area objects in the document. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/links) */ - links: htmlCollectionOf, + links: htmlCollection, /** Retrieves a collection, in source order, of all form objects in the document. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/forms) */ - forms: htmlCollectionOf, + forms: htmlCollection, /** Retrieves a collection of all script objects in the document. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/scripts) */ - scripts: htmlCollectionOf, + scripts: htmlCollection, /** Returns the script element, or the SVG script element, that is currently executing, as long as the element represents a classic script. In the case of reentrant script execution, returns the one that most recently started executing amongst those that have not yet finished executing. @@ -5910,7 +5900,7 @@ Similarly, when the focused element is in a different node tree than documentOrS Returns the child elements. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/children) */ - children: htmlCollection, + children: htmlCollection, /** Returns the first child that is an element, and null otherwise. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/firstElementChild) @@ -6453,7 +6443,7 @@ A minimal document object that has no parent. It is used as a lightweight versio Returns the child elements. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/children) */ - children: htmlCollection, + children: htmlCollection, /** Returns the first child that is an element, and null otherwise. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/firstElementChild) @@ -7383,12 +7373,12 @@ type rec htmlTableElement = { Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLTableElement/tBodies) */ - tBodies: htmlCollectionOf, + tBodies: htmlCollection, /** Sets or retrieves the number of horizontal rows contained in the object. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLTableElement/rows) */ - rows: htmlCollectionOf, + rows: htmlCollection, } /** @@ -7409,7 +7399,7 @@ Provides special properties and methods (beyond the HTMLElement interface it als Sets or retrieves the number of horizontal rows contained in the object. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLTableSectionElement/rows) */ - rows: htmlCollectionOf, + rows: htmlCollection, } /** @@ -7470,7 +7460,7 @@ Provides special properties and methods (beyond the HTMLElement interface it als Retrieves a collection of all cells in the table row. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLTableRowElement/cells) */ - cells: htmlCollectionOf, + cells: htmlCollection, } /** @@ -7976,7 +7966,7 @@ Provides special properties (beyond the HTMLElement object interface it also has Returns an HTMLCollection of the option elements of the datalist element. [Read more on MDN](https://developer.mozilla.org/docs/Web/API/HTMLDataListElement/options) */ - options: htmlCollectionOf, + options: htmlCollection, } /** @@ -8033,7 +8023,7 @@ A