From ad34fdad48bd63fa81c4023b969de07fb4bdaa44 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Fri, 25 Apr 2025 10:07:43 -0400 Subject: [PATCH] LibWeb: Convert trivial attributes to FrozenArray --- Libraries/LibWeb/CSS/CSSLayerStatementRule.idl | 5 ++--- Libraries/LibWeb/Clipboard/ClipboardItem.idl | 3 +-- Libraries/LibWeb/HTML/DataTransfer.idl | 2 +- Libraries/LibWeb/HTML/NavigatorLanguage.idl | 5 ++--- .../LibWeb/IntersectionObserver/IntersectionObserver.idl | 3 +-- Libraries/LibWeb/ResizeObserver/ResizeObserverEntry.idl | 9 +++------ 6 files changed, 10 insertions(+), 17 deletions(-) diff --git a/Libraries/LibWeb/CSS/CSSLayerStatementRule.idl b/Libraries/LibWeb/CSS/CSSLayerStatementRule.idl index 043ccb0afaa..5b8a2b00320 100644 --- a/Libraries/LibWeb/CSS/CSSLayerStatementRule.idl +++ b/Libraries/LibWeb/CSS/CSSLayerStatementRule.idl @@ -3,6 +3,5 @@ // https://drafts.csswg.org/css-cascade-5/#the-csslayerstatementrule-interface [Exposed=Window] interface CSSLayerStatementRule : CSSRule { - // FIXME: Should be a FrozenArray - readonly attribute sequence nameList; -}; \ No newline at end of file + readonly attribute FrozenArray nameList; +}; diff --git a/Libraries/LibWeb/Clipboard/ClipboardItem.idl b/Libraries/LibWeb/Clipboard/ClipboardItem.idl index 542b88e65b5..0fde69e5ff1 100644 --- a/Libraries/LibWeb/Clipboard/ClipboardItem.idl +++ b/Libraries/LibWeb/Clipboard/ClipboardItem.idl @@ -7,8 +7,7 @@ interface ClipboardItem { optional ClipboardItemOptions options = {}); readonly attribute PresentationStyle presentationStyle; - // FIXME: Should be a FrozenArray - readonly attribute sequence types; + readonly attribute FrozenArray types; Promise getType(DOMString type); diff --git a/Libraries/LibWeb/HTML/DataTransfer.idl b/Libraries/LibWeb/HTML/DataTransfer.idl index 460be573368..4e06c7054f9 100644 --- a/Libraries/LibWeb/HTML/DataTransfer.idl +++ b/Libraries/LibWeb/HTML/DataTransfer.idl @@ -14,7 +14,7 @@ interface DataTransfer { [FIXME] undefined setDragImage(Element image, long x, long y); // old interface - readonly attribute sequence types; // FIXME: This should be FrozenArray + readonly attribute FrozenArray types; DOMString getData(DOMString format); [FIXME] undefined setData(DOMString format, DOMString data); [FIXME] undefined clearData(optional DOMString format); diff --git a/Libraries/LibWeb/HTML/NavigatorLanguage.idl b/Libraries/LibWeb/HTML/NavigatorLanguage.idl index 6f7b64db758..034c5cb837e 100644 --- a/Libraries/LibWeb/HTML/NavigatorLanguage.idl +++ b/Libraries/LibWeb/HTML/NavigatorLanguage.idl @@ -1,7 +1,6 @@ // https://html.spec.whatwg.org/multipage/system-state.html#navigatorlanguage interface mixin NavigatorLanguage { readonly attribute DOMString language; - // FIXME: readonly attribute FrozenArray languages; - // This is supposed to be a FrozenArray that always returns the same object - readonly attribute sequence languages; + // FIXME: This is supposed always return the same object + readonly attribute FrozenArray languages; }; diff --git a/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.idl b/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.idl index f17877a1b71..442ecc61d17 100644 --- a/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.idl +++ b/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.idl @@ -13,8 +13,7 @@ interface IntersectionObserver { readonly attribute (Element or Document)? root; readonly attribute DOMString rootMargin; readonly attribute DOMString scrollMargin; - // FIXME: `sequence` should be `FrozenArray` - readonly attribute sequence thresholds; + readonly attribute FrozenArray thresholds; readonly attribute long delay; readonly attribute boolean trackVisibility; undefined observe(Element target); diff --git a/Libraries/LibWeb/ResizeObserver/ResizeObserverEntry.idl b/Libraries/LibWeb/ResizeObserver/ResizeObserverEntry.idl index 8ff54e12df1..79571062ac1 100644 --- a/Libraries/LibWeb/ResizeObserver/ResizeObserverEntry.idl +++ b/Libraries/LibWeb/ResizeObserver/ResizeObserverEntry.idl @@ -6,10 +6,7 @@ interface ResizeObserverEntry { readonly attribute Element target; readonly attribute DOMRectReadOnly contentRect; - // FIXME: Return FrozenArray instead of any. - [ImplementedAs=border_box_size_js_array] readonly attribute any borderBoxSize; - // FIXME: Return FrozenArray instead of any. - [ImplementedAs=content_box_size_js_array] readonly attribute any contentBoxSize; - // FIXME: Return FrozenArray instead of any. - [ImplementedAs=device_pixel_content_box_size_js_array] readonly attribute any devicePixelContentBoxSize; + readonly attribute FrozenArray borderBoxSize; + readonly attribute FrozenArray contentBoxSize; + readonly attribute FrozenArray devicePixelContentBoxSize; };