From f3db0003c2c16216ebd73ef600ae7ccbf868a30b Mon Sep 17 00:00:00 2001 From: Bastiaan van der Plaat Date: Fri, 24 Nov 2023 17:39:12 +0100 Subject: [PATCH] LibWeb: Add script element text getter setter --- Userland/Libraries/LibWeb/HTML/HTMLScriptElement.h | 3 +++ Userland/Libraries/LibWeb/HTML/HTMLScriptElement.idl | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.h b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.h index edbb324b250..2822ae2534c 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.h @@ -55,6 +55,9 @@ public: void unmark_as_already_started(Badge); void unmark_as_parser_inserted(Badge); + String text() { return MUST(String::from_deprecated_string(child_text_content())); } + void set_text(String const& text) { string_replace_all(text.to_deprecated_string()); } + private: HTMLScriptElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.idl b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.idl index 12858d3e25c..b3dffc7e2ae 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.idl +++ b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.idl @@ -13,7 +13,7 @@ interface HTMLScriptElement : HTMLElement { // FIXME: [CEReactions] attribute boolean async; [CEReactions, Reflect] attribute boolean defer; [CEReactions, Reflect=crossorigin, Enumerated=CORSSettingsAttribute] attribute DOMString? crossOrigin; - // FIXME: [CEReactions] attribute DOMString text; + [CEReactions] attribute DOMString text; [CEReactions, Reflect] attribute DOMString integrity; [CEReactions, Reflect=referrerpolicy] attribute DOMString referrerPolicy; // FIXME: [SameObject, PutForwards=value] readonly attribute DOMTokenList blocking;