From c0d7f748edd86ea744f4dedc8a2bfd5b612d2812 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 16 Mar 2024 13:13:08 +0100 Subject: [PATCH] LibWeb: Avoid FlyString lookups when setting IDL interface prototypes This commit introduces a WEB_SET_PROTOTYPE_FOR_INTERFACE macro that caches the interface name in a local static FlyString. This means that we only pay for FlyString-from-literal lookup once per browser lifetime instead of every time the interface is instantiated. --- Userland/Libraries/LibWeb/Animations/Animation.cpp | 2 +- Userland/Libraries/LibWeb/Animations/AnimationEffect.cpp | 2 +- .../LibWeb/Animations/AnimationPlaybackEvent.cpp | 2 +- .../Libraries/LibWeb/Animations/AnimationTimeline.cpp | 2 +- Userland/Libraries/LibWeb/Animations/DocumentTimeline.cpp | 2 +- Userland/Libraries/LibWeb/Animations/KeyframeEffect.cpp | 2 +- Userland/Libraries/LibWeb/Bindings/Intrinsics.h | 8 ++++++++ Userland/Libraries/LibWeb/CSS/AnimationEvent.cpp | 2 +- Userland/Libraries/LibWeb/CSS/CSSAnimation.cpp | 2 +- Userland/Libraries/LibWeb/CSS/CSSConditionRule.cpp | 2 +- Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp | 2 +- Userland/Libraries/LibWeb/CSS/CSSGroupingRule.cpp | 2 +- Userland/Libraries/LibWeb/CSS/CSSImportRule.cpp | 2 +- Userland/Libraries/LibWeb/CSS/CSSKeyframeRule.cpp | 2 +- Userland/Libraries/LibWeb/CSS/CSSKeyframesRule.cpp | 2 +- Userland/Libraries/LibWeb/CSS/CSSMediaRule.cpp | 2 +- Userland/Libraries/LibWeb/CSS/CSSNamespaceRule.cpp | 2 +- Userland/Libraries/LibWeb/CSS/CSSRuleList.cpp | 2 +- Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp | 2 +- Userland/Libraries/LibWeb/CSS/CSSStyleRule.cpp | 2 +- Userland/Libraries/LibWeb/CSS/CSSStyleSheet.cpp | 2 +- Userland/Libraries/LibWeb/CSS/CSSSupportsRule.cpp | 2 +- Userland/Libraries/LibWeb/CSS/MediaList.cpp | 2 +- Userland/Libraries/LibWeb/CSS/MediaQueryList.cpp | 2 +- Userland/Libraries/LibWeb/CSS/MediaQueryListEvent.cpp | 2 +- Userland/Libraries/LibWeb/CSS/Screen.cpp | 2 +- Userland/Libraries/LibWeb/CSS/StyleSheetList.cpp | 2 +- Userland/Libraries/LibWeb/CSS/VisualViewport.cpp | 2 +- Userland/Libraries/LibWeb/Clipboard/Clipboard.cpp | 2 +- Userland/Libraries/LibWeb/Crypto/Crypto.cpp | 2 +- Userland/Libraries/LibWeb/Crypto/CryptoKey.cpp | 2 +- Userland/Libraries/LibWeb/Crypto/SubtleCrypto.cpp | 2 +- Userland/Libraries/LibWeb/DOM/AbortController.cpp | 2 +- Userland/Libraries/LibWeb/DOM/AbortSignal.cpp | 2 +- Userland/Libraries/LibWeb/DOM/AbstractRange.cpp | 2 +- Userland/Libraries/LibWeb/DOM/Attr.cpp | 2 +- Userland/Libraries/LibWeb/DOM/CDATASection.cpp | 2 +- Userland/Libraries/LibWeb/DOM/CharacterData.cpp | 2 +- Userland/Libraries/LibWeb/DOM/Comment.cpp | 2 +- Userland/Libraries/LibWeb/DOM/CustomEvent.cpp | 2 +- Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp | 2 +- Userland/Libraries/LibWeb/DOM/DOMTokenList.cpp | 2 +- Userland/Libraries/LibWeb/DOM/Document.cpp | 2 +- Userland/Libraries/LibWeb/DOM/DocumentFragment.cpp | 2 +- Userland/Libraries/LibWeb/DOM/DocumentType.cpp | 2 +- Userland/Libraries/LibWeb/DOM/Element.cpp | 2 +- Userland/Libraries/LibWeb/DOM/Event.cpp | 2 +- Userland/Libraries/LibWeb/DOM/EventTarget.cpp | 2 +- Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp | 2 +- .../Libraries/LibWeb/DOM/HTMLFormControlsCollection.cpp | 2 +- Userland/Libraries/LibWeb/DOM/MutationObserver.cpp | 2 +- Userland/Libraries/LibWeb/DOM/MutationRecord.cpp | 2 +- Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp | 2 +- Userland/Libraries/LibWeb/DOM/NodeIterator.cpp | 2 +- Userland/Libraries/LibWeb/DOM/NodeList.cpp | 2 +- Userland/Libraries/LibWeb/DOM/ProcessingInstruction.cpp | 2 +- Userland/Libraries/LibWeb/DOM/RadioNodeList.cpp | 2 +- Userland/Libraries/LibWeb/DOM/Range.cpp | 2 +- Userland/Libraries/LibWeb/DOM/ShadowRoot.cpp | 2 +- Userland/Libraries/LibWeb/DOM/StaticRange.cpp | 2 +- Userland/Libraries/LibWeb/DOM/Text.cpp | 2 +- Userland/Libraries/LibWeb/DOM/TreeWalker.cpp | 2 +- Userland/Libraries/LibWeb/DOM/XMLDocument.cpp | 2 +- Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.cpp | 2 +- Userland/Libraries/LibWeb/DOMURL/DOMURL.cpp | 2 +- Userland/Libraries/LibWeb/DOMURL/URLSearchParams.cpp | 2 +- .../Libraries/LibWeb/DOMURL/URLSearchParamsIterator.cpp | 2 +- Userland/Libraries/LibWeb/Encoding/TextDecoder.cpp | 2 +- Userland/Libraries/LibWeb/Encoding/TextEncoder.cpp | 2 +- Userland/Libraries/LibWeb/Fetch/Headers.cpp | 2 +- Userland/Libraries/LibWeb/Fetch/HeadersIterator.cpp | 2 +- Userland/Libraries/LibWeb/Fetch/Request.cpp | 2 +- Userland/Libraries/LibWeb/Fetch/Response.cpp | 2 +- Userland/Libraries/LibWeb/FileAPI/Blob.cpp | 2 +- Userland/Libraries/LibWeb/FileAPI/File.cpp | 2 +- Userland/Libraries/LibWeb/FileAPI/FileList.cpp | 2 +- Userland/Libraries/LibWeb/FileAPI/FileReader.cpp | 2 +- Userland/Libraries/LibWeb/Geometry/DOMMatrix.cpp | 2 +- Userland/Libraries/LibWeb/Geometry/DOMMatrixReadOnly.cpp | 2 +- Userland/Libraries/LibWeb/Geometry/DOMPoint.cpp | 2 +- Userland/Libraries/LibWeb/Geometry/DOMPointReadOnly.cpp | 2 +- Userland/Libraries/LibWeb/Geometry/DOMQuad.cpp | 2 +- Userland/Libraries/LibWeb/Geometry/DOMRect.cpp | 2 +- Userland/Libraries/LibWeb/Geometry/DOMRectList.cpp | 2 +- Userland/Libraries/LibWeb/Geometry/DOMRectReadOnly.cpp | 2 +- Userland/Libraries/LibWeb/HTML/AudioTrack.cpp | 2 +- Userland/Libraries/LibWeb/HTML/AudioTrackList.cpp | 2 +- Userland/Libraries/LibWeb/HTML/CanvasGradient.cpp | 2 +- Userland/Libraries/LibWeb/HTML/CanvasPattern.cpp | 2 +- Userland/Libraries/LibWeb/HTML/CloseEvent.cpp | 2 +- .../LibWeb/HTML/CustomElements/CustomElementRegistry.cpp | 2 +- Userland/Libraries/LibWeb/HTML/DOMParser.cpp | 2 +- Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp | 2 +- Userland/Libraries/LibWeb/HTML/DataTransfer.cpp | 2 +- Userland/Libraries/LibWeb/HTML/ErrorEvent.cpp | 2 +- Userland/Libraries/LibWeb/HTML/FormDataEvent.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLAreaElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLAudioElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLBRElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLBaseElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLButtonElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLDListElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLDataElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLDataListElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLDialogElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLDirectoryElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLDivElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLDocument.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLEmbedElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLFieldSetElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLFontElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLFrameElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLHRElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLHeadElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLHtmlElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLLIElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLLabelElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLLegendElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLMapElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLMarqueeElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLMenuElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLMetaElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLMeterElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLModElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLOListElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLOptGroupElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLOptionElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLOptionsCollection.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLOutputElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLParamElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLPictureElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLPreElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLProgressElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLQuoteElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLSlotElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLSourceElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLSpanElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLStyleElement.cpp | 2 +- .../Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLTableColElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.cpp | 2 +- .../Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLTemplateElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLTimeElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLTitleElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLTrackElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLUListElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLUnknownElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/History.cpp | 2 +- Userland/Libraries/LibWeb/HTML/ImageData.cpp | 2 +- Userland/Libraries/LibWeb/HTML/Location.cpp | 2 +- Userland/Libraries/LibWeb/HTML/MediaError.cpp | 2 +- Userland/Libraries/LibWeb/HTML/MessageChannel.cpp | 2 +- Userland/Libraries/LibWeb/HTML/MessageEvent.cpp | 2 +- Userland/Libraries/LibWeb/HTML/MessagePort.cpp | 2 +- Userland/Libraries/LibWeb/HTML/MimeType.cpp | 2 +- Userland/Libraries/LibWeb/HTML/MimeTypeArray.cpp | 2 +- Userland/Libraries/LibWeb/HTML/NavigateEvent.cpp | 2 +- Userland/Libraries/LibWeb/HTML/Navigation.cpp | 2 +- .../LibWeb/HTML/NavigationCurrentEntryChangeEvent.cpp | 2 +- Userland/Libraries/LibWeb/HTML/NavigationDestination.cpp | 2 +- Userland/Libraries/LibWeb/HTML/NavigationHistoryEntry.cpp | 2 +- Userland/Libraries/LibWeb/HTML/NavigationTransition.cpp | 2 +- Userland/Libraries/LibWeb/HTML/Navigator.cpp | 2 +- Userland/Libraries/LibWeb/HTML/PageTransitionEvent.cpp | 2 +- Userland/Libraries/LibWeb/HTML/Plugin.cpp | 2 +- Userland/Libraries/LibWeb/HTML/PluginArray.cpp | 2 +- Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.cpp | 2 +- Userland/Libraries/LibWeb/HTML/Storage.cpp | 2 +- Userland/Libraries/LibWeb/HTML/SubmitEvent.cpp | 2 +- Userland/Libraries/LibWeb/HTML/TextMetrics.cpp | 2 +- Userland/Libraries/LibWeb/HTML/TimeRanges.cpp | 2 +- Userland/Libraries/LibWeb/HTML/ToggleEvent.cpp | 2 +- Userland/Libraries/LibWeb/HTML/TrackEvent.cpp | 2 +- Userland/Libraries/LibWeb/HTML/VideoTrack.cpp | 2 +- Userland/Libraries/LibWeb/HTML/VideoTrackList.cpp | 2 +- Userland/Libraries/LibWeb/HTML/Window.cpp | 2 +- Userland/Libraries/LibWeb/HTML/Worker.cpp | 2 +- Userland/Libraries/LibWeb/HTML/WorkerGlobalScope.cpp | 2 +- Userland/Libraries/LibWeb/HTML/WorkerNavigator.cpp | 2 +- .../Libraries/LibWeb/HighResolutionTime/Performance.cpp | 2 +- Userland/Libraries/LibWeb/Internals/Inspector.cpp | 2 +- Userland/Libraries/LibWeb/Internals/Internals.cpp | 2 +- .../LibWeb/IntersectionObserver/IntersectionObserver.cpp | 2 +- .../IntersectionObserver/IntersectionObserverEntry.cpp | 2 +- Userland/Libraries/LibWeb/MathML/MathMLElement.cpp | 2 +- .../LibWeb/NavigationTiming/PerformanceTiming.cpp | 2 +- .../LibWeb/PerformanceTimeline/PerformanceEntry.cpp | 2 +- .../LibWeb/PerformanceTimeline/PerformanceObserver.cpp | 2 +- .../PerformanceTimeline/PerformanceObserverEntryList.cpp | 2 +- .../Libraries/LibWeb/RequestIdleCallback/IdleDeadline.cpp | 2 +- .../Libraries/LibWeb/ResizeObserver/ResizeObserver.cpp | 2 +- .../LibWeb/ResizeObserver/ResizeObserverEntry.cpp | 2 +- .../LibWeb/ResizeObserver/ResizeObserverSize.cpp | 2 +- Userland/Libraries/LibWeb/SVG/SVGAnimatedLength.cpp | 2 +- Userland/Libraries/LibWeb/SVG/SVGAnimatedNumber.cpp | 2 +- Userland/Libraries/LibWeb/SVG/SVGAnimatedRect.cpp | 2 +- Userland/Libraries/LibWeb/SVG/SVGAnimatedString.cpp | 2 +- Userland/Libraries/LibWeb/SVG/SVGCircleElement.cpp | 2 +- Userland/Libraries/LibWeb/SVG/SVGClipPathElement.cpp | 2 +- Userland/Libraries/LibWeb/SVG/SVGDefsElement.cpp | 2 +- Userland/Libraries/LibWeb/SVG/SVGElement.cpp | 2 +- Userland/Libraries/LibWeb/SVG/SVGEllipseElement.cpp | 2 +- Userland/Libraries/LibWeb/SVG/SVGForeignObjectElement.cpp | 2 +- Userland/Libraries/LibWeb/SVG/SVGGeometryElement.cpp | 2 +- Userland/Libraries/LibWeb/SVG/SVGGradientElement.cpp | 2 +- Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp | 2 +- Userland/Libraries/LibWeb/SVG/SVGLength.cpp | 2 +- Userland/Libraries/LibWeb/SVG/SVGLineElement.cpp | 2 +- .../Libraries/LibWeb/SVG/SVGLinearGradientElement.cpp | 2 +- Userland/Libraries/LibWeb/SVG/SVGMaskElement.cpp | 2 +- Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp | 2 +- Userland/Libraries/LibWeb/SVG/SVGPolygonElement.cpp | 2 +- Userland/Libraries/LibWeb/SVG/SVGPolylineElement.cpp | 2 +- .../Libraries/LibWeb/SVG/SVGRadialGradientElement.cpp | 2 +- Userland/Libraries/LibWeb/SVG/SVGRectElement.cpp | 2 +- Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp | 2 +- Userland/Libraries/LibWeb/SVG/SVGScriptElement.cpp | 2 +- Userland/Libraries/LibWeb/SVG/SVGStopElement.cpp | 2 +- Userland/Libraries/LibWeb/SVG/SVGStyleElement.cpp | 2 +- Userland/Libraries/LibWeb/SVG/SVGSymbolElement.cpp | 2 +- Userland/Libraries/LibWeb/SVG/SVGTSpanElement.cpp | 2 +- Userland/Libraries/LibWeb/SVG/SVGTextContentElement.cpp | 2 +- Userland/Libraries/LibWeb/SVG/SVGTextElement.cpp | 2 +- Userland/Libraries/LibWeb/SVG/SVGTextPathElement.cpp | 2 +- .../Libraries/LibWeb/SVG/SVGTextPositioningElement.cpp | 2 +- Userland/Libraries/LibWeb/SVG/SVGTitleElement.cpp | 2 +- Userland/Libraries/LibWeb/SVG/SVGUseElement.cpp | 2 +- Userland/Libraries/LibWeb/Selection/Selection.cpp | 2 +- .../LibWeb/Streams/ByteLengthQueuingStrategy.cpp | 2 +- .../Libraries/LibWeb/Streams/CountQueuingStrategy.cpp | 2 +- .../LibWeb/Streams/ReadableByteStreamController.cpp | 2 +- Userland/Libraries/LibWeb/Streams/ReadableStream.cpp | 2 +- .../Libraries/LibWeb/Streams/ReadableStreamBYOBReader.cpp | 2 +- .../LibWeb/Streams/ReadableStreamBYOBRequest.cpp | 2 +- .../LibWeb/Streams/ReadableStreamDefaultController.cpp | 2 +- .../LibWeb/Streams/ReadableStreamDefaultReader.cpp | 2 +- Userland/Libraries/LibWeb/Streams/TransformStream.cpp | 2 +- .../LibWeb/Streams/TransformStreamDefaultController.cpp | 2 +- Userland/Libraries/LibWeb/Streams/WritableStream.cpp | 2 +- .../LibWeb/Streams/WritableStreamDefaultWriter.cpp | 2 +- Userland/Libraries/LibWeb/UIEvents/FocusEvent.cpp | 2 +- Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.cpp | 2 +- Userland/Libraries/LibWeb/UIEvents/MouseEvent.cpp | 2 +- Userland/Libraries/LibWeb/UIEvents/UIEvent.cpp | 2 +- Userland/Libraries/LibWeb/UIEvents/WheelEvent.cpp | 2 +- Userland/Libraries/LibWeb/UserTiming/PerformanceMark.cpp | 2 +- .../Libraries/LibWeb/UserTiming/PerformanceMeasure.cpp | 2 +- Userland/Libraries/LibWeb/WebAssembly/Instance.cpp | 2 +- Userland/Libraries/LibWeb/WebAssembly/Memory.cpp | 2 +- Userland/Libraries/LibWeb/WebAssembly/Module.cpp | 2 +- Userland/Libraries/LibWeb/WebAssembly/Table.cpp | 2 +- Userland/Libraries/LibWeb/WebAudio/AudioContext.cpp | 2 +- Userland/Libraries/LibWeb/WebAudio/BaseAudioContext.cpp | 2 +- Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.cpp | 2 +- Userland/Libraries/LibWeb/WebGL/WebGLRenderingContext.cpp | 2 +- Userland/Libraries/LibWeb/WebIDL/DOMException.cpp | 2 +- Userland/Libraries/LibWeb/WebSockets/WebSocket.cpp | 2 +- Userland/Libraries/LibWeb/XHR/FormData.cpp | 2 +- Userland/Libraries/LibWeb/XHR/FormDataIterator.cpp | 2 +- Userland/Libraries/LibWeb/XHR/ProgressEvent.cpp | 2 +- Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp | 2 +- Userland/Libraries/LibWeb/XHR/XMLHttpRequestUpload.cpp | 2 +- 284 files changed, 291 insertions(+), 283 deletions(-) diff --git a/Userland/Libraries/LibWeb/Animations/Animation.cpp b/Userland/Libraries/LibWeb/Animations/Animation.cpp index a64b851ee40..f2dc5d3ad2f 100644 --- a/Userland/Libraries/LibWeb/Animations/Animation.cpp +++ b/Userland/Libraries/LibWeb/Animations/Animation.cpp @@ -1331,7 +1331,7 @@ Animation::Animation(JS::Realm& realm) void Animation::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "Animation"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(Animation); } void Animation::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/Animations/AnimationEffect.cpp b/Userland/Libraries/LibWeb/Animations/AnimationEffect.cpp index 4d018785de9..5d0ea7115ad 100644 --- a/Userland/Libraries/LibWeb/Animations/AnimationEffect.cpp +++ b/Userland/Libraries/LibWeb/Animations/AnimationEffect.cpp @@ -604,7 +604,7 @@ AnimationEffect::AnimationEffect(JS::Realm& realm) void AnimationEffect::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "AnimationEffect"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(AnimationEffect); } } diff --git a/Userland/Libraries/LibWeb/Animations/AnimationPlaybackEvent.cpp b/Userland/Libraries/LibWeb/Animations/AnimationPlaybackEvent.cpp index 99c6994b62e..38feec290d5 100644 --- a/Userland/Libraries/LibWeb/Animations/AnimationPlaybackEvent.cpp +++ b/Userland/Libraries/LibWeb/Animations/AnimationPlaybackEvent.cpp @@ -32,7 +32,7 @@ AnimationPlaybackEvent::AnimationPlaybackEvent(JS::Realm& realm, FlyString const void AnimationPlaybackEvent::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "AnimationPlaybackEvent"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(AnimationPlaybackEvent); } } diff --git a/Userland/Libraries/LibWeb/Animations/AnimationTimeline.cpp b/Userland/Libraries/LibWeb/Animations/AnimationTimeline.cpp index 2e419d72eff..7bf4f001f95 100644 --- a/Userland/Libraries/LibWeb/Animations/AnimationTimeline.cpp +++ b/Userland/Libraries/LibWeb/Animations/AnimationTimeline.cpp @@ -57,7 +57,7 @@ void AnimationTimeline::finalize() void AnimationTimeline::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "AnimationTimeline"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(AnimationTimeline); } void AnimationTimeline::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/Animations/DocumentTimeline.cpp b/Userland/Libraries/LibWeb/Animations/DocumentTimeline.cpp index 5f0bb816ee1..08d51b5a9c7 100644 --- a/Userland/Libraries/LibWeb/Animations/DocumentTimeline.cpp +++ b/Userland/Libraries/LibWeb/Animations/DocumentTimeline.cpp @@ -77,7 +77,7 @@ DocumentTimeline::DocumentTimeline(JS::Realm& realm, DOM::Document& document, Hi void DocumentTimeline::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "DocumentTimeline"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(DocumentTimeline); } } diff --git a/Userland/Libraries/LibWeb/Animations/KeyframeEffect.cpp b/Userland/Libraries/LibWeb/Animations/KeyframeEffect.cpp index 71a12cb2dbb..55cb35d794c 100644 --- a/Userland/Libraries/LibWeb/Animations/KeyframeEffect.cpp +++ b/Userland/Libraries/LibWeb/Animations/KeyframeEffect.cpp @@ -860,7 +860,7 @@ KeyframeEffect::KeyframeEffect(JS::Realm& realm) void KeyframeEffect::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "KeyframeEffect"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(KeyframeEffect); } void KeyframeEffect::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/Bindings/Intrinsics.h b/Userland/Libraries/LibWeb/Bindings/Intrinsics.h index b4531b7c6ea..8dfd13bd786 100644 --- a/Userland/Libraries/LibWeb/Bindings/Intrinsics.h +++ b/Userland/Libraries/LibWeb/Bindings/Intrinsics.h @@ -15,6 +15,14 @@ #include #include +#define WEB_SET_PROTOTYPE_FOR_INTERFACE_WITH_CUSTOM_NAME(interface_class, interface_name) \ + do { \ + static auto name = #interface_name##_fly_string; \ + set_prototype(&Bindings::ensure_web_prototype(realm, name)); \ + } while (0) + +#define WEB_SET_PROTOTYPE_FOR_INTERFACE(interface_name) WEB_SET_PROTOTYPE_FOR_INTERFACE_WITH_CUSTOM_NAME(interface_name, interface_name) + namespace Web::Bindings { class Intrinsics final : public JS::Cell { diff --git a/Userland/Libraries/LibWeb/CSS/AnimationEvent.cpp b/Userland/Libraries/LibWeb/CSS/AnimationEvent.cpp index 6ed52600d5d..aeadc1b694b 100644 --- a/Userland/Libraries/LibWeb/CSS/AnimationEvent.cpp +++ b/Userland/Libraries/LibWeb/CSS/AnimationEvent.cpp @@ -30,7 +30,7 @@ AnimationEvent::AnimationEvent(JS::Realm& realm, FlyString const& type, Animatio void AnimationEvent::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "AnimationEvent"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(AnimationEvent); } } diff --git a/Userland/Libraries/LibWeb/CSS/CSSAnimation.cpp b/Userland/Libraries/LibWeb/CSS/CSSAnimation.cpp index f8de7504b3a..f56afa98c85 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSAnimation.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSAnimation.cpp @@ -73,7 +73,7 @@ CSSAnimation::CSSAnimation(JS::Realm& realm) void CSSAnimation::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "CSSAnimation"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(CSSAnimation); } void CSSAnimation::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/CSS/CSSConditionRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSConditionRule.cpp index 2a4f2576aaa..b926ffc521f 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSConditionRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSConditionRule.cpp @@ -31,7 +31,7 @@ void CSSConditionRule::for_each_effective_keyframes_at_rule(Function(realm, "CSSConditionRule"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(CSSConditionRule); } } diff --git a/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp index 75d46146ac0..a17284f7726 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp @@ -30,7 +30,7 @@ CSSFontFaceRule::CSSFontFaceRule(JS::Realm& realm, FontFace&& font_face) void CSSFontFaceRule::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "CSSFontFaceRule"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(CSSFontFaceRule); } CSSStyleDeclaration* CSSFontFaceRule::style() diff --git a/Userland/Libraries/LibWeb/CSS/CSSGroupingRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSGroupingRule.cpp index 886b5d91561..b0f36ff0f39 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSGroupingRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSGroupingRule.cpp @@ -25,7 +25,7 @@ CSSGroupingRule::CSSGroupingRule(JS::Realm& realm, CSSRuleList& rules) void CSSGroupingRule::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "CSSGroupingRule"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(CSSGroupingRule); } void CSSGroupingRule::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/CSS/CSSImportRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSImportRule.cpp index f13e24fb1f9..6449393d516 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSImportRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSImportRule.cpp @@ -45,7 +45,7 @@ CSSImportRule::CSSImportRule(URL url, DOM::Document& document) void CSSImportRule::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "CSSImportRule"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(CSSImportRule); } void CSSImportRule::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/CSS/CSSKeyframeRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSKeyframeRule.cpp index 1c871c49d58..31583fe7003 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSKeyframeRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSKeyframeRule.cpp @@ -27,7 +27,7 @@ void CSSKeyframeRule::visit_edges(Visitor& visitor) void CSSKeyframeRule::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "CSSKeyframeRule"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(CSSKeyframeRule); } String CSSKeyframeRule::serialized() const diff --git a/Userland/Libraries/LibWeb/CSS/CSSKeyframesRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSKeyframesRule.cpp index 87d27963a82..c41dba48ae2 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSKeyframesRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSKeyframesRule.cpp @@ -27,7 +27,7 @@ void CSSKeyframesRule::visit_edges(Visitor& visitor) void CSSKeyframesRule::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "CSSKeyframesRule"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(CSSKeyframesRule); } String CSSKeyframesRule::serialized() const diff --git a/Userland/Libraries/LibWeb/CSS/CSSMediaRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSMediaRule.cpp index 90a7c4418dd..5d82779c846 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSMediaRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSMediaRule.cpp @@ -28,7 +28,7 @@ CSSMediaRule::CSSMediaRule(JS::Realm& realm, MediaList& media, CSSRuleList& rule void CSSMediaRule::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "CSSMediaRule"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(CSSMediaRule); } void CSSMediaRule::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/CSS/CSSNamespaceRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSNamespaceRule.cpp index f180736878f..abb1ae03e7b 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSNamespaceRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSNamespaceRule.cpp @@ -31,7 +31,7 @@ JS::NonnullGCPtr CSSNamespaceRule::create(JS::Realm& realm, Op void CSSNamespaceRule::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "CSSNamespaceRule"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(CSSNamespaceRule); } // https://www.w3.org/TR/cssom/#serialize-a-css-rule diff --git a/Userland/Libraries/LibWeb/CSS/CSSRuleList.cpp b/Userland/Libraries/LibWeb/CSS/CSSRuleList.cpp index b6a1d3fb0b8..e6ddfccdfb7 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSRuleList.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSRuleList.cpp @@ -42,7 +42,7 @@ JS::NonnullGCPtr CSSRuleList::create_empty(JS::Realm& realm) void CSSRuleList::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "CSSRuleList"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(CSSRuleList); } void CSSRuleList::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp b/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp index a844b889e65..eca0ba2a3bb 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp @@ -28,7 +28,7 @@ CSSStyleDeclaration::CSSStyleDeclaration(JS::Realm& realm) void CSSStyleDeclaration::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "CSSStyleDeclaration"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(CSSStyleDeclaration); } JS::NonnullGCPtr PropertyOwningCSSStyleDeclaration::create(JS::Realm& realm, Vector properties, HashMap custom_properties) diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSStyleRule.cpp index fe9dafc0fbe..c5fb5df6c3a 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleRule.cpp @@ -29,7 +29,7 @@ CSSStyleRule::CSSStyleRule(JS::Realm& realm, Vector>&& s void CSSStyleRule::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "CSSStyleRule"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(CSSStyleRule); } void CSSStyleRule::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.cpp b/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.cpp index 70c8da6329b..34a9c7850e6 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.cpp @@ -111,7 +111,7 @@ CSSStyleSheet::CSSStyleSheet(JS::Realm& realm, CSSRuleList& rules, MediaList& me void CSSStyleSheet::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "CSSStyleSheet"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(CSSStyleSheet); } void CSSStyleSheet::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/CSS/CSSSupportsRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSSupportsRule.cpp index ed1bb01155a..76a0426ce9c 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSSupportsRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSSupportsRule.cpp @@ -27,7 +27,7 @@ CSSSupportsRule::CSSSupportsRule(JS::Realm& realm, NonnullRefPtr&& sup void CSSSupportsRule::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "CSSSupportsRule"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(CSSSupportsRule); } String CSSSupportsRule::condition_text() const diff --git a/Userland/Libraries/LibWeb/CSS/MediaList.cpp b/Userland/Libraries/LibWeb/CSS/MediaList.cpp index 48e3fcebd55..e811afa80d1 100644 --- a/Userland/Libraries/LibWeb/CSS/MediaList.cpp +++ b/Userland/Libraries/LibWeb/CSS/MediaList.cpp @@ -30,7 +30,7 @@ MediaList::MediaList(JS::Realm& realm, Vector>&& media void MediaList::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "MediaList"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(MediaList); } // https://www.w3.org/TR/cssom-1/#dom-medialist-mediatext diff --git a/Userland/Libraries/LibWeb/CSS/MediaQueryList.cpp b/Userland/Libraries/LibWeb/CSS/MediaQueryList.cpp index 3f891e01422..cb8b9de37df 100644 --- a/Userland/Libraries/LibWeb/CSS/MediaQueryList.cpp +++ b/Userland/Libraries/LibWeb/CSS/MediaQueryList.cpp @@ -33,7 +33,7 @@ MediaQueryList::MediaQueryList(DOM::Document& document, Vector(realm, "MediaQueryList"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(MediaQueryList); } void MediaQueryList::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/CSS/MediaQueryListEvent.cpp b/Userland/Libraries/LibWeb/CSS/MediaQueryListEvent.cpp index c175a313f06..0bb697149dd 100644 --- a/Userland/Libraries/LibWeb/CSS/MediaQueryListEvent.cpp +++ b/Userland/Libraries/LibWeb/CSS/MediaQueryListEvent.cpp @@ -29,7 +29,7 @@ MediaQueryListEvent::~MediaQueryListEvent() = default; void MediaQueryListEvent::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "MediaQueryListEvent"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(MediaQueryListEvent); } } diff --git a/Userland/Libraries/LibWeb/CSS/Screen.cpp b/Userland/Libraries/LibWeb/CSS/Screen.cpp index 8f8d3f4814d..d78a35e87e1 100644 --- a/Userland/Libraries/LibWeb/CSS/Screen.cpp +++ b/Userland/Libraries/LibWeb/CSS/Screen.cpp @@ -29,7 +29,7 @@ Screen::Screen(HTML::Window& window) void Screen::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "Screen"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(Screen); } void Screen::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/CSS/StyleSheetList.cpp b/Userland/Libraries/LibWeb/CSS/StyleSheetList.cpp index 012365d45fb..ecab95e6506 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleSheetList.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleSheetList.cpp @@ -80,7 +80,7 @@ StyleSheetList::StyleSheetList(DOM::Document& document) void StyleSheetList::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "StyleSheetList"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(StyleSheetList); } void StyleSheetList::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/CSS/VisualViewport.cpp b/Userland/Libraries/LibWeb/CSS/VisualViewport.cpp index c4f2b02257c..d33d1a86643 100644 --- a/Userland/Libraries/LibWeb/CSS/VisualViewport.cpp +++ b/Userland/Libraries/LibWeb/CSS/VisualViewport.cpp @@ -31,7 +31,7 @@ VisualViewport::VisualViewport(DOM::Document& document) void VisualViewport::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "VisualViewport"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(VisualViewport); } void VisualViewport::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/Clipboard/Clipboard.cpp b/Userland/Libraries/LibWeb/Clipboard/Clipboard.cpp index 55da3cb9a43..bb90eceb349 100644 --- a/Userland/Libraries/LibWeb/Clipboard/Clipboard.cpp +++ b/Userland/Libraries/LibWeb/Clipboard/Clipboard.cpp @@ -36,7 +36,7 @@ Clipboard::~Clipboard() = default; void Clipboard::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "Clipboard"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(Clipboard); } // https://w3c.github.io/clipboard-apis/#os-specific-well-known-format diff --git a/Userland/Libraries/LibWeb/Crypto/Crypto.cpp b/Userland/Libraries/LibWeb/Crypto/Crypto.cpp index 21a99a3f7ff..ddb1fe1861d 100644 --- a/Userland/Libraries/LibWeb/Crypto/Crypto.cpp +++ b/Userland/Libraries/LibWeb/Crypto/Crypto.cpp @@ -33,7 +33,7 @@ Crypto::~Crypto() = default; void Crypto::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "Crypto"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(Crypto); m_subtle = SubtleCrypto::create(realm); } diff --git a/Userland/Libraries/LibWeb/Crypto/CryptoKey.cpp b/Userland/Libraries/LibWeb/Crypto/CryptoKey.cpp index 59212c4ef53..d70919db072 100644 --- a/Userland/Libraries/LibWeb/Crypto/CryptoKey.cpp +++ b/Userland/Libraries/LibWeb/Crypto/CryptoKey.cpp @@ -38,7 +38,7 @@ CryptoKey::~CryptoKey() void CryptoKey::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "CryptoKey"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(CryptoKey); } void CryptoKey::visit_edges(Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/Crypto/SubtleCrypto.cpp b/Userland/Libraries/LibWeb/Crypto/SubtleCrypto.cpp index 32f26d67ed8..fce5f418f81 100644 --- a/Userland/Libraries/LibWeb/Crypto/SubtleCrypto.cpp +++ b/Userland/Libraries/LibWeb/Crypto/SubtleCrypto.cpp @@ -44,7 +44,7 @@ SubtleCrypto::~SubtleCrypto() = default; void SubtleCrypto::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SubtleCrypto"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SubtleCrypto); } // https://w3c.github.io/webcrypto/#dfn-normalize-an-algorithm diff --git a/Userland/Libraries/LibWeb/DOM/AbortController.cpp b/Userland/Libraries/LibWeb/DOM/AbortController.cpp index 324b4cb378f..4b518e788f9 100644 --- a/Userland/Libraries/LibWeb/DOM/AbortController.cpp +++ b/Userland/Libraries/LibWeb/DOM/AbortController.cpp @@ -30,7 +30,7 @@ AbortController::~AbortController() = default; void AbortController::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "AbortController"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(AbortController); } void AbortController::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/AbortSignal.cpp b/Userland/Libraries/LibWeb/DOM/AbortSignal.cpp index 0b5df2fb26c..caf638687e7 100644 --- a/Userland/Libraries/LibWeb/DOM/AbortSignal.cpp +++ b/Userland/Libraries/LibWeb/DOM/AbortSignal.cpp @@ -30,7 +30,7 @@ AbortSignal::AbortSignal(JS::Realm& realm) void AbortSignal::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "AbortSignal"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(AbortSignal); } // https://dom.spec.whatwg.org/#abortsignal-add diff --git a/Userland/Libraries/LibWeb/DOM/AbstractRange.cpp b/Userland/Libraries/LibWeb/DOM/AbstractRange.cpp index 9a99a7cc627..03172f359a4 100644 --- a/Userland/Libraries/LibWeb/DOM/AbstractRange.cpp +++ b/Userland/Libraries/LibWeb/DOM/AbstractRange.cpp @@ -24,7 +24,7 @@ AbstractRange::~AbstractRange() = default; void AbstractRange::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "AbstractRange"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(AbstractRange); } void AbstractRange::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/Attr.cpp b/Userland/Libraries/LibWeb/DOM/Attr.cpp index 0c07d9e8762..9f778252fb6 100644 --- a/Userland/Libraries/LibWeb/DOM/Attr.cpp +++ b/Userland/Libraries/LibWeb/DOM/Attr.cpp @@ -44,7 +44,7 @@ Attr::Attr(Document& document, QualifiedName qualified_name, String value, Eleme void Attr::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "Attr"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(Attr); } void Attr::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/CDATASection.cpp b/Userland/Libraries/LibWeb/DOM/CDATASection.cpp index c7b8491abf0..78051696d20 100644 --- a/Userland/Libraries/LibWeb/DOM/CDATASection.cpp +++ b/Userland/Libraries/LibWeb/DOM/CDATASection.cpp @@ -21,7 +21,7 @@ CDATASection::~CDATASection() = default; void CDATASection::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "CDATASection"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(CDATASection); } } diff --git a/Userland/Libraries/LibWeb/DOM/CharacterData.cpp b/Userland/Libraries/LibWeb/DOM/CharacterData.cpp index 2d3b8aaa7ac..230c0f8363c 100644 --- a/Userland/Libraries/LibWeb/DOM/CharacterData.cpp +++ b/Userland/Libraries/LibWeb/DOM/CharacterData.cpp @@ -25,7 +25,7 @@ CharacterData::CharacterData(Document& document, NodeType type, String const& da void CharacterData::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "CharacterData"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(CharacterData); } // https://dom.spec.whatwg.org/#dom-characterdata-data diff --git a/Userland/Libraries/LibWeb/DOM/Comment.cpp b/Userland/Libraries/LibWeb/DOM/Comment.cpp index 63f174e0d5f..af33e0e460d 100644 --- a/Userland/Libraries/LibWeb/DOM/Comment.cpp +++ b/Userland/Libraries/LibWeb/DOM/Comment.cpp @@ -28,7 +28,7 @@ WebIDL::ExceptionOr> Comment::construct_impl(JS::Realm void Comment::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "Comment"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(Comment); } } diff --git a/Userland/Libraries/LibWeb/DOM/CustomEvent.cpp b/Userland/Libraries/LibWeb/DOM/CustomEvent.cpp index e22480f24a0..1bdfede699d 100644 --- a/Userland/Libraries/LibWeb/DOM/CustomEvent.cpp +++ b/Userland/Libraries/LibWeb/DOM/CustomEvent.cpp @@ -34,7 +34,7 @@ CustomEvent::~CustomEvent() = default; void CustomEvent::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "CustomEvent"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(CustomEvent); } void CustomEvent::visit_edges(JS::Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp b/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp index 7cbeca47473..a6a05212801 100644 --- a/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp +++ b/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp @@ -37,7 +37,7 @@ DOMImplementation::~DOMImplementation() = default; void DOMImplementation::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "DOMImplementation"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(DOMImplementation); } void DOMImplementation::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/DOMTokenList.cpp b/Userland/Libraries/LibWeb/DOM/DOMTokenList.cpp index aa4d9351e8e..fbaf9e101e9 100644 --- a/Userland/Libraries/LibWeb/DOM/DOMTokenList.cpp +++ b/Userland/Libraries/LibWeb/DOM/DOMTokenList.cpp @@ -74,7 +74,7 @@ DOMTokenList::DOMTokenList(Element& associated_element, FlyString associated_att void DOMTokenList::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "DOMTokenList"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(DOMTokenList); } void DOMTokenList::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index 6bb5342d1f8..6af8fe3eccb 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -374,7 +374,7 @@ Document::~Document() void Document::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "Document"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(Document); m_selection = heap().allocate(realm, realm, *this); diff --git a/Userland/Libraries/LibWeb/DOM/DocumentFragment.cpp b/Userland/Libraries/LibWeb/DOM/DocumentFragment.cpp index 58a0f1754a2..085c9e34a8c 100644 --- a/Userland/Libraries/LibWeb/DOM/DocumentFragment.cpp +++ b/Userland/Libraries/LibWeb/DOM/DocumentFragment.cpp @@ -19,7 +19,7 @@ DocumentFragment::DocumentFragment(Document& document) void DocumentFragment::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "DocumentFragment"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(DocumentFragment); } void DocumentFragment::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/DocumentType.cpp b/Userland/Libraries/LibWeb/DOM/DocumentType.cpp index 925f48d3b6f..834cd27761b 100644 --- a/Userland/Libraries/LibWeb/DOM/DocumentType.cpp +++ b/Userland/Libraries/LibWeb/DOM/DocumentType.cpp @@ -24,7 +24,7 @@ DocumentType::DocumentType(Document& document) void DocumentType::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "DocumentType"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(DocumentType); } } diff --git a/Userland/Libraries/LibWeb/DOM/Element.cpp b/Userland/Libraries/LibWeb/DOM/Element.cpp index 1fe2e8132da..857bde12c45 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.cpp +++ b/Userland/Libraries/LibWeb/DOM/Element.cpp @@ -82,7 +82,7 @@ Element::~Element() = default; void Element::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "Element"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(Element); m_attributes = NamedNodeMap::create(*this); } diff --git a/Userland/Libraries/LibWeb/DOM/Event.cpp b/Userland/Libraries/LibWeb/DOM/Event.cpp index 4a13e479f73..192c54df142 100644 --- a/Userland/Libraries/LibWeb/DOM/Event.cpp +++ b/Userland/Libraries/LibWeb/DOM/Event.cpp @@ -46,7 +46,7 @@ Event::Event(JS::Realm& realm, FlyString const& type, EventInit const& event_ini void Event::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "Event"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(Event); } void Event::visit_edges(Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/EventTarget.cpp b/Userland/Libraries/LibWeb/DOM/EventTarget.cpp index 1f44b67a486..6173efd7606 100644 --- a/Userland/Libraries/LibWeb/DOM/EventTarget.cpp +++ b/Userland/Libraries/LibWeb/DOM/EventTarget.cpp @@ -59,7 +59,7 @@ void EventTarget::initialize(JS::Realm& realm) // FIXME: We can't do this for HTML::Window or HTML::WorkerGlobalScope, as this will run when creating the initial global object. // During this time, the ESO is not setup, so it will cause a nullptr dereference in host_defined_intrinsics. if (!is(this)) - set_prototype(&Bindings::ensure_web_prototype(realm, "EventTarget"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(EventTarget); } void EventTarget::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp b/Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp index e508db03648..b899f20c60c 100644 --- a/Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp +++ b/Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp @@ -38,7 +38,7 @@ HTMLCollection::~HTMLCollection() = default; void HTMLCollection::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLCollection"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLCollection); } void HTMLCollection::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/HTMLFormControlsCollection.cpp b/Userland/Libraries/LibWeb/DOM/HTMLFormControlsCollection.cpp index c327f996b6d..86db7f9d0d2 100644 --- a/Userland/Libraries/LibWeb/DOM/HTMLFormControlsCollection.cpp +++ b/Userland/Libraries/LibWeb/DOM/HTMLFormControlsCollection.cpp @@ -29,7 +29,7 @@ HTMLFormControlsCollection::~HTMLFormControlsCollection() = default; void HTMLFormControlsCollection::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLFormControlsCollection"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLFormControlsCollection); } // https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#dom-htmlformcontrolscollection-nameditem diff --git a/Userland/Libraries/LibWeb/DOM/MutationObserver.cpp b/Userland/Libraries/LibWeb/DOM/MutationObserver.cpp index db69ea2256e..b1bffc92ade 100644 --- a/Userland/Libraries/LibWeb/DOM/MutationObserver.cpp +++ b/Userland/Libraries/LibWeb/DOM/MutationObserver.cpp @@ -42,7 +42,7 @@ MutationObserver::~MutationObserver() void MutationObserver::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "MutationObserver"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(MutationObserver); } void MutationObserver::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/MutationRecord.cpp b/Userland/Libraries/LibWeb/DOM/MutationRecord.cpp index 3c8c3b7f0f0..261856f6bd1 100644 --- a/Userland/Libraries/LibWeb/DOM/MutationRecord.cpp +++ b/Userland/Libraries/LibWeb/DOM/MutationRecord.cpp @@ -38,7 +38,7 @@ MutationRecord::~MutationRecord() = default; void MutationRecord::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "MutationRecord"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(MutationRecord); } void MutationRecord::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp b/Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp index 581427f23c3..e95f2c967d1 100644 --- a/Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp +++ b/Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp @@ -36,7 +36,7 @@ NamedNodeMap::NamedNodeMap(Element& element) void NamedNodeMap::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "NamedNodeMap"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(NamedNodeMap); } void NamedNodeMap::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/NodeIterator.cpp b/Userland/Libraries/LibWeb/DOM/NodeIterator.cpp index 220087ae5ce..fe3f6753f9a 100644 --- a/Userland/Libraries/LibWeb/DOM/NodeIterator.cpp +++ b/Userland/Libraries/LibWeb/DOM/NodeIterator.cpp @@ -26,7 +26,7 @@ NodeIterator::~NodeIterator() = default; void NodeIterator::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "NodeIterator"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(NodeIterator); } void NodeIterator::finalize() diff --git a/Userland/Libraries/LibWeb/DOM/NodeList.cpp b/Userland/Libraries/LibWeb/DOM/NodeList.cpp index 899cecd5aa7..ce2ad6addad 100644 --- a/Userland/Libraries/LibWeb/DOM/NodeList.cpp +++ b/Userland/Libraries/LibWeb/DOM/NodeList.cpp @@ -21,7 +21,7 @@ NodeList::~NodeList() = default; void NodeList::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "NodeList"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(NodeList); } WebIDL::ExceptionOr NodeList::item_value(size_t index) const diff --git a/Userland/Libraries/LibWeb/DOM/ProcessingInstruction.cpp b/Userland/Libraries/LibWeb/DOM/ProcessingInstruction.cpp index 64da6f89077..5a662cd8864 100644 --- a/Userland/Libraries/LibWeb/DOM/ProcessingInstruction.cpp +++ b/Userland/Libraries/LibWeb/DOM/ProcessingInstruction.cpp @@ -22,7 +22,7 @@ ProcessingInstruction::ProcessingInstruction(Document& document, String const& d void ProcessingInstruction::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "ProcessingInstruction"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(ProcessingInstruction); } } diff --git a/Userland/Libraries/LibWeb/DOM/RadioNodeList.cpp b/Userland/Libraries/LibWeb/DOM/RadioNodeList.cpp index 24b563dab5a..03a09d16157 100644 --- a/Userland/Libraries/LibWeb/DOM/RadioNodeList.cpp +++ b/Userland/Libraries/LibWeb/DOM/RadioNodeList.cpp @@ -29,7 +29,7 @@ RadioNodeList::~RadioNodeList() = default; void RadioNodeList::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "RadioNodeList"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(RadioNodeList); } static HTML::HTMLInputElement const* radio_button(Node const& node) diff --git a/Userland/Libraries/LibWeb/DOM/Range.cpp b/Userland/Libraries/LibWeb/DOM/Range.cpp index ef13773e1f3..fdfd78e688b 100644 --- a/Userland/Libraries/LibWeb/DOM/Range.cpp +++ b/Userland/Libraries/LibWeb/DOM/Range.cpp @@ -78,7 +78,7 @@ Range::~Range() void Range::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "Range"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(Range); } void Range::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/ShadowRoot.cpp b/Userland/Libraries/LibWeb/DOM/ShadowRoot.cpp index 9de779f3669..222d03a76ef 100644 --- a/Userland/Libraries/LibWeb/DOM/ShadowRoot.cpp +++ b/Userland/Libraries/LibWeb/DOM/ShadowRoot.cpp @@ -32,7 +32,7 @@ void ShadowRoot::finalize() void ShadowRoot::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "ShadowRoot"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(ShadowRoot); } // https://dom.spec.whatwg.org/#ref-for-get-the-parent%E2%91%A6 diff --git a/Userland/Libraries/LibWeb/DOM/StaticRange.cpp b/Userland/Libraries/LibWeb/DOM/StaticRange.cpp index bd113c1a9b9..ff9c5d3f4dd 100644 --- a/Userland/Libraries/LibWeb/DOM/StaticRange.cpp +++ b/Userland/Libraries/LibWeb/DOM/StaticRange.cpp @@ -40,7 +40,7 @@ WebIDL::ExceptionOr> StaticRange::construct_impl(J void StaticRange::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "StaticRange"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(StaticRange); } } diff --git a/Userland/Libraries/LibWeb/DOM/Text.cpp b/Userland/Libraries/LibWeb/DOM/Text.cpp index 739ab63e69f..b9a6921acc8 100644 --- a/Userland/Libraries/LibWeb/DOM/Text.cpp +++ b/Userland/Libraries/LibWeb/DOM/Text.cpp @@ -28,7 +28,7 @@ Text::Text(Document& document, NodeType type, String const& data) void Text::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "Text"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(Text); } void Text::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/TreeWalker.cpp b/Userland/Libraries/LibWeb/DOM/TreeWalker.cpp index 00d58b69f1c..9aff7a8f182 100644 --- a/Userland/Libraries/LibWeb/DOM/TreeWalker.cpp +++ b/Userland/Libraries/LibWeb/DOM/TreeWalker.cpp @@ -27,7 +27,7 @@ TreeWalker::~TreeWalker() = default; void TreeWalker::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "TreeWalker"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(TreeWalker); } void TreeWalker::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOM/XMLDocument.cpp b/Userland/Libraries/LibWeb/DOM/XMLDocument.cpp index 13804e030e2..4c58d3d8d4c 100644 --- a/Userland/Libraries/LibWeb/DOM/XMLDocument.cpp +++ b/Userland/Libraries/LibWeb/DOM/XMLDocument.cpp @@ -24,7 +24,7 @@ XMLDocument::XMLDocument(JS::Realm& realm, URL const& url) void XMLDocument::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "XMLDocument"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(XMLDocument); } } diff --git a/Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.cpp b/Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.cpp index ea076a78487..95510129a66 100644 --- a/Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.cpp +++ b/Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.cpp @@ -40,7 +40,7 @@ XMLSerializer::~XMLSerializer() = default; void XMLSerializer::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "XMLSerializer"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(XMLSerializer); } // https://w3c.github.io/DOM-Parsing/#dom-xmlserializer-serializetostring diff --git a/Userland/Libraries/LibWeb/DOMURL/DOMURL.cpp b/Userland/Libraries/LibWeb/DOMURL/DOMURL.cpp index d6d5969ebb2..099c104431c 100644 --- a/Userland/Libraries/LibWeb/DOMURL/DOMURL.cpp +++ b/Userland/Libraries/LibWeb/DOMURL/DOMURL.cpp @@ -87,7 +87,7 @@ DOMURL::~DOMURL() = default; void DOMURL::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "URL"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE_WITH_CUSTOM_NAME(DOMURL, URL); } void DOMURL::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOMURL/URLSearchParams.cpp b/Userland/Libraries/LibWeb/DOMURL/URLSearchParams.cpp index 581aab76285..4ce11ff2424 100644 --- a/Userland/Libraries/LibWeb/DOMURL/URLSearchParams.cpp +++ b/Userland/Libraries/LibWeb/DOMURL/URLSearchParams.cpp @@ -30,7 +30,7 @@ URLSearchParams::~URLSearchParams() = default; void URLSearchParams::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "URLSearchParams"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(URLSearchParams); } void URLSearchParams::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/DOMURL/URLSearchParamsIterator.cpp b/Userland/Libraries/LibWeb/DOMURL/URLSearchParamsIterator.cpp index 7f48f4dd3fe..b2f03fa7d9f 100644 --- a/Userland/Libraries/LibWeb/DOMURL/URLSearchParamsIterator.cpp +++ b/Userland/Libraries/LibWeb/DOMURL/URLSearchParamsIterator.cpp @@ -42,7 +42,7 @@ URLSearchParamsIterator::~URLSearchParamsIterator() = default; void URLSearchParamsIterator::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "URLSearchParamsIterator"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(URLSearchParamsIterator); } void URLSearchParamsIterator::visit_edges(JS::Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/Encoding/TextDecoder.cpp b/Userland/Libraries/LibWeb/Encoding/TextDecoder.cpp index 0166fa7407f..f8ddc655b6f 100644 --- a/Userland/Libraries/LibWeb/Encoding/TextDecoder.cpp +++ b/Userland/Libraries/LibWeb/Encoding/TextDecoder.cpp @@ -41,7 +41,7 @@ TextDecoder::~TextDecoder() = default; void TextDecoder::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "TextDecoder"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(TextDecoder); } // https://encoding.spec.whatwg.org/#dom-textdecoder-decode diff --git a/Userland/Libraries/LibWeb/Encoding/TextEncoder.cpp b/Userland/Libraries/LibWeb/Encoding/TextEncoder.cpp index b2c4f8d8431..731f3ca1f93 100644 --- a/Userland/Libraries/LibWeb/Encoding/TextEncoder.cpp +++ b/Userland/Libraries/LibWeb/Encoding/TextEncoder.cpp @@ -28,7 +28,7 @@ TextEncoder::~TextEncoder() = default; void TextEncoder::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "TextEncoder"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(TextEncoder); } // https://encoding.spec.whatwg.org/#dom-textencoder-encode diff --git a/Userland/Libraries/LibWeb/Fetch/Headers.cpp b/Userland/Libraries/LibWeb/Fetch/Headers.cpp index 011c9bbe952..fd66ed5d3ff 100644 --- a/Userland/Libraries/LibWeb/Fetch/Headers.cpp +++ b/Userland/Libraries/LibWeb/Fetch/Headers.cpp @@ -42,7 +42,7 @@ Headers::~Headers() = default; void Headers::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "Headers"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(Headers); } void Headers::visit_edges(JS::Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/Fetch/HeadersIterator.cpp b/Userland/Libraries/LibWeb/Fetch/HeadersIterator.cpp index d0330b2cfe5..cc5b978c5d9 100644 --- a/Userland/Libraries/LibWeb/Fetch/HeadersIterator.cpp +++ b/Userland/Libraries/LibWeb/Fetch/HeadersIterator.cpp @@ -42,7 +42,7 @@ HeadersIterator::~HeadersIterator() = default; void HeadersIterator::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HeadersIterator"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HeadersIterator); } void HeadersIterator::visit_edges(JS::Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/Fetch/Request.cpp b/Userland/Libraries/LibWeb/Fetch/Request.cpp index c652a4e9480..ef9dd3e9a61 100644 --- a/Userland/Libraries/LibWeb/Fetch/Request.cpp +++ b/Userland/Libraries/LibWeb/Fetch/Request.cpp @@ -34,7 +34,7 @@ Request::~Request() = default; void Request::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "Request"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(Request); } void Request::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/Fetch/Response.cpp b/Userland/Libraries/LibWeb/Fetch/Response.cpp index 80c80681b9e..a86beae7603 100644 --- a/Userland/Libraries/LibWeb/Fetch/Response.cpp +++ b/Userland/Libraries/LibWeb/Fetch/Response.cpp @@ -31,7 +31,7 @@ Response::~Response() = default; void Response::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "Response"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(Response); } void Response::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/FileAPI/Blob.cpp b/Userland/Libraries/LibWeb/FileAPI/Blob.cpp index 4dabe0385e0..f13c649f958 100644 --- a/Userland/Libraries/LibWeb/FileAPI/Blob.cpp +++ b/Userland/Libraries/LibWeb/FileAPI/Blob.cpp @@ -146,7 +146,7 @@ Blob::~Blob() = default; void Blob::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "Blob"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(Blob); } WebIDL::ExceptionOr Blob::serialization_steps(HTML::SerializationRecord& record, bool) diff --git a/Userland/Libraries/LibWeb/FileAPI/File.cpp b/Userland/Libraries/LibWeb/FileAPI/File.cpp index 5e882789cf2..507f5e47a08 100644 --- a/Userland/Libraries/LibWeb/FileAPI/File.cpp +++ b/Userland/Libraries/LibWeb/FileAPI/File.cpp @@ -29,7 +29,7 @@ File::File(JS::Realm& realm) void File::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "File"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(File); } File::~File() = default; diff --git a/Userland/Libraries/LibWeb/FileAPI/FileList.cpp b/Userland/Libraries/LibWeb/FileAPI/FileList.cpp index 47fc192d987..50f529ff377 100644 --- a/Userland/Libraries/LibWeb/FileAPI/FileList.cpp +++ b/Userland/Libraries/LibWeb/FileAPI/FileList.cpp @@ -30,7 +30,7 @@ FileList::~FileList() = default; void FileList::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "FileList"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(FileList); } // https://w3c.github.io/FileAPI/#dfn-item diff --git a/Userland/Libraries/LibWeb/FileAPI/FileReader.cpp b/Userland/Libraries/LibWeb/FileAPI/FileReader.cpp index e52a842d769..a939beee3e8 100644 --- a/Userland/Libraries/LibWeb/FileAPI/FileReader.cpp +++ b/Userland/Libraries/LibWeb/FileAPI/FileReader.cpp @@ -42,7 +42,7 @@ FileReader::FileReader(JS::Realm& realm) void FileReader::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "FileReader"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(FileReader); } void FileReader::visit_edges(JS::Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/Geometry/DOMMatrix.cpp b/Userland/Libraries/LibWeb/Geometry/DOMMatrix.cpp index c1c4c599e34..b974f5ee100 100644 --- a/Userland/Libraries/LibWeb/Geometry/DOMMatrix.cpp +++ b/Userland/Libraries/LibWeb/Geometry/DOMMatrix.cpp @@ -138,7 +138,7 @@ DOMMatrix::~DOMMatrix() = default; void DOMMatrix::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "DOMMatrix"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(DOMMatrix); } // https://drafts.fxtf.org/geometry/#dom-dommatrix-frommatrix diff --git a/Userland/Libraries/LibWeb/Geometry/DOMMatrixReadOnly.cpp b/Userland/Libraries/LibWeb/Geometry/DOMMatrixReadOnly.cpp index 6dcc89c1e8e..90aee5e7147 100644 --- a/Userland/Libraries/LibWeb/Geometry/DOMMatrixReadOnly.cpp +++ b/Userland/Libraries/LibWeb/Geometry/DOMMatrixReadOnly.cpp @@ -139,7 +139,7 @@ DOMMatrixReadOnly::~DOMMatrixReadOnly() = default; void DOMMatrixReadOnly::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "DOMMatrixReadOnly"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(DOMMatrixReadOnly); } // https://drafts.fxtf.org/geometry/#create-a-2d-matrix diff --git a/Userland/Libraries/LibWeb/Geometry/DOMPoint.cpp b/Userland/Libraries/LibWeb/Geometry/DOMPoint.cpp index fb30785437e..c77c2eaf906 100644 --- a/Userland/Libraries/LibWeb/Geometry/DOMPoint.cpp +++ b/Userland/Libraries/LibWeb/Geometry/DOMPoint.cpp @@ -34,7 +34,7 @@ DOMPoint::~DOMPoint() = default; void DOMPoint::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "DOMPoint"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(DOMPoint); } } diff --git a/Userland/Libraries/LibWeb/Geometry/DOMPointReadOnly.cpp b/Userland/Libraries/LibWeb/Geometry/DOMPointReadOnly.cpp index b6db2e5cc65..035b4ef2835 100644 --- a/Userland/Libraries/LibWeb/Geometry/DOMPointReadOnly.cpp +++ b/Userland/Libraries/LibWeb/Geometry/DOMPointReadOnly.cpp @@ -50,7 +50,7 @@ WebIDL::ExceptionOr> DOMPointReadOnly::matrix_transfo void DOMPointReadOnly::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "DOMPointReadOnly"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(DOMPointReadOnly); } } diff --git a/Userland/Libraries/LibWeb/Geometry/DOMQuad.cpp b/Userland/Libraries/LibWeb/Geometry/DOMQuad.cpp index 09aa32472b6..1cc24aea643 100644 --- a/Userland/Libraries/LibWeb/Geometry/DOMQuad.cpp +++ b/Userland/Libraries/LibWeb/Geometry/DOMQuad.cpp @@ -87,7 +87,7 @@ JS::NonnullGCPtr DOMQuad::get_bounds() const void DOMQuad::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "DOMQuad"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(DOMQuad); } void DOMQuad::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/Geometry/DOMRect.cpp b/Userland/Libraries/LibWeb/Geometry/DOMRect.cpp index bfd627e4148..53be04b73c2 100644 --- a/Userland/Libraries/LibWeb/Geometry/DOMRect.cpp +++ b/Userland/Libraries/LibWeb/Geometry/DOMRect.cpp @@ -39,7 +39,7 @@ DOMRect::~DOMRect() = default; void DOMRect::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "DOMRect"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(DOMRect); } } diff --git a/Userland/Libraries/LibWeb/Geometry/DOMRectList.cpp b/Userland/Libraries/LibWeb/Geometry/DOMRectList.cpp index c3423b18eaf..28a46fdc6e0 100644 --- a/Userland/Libraries/LibWeb/Geometry/DOMRectList.cpp +++ b/Userland/Libraries/LibWeb/Geometry/DOMRectList.cpp @@ -34,7 +34,7 @@ DOMRectList::~DOMRectList() = default; void DOMRectList::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "DOMRectList"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(DOMRectList); } void DOMRectList::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/Geometry/DOMRectReadOnly.cpp b/Userland/Libraries/LibWeb/Geometry/DOMRectReadOnly.cpp index 09d06658417..5bc74203274 100644 --- a/Userland/Libraries/LibWeb/Geometry/DOMRectReadOnly.cpp +++ b/Userland/Libraries/LibWeb/Geometry/DOMRectReadOnly.cpp @@ -35,7 +35,7 @@ DOMRectReadOnly::~DOMRectReadOnly() = default; void DOMRectReadOnly::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "DOMRectReadOnly"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(DOMRectReadOnly); } } diff --git a/Userland/Libraries/LibWeb/HTML/AudioTrack.cpp b/Userland/Libraries/LibWeb/HTML/AudioTrack.cpp index dce51667c8b..6ec2a531f50 100644 --- a/Userland/Libraries/LibWeb/HTML/AudioTrack.cpp +++ b/Userland/Libraries/LibWeb/HTML/AudioTrack.cpp @@ -50,7 +50,7 @@ AudioTrack::~AudioTrack() void AudioTrack::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "AudioTrack"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(AudioTrack); auto id = s_audio_track_id_allocator.allocate(); m_id = MUST(String::number(id)); diff --git a/Userland/Libraries/LibWeb/HTML/AudioTrackList.cpp b/Userland/Libraries/LibWeb/HTML/AudioTrackList.cpp index 218eff9b730..2748a3f8062 100644 --- a/Userland/Libraries/LibWeb/HTML/AudioTrackList.cpp +++ b/Userland/Libraries/LibWeb/HTML/AudioTrackList.cpp @@ -24,7 +24,7 @@ AudioTrackList::AudioTrackList(JS::Realm& realm) void AudioTrackList::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "AudioTrackList"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(AudioTrackList); } // https://html.spec.whatwg.org/multipage/media.html#dom-tracklist-item diff --git a/Userland/Libraries/LibWeb/HTML/CanvasGradient.cpp b/Userland/Libraries/LibWeb/HTML/CanvasGradient.cpp index 67d4e5b4868..2819fc09d31 100644 --- a/Userland/Libraries/LibWeb/HTML/CanvasGradient.cpp +++ b/Userland/Libraries/LibWeb/HTML/CanvasGradient.cpp @@ -52,7 +52,7 @@ CanvasGradient::~CanvasGradient() = default; void CanvasGradient::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "CanvasGradient"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(CanvasGradient); } // https://html.spec.whatwg.org/multipage/canvas.html#dom-canvasgradient-addcolorstop diff --git a/Userland/Libraries/LibWeb/HTML/CanvasPattern.cpp b/Userland/Libraries/LibWeb/HTML/CanvasPattern.cpp index 72bc546c21b..c36fd92fc39 100644 --- a/Userland/Libraries/LibWeb/HTML/CanvasPattern.cpp +++ b/Userland/Libraries/LibWeb/HTML/CanvasPattern.cpp @@ -138,7 +138,7 @@ WebIDL::ExceptionOr> CanvasPattern::create(JS::Realm& r void CanvasPattern::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "CanvasPattern"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(CanvasPattern); } } diff --git a/Userland/Libraries/LibWeb/HTML/CloseEvent.cpp b/Userland/Libraries/LibWeb/HTML/CloseEvent.cpp index bfea23eab0e..b0b46ae03f2 100644 --- a/Userland/Libraries/LibWeb/HTML/CloseEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/CloseEvent.cpp @@ -34,7 +34,7 @@ CloseEvent::~CloseEvent() = default; void CloseEvent::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "CloseEvent"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(CloseEvent); } } diff --git a/Userland/Libraries/LibWeb/HTML/CustomElements/CustomElementRegistry.cpp b/Userland/Libraries/LibWeb/HTML/CustomElements/CustomElementRegistry.cpp index 614ad80b623..06d232bfbe6 100644 --- a/Userland/Libraries/LibWeb/HTML/CustomElements/CustomElementRegistry.cpp +++ b/Userland/Libraries/LibWeb/HTML/CustomElements/CustomElementRegistry.cpp @@ -33,7 +33,7 @@ CustomElementRegistry::~CustomElementRegistry() = default; void CustomElementRegistry::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "CustomElementRegistry"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(CustomElementRegistry); } void CustomElementRegistry::visit_edges(Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/DOMParser.cpp b/Userland/Libraries/LibWeb/HTML/DOMParser.cpp index e61fecee5cf..6cf711d649e 100644 --- a/Userland/Libraries/LibWeb/HTML/DOMParser.cpp +++ b/Userland/Libraries/LibWeb/HTML/DOMParser.cpp @@ -33,7 +33,7 @@ DOMParser::~DOMParser() = default; void DOMParser::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "DOMParser"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(DOMParser); } // https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring diff --git a/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp b/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp index fe37def2c54..68582730681 100644 --- a/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp +++ b/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp @@ -37,7 +37,7 @@ DOMStringMap::~DOMStringMap() = default; void DOMStringMap::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "DOMStringMap"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(DOMStringMap); } void DOMStringMap::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/DataTransfer.cpp b/Userland/Libraries/LibWeb/HTML/DataTransfer.cpp index 091a3ee2217..2b6370185e1 100644 --- a/Userland/Libraries/LibWeb/HTML/DataTransfer.cpp +++ b/Userland/Libraries/LibWeb/HTML/DataTransfer.cpp @@ -27,7 +27,7 @@ DataTransfer::~DataTransfer() = default; void DataTransfer::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "DataTransfer"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(DataTransfer); } } diff --git a/Userland/Libraries/LibWeb/HTML/ErrorEvent.cpp b/Userland/Libraries/LibWeb/HTML/ErrorEvent.cpp index e5d71da44b0..5606bfdb154 100644 --- a/Userland/Libraries/LibWeb/HTML/ErrorEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/ErrorEvent.cpp @@ -36,7 +36,7 @@ ErrorEvent::~ErrorEvent() = default; void ErrorEvent::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "ErrorEvent"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(ErrorEvent); } void ErrorEvent::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/FormDataEvent.cpp b/Userland/Libraries/LibWeb/HTML/FormDataEvent.cpp index 64f6a74a668..95e4992aac6 100644 --- a/Userland/Libraries/LibWeb/HTML/FormDataEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/FormDataEvent.cpp @@ -28,7 +28,7 @@ FormDataEvent::~FormDataEvent() = default; void FormDataEvent::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "FormDataEvent"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(FormDataEvent); } void FormDataEvent::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.cpp index a28027dc960..56516ed247f 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.cpp @@ -23,7 +23,7 @@ HTMLAnchorElement::~HTMLAnchorElement() = default; void HTMLAnchorElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLAnchorElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLAnchorElement); } void HTMLAnchorElement::attribute_changed(FlyString const& name, Optional const& value) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.cpp index 532c9034cf5..3654d7c7bd2 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.cpp @@ -22,7 +22,7 @@ HTMLAreaElement::~HTMLAreaElement() = default; void HTMLAreaElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLAreaElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLAreaElement); } void HTMLAreaElement::attribute_changed(FlyString const& name, Optional const& value) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLAudioElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLAudioElement.cpp index 35d4bbcf60c..5a7bd7ca127 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLAudioElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLAudioElement.cpp @@ -24,7 +24,7 @@ HTMLAudioElement::~HTMLAudioElement() = default; void HTMLAudioElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLAudioElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLAudioElement); } JS::GCPtr HTMLAudioElement::create_layout_node(NonnullRefPtr style) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBRElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLBRElement.cpp index ed44de780c5..b1c2e002aa2 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLBRElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLBRElement.cpp @@ -22,7 +22,7 @@ HTMLBRElement::~HTMLBRElement() = default; void HTMLBRElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLBRElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLBRElement); } JS::GCPtr HTMLBRElement::create_layout_node(NonnullRefPtr style) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.cpp index d6e7c1691cb..26fc0290f46 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.cpp @@ -21,7 +21,7 @@ HTMLBaseElement::~HTMLBaseElement() = default; void HTMLBaseElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLBaseElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLBaseElement); } void HTMLBaseElement::inserted() diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp index 77613fe3858..377e3f9ee02 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp @@ -35,7 +35,7 @@ void HTMLBodyElement::visit_edges(Visitor& visitor) void HTMLBodyElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLBodyElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLBodyElement); } void HTMLBodyElement::apply_presentational_hints(CSS::StyleProperties& style) const diff --git a/Userland/Libraries/LibWeb/HTML/HTMLButtonElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLButtonElement.cpp index 03a43eb5fd8..c44a4d2652d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLButtonElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLButtonElement.cpp @@ -22,7 +22,7 @@ HTMLButtonElement::~HTMLButtonElement() = default; void HTMLButtonElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLButtonElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLButtonElement); } HTMLButtonElement::TypeAttributeState HTMLButtonElement::type_state() const diff --git a/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp index 0d111573e8c..72a6123dc22 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp @@ -40,7 +40,7 @@ HTMLCanvasElement::~HTMLCanvasElement() = default; void HTMLCanvasElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLCanvasElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLCanvasElement); } void HTMLCanvasElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDListElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDListElement.cpp index c475227bd91..8283a093068 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDListElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDListElement.cpp @@ -21,7 +21,7 @@ HTMLDListElement::~HTMLDListElement() = default; void HTMLDListElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLDListElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLDListElement); } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDataElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDataElement.cpp index df15102d509..35f96252e69 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDataElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDataElement.cpp @@ -21,7 +21,7 @@ HTMLDataElement::~HTMLDataElement() = default; void HTMLDataElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLDataElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLDataElement); } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDataListElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDataListElement.cpp index f5ee101fc8f..45191c3977d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDataListElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDataListElement.cpp @@ -21,7 +21,7 @@ HTMLDataListElement::~HTMLDataListElement() = default; void HTMLDataListElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLDataListElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLDataListElement); } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp index 23110e1ebce..e617970ec47 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp @@ -38,7 +38,7 @@ void HTMLDetailsElement::visit_edges(Cell::Visitor& visitor) void HTMLDetailsElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLDetailsElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLDetailsElement); } void HTMLDetailsElement::inserted() diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDialogElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDialogElement.cpp index 18642c58d5c..4f9d08679d9 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDialogElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDialogElement.cpp @@ -23,7 +23,7 @@ HTMLDialogElement::~HTMLDialogElement() = default; void HTMLDialogElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLDialogElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLDialogElement); } // https://html.spec.whatwg.org/multipage/interactive-elements.html#dom-dialog-show diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDirectoryElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDirectoryElement.cpp index 8729794e561..8ff6f957d17 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDirectoryElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDirectoryElement.cpp @@ -21,7 +21,7 @@ HTMLDirectoryElement::~HTMLDirectoryElement() = default; void HTMLDirectoryElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLDirectoryElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLDirectoryElement); } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDivElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDivElement.cpp index 205122d03b0..9ad3a24263c 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDivElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDivElement.cpp @@ -40,7 +40,7 @@ void HTMLDivElement::apply_presentational_hints(CSS::StyleProperties& style) con void HTMLDivElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLDivElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLDivElement); } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDocument.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDocument.cpp index b890e57bbb1..601a70ee978 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDocument.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDocument.cpp @@ -30,7 +30,7 @@ JS::NonnullGCPtr HTMLDocument::create(JS::Realm& realm, URL const& void HTMLDocument::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLDocument"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLDocument); } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp index 839e4e838c9..d8003b881b1 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp @@ -48,7 +48,7 @@ HTMLElement::~HTMLElement() = default; void HTMLElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLElement); m_dataset = DOMStringMap::create(*this); } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLEmbedElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLEmbedElement.cpp index 67dd6941bcf..afebbc03e9e 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLEmbedElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLEmbedElement.cpp @@ -21,7 +21,7 @@ HTMLEmbedElement::~HTMLEmbedElement() = default; void HTMLEmbedElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLEmbedElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLEmbedElement); } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFieldSetElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFieldSetElement.cpp index d3b371a5ede..eb70c8555c7 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFieldSetElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLFieldSetElement.cpp @@ -28,7 +28,7 @@ HTMLFieldSetElement::~HTMLFieldSetElement() = default; void HTMLFieldSetElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLFieldSetElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLFieldSetElement); } void HTMLFieldSetElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFontElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFontElement.cpp index ff998a5d32a..9e6e46205bd 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFontElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLFontElement.cpp @@ -108,7 +108,7 @@ HTMLFontElement::~HTMLFontElement() = default; void HTMLFontElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLFontElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLFontElement); } void HTMLFontElement::apply_presentational_hints(CSS::StyleProperties& style) const diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp index e973b6194cc..a43dbe46a93 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp @@ -52,7 +52,7 @@ HTMLFormElement::~HTMLFormElement() = default; void HTMLFormElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLFormElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLFormElement); } void HTMLFormElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFrameElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFrameElement.cpp index 570cdbfdc4d..fb64b872859 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFrameElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLFrameElement.cpp @@ -21,7 +21,7 @@ HTMLFrameElement::~HTMLFrameElement() = default; void HTMLFrameElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLFrameElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLFrameElement); } // https://html.spec.whatwg.org/multipage/interaction.html#dom-tabindex diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.cpp index bf9fcf04b3b..0603b4a9041 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.cpp @@ -22,7 +22,7 @@ HTMLFrameSetElement::~HTMLFrameSetElement() = default; void HTMLFrameSetElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLFrameSetElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLFrameSetElement); } void HTMLFrameSetElement::attribute_changed(FlyString const& name, Optional const& value) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLHRElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLHRElement.cpp index 421108bb3ac..f1f176be01d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLHRElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLHRElement.cpp @@ -21,7 +21,7 @@ HTMLHRElement::~HTMLHRElement() = default; void HTMLHRElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLHRElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLHRElement); } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLHeadElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLHeadElement.cpp index dad17f877f1..5cadf535917 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLHeadElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLHeadElement.cpp @@ -21,7 +21,7 @@ HTMLHeadElement::~HTMLHeadElement() = default; void HTMLHeadElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLHeadElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLHeadElement); } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp index 613e5b76d12..59835cf6b46 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp @@ -23,7 +23,7 @@ HTMLHeadingElement::~HTMLHeadingElement() = default; void HTMLHeadingElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLHeadingElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLHeadingElement); } // https://html.spec.whatwg.org/multipage/rendering.html#tables-2 diff --git a/Userland/Libraries/LibWeb/HTML/HTMLHtmlElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLHtmlElement.cpp index 6274dcd44d2..5470f9ec770 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLHtmlElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLHtmlElement.cpp @@ -22,7 +22,7 @@ HTMLHtmlElement::~HTMLHtmlElement() = default; void HTMLHtmlElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLHtmlElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLHtmlElement); } bool HTMLHtmlElement::should_use_body_background_properties() const diff --git a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp index da0764c4e49..842b2b8cf0e 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp @@ -28,7 +28,7 @@ HTMLIFrameElement::~HTMLIFrameElement() = default; void HTMLIFrameElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLIFrameElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLIFrameElement); } JS::GCPtr HTMLIFrameElement::create_layout_node(NonnullRefPtr style) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp index 280a9f66640..ac1215e92c9 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp @@ -55,7 +55,7 @@ void HTMLImageElement::finalize() void HTMLImageElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLImageElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLImageElement); m_current_request = ImageRequest::create(realm, document().page()); } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp index 61c62e25419..6aaeee35ca7 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp @@ -62,7 +62,7 @@ HTMLInputElement::~HTMLInputElement() = default; void HTMLInputElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLInputElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLInputElement); } void HTMLInputElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLLIElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLLIElement.cpp index b51f0d5ea0e..13f0a3ba257 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLLIElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLLIElement.cpp @@ -21,7 +21,7 @@ HTMLLIElement::~HTMLLIElement() = default; void HTMLLIElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLLIElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLLIElement); } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLLabelElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLLabelElement.cpp index 95a41f7539a..411a4279b8f 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLLabelElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLLabelElement.cpp @@ -22,7 +22,7 @@ HTMLLabelElement::~HTMLLabelElement() = default; void HTMLLabelElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLLabelElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLLabelElement); } JS::GCPtr HTMLLabelElement::create_layout_node(NonnullRefPtr style) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLLegendElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLLegendElement.cpp index 84362407b9c..aaedddd478f 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLLegendElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLLegendElement.cpp @@ -22,7 +22,7 @@ HTMLLegendElement::~HTMLLegendElement() = default; void HTMLLegendElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLLegendElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLLegendElement); } // https://html.spec.whatwg.org/multipage/form-elements.html#dom-legend-form diff --git a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp index 5d1e03db36d..9a5e25a5633 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp @@ -43,7 +43,7 @@ HTMLLinkElement::~HTMLLinkElement() = default; void HTMLLinkElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLLinkElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLLinkElement); } void HTMLLinkElement::inserted() diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMapElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMapElement.cpp index c39ad4b73a5..99515fa882b 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMapElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMapElement.cpp @@ -21,7 +21,7 @@ HTMLMapElement::~HTMLMapElement() = default; void HTMLMapElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLMapElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLMapElement); } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMarqueeElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMarqueeElement.cpp index d386096fe53..ac39cb23b7d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMarqueeElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMarqueeElement.cpp @@ -24,7 +24,7 @@ HTMLMarqueeElement::~HTMLMarqueeElement() = default; void HTMLMarqueeElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLMarqueeElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLMarqueeElement); } void HTMLMarqueeElement::apply_presentational_hints(CSS::StyleProperties& style) const diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp index 4d9193a7a88..0b4265808bc 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp @@ -51,7 +51,7 @@ HTMLMediaElement::~HTMLMediaElement() = default; void HTMLMediaElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLMediaElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLMediaElement); m_audio_tracks = realm.heap().allocate(realm, realm); m_video_tracks = realm.heap().allocate(realm, realm); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMenuElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMenuElement.cpp index e034025a8c8..06846b6379a 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMenuElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMenuElement.cpp @@ -21,7 +21,7 @@ HTMLMenuElement::~HTMLMenuElement() = default; void HTMLMenuElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLMenuElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLMenuElement); } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMetaElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMetaElement.cpp index 2bf21c45e58..503bbf26a2c 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMetaElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMetaElement.cpp @@ -29,7 +29,7 @@ HTMLMetaElement::~HTMLMetaElement() = default; void HTMLMetaElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLMetaElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLMetaElement); } Optional HTMLMetaElement::http_equiv_state() const diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMeterElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMeterElement.cpp index e677cdbbd3f..abc3a5c9487 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMeterElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMeterElement.cpp @@ -26,7 +26,7 @@ HTMLMeterElement::~HTMLMeterElement() = default; void HTMLMeterElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLMeterElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLMeterElement); } void HTMLMeterElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLModElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLModElement.cpp index 6925ef7cda1..76f5713f4c1 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLModElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLModElement.cpp @@ -22,7 +22,7 @@ HTMLModElement::~HTMLModElement() = default; void HTMLModElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLModElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLModElement); } Optional HTMLModElement::default_role() const diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOListElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLOListElement.cpp index 43fa8c7af93..db264c36467 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOListElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLOListElement.cpp @@ -21,7 +21,7 @@ HTMLOListElement::~HTMLOListElement() = default; void HTMLOListElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLOListElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLOListElement); } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp index f1d50ccb4bc..cc90332ca7e 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp @@ -39,7 +39,7 @@ HTMLObjectElement::~HTMLObjectElement() = default; void HTMLObjectElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLObjectElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLObjectElement); } void HTMLObjectElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOptGroupElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLOptGroupElement.cpp index 9a06b7f36f8..95ca8ae293a 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOptGroupElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLOptGroupElement.cpp @@ -21,7 +21,7 @@ HTMLOptGroupElement::~HTMLOptGroupElement() = default; void HTMLOptGroupElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLOptGroupElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLOptGroupElement); } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.cpp index 122c01685b4..b5b14ef2512 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.cpp @@ -30,7 +30,7 @@ HTMLOptionElement::~HTMLOptionElement() = default; void HTMLOptionElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLOptionElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLOptionElement); } void HTMLOptionElement::attribute_changed(FlyString const& name, Optional const& value) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOptionsCollection.cpp b/Userland/Libraries/LibWeb/HTML/HTMLOptionsCollection.cpp index b257f406818..4a2ff0eb406 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOptionsCollection.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLOptionsCollection.cpp @@ -30,7 +30,7 @@ HTMLOptionsCollection::~HTMLOptionsCollection() = default; void HTMLOptionsCollection::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLOptionsCollection"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLOptionsCollection); } // https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#dom-htmloptionscollection-add diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOutputElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLOutputElement.cpp index b12bcf0ab80..4dcd3c11a86 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOutputElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLOutputElement.cpp @@ -21,7 +21,7 @@ HTMLOutputElement::~HTMLOutputElement() = default; void HTMLOutputElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLOutputElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLOutputElement); } // https://html.spec.whatwg.org/multipage/form-elements.html#dom-output-defaultvalue diff --git a/Userland/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp index 6b06962d39c..4894f0558e2 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp @@ -23,7 +23,7 @@ HTMLParagraphElement::~HTMLParagraphElement() = default; void HTMLParagraphElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLParagraphElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLParagraphElement); } // https://html.spec.whatwg.org/multipage/rendering.html#tables-2 diff --git a/Userland/Libraries/LibWeb/HTML/HTMLParamElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLParamElement.cpp index d1d672b4781..af976e1cadd 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLParamElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLParamElement.cpp @@ -21,7 +21,7 @@ HTMLParamElement::~HTMLParamElement() = default; void HTMLParamElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLParamElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLParamElement); } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLPictureElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLPictureElement.cpp index 57cea48918d..7a40a145050 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLPictureElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLPictureElement.cpp @@ -21,7 +21,7 @@ HTMLPictureElement::~HTMLPictureElement() = default; void HTMLPictureElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLPictureElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLPictureElement); } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLPreElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLPreElement.cpp index ee2c2e7cf82..b14d38b060c 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLPreElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLPreElement.cpp @@ -24,7 +24,7 @@ HTMLPreElement::~HTMLPreElement() = default; void HTMLPreElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLPreElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLPreElement); } void HTMLPreElement::apply_presentational_hints(CSS::StyleProperties& style) const diff --git a/Userland/Libraries/LibWeb/HTML/HTMLProgressElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLProgressElement.cpp index bf394a134e8..c0629e1c039 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLProgressElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLProgressElement.cpp @@ -27,7 +27,7 @@ HTMLProgressElement::~HTMLProgressElement() = default; void HTMLProgressElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLProgressElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLProgressElement); } void HTMLProgressElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLQuoteElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLQuoteElement.cpp index 312f4abda80..91f0073161e 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLQuoteElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLQuoteElement.cpp @@ -23,7 +23,7 @@ HTMLQuoteElement::~HTMLQuoteElement() = default; void HTMLQuoteElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLQuoteElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLQuoteElement); } Optional HTMLQuoteElement::default_role() const diff --git a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp index 57eb0c75961..31ba38b5622 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp @@ -35,7 +35,7 @@ HTMLScriptElement::~HTMLScriptElement() = default; void HTMLScriptElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLScriptElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLScriptElement); } void HTMLScriptElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp index 4bc8958cf21..46ccb9a5da5 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp @@ -37,7 +37,7 @@ HTMLSelectElement::~HTMLSelectElement() = default; void HTMLSelectElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLSelectElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLSelectElement); } void HTMLSelectElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSlotElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLSlotElement.cpp index 4a52fc9cf26..edb0a3910bf 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLSlotElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLSlotElement.cpp @@ -24,7 +24,7 @@ HTMLSlotElement::~HTMLSlotElement() = default; void HTMLSlotElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLSlotElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLSlotElement); } void HTMLSlotElement::visit_edges(JS::Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSourceElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLSourceElement.cpp index 5ac4a955ba8..c11cd04cb88 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLSourceElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLSourceElement.cpp @@ -23,7 +23,7 @@ HTMLSourceElement::~HTMLSourceElement() = default; void HTMLSourceElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLSourceElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLSourceElement); } // https://html.spec.whatwg.org/multipage/embedded-content.html#the-source-element:the-source-element-15 diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSpanElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLSpanElement.cpp index 5999fee0828..3718131ff4e 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLSpanElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLSpanElement.cpp @@ -21,7 +21,7 @@ HTMLSpanElement::~HTMLSpanElement() = default; void HTMLSpanElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLSpanElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLSpanElement); } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.cpp index 3134fd39202..13798f7cd9d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLStyleElement.cpp @@ -21,7 +21,7 @@ HTMLStyleElement::~HTMLStyleElement() = default; void HTMLStyleElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLStyleElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLStyleElement); } void HTMLStyleElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp index 18adcb81ef6..24a6a26bf6e 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp @@ -23,7 +23,7 @@ HTMLTableCaptionElement::~HTMLTableCaptionElement() = default; void HTMLTableCaptionElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLTableCaptionElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLTableCaptionElement); } // https://html.spec.whatwg.org/multipage/rendering.html#tables-2 diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp index e283c4cea10..0a02c7104b7 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp @@ -31,7 +31,7 @@ HTMLTableCellElement::~HTMLTableCellElement() = default; void HTMLTableCellElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLTableCellElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLTableCellElement); } void HTMLTableCellElement::apply_presentational_hints(CSS::StyleProperties& style) const diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableColElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableColElement.cpp index b8123c50cc1..c14b9ca3b25 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableColElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableColElement.cpp @@ -22,7 +22,7 @@ HTMLTableColElement::~HTMLTableColElement() = default; void HTMLTableColElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLTableColElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLTableColElement); } // https://html.spec.whatwg.org/multipage/tables.html#dom-colgroup-span diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp index 2161e219a7c..85c9a4aee68 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp @@ -34,7 +34,7 @@ HTMLTableElement::~HTMLTableElement() = default; void HTMLTableElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLTableElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLTableElement); } void HTMLTableElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.cpp index c917b27fb4d..ca544937ebf 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.cpp @@ -35,7 +35,7 @@ HTMLTableRowElement::~HTMLTableRowElement() = default; void HTMLTableRowElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLTableRowElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLTableRowElement); } void HTMLTableRowElement::apply_presentational_hints(CSS::StyleProperties& style) const diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp index cd1a71f688e..332283d6c8e 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp @@ -26,7 +26,7 @@ HTMLTableSectionElement::~HTMLTableSectionElement() = default; void HTMLTableSectionElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLTableSectionElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLTableSectionElement); } void HTMLTableSectionElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTemplateElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTemplateElement.cpp index 0fccdfc1052..0cfb8118615 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTemplateElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTemplateElement.cpp @@ -22,7 +22,7 @@ HTMLTemplateElement::~HTMLTemplateElement() = default; void HTMLTemplateElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLTemplateElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLTemplateElement); m_content = heap().allocate(realm, m_document->appropriate_template_contents_owner_document()); m_content->set_host(this); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp index e059950b3f1..05ac71e2d51 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp @@ -52,7 +52,7 @@ void HTMLTextAreaElement::adjust_computed_style(CSS::StyleProperties& style) void HTMLTextAreaElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLTextAreaElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLTextAreaElement); } void HTMLTextAreaElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTimeElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTimeElement.cpp index 69f9151c011..1937644bd7a 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTimeElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTimeElement.cpp @@ -19,7 +19,7 @@ HTMLTimeElement::HTMLTimeElement(DOM::Document& document, DOM::QualifiedName qua void HTMLTimeElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLTimeElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLTimeElement); } HTMLTimeElement::~HTMLTimeElement() = default; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTitleElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTitleElement.cpp index a65e15158ec..47e989c1a58 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTitleElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTitleElement.cpp @@ -23,7 +23,7 @@ HTMLTitleElement::~HTMLTitleElement() = default; void HTMLTitleElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLTitleElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLTitleElement); } void HTMLTitleElement::children_changed() diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTrackElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTrackElement.cpp index 09c983b04d7..1f4b6403915 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTrackElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTrackElement.cpp @@ -21,7 +21,7 @@ HTMLTrackElement::~HTMLTrackElement() = default; void HTMLTrackElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLTrackElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLTrackElement); } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLUListElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLUListElement.cpp index 6488b8c0b94..93f5ba42652 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLUListElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLUListElement.cpp @@ -21,7 +21,7 @@ HTMLUListElement::~HTMLUListElement() = default; void HTMLUListElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLUListElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLUListElement); } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLUnknownElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLUnknownElement.cpp index 2e5d0102d5c..94fcbe45126 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLUnknownElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLUnknownElement.cpp @@ -21,7 +21,7 @@ HTMLUnknownElement::~HTMLUnknownElement() = default; void HTMLUnknownElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLUnknownElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLUnknownElement); } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp index b4f8ad94e0a..1253455cd86 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp @@ -33,7 +33,7 @@ HTMLVideoElement::~HTMLVideoElement() = default; void HTMLVideoElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLVideoElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(HTMLVideoElement); } void HTMLVideoElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/History.cpp b/Userland/Libraries/LibWeb/HTML/History.cpp index 31bb36efd63..5e6b8a7eaf3 100644 --- a/Userland/Libraries/LibWeb/HTML/History.cpp +++ b/Userland/Libraries/LibWeb/HTML/History.cpp @@ -31,7 +31,7 @@ History::~History() = default; void History::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "History"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(History); } void History::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/ImageData.cpp b/Userland/Libraries/LibWeb/HTML/ImageData.cpp index 1fa96c20869..648de71a04a 100644 --- a/Userland/Libraries/LibWeb/HTML/ImageData.cpp +++ b/Userland/Libraries/LibWeb/HTML/ImageData.cpp @@ -45,7 +45,7 @@ ImageData::~ImageData() = default; void ImageData::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "ImageData"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(ImageData); } void ImageData::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/Location.cpp b/Userland/Libraries/LibWeb/HTML/Location.cpp index 82ddb7b4116..c03e199bde4 100644 --- a/Userland/Libraries/LibWeb/HTML/Location.cpp +++ b/Userland/Libraries/LibWeb/HTML/Location.cpp @@ -42,7 +42,7 @@ void Location::visit_edges(Cell::Visitor& visitor) void Location::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "Location"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(Location); // FIXME: Implement steps 2.-4. diff --git a/Userland/Libraries/LibWeb/HTML/MediaError.cpp b/Userland/Libraries/LibWeb/HTML/MediaError.cpp index 50b335338af..7f509048110 100644 --- a/Userland/Libraries/LibWeb/HTML/MediaError.cpp +++ b/Userland/Libraries/LibWeb/HTML/MediaError.cpp @@ -23,7 +23,7 @@ MediaError::MediaError(JS::Realm& realm, Code code, String message) void MediaError::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "MediaError"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(MediaError); } } diff --git a/Userland/Libraries/LibWeb/HTML/MessageChannel.cpp b/Userland/Libraries/LibWeb/HTML/MessageChannel.cpp index a3bd1497879..256cef605de 100644 --- a/Userland/Libraries/LibWeb/HTML/MessageChannel.cpp +++ b/Userland/Libraries/LibWeb/HTML/MessageChannel.cpp @@ -43,7 +43,7 @@ void MessageChannel::visit_edges(Cell::Visitor& visitor) void MessageChannel::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "MessageChannel"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(MessageChannel); } MessagePort* MessageChannel::port1() diff --git a/Userland/Libraries/LibWeb/HTML/MessageEvent.cpp b/Userland/Libraries/LibWeb/HTML/MessageEvent.cpp index c5046dfccdd..1f754c62ef1 100644 --- a/Userland/Libraries/LibWeb/HTML/MessageEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/MessageEvent.cpp @@ -41,7 +41,7 @@ MessageEvent::~MessageEvent() = default; void MessageEvent::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "MessageEvent"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(MessageEvent); } void MessageEvent::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/MessagePort.cpp b/Userland/Libraries/LibWeb/HTML/MessagePort.cpp index defc64969b0..f4fef1b06d0 100644 --- a/Userland/Libraries/LibWeb/HTML/MessagePort.cpp +++ b/Userland/Libraries/LibWeb/HTML/MessagePort.cpp @@ -45,7 +45,7 @@ MessagePort::~MessagePort() void MessagePort::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "MessagePort"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(MessagePort); } void MessagePort::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/MimeType.cpp b/Userland/Libraries/LibWeb/HTML/MimeType.cpp index 571f7ea75e7..ee12da6d575 100644 --- a/Userland/Libraries/LibWeb/HTML/MimeType.cpp +++ b/Userland/Libraries/LibWeb/HTML/MimeType.cpp @@ -24,7 +24,7 @@ MimeType::~MimeType() = default; void MimeType::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "MimeType"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(MimeType); } // https://html.spec.whatwg.org/multipage/system-state.html#concept-mimetype-type diff --git a/Userland/Libraries/LibWeb/HTML/MimeTypeArray.cpp b/Userland/Libraries/LibWeb/HTML/MimeTypeArray.cpp index b55390d758a..832a0e06ddf 100644 --- a/Userland/Libraries/LibWeb/HTML/MimeTypeArray.cpp +++ b/Userland/Libraries/LibWeb/HTML/MimeTypeArray.cpp @@ -29,7 +29,7 @@ MimeTypeArray::~MimeTypeArray() = default; void MimeTypeArray::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "MimeTypeArray"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(MimeTypeArray); } // https://html.spec.whatwg.org/multipage/system-state.html#pdf-viewing-support:support-named-properties-2 diff --git a/Userland/Libraries/LibWeb/HTML/NavigateEvent.cpp b/Userland/Libraries/LibWeb/HTML/NavigateEvent.cpp index ee1eec390da..3a63f381a66 100644 --- a/Userland/Libraries/LibWeb/HTML/NavigateEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/NavigateEvent.cpp @@ -50,7 +50,7 @@ NavigateEvent::~NavigateEvent() = default; void NavigateEvent::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "NavigateEvent"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(NavigateEvent); } void NavigateEvent::visit_edges(JS::Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/Navigation.cpp b/Userland/Libraries/LibWeb/HTML/Navigation.cpp index f78d3b26f6b..b0ab3321d05 100644 --- a/Userland/Libraries/LibWeb/HTML/Navigation.cpp +++ b/Userland/Libraries/LibWeb/HTML/Navigation.cpp @@ -76,7 +76,7 @@ Navigation::~Navigation() = default; void Navigation::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "Navigation"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(Navigation); } void Navigation::visit_edges(JS::Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/NavigationCurrentEntryChangeEvent.cpp b/Userland/Libraries/LibWeb/HTML/NavigationCurrentEntryChangeEvent.cpp index f4884eece20..944304e9195 100644 --- a/Userland/Libraries/LibWeb/HTML/NavigationCurrentEntryChangeEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/NavigationCurrentEntryChangeEvent.cpp @@ -32,7 +32,7 @@ NavigationCurrentEntryChangeEvent::~NavigationCurrentEntryChangeEvent() = defaul void NavigationCurrentEntryChangeEvent::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "NavigationCurrentEntryChangeEvent"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(NavigationCurrentEntryChangeEvent); } void NavigationCurrentEntryChangeEvent::visit_edges(JS::Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/NavigationDestination.cpp b/Userland/Libraries/LibWeb/HTML/NavigationDestination.cpp index d42591b1a88..c04dcf7c210 100644 --- a/Userland/Libraries/LibWeb/HTML/NavigationDestination.cpp +++ b/Userland/Libraries/LibWeb/HTML/NavigationDestination.cpp @@ -30,7 +30,7 @@ NavigationDestination::~NavigationDestination() = default; void NavigationDestination::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "NavigationDestination"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(NavigationDestination); } void NavigationDestination::visit_edges(JS::Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/NavigationHistoryEntry.cpp b/Userland/Libraries/LibWeb/HTML/NavigationHistoryEntry.cpp index d4f6500a315..3a1d541e15d 100644 --- a/Userland/Libraries/LibWeb/HTML/NavigationHistoryEntry.cpp +++ b/Userland/Libraries/LibWeb/HTML/NavigationHistoryEntry.cpp @@ -34,7 +34,7 @@ NavigationHistoryEntry::~NavigationHistoryEntry() = default; void NavigationHistoryEntry::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "NavigationHistoryEntry"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(NavigationHistoryEntry); } void NavigationHistoryEntry::visit_edges(JS::Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/NavigationTransition.cpp b/Userland/Libraries/LibWeb/HTML/NavigationTransition.cpp index 233439ef741..9d953116b14 100644 --- a/Userland/Libraries/LibWeb/HTML/NavigationTransition.cpp +++ b/Userland/Libraries/LibWeb/HTML/NavigationTransition.cpp @@ -34,7 +34,7 @@ NavigationTransition::~NavigationTransition() = default; void NavigationTransition::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "NavigationTransition"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(NavigationTransition); } void NavigationTransition::visit_edges(JS::Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/Navigator.cpp b/Userland/Libraries/LibWeb/HTML/Navigator.cpp index d60a919f443..e4da92d0a48 100644 --- a/Userland/Libraries/LibWeb/HTML/Navigator.cpp +++ b/Userland/Libraries/LibWeb/HTML/Navigator.cpp @@ -33,7 +33,7 @@ Navigator::~Navigator() = default; void Navigator::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "Navigator"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(Navigator); } // https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-pdfviewerenabled diff --git a/Userland/Libraries/LibWeb/HTML/PageTransitionEvent.cpp b/Userland/Libraries/LibWeb/HTML/PageTransitionEvent.cpp index da408f86adf..8e359c8048f 100644 --- a/Userland/Libraries/LibWeb/HTML/PageTransitionEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/PageTransitionEvent.cpp @@ -32,7 +32,7 @@ PageTransitionEvent::~PageTransitionEvent() = default; void PageTransitionEvent::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "PageTransitionEvent"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(PageTransitionEvent); } } diff --git a/Userland/Libraries/LibWeb/HTML/Plugin.cpp b/Userland/Libraries/LibWeb/HTML/Plugin.cpp index 77b9a95ebee..6da0e473157 100644 --- a/Userland/Libraries/LibWeb/HTML/Plugin.cpp +++ b/Userland/Libraries/LibWeb/HTML/Plugin.cpp @@ -30,7 +30,7 @@ Plugin::~Plugin() = default; void Plugin::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "Plugin"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(Plugin); } // https://html.spec.whatwg.org/multipage/system-state.html#dom-plugin-name diff --git a/Userland/Libraries/LibWeb/HTML/PluginArray.cpp b/Userland/Libraries/LibWeb/HTML/PluginArray.cpp index 69f54007ba1..79104ac199f 100644 --- a/Userland/Libraries/LibWeb/HTML/PluginArray.cpp +++ b/Userland/Libraries/LibWeb/HTML/PluginArray.cpp @@ -29,7 +29,7 @@ PluginArray::~PluginArray() = default; void PluginArray::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "PluginArray"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(PluginArray); } // https://html.spec.whatwg.org/multipage/system-state.html#dom-pluginarray-refresh diff --git a/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.cpp b/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.cpp index acdb915d7e9..cb9cd964fdb 100644 --- a/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/PromiseRejectionEvent.cpp @@ -40,7 +40,7 @@ void PromiseRejectionEvent::visit_edges(Cell::Visitor& visitor) void PromiseRejectionEvent::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "PromiseRejectionEvent"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(PromiseRejectionEvent); } } diff --git a/Userland/Libraries/LibWeb/HTML/Storage.cpp b/Userland/Libraries/LibWeb/HTML/Storage.cpp index 5bdcc03171a..4c1c3bbade8 100644 --- a/Userland/Libraries/LibWeb/HTML/Storage.cpp +++ b/Userland/Libraries/LibWeb/HTML/Storage.cpp @@ -36,7 +36,7 @@ Storage::~Storage() = default; void Storage::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "Storage"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(Storage); } // https://html.spec.whatwg.org/multipage/webstorage.html#dom-storage-length diff --git a/Userland/Libraries/LibWeb/HTML/SubmitEvent.cpp b/Userland/Libraries/LibWeb/HTML/SubmitEvent.cpp index 5c3a2b171c5..ea77be544c8 100644 --- a/Userland/Libraries/LibWeb/HTML/SubmitEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/SubmitEvent.cpp @@ -32,7 +32,7 @@ SubmitEvent::~SubmitEvent() = default; void SubmitEvent::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SubmitEvent"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SubmitEvent); } void SubmitEvent::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/TextMetrics.cpp b/Userland/Libraries/LibWeb/HTML/TextMetrics.cpp index d7729bd6d35..c7f7ed45d70 100644 --- a/Userland/Libraries/LibWeb/HTML/TextMetrics.cpp +++ b/Userland/Libraries/LibWeb/HTML/TextMetrics.cpp @@ -27,7 +27,7 @@ TextMetrics::~TextMetrics() = default; void TextMetrics::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "TextMetrics"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(TextMetrics); } } diff --git a/Userland/Libraries/LibWeb/HTML/TimeRanges.cpp b/Userland/Libraries/LibWeb/HTML/TimeRanges.cpp index 5ae17229dce..0256fb2b0d7 100644 --- a/Userland/Libraries/LibWeb/HTML/TimeRanges.cpp +++ b/Userland/Libraries/LibWeb/HTML/TimeRanges.cpp @@ -21,7 +21,7 @@ TimeRanges::TimeRanges(JS::Realm& realm) void TimeRanges::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "TimeRanges"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(TimeRanges); } // https://html.spec.whatwg.org/multipage/media.html#dom-timeranges-length diff --git a/Userland/Libraries/LibWeb/HTML/ToggleEvent.cpp b/Userland/Libraries/LibWeb/HTML/ToggleEvent.cpp index e1c1f087a9e..ab5b33c8d35 100644 --- a/Userland/Libraries/LibWeb/HTML/ToggleEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/ToggleEvent.cpp @@ -32,7 +32,7 @@ ToggleEvent::ToggleEvent(JS::Realm& realm, FlyString const& event_name, ToggleEv void ToggleEvent::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "ToggleEvent"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(ToggleEvent); } } diff --git a/Userland/Libraries/LibWeb/HTML/TrackEvent.cpp b/Userland/Libraries/LibWeb/HTML/TrackEvent.cpp index e42548bda2f..512135089a8 100644 --- a/Userland/Libraries/LibWeb/HTML/TrackEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/TrackEvent.cpp @@ -31,7 +31,7 @@ TrackEvent::TrackEvent(JS::Realm& realm, FlyString const& event_name, TrackEvent void TrackEvent::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "TrackEvent"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(TrackEvent); } Variant, JS::Handle> TrackEvent::track() const diff --git a/Userland/Libraries/LibWeb/HTML/VideoTrack.cpp b/Userland/Libraries/LibWeb/HTML/VideoTrack.cpp index 9dec80409a8..d6f598f53a0 100644 --- a/Userland/Libraries/LibWeb/HTML/VideoTrack.cpp +++ b/Userland/Libraries/LibWeb/HTML/VideoTrack.cpp @@ -75,7 +75,7 @@ VideoTrack::~VideoTrack() void VideoTrack::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "VideoTrack"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(VideoTrack); auto id = s_video_track_id_allocator.allocate(); m_id = MUST(String::number(id)); diff --git a/Userland/Libraries/LibWeb/HTML/VideoTrackList.cpp b/Userland/Libraries/LibWeb/HTML/VideoTrackList.cpp index ace2faaa54f..616562de967 100644 --- a/Userland/Libraries/LibWeb/HTML/VideoTrackList.cpp +++ b/Userland/Libraries/LibWeb/HTML/VideoTrackList.cpp @@ -24,7 +24,7 @@ VideoTrackList::VideoTrackList(JS::Realm& realm) void VideoTrackList::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "VideoTrackList"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(VideoTrackList); } // https://html.spec.whatwg.org/multipage/media.html#dom-tracklist-item diff --git a/Userland/Libraries/LibWeb/HTML/Window.cpp b/Userland/Libraries/LibWeb/HTML/Window.cpp index c80f5affb34..10c55fe018a 100644 --- a/Userland/Libraries/LibWeb/HTML/Window.cpp +++ b/Userland/Libraries/LibWeb/HTML/Window.cpp @@ -806,7 +806,7 @@ WebIDL::ExceptionOr Window::initialize_web_interfaces(Badgerealm(); add_window_exposed_interfaces(*this); - Object::set_prototype(&Bindings::ensure_web_prototype(realm, "Window"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(Window); Bindings::WindowGlobalMixin::initialize(realm, *this); WindowOrWorkerGlobalScopeMixin::initialize(realm); diff --git a/Userland/Libraries/LibWeb/HTML/Worker.cpp b/Userland/Libraries/LibWeb/HTML/Worker.cpp index bdda083d551..ca5f5720f41 100644 --- a/Userland/Libraries/LibWeb/HTML/Worker.cpp +++ b/Userland/Libraries/LibWeb/HTML/Worker.cpp @@ -29,7 +29,7 @@ Worker::Worker(String const& script_url, WorkerOptions const& options, DOM::Docu void Worker::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "Worker"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(Worker); } void Worker::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/HTML/WorkerGlobalScope.cpp b/Userland/Libraries/LibWeb/HTML/WorkerGlobalScope.cpp index ad3c772385f..3267c6ccaac 100644 --- a/Userland/Libraries/LibWeb/HTML/WorkerGlobalScope.cpp +++ b/Userland/Libraries/LibWeb/HTML/WorkerGlobalScope.cpp @@ -37,7 +37,7 @@ void WorkerGlobalScope::initialize_web_interfaces(Badge(realm, "WorkerGlobalScope"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(WorkerGlobalScope); WindowOrWorkerGlobalScopeMixin::initialize(realm); diff --git a/Userland/Libraries/LibWeb/HTML/WorkerNavigator.cpp b/Userland/Libraries/LibWeb/HTML/WorkerNavigator.cpp index 1663e031a0a..40ccac732e9 100644 --- a/Userland/Libraries/LibWeb/HTML/WorkerNavigator.cpp +++ b/Userland/Libraries/LibWeb/HTML/WorkerNavigator.cpp @@ -28,7 +28,7 @@ WorkerNavigator::~WorkerNavigator() = default; void WorkerNavigator::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "WorkerNavigator"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(WorkerNavigator); } } diff --git a/Userland/Libraries/LibWeb/HighResolutionTime/Performance.cpp b/Userland/Libraries/LibWeb/HighResolutionTime/Performance.cpp index f11cbd8ef13..bd208624e76 100644 --- a/Userland/Libraries/LibWeb/HighResolutionTime/Performance.cpp +++ b/Userland/Libraries/LibWeb/HighResolutionTime/Performance.cpp @@ -33,7 +33,7 @@ Performance::~Performance() = default; void Performance::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "Performance"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(Performance); } void Performance::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/Internals/Inspector.cpp b/Userland/Libraries/LibWeb/Internals/Inspector.cpp index 2334bd4520f..761f2c80f9f 100644 --- a/Userland/Libraries/LibWeb/Internals/Inspector.cpp +++ b/Userland/Libraries/LibWeb/Internals/Inspector.cpp @@ -29,7 +29,7 @@ Inspector::~Inspector() = default; void Inspector::initialize(JS::Realm& realm) { Base::initialize(realm); - Object::set_prototype(&Bindings::ensure_web_prototype(realm, "Inspector"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(Inspector); } void Inspector::inspector_loaded() diff --git a/Userland/Libraries/LibWeb/Internals/Internals.cpp b/Userland/Libraries/LibWeb/Internals/Internals.cpp index c856b615b6d..523d21f743f 100644 --- a/Userland/Libraries/LibWeb/Internals/Internals.cpp +++ b/Userland/Libraries/LibWeb/Internals/Internals.cpp @@ -32,7 +32,7 @@ Internals::~Internals() = default; void Internals::initialize(JS::Realm& realm) { Base::initialize(realm); - Object::set_prototype(&Bindings::ensure_web_prototype(realm, "Internals"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(Internals); } void Internals::signal_text_test_is_done() diff --git a/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.cpp b/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.cpp index 28e4c733678..4309608dd23 100644 --- a/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.cpp +++ b/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.cpp @@ -70,7 +70,7 @@ void IntersectionObserver::finalize() void IntersectionObserver::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "IntersectionObserver"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(IntersectionObserver); } void IntersectionObserver::visit_edges(JS::Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserverEntry.cpp b/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserverEntry.cpp index acf6def535f..705e2a1ee43 100644 --- a/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserverEntry.cpp +++ b/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserverEntry.cpp @@ -42,7 +42,7 @@ IntersectionObserverEntry::~IntersectionObserverEntry() = default; void IntersectionObserverEntry::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "IntersectionObserverEntry"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(IntersectionObserverEntry); } void IntersectionObserverEntry::visit_edges(JS::Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/MathML/MathMLElement.cpp b/Userland/Libraries/LibWeb/MathML/MathMLElement.cpp index 06e1fb1b0c5..c6af7588340 100644 --- a/Userland/Libraries/LibWeb/MathML/MathMLElement.cpp +++ b/Userland/Libraries/LibWeb/MathML/MathMLElement.cpp @@ -22,7 +22,7 @@ MathMLElement::MathMLElement(DOM::Document& document, DOM::QualifiedName qualifi void MathMLElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "MathMLElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(MathMLElement); m_dataset = HTML::DOMStringMap::create(*this); } diff --git a/Userland/Libraries/LibWeb/NavigationTiming/PerformanceTiming.cpp b/Userland/Libraries/LibWeb/NavigationTiming/PerformanceTiming.cpp index e259b51030c..c3a4260c6f9 100644 --- a/Userland/Libraries/LibWeb/NavigationTiming/PerformanceTiming.cpp +++ b/Userland/Libraries/LibWeb/NavigationTiming/PerformanceTiming.cpp @@ -21,7 +21,7 @@ PerformanceTiming::~PerformanceTiming() = default; void PerformanceTiming::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "PerformanceTiming"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(PerformanceTiming); } void PerformanceTiming::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/PerformanceTimeline/PerformanceEntry.cpp b/Userland/Libraries/LibWeb/PerformanceTimeline/PerformanceEntry.cpp index 22872d449b8..cd89a856937 100644 --- a/Userland/Libraries/LibWeb/PerformanceTimeline/PerformanceEntry.cpp +++ b/Userland/Libraries/LibWeb/PerformanceTimeline/PerformanceEntry.cpp @@ -23,7 +23,7 @@ PerformanceEntry::~PerformanceEntry() = default; void PerformanceEntry::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "PerformanceEntry"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(PerformanceEntry); } } diff --git a/Userland/Libraries/LibWeb/PerformanceTimeline/PerformanceObserver.cpp b/Userland/Libraries/LibWeb/PerformanceTimeline/PerformanceObserver.cpp index 55ca52f4f9c..a71807f926c 100644 --- a/Userland/Libraries/LibWeb/PerformanceTimeline/PerformanceObserver.cpp +++ b/Userland/Libraries/LibWeb/PerformanceTimeline/PerformanceObserver.cpp @@ -34,7 +34,7 @@ PerformanceObserver::~PerformanceObserver() = default; void PerformanceObserver::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "PerformanceObserver"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(PerformanceObserver); } void PerformanceObserver::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/PerformanceTimeline/PerformanceObserverEntryList.cpp b/Userland/Libraries/LibWeb/PerformanceTimeline/PerformanceObserverEntryList.cpp index 4d0fa9be667..9ada84eb15d 100644 --- a/Userland/Libraries/LibWeb/PerformanceTimeline/PerformanceObserverEntryList.cpp +++ b/Userland/Libraries/LibWeb/PerformanceTimeline/PerformanceObserverEntryList.cpp @@ -26,7 +26,7 @@ PerformanceObserverEntryList::~PerformanceObserverEntryList() = default; void PerformanceObserverEntryList::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "PerformanceObserverEntryList"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(PerformanceObserverEntryList); } void PerformanceObserverEntryList::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/RequestIdleCallback/IdleDeadline.cpp b/Userland/Libraries/LibWeb/RequestIdleCallback/IdleDeadline.cpp index 3f0b2772640..d738b14aa52 100644 --- a/Userland/Libraries/LibWeb/RequestIdleCallback/IdleDeadline.cpp +++ b/Userland/Libraries/LibWeb/RequestIdleCallback/IdleDeadline.cpp @@ -28,7 +28,7 @@ IdleDeadline::IdleDeadline(JS::Realm& realm, bool did_timeout) void IdleDeadline::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "IdleDeadline"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(IdleDeadline); } IdleDeadline::~IdleDeadline() = default; diff --git a/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserver.cpp b/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserver.cpp index f18548b8d57..191867102ec 100644 --- a/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserver.cpp +++ b/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserver.cpp @@ -36,7 +36,7 @@ ResizeObserver::~ResizeObserver() = default; void ResizeObserver::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "ResizeObserver"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(ResizeObserver); } void ResizeObserver::visit_edges(JS::Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserverEntry.cpp b/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserverEntry.cpp index 9f04005fa9f..2c0a4a5640d 100644 --- a/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserverEntry.cpp +++ b/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserverEntry.cpp @@ -61,7 +61,7 @@ WebIDL::ExceptionOr> ResizeObserverEntry:: void ResizeObserverEntry::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "ResizeObserverEntry"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(ResizeObserverEntry); } void ResizeObserverEntry::visit_edges(JS::Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserverSize.cpp b/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserverSize.cpp index 64cbe591d61..3b48300efee 100644 --- a/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserverSize.cpp +++ b/Userland/Libraries/LibWeb/ResizeObserver/ResizeObserverSize.cpp @@ -17,7 +17,7 @@ JS_DEFINE_ALLOCATOR(ResizeObserverSize); void ResizeObserverSize::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "ResizeObserverSize"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(ResizeObserverSize); } // https://drafts.csswg.org/resize-observer-1/#calculate-box-size diff --git a/Userland/Libraries/LibWeb/SVG/SVGAnimatedLength.cpp b/Userland/Libraries/LibWeb/SVG/SVGAnimatedLength.cpp index 7415dfd8f79..4a12507ed00 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGAnimatedLength.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGAnimatedLength.cpp @@ -30,7 +30,7 @@ SVGAnimatedLength::~SVGAnimatedLength() = default; void SVGAnimatedLength::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGAnimatedLength"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGAnimatedLength); } void SVGAnimatedLength::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/SVG/SVGAnimatedNumber.cpp b/Userland/Libraries/LibWeb/SVG/SVGAnimatedNumber.cpp index 4107b84a6af..76bb3f61c47 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGAnimatedNumber.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGAnimatedNumber.cpp @@ -28,7 +28,7 @@ SVGAnimatedNumber::~SVGAnimatedNumber() = default; void SVGAnimatedNumber::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGAnimatedNumber"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGAnimatedNumber); } } diff --git a/Userland/Libraries/LibWeb/SVG/SVGAnimatedRect.cpp b/Userland/Libraries/LibWeb/SVG/SVGAnimatedRect.cpp index 1735c0b2a0f..521178f9ebd 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGAnimatedRect.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGAnimatedRect.cpp @@ -23,7 +23,7 @@ SVGAnimatedRect::~SVGAnimatedRect() = default; void SVGAnimatedRect::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGAnimatedRect"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGAnimatedRect); m_base_val = Geometry::DOMRect::create(realm, { 0, 0, 0, 0 }); m_anim_val = Geometry::DOMRect::create(realm, { 0, 0, 0, 0 }); } diff --git a/Userland/Libraries/LibWeb/SVG/SVGAnimatedString.cpp b/Userland/Libraries/LibWeb/SVG/SVGAnimatedString.cpp index 83d1c4a1314..e2d987c87d1 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGAnimatedString.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGAnimatedString.cpp @@ -33,7 +33,7 @@ SVGAnimatedString::~SVGAnimatedString() = default; void SVGAnimatedString::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGAnimatedString"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGAnimatedString); } void SVGAnimatedString::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/SVG/SVGCircleElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGCircleElement.cpp index 0f2d750238b..cb3a21b5e46 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGCircleElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGCircleElement.cpp @@ -24,7 +24,7 @@ SVGCircleElement::SVGCircleElement(DOM::Document& document, DOM::QualifiedName q void SVGCircleElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGCircleElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGCircleElement); } void SVGCircleElement::apply_presentational_hints(CSS::StyleProperties& style) const diff --git a/Userland/Libraries/LibWeb/SVG/SVGClipPathElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGClipPathElement.cpp index a9d61e3d776..f59b0cfa185 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGClipPathElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGClipPathElement.cpp @@ -23,7 +23,7 @@ SVGClipPathElement::~SVGClipPathElement() void SVGClipPathElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGClipPathElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGClipPathElement); } JS::GCPtr SVGClipPathElement::create_layout_node(NonnullRefPtr) diff --git a/Userland/Libraries/LibWeb/SVG/SVGDefsElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGDefsElement.cpp index 62457ef9b93..0300fe017a8 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGDefsElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGDefsElement.cpp @@ -24,7 +24,7 @@ SVGDefsElement::~SVGDefsElement() void SVGDefsElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGDefsElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGDefsElement); } } diff --git a/Userland/Libraries/LibWeb/SVG/SVGElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGElement.cpp index 4d0d1904e49..b46d94bbc0a 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGElement.cpp @@ -23,7 +23,7 @@ SVGElement::SVGElement(DOM::Document& document, DOM::QualifiedName qualified_nam void SVGElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGElement); m_dataset = HTML::DOMStringMap::create(*this); } diff --git a/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.cpp index a0efafc833c..1672be59be2 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.cpp @@ -21,7 +21,7 @@ SVGEllipseElement::SVGEllipseElement(DOM::Document& document, DOM::QualifiedName void SVGEllipseElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGEllipseElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGEllipseElement); } void SVGEllipseElement::attribute_changed(FlyString const& name, Optional const& value) diff --git a/Userland/Libraries/LibWeb/SVG/SVGForeignObjectElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGForeignObjectElement.cpp index 0829c26ebcc..8804fb3ebf8 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGForeignObjectElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGForeignObjectElement.cpp @@ -27,7 +27,7 @@ SVGForeignObjectElement::~SVGForeignObjectElement() = default; void SVGForeignObjectElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGForeignObjectElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGForeignObjectElement); // FIXME: These never actually get updated! m_x = SVGAnimatedLength::create(realm, SVGLength::create(realm, 0, 0), SVGLength::create(realm, 0, 0)); diff --git a/Userland/Libraries/LibWeb/SVG/SVGGeometryElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGGeometryElement.cpp index 6d796378154..8cec7a7326e 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGGeometryElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGGeometryElement.cpp @@ -18,7 +18,7 @@ SVGGeometryElement::SVGGeometryElement(DOM::Document& document, DOM::QualifiedNa void SVGGeometryElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGGeometryElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGGeometryElement); } JS::GCPtr SVGGeometryElement::create_layout_node(NonnullRefPtr style) diff --git a/Userland/Libraries/LibWeb/SVG/SVGGradientElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGGradientElement.cpp index c1a724d5e63..df0b5d20b44 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGGradientElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGGradientElement.cpp @@ -135,7 +135,7 @@ JS::GCPtr SVGGradientElement::linked_gradient(HashTabl void SVGGradientElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGGradientElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGGradientElement); } } diff --git a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp index d2facaa10c1..c48c899e76f 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp @@ -29,7 +29,7 @@ SVGGraphicsElement::SVGGraphicsElement(DOM::Document& document, DOM::QualifiedNa void SVGGraphicsElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGGraphicsElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGGraphicsElement); } void SVGGraphicsElement::attribute_changed(FlyString const& name, Optional const& value) diff --git a/Userland/Libraries/LibWeb/SVG/SVGLength.cpp b/Userland/Libraries/LibWeb/SVG/SVGLength.cpp index 7ec091617dc..f68e463727c 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGLength.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGLength.cpp @@ -74,7 +74,7 @@ SVGLength::SVGLength(JS::Realm& realm, u8 unit_type, float value) void SVGLength::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGLength"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGLength); } SVGLength::~SVGLength() = default; diff --git a/Userland/Libraries/LibWeb/SVG/SVGLineElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGLineElement.cpp index 55998a3b6a6..8fe58111c8a 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGLineElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGLineElement.cpp @@ -21,7 +21,7 @@ SVGLineElement::SVGLineElement(DOM::Document& document, DOM::QualifiedName quali void SVGLineElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGLineElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGLineElement); } void SVGLineElement::attribute_changed(FlyString const& name, Optional const& value) diff --git a/Userland/Libraries/LibWeb/SVG/SVGLinearGradientElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGLinearGradientElement.cpp index 2e78b91e39a..6dbe62f3745 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGLinearGradientElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGLinearGradientElement.cpp @@ -23,7 +23,7 @@ SVGLinearGradientElement::SVGLinearGradientElement(DOM::Document& document, DOM: void SVGLinearGradientElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGLinearGradientElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGLinearGradientElement); } void SVGLinearGradientElement::attribute_changed(FlyString const& name, Optional const& value) diff --git a/Userland/Libraries/LibWeb/SVG/SVGMaskElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGMaskElement.cpp index cb900680752..0104c0726ae 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGMaskElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGMaskElement.cpp @@ -24,7 +24,7 @@ SVGMaskElement::~SVGMaskElement() = default; void SVGMaskElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGMaskElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGMaskElement); } JS::GCPtr SVGMaskElement::create_layout_node(NonnullRefPtr) diff --git a/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp index b5685a7f1f7..1b462e27ff8 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp @@ -92,7 +92,7 @@ SVGPathElement::SVGPathElement(DOM::Document& document, DOM::QualifiedName quali void SVGPathElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGPathElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGPathElement); } void SVGPathElement::attribute_changed(FlyString const& name, Optional const& value) diff --git a/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.cpp index 41c476c15a4..f8808902e73 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.cpp @@ -21,7 +21,7 @@ SVGPolygonElement::SVGPolygonElement(DOM::Document& document, DOM::QualifiedName void SVGPolygonElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGPolygonElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGPolygonElement); } void SVGPolygonElement::attribute_changed(FlyString const& name, Optional const& value) diff --git a/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.cpp index 0e282d917d3..0e9ea1d8727 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.cpp @@ -21,7 +21,7 @@ SVGPolylineElement::SVGPolylineElement(DOM::Document& document, DOM::QualifiedNa void SVGPolylineElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGPolylineElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGPolylineElement); } void SVGPolylineElement::attribute_changed(FlyString const& name, Optional const& value) diff --git a/Userland/Libraries/LibWeb/SVG/SVGRadialGradientElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGRadialGradientElement.cpp index f2a282e42aa..70280c3ae6a 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGRadialGradientElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGRadialGradientElement.cpp @@ -20,7 +20,7 @@ SVGRadialGradientElement::SVGRadialGradientElement(DOM::Document& document, DOM: void SVGRadialGradientElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGRadialGradientElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGRadialGradientElement); } void SVGRadialGradientElement::attribute_changed(FlyString const& name, Optional const& value) diff --git a/Userland/Libraries/LibWeb/SVG/SVGRectElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGRectElement.cpp index c352a91ebac..77a9aa976d4 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGRectElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGRectElement.cpp @@ -23,7 +23,7 @@ SVGRectElement::SVGRectElement(DOM::Document& document, DOM::QualifiedName quali void SVGRectElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGRectElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGRectElement); } void SVGRectElement::attribute_changed(FlyString const& name, Optional const& value) diff --git a/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp index 35a76c2ab1e..5d4e709bbe5 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp @@ -29,7 +29,7 @@ SVGSVGElement::SVGSVGElement(DOM::Document& document, DOM::QualifiedName qualifi void SVGSVGElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGSVGElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGSVGElement); m_view_box_for_bindings = heap().allocate(realm, realm); } diff --git a/Userland/Libraries/LibWeb/SVG/SVGScriptElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGScriptElement.cpp index e4f092eaff8..03e1f031a5e 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGScriptElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGScriptElement.cpp @@ -21,7 +21,7 @@ SVGScriptElement::SVGScriptElement(DOM::Document& document, DOM::QualifiedName q void SVGScriptElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGScriptElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGScriptElement); } void SVGScriptElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/SVG/SVGStopElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGStopElement.cpp index 4a8147af9d2..a81e4480ffc 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGStopElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGStopElement.cpp @@ -68,7 +68,7 @@ JS::NonnullGCPtr SVGStopElement::offset() const void SVGStopElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGStopElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGStopElement); } } diff --git a/Userland/Libraries/LibWeb/SVG/SVGStyleElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGStyleElement.cpp index 5817156eaae..114ce906537 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGStyleElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGStyleElement.cpp @@ -20,7 +20,7 @@ SVGStyleElement::~SVGStyleElement() = default; void SVGStyleElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGStyleElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGStyleElement); } void SVGStyleElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/SVG/SVGSymbolElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGSymbolElement.cpp index d21da704b70..d59c6b72f41 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGSymbolElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGSymbolElement.cpp @@ -27,7 +27,7 @@ SVGSymbolElement::SVGSymbolElement(DOM::Document& document, DOM::QualifiedName q void SVGSymbolElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGSymbolElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGSymbolElement); } // https://svgwg.org/svg2-draft/struct.html#SymbolNotes diff --git a/Userland/Libraries/LibWeb/SVG/SVGTSpanElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGTSpanElement.cpp index c11504b28b6..59761cfe726 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGTSpanElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGTSpanElement.cpp @@ -20,7 +20,7 @@ SVGTSpanElement::SVGTSpanElement(DOM::Document& document, DOM::QualifiedName qua void SVGTSpanElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGTSpanElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGTSpanElement); } JS::GCPtr SVGTSpanElement::create_layout_node(NonnullRefPtr style) diff --git a/Userland/Libraries/LibWeb/SVG/SVGTextContentElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGTextContentElement.cpp index 38d374c8927..24d4e01688d 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGTextContentElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGTextContentElement.cpp @@ -26,7 +26,7 @@ SVGTextContentElement::SVGTextContentElement(DOM::Document& document, DOM::Quali void SVGTextContentElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGTextContentElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGTextContentElement); } Optional SVGTextContentElement::text_anchor() const diff --git a/Userland/Libraries/LibWeb/SVG/SVGTextElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGTextElement.cpp index af76a7bc6e1..dac940e67d8 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGTextElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGTextElement.cpp @@ -19,7 +19,7 @@ SVGTextElement::SVGTextElement(DOM::Document& document, DOM::QualifiedName quali void SVGTextElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGTextElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGTextElement); } JS::GCPtr SVGTextElement::create_layout_node(NonnullRefPtr style) diff --git a/Userland/Libraries/LibWeb/SVG/SVGTextPathElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGTextPathElement.cpp index 38170449574..ac9fe8b7ce7 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGTextPathElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGTextPathElement.cpp @@ -30,7 +30,7 @@ JS::GCPtr SVGTextPathElement::path_or_shape() const void SVGTextPathElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGTextPathElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGTextPathElement); } void SVGTextPathElement::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/SVG/SVGTextPositioningElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGTextPositioningElement.cpp index 58a2c298cd9..13d8c9ba7c1 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGTextPositioningElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGTextPositioningElement.cpp @@ -25,7 +25,7 @@ SVGTextPositioningElement::SVGTextPositioningElement(DOM::Document& document, DO void SVGTextPositioningElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGTextPositioningElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGTextPositioningElement); } void SVGTextPositioningElement::attribute_changed(FlyString const& name, Optional const& value) diff --git a/Userland/Libraries/LibWeb/SVG/SVGTitleElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGTitleElement.cpp index 0c1783d7eaf..19464011cc6 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGTitleElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGTitleElement.cpp @@ -21,7 +21,7 @@ SVGTitleElement::SVGTitleElement(DOM::Document& document, DOM::QualifiedName qua void SVGTitleElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGTitleElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGTitleElement); } JS::GCPtr SVGTitleElement::create_layout_node(NonnullRefPtr) diff --git a/Userland/Libraries/LibWeb/SVG/SVGUseElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGUseElement.cpp index 9aa31151f6f..37d6a17f2b6 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGUseElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGUseElement.cpp @@ -28,7 +28,7 @@ SVGUseElement::SVGUseElement(DOM::Document& document, DOM::QualifiedName qualifi void SVGUseElement::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "SVGUseElement"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGUseElement); // The shadow tree is open (inspectable by script), but read-only. auto shadow_root = heap().allocate(realm, document(), *this, Bindings::ShadowRootMode::Open); diff --git a/Userland/Libraries/LibWeb/Selection/Selection.cpp b/Userland/Libraries/LibWeb/Selection/Selection.cpp index bf90fbe6108..5fc0e7596f4 100644 --- a/Userland/Libraries/LibWeb/Selection/Selection.cpp +++ b/Userland/Libraries/LibWeb/Selection/Selection.cpp @@ -29,7 +29,7 @@ Selection::~Selection() = default; void Selection::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "Selection"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(Selection); } // https://w3c.github.io/selection-api/#dfn-empty diff --git a/Userland/Libraries/LibWeb/Streams/ByteLengthQueuingStrategy.cpp b/Userland/Libraries/LibWeb/Streams/ByteLengthQueuingStrategy.cpp index 986da72410a..a7eefe9b335 100644 --- a/Userland/Libraries/LibWeb/Streams/ByteLengthQueuingStrategy.cpp +++ b/Userland/Libraries/LibWeb/Streams/ByteLengthQueuingStrategy.cpp @@ -41,7 +41,7 @@ WebIDL::ExceptionOr> ByteLengthQueuingStr void ByteLengthQueuingStrategy::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "ByteLengthQueuingStrategy"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(ByteLengthQueuingStrategy); } } diff --git a/Userland/Libraries/LibWeb/Streams/CountQueuingStrategy.cpp b/Userland/Libraries/LibWeb/Streams/CountQueuingStrategy.cpp index 39824f0d735..9b28ca4a5c3 100644 --- a/Userland/Libraries/LibWeb/Streams/CountQueuingStrategy.cpp +++ b/Userland/Libraries/LibWeb/Streams/CountQueuingStrategy.cpp @@ -41,7 +41,7 @@ WebIDL::ExceptionOr> CountQueuingStrategy void CountQueuingStrategy::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "CountQueuingStrategy"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(CountQueuingStrategy); } } diff --git a/Userland/Libraries/LibWeb/Streams/ReadableByteStreamController.cpp b/Userland/Libraries/LibWeb/Streams/ReadableByteStreamController.cpp index 243e6383c4f..df79e0c5f7e 100644 --- a/Userland/Libraries/LibWeb/Streams/ReadableByteStreamController.cpp +++ b/Userland/Libraries/LibWeb/Streams/ReadableByteStreamController.cpp @@ -66,7 +66,7 @@ ReadableByteStreamController::ReadableByteStreamController(JS::Realm& realm) void ReadableByteStreamController::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "ReadableByteStreamController"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(ReadableByteStreamController); } // https://streams.spec.whatwg.org/#rbs-controller-enqueue diff --git a/Userland/Libraries/LibWeb/Streams/ReadableStream.cpp b/Userland/Libraries/LibWeb/Streams/ReadableStream.cpp index f4eb80abfe4..bd347de7708 100644 --- a/Userland/Libraries/LibWeb/Streams/ReadableStream.cpp +++ b/Userland/Libraries/LibWeb/Streams/ReadableStream.cpp @@ -118,7 +118,7 @@ WebIDL::ExceptionOr ReadableStream::tee() void ReadableStream::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "ReadableStream"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(ReadableStream); } void ReadableStream::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/Streams/ReadableStreamBYOBReader.cpp b/Userland/Libraries/LibWeb/Streams/ReadableStreamBYOBReader.cpp index 638871c2144..1c923911ca8 100644 --- a/Userland/Libraries/LibWeb/Streams/ReadableStreamBYOBReader.cpp +++ b/Userland/Libraries/LibWeb/Streams/ReadableStreamBYOBReader.cpp @@ -27,7 +27,7 @@ ReadableStreamBYOBReader::ReadableStreamBYOBReader(JS::Realm& realm) void ReadableStreamBYOBReader::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "ReadableStreamBYOBReader"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(ReadableStreamBYOBReader); } // https://streams.spec.whatwg.org/#byob-reader-constructor diff --git a/Userland/Libraries/LibWeb/Streams/ReadableStreamBYOBRequest.cpp b/Userland/Libraries/LibWeb/Streams/ReadableStreamBYOBRequest.cpp index d56e9278c2e..7e87dd3a16f 100644 --- a/Userland/Libraries/LibWeb/Streams/ReadableStreamBYOBRequest.cpp +++ b/Userland/Libraries/LibWeb/Streams/ReadableStreamBYOBRequest.cpp @@ -30,7 +30,7 @@ ReadableStreamBYOBRequest::ReadableStreamBYOBRequest(JS::Realm& realm) void ReadableStreamBYOBRequest::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "ReadableStreamBYOBRequest"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(ReadableStreamBYOBRequest); } void ReadableStreamBYOBRequest::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/Streams/ReadableStreamDefaultController.cpp b/Userland/Libraries/LibWeb/Streams/ReadableStreamDefaultController.cpp index 75995c45224..94903519aea 100644 --- a/Userland/Libraries/LibWeb/Streams/ReadableStreamDefaultController.cpp +++ b/Userland/Libraries/LibWeb/Streams/ReadableStreamDefaultController.cpp @@ -129,7 +129,7 @@ WebIDL::ExceptionOr ReadableStreamDefaultController::release_steps() void ReadableStreamDefaultController::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "ReadableStreamDefaultController"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(ReadableStreamDefaultController); } void ReadableStreamDefaultController::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/Streams/ReadableStreamDefaultReader.cpp b/Userland/Libraries/LibWeb/Streams/ReadableStreamDefaultReader.cpp index fa2df5f9461..34a0b78786a 100644 --- a/Userland/Libraries/LibWeb/Streams/ReadableStreamDefaultReader.cpp +++ b/Userland/Libraries/LibWeb/Streams/ReadableStreamDefaultReader.cpp @@ -52,7 +52,7 @@ ReadableStreamDefaultReader::ReadableStreamDefaultReader(JS::Realm& realm) void ReadableStreamDefaultReader::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "ReadableStreamDefaultReader"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(ReadableStreamDefaultReader); } void ReadableStreamDefaultReader::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/Streams/TransformStream.cpp b/Userland/Libraries/LibWeb/Streams/TransformStream.cpp index e7a97009733..470efd695e9 100644 --- a/Userland/Libraries/LibWeb/Streams/TransformStream.cpp +++ b/Userland/Libraries/LibWeb/Streams/TransformStream.cpp @@ -84,7 +84,7 @@ TransformStream::~TransformStream() = default; void TransformStream::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "TransformStream"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(TransformStream); } void TransformStream::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/Streams/TransformStreamDefaultController.cpp b/Userland/Libraries/LibWeb/Streams/TransformStreamDefaultController.cpp index c856581fb9f..c825b656975 100644 --- a/Userland/Libraries/LibWeb/Streams/TransformStreamDefaultController.cpp +++ b/Userland/Libraries/LibWeb/Streams/TransformStreamDefaultController.cpp @@ -22,7 +22,7 @@ TransformStreamDefaultController::~TransformStreamDefaultController() = default; void TransformStreamDefaultController::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "TransformStreamDefaultController"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(TransformStreamDefaultController); } void TransformStreamDefaultController::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/Streams/WritableStream.cpp b/Userland/Libraries/LibWeb/Streams/WritableStream.cpp index bbad973dc68..022b7001062 100644 --- a/Userland/Libraries/LibWeb/Streams/WritableStream.cpp +++ b/Userland/Libraries/LibWeb/Streams/WritableStream.cpp @@ -108,7 +108,7 @@ WritableStream::WritableStream(JS::Realm& realm) void WritableStream::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "WritableStream"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(WritableStream); } void WritableStream::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/Streams/WritableStreamDefaultWriter.cpp b/Userland/Libraries/LibWeb/Streams/WritableStreamDefaultWriter.cpp index 574900edd8a..877f9a9c654 100644 --- a/Userland/Libraries/LibWeb/Streams/WritableStreamDefaultWriter.cpp +++ b/Userland/Libraries/LibWeb/Streams/WritableStreamDefaultWriter.cpp @@ -128,7 +128,7 @@ WritableStreamDefaultWriter::WritableStreamDefaultWriter(JS::Realm& realm) void WritableStreamDefaultWriter::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "WritableStreamDefaultWriter"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(WritableStreamDefaultWriter); } void WritableStreamDefaultWriter::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/UIEvents/FocusEvent.cpp b/Userland/Libraries/LibWeb/UIEvents/FocusEvent.cpp index 6659dc803ac..83bfc83de1b 100644 --- a/Userland/Libraries/LibWeb/UIEvents/FocusEvent.cpp +++ b/Userland/Libraries/LibWeb/UIEvents/FocusEvent.cpp @@ -27,7 +27,7 @@ FocusEvent::~FocusEvent() = default; void FocusEvent::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "FocusEvent"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(FocusEvent); } } diff --git a/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.cpp b/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.cpp index fbfda1384a6..6dd594d230c 100644 --- a/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.cpp +++ b/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.cpp @@ -727,7 +727,7 @@ KeyboardEvent::~KeyboardEvent() = default; void KeyboardEvent::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "KeyboardEvent"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(KeyboardEvent); } } diff --git a/Userland/Libraries/LibWeb/UIEvents/MouseEvent.cpp b/Userland/Libraries/LibWeb/UIEvents/MouseEvent.cpp index d7967125799..8fc26f64a03 100644 --- a/Userland/Libraries/LibWeb/UIEvents/MouseEvent.cpp +++ b/Userland/Libraries/LibWeb/UIEvents/MouseEvent.cpp @@ -53,7 +53,7 @@ MouseEvent::~MouseEvent() = default; void MouseEvent::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "MouseEvent"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(MouseEvent); } bool MouseEvent::get_modifier_state(String const& key_arg) const diff --git a/Userland/Libraries/LibWeb/UIEvents/UIEvent.cpp b/Userland/Libraries/LibWeb/UIEvents/UIEvent.cpp index dc53e963e25..c2a25ec07ab 100644 --- a/Userland/Libraries/LibWeb/UIEvents/UIEvent.cpp +++ b/Userland/Libraries/LibWeb/UIEvents/UIEvent.cpp @@ -38,7 +38,7 @@ UIEvent::~UIEvent() = default; void UIEvent::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "UIEvent"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(UIEvent); } void UIEvent::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/UIEvents/WheelEvent.cpp b/Userland/Libraries/LibWeb/UIEvents/WheelEvent.cpp index 21f428b82a6..9b938ef0b52 100644 --- a/Userland/Libraries/LibWeb/UIEvents/WheelEvent.cpp +++ b/Userland/Libraries/LibWeb/UIEvents/WheelEvent.cpp @@ -29,7 +29,7 @@ WheelEvent::~WheelEvent() = default; void WheelEvent::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "WheelEvent"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(WheelEvent); } JS::NonnullGCPtr WheelEvent::create(JS::Realm& realm, FlyString const& event_name, WheelEventInit const& event_init, double page_x, double page_y, double offset_x, double offset_y) diff --git a/Userland/Libraries/LibWeb/UserTiming/PerformanceMark.cpp b/Userland/Libraries/LibWeb/UserTiming/PerformanceMark.cpp index 8aafdc12dbc..6ec1f15a52c 100644 --- a/Userland/Libraries/LibWeb/UserTiming/PerformanceMark.cpp +++ b/Userland/Libraries/LibWeb/UserTiming/PerformanceMark.cpp @@ -101,7 +101,7 @@ FlyString const& PerformanceMark::entry_type() const void PerformanceMark::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "PerformanceMark"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(PerformanceMark); } void PerformanceMark::visit_edges(JS::Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/UserTiming/PerformanceMeasure.cpp b/Userland/Libraries/LibWeb/UserTiming/PerformanceMeasure.cpp index a8c5918f1e6..9aab6ebe8f8 100644 --- a/Userland/Libraries/LibWeb/UserTiming/PerformanceMeasure.cpp +++ b/Userland/Libraries/LibWeb/UserTiming/PerformanceMeasure.cpp @@ -39,7 +39,7 @@ FlyString const& PerformanceMeasure::entry_type() const void PerformanceMeasure::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "PerformanceMeasure"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(PerformanceMeasure); } void PerformanceMeasure::visit_edges(JS::Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/WebAssembly/Instance.cpp b/Userland/Libraries/LibWeb/WebAssembly/Instance.cpp index d2178f86d60..6bf56018c62 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/Instance.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/Instance.cpp @@ -45,7 +45,7 @@ void Instance::initialize(JS::Realm& realm) auto& vm = this->vm(); Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "WebAssembly.Instance"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE_WITH_CUSTOM_NAME(Instance, WebAssembly.Instance); auto& instance = *Detail::s_instantiated_modules[m_index]; auto& cache = Detail::s_module_caches.at(m_index); diff --git a/Userland/Libraries/LibWeb/WebAssembly/Memory.cpp b/Userland/Libraries/LibWeb/WebAssembly/Memory.cpp index 0292f96352c..caed9aa77dd 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/Memory.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/Memory.cpp @@ -44,7 +44,7 @@ Memory::Memory(JS::Realm& realm, Wasm::MemoryAddress address) void Memory::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "WebAssembly.Memory"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE_WITH_CUSTOM_NAME(Memory, WebAssembly.Memory); } // https://webassembly.github.io/spec/js-api/#dom-memory-grow diff --git a/Userland/Libraries/LibWeb/WebAssembly/Module.cpp b/Userland/Libraries/LibWeb/WebAssembly/Module.cpp index fda278574ca..83abf4043d6 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/Module.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/Module.cpp @@ -34,7 +34,7 @@ Module::Module(JS::Realm& realm, size_t index) void Module::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "WebAssembly.Module"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE_WITH_CUSTOM_NAME(Module, WebAssembly.Module); } Wasm::Module const& Module::module() const diff --git a/Userland/Libraries/LibWeb/WebAssembly/Table.cpp b/Userland/Libraries/LibWeb/WebAssembly/Table.cpp index 15d4df725d7..986b75a12d7 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/Table.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/Table.cpp @@ -66,7 +66,7 @@ Table::Table(JS::Realm& realm, Wasm::TableAddress address) void Table::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "WebAssembly.Table"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE_WITH_CUSTOM_NAME(Table, WebAssembly.Table); } // https://webassembly.github.io/spec/js-api/#dom-table-grow diff --git a/Userland/Libraries/LibWeb/WebAudio/AudioContext.cpp b/Userland/Libraries/LibWeb/WebAudio/AudioContext.cpp index 6d0f24c6cc5..7fc1ad07f6b 100644 --- a/Userland/Libraries/LibWeb/WebAudio/AudioContext.cpp +++ b/Userland/Libraries/LibWeb/WebAudio/AudioContext.cpp @@ -84,7 +84,7 @@ AudioContext::~AudioContext() = default; void AudioContext::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "AudioContext"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(AudioContext); } void AudioContext::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/WebAudio/BaseAudioContext.cpp b/Userland/Libraries/LibWeb/WebAudio/BaseAudioContext.cpp index eeaab2a2f9e..f9bfce66c46 100644 --- a/Userland/Libraries/LibWeb/WebAudio/BaseAudioContext.cpp +++ b/Userland/Libraries/LibWeb/WebAudio/BaseAudioContext.cpp @@ -20,7 +20,7 @@ BaseAudioContext::~BaseAudioContext() = default; void BaseAudioContext::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "BaseAudioContext"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(BaseAudioContext); } void BaseAudioContext::set_onstatechange(WebIDL::CallbackType* event_handler) diff --git a/Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.cpp b/Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.cpp index ad338aac549..0de708ff748 100644 --- a/Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.cpp +++ b/Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.cpp @@ -32,7 +32,7 @@ WebGLContextEvent::~WebGLContextEvent() = default; void WebGLContextEvent::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "WebGLContextEvent"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(WebGLContextEvent); } } diff --git a/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContext.cpp b/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContext.cpp index a8d92f87417..8396216257b 100644 --- a/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContext.cpp +++ b/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContext.cpp @@ -65,7 +65,7 @@ WebGLRenderingContext::~WebGLRenderingContext() = default; void WebGLRenderingContext::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "WebGLRenderingContext"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(WebGLRenderingContext); } } diff --git a/Userland/Libraries/LibWeb/WebIDL/DOMException.cpp b/Userland/Libraries/LibWeb/WebIDL/DOMException.cpp index 406538d589c..824e73528f2 100644 --- a/Userland/Libraries/LibWeb/WebIDL/DOMException.cpp +++ b/Userland/Libraries/LibWeb/WebIDL/DOMException.cpp @@ -33,7 +33,7 @@ DOMException::~DOMException() = default; void DOMException::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "DOMException"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(DOMException); } } diff --git a/Userland/Libraries/LibWeb/WebSockets/WebSocket.cpp b/Userland/Libraries/LibWeb/WebSockets/WebSocket.cpp index c8e5c72a5f7..4feeed2f986 100644 --- a/Userland/Libraries/LibWeb/WebSockets/WebSocket.cpp +++ b/Userland/Libraries/LibWeb/WebSockets/WebSocket.cpp @@ -115,7 +115,7 @@ WebSocket::~WebSocket() = default; void WebSocket::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "WebSocket"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(WebSocket); } ErrorOr WebSocket::establish_web_socket_connection(URL& url_record, Vector& protocols, HTML::EnvironmentSettingsObject& client) diff --git a/Userland/Libraries/LibWeb/XHR/FormData.cpp b/Userland/Libraries/LibWeb/XHR/FormData.cpp index 4365b3d8149..4b9799e4f94 100644 --- a/Userland/Libraries/LibWeb/XHR/FormData.cpp +++ b/Userland/Libraries/LibWeb/XHR/FormData.cpp @@ -51,7 +51,7 @@ FormData::~FormData() = default; void FormData::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "FormData"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(FormData); } // https://xhr.spec.whatwg.org/#dom-formdata-append diff --git a/Userland/Libraries/LibWeb/XHR/FormDataIterator.cpp b/Userland/Libraries/LibWeb/XHR/FormDataIterator.cpp index 26aa8892757..606b617c26f 100644 --- a/Userland/Libraries/LibWeb/XHR/FormDataIterator.cpp +++ b/Userland/Libraries/LibWeb/XHR/FormDataIterator.cpp @@ -42,7 +42,7 @@ FormDataIterator::~FormDataIterator() = default; void FormDataIterator::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "FormDataIterator"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(FormDataIterator); } void FormDataIterator::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/XHR/ProgressEvent.cpp b/Userland/Libraries/LibWeb/XHR/ProgressEvent.cpp index 33808774d7d..6d10fe7a3c4 100644 --- a/Userland/Libraries/LibWeb/XHR/ProgressEvent.cpp +++ b/Userland/Libraries/LibWeb/XHR/ProgressEvent.cpp @@ -34,7 +34,7 @@ ProgressEvent::~ProgressEvent() = default; void ProgressEvent::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "ProgressEvent"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(ProgressEvent); } } diff --git a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp index 505ea96d839..7d2dedb932d 100644 --- a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp +++ b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp @@ -81,7 +81,7 @@ XMLHttpRequest::~XMLHttpRequest() = default; void XMLHttpRequest::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "XMLHttpRequest"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(XMLHttpRequest); } void XMLHttpRequest::visit_edges(Cell::Visitor& visitor) diff --git a/Userland/Libraries/LibWeb/XHR/XMLHttpRequestUpload.cpp b/Userland/Libraries/LibWeb/XHR/XMLHttpRequestUpload.cpp index df81985ab9e..1da8dab95a7 100644 --- a/Userland/Libraries/LibWeb/XHR/XMLHttpRequestUpload.cpp +++ b/Userland/Libraries/LibWeb/XHR/XMLHttpRequestUpload.cpp @@ -22,7 +22,7 @@ XMLHttpRequestUpload::~XMLHttpRequestUpload() = default; void XMLHttpRequestUpload::initialize(JS::Realm& realm) { Base::initialize(realm); - set_prototype(&Bindings::ensure_web_prototype(realm, "XMLHttpRequestUpload"_fly_string)); + WEB_SET_PROTOTYPE_FOR_INTERFACE(XMLHttpRequestUpload); } }