diff options
author | Andreas Kling <kling@serenityos.org> | 2022-09-20 18:28:41 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-09-20 18:28:41 +0200 |
commit | aa4dd6c1bc4dc28cf096aff76b3487501fe7af1f (patch) | |
tree | 9e009fddbddc0f94913e3f8300b2461ec9a8081a /Userland/Libraries/LibWeb/DOMParsing | |
parent | 287a9b552a017903d496cd3011142dad858749e9 (diff) | |
download | serenity-aa4dd6c1bc4dc28cf096aff76b3487501fe7af1f.zip |
LibWeb: Implement Element.insertAdjacentHTML() from DOM Parsing
One edge case is left as a TODO() for now, since I'm not entirely sure
how to construct an element to those specifications.
With this patch, we can now run the Speedometer benchmark! :^)
Diffstat (limited to 'Userland/Libraries/LibWeb/DOMParsing')
-rw-r--r-- | Userland/Libraries/LibWeb/DOMParsing/InnerHTML.cpp | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/DOMParsing/InnerHTML.h | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/DOMParsing/InnerHTML.cpp b/Userland/Libraries/LibWeb/DOMParsing/InnerHTML.cpp index a92e187aa2..245dbeb049 100644 --- a/Userland/Libraries/LibWeb/DOMParsing/InnerHTML.cpp +++ b/Userland/Libraries/LibWeb/DOMParsing/InnerHTML.cpp @@ -12,7 +12,7 @@ namespace Web::DOMParsing { // https://w3c.github.io/DOM-Parsing/#dfn-fragment-parsing-algorithm -static DOM::ExceptionOr<JS::NonnullGCPtr<DOM::DocumentFragment>> parse_fragment(String const& markup, DOM::Element& context_element) +DOM::ExceptionOr<JS::NonnullGCPtr<DOM::DocumentFragment>> parse_fragment(String const& markup, DOM::Element& context_element) { // FIXME: Handle XML documents. diff --git a/Userland/Libraries/LibWeb/DOMParsing/InnerHTML.h b/Userland/Libraries/LibWeb/DOMParsing/InnerHTML.h index 9689d4edcc..9619254e14 100644 --- a/Userland/Libraries/LibWeb/DOMParsing/InnerHTML.h +++ b/Userland/Libraries/LibWeb/DOMParsing/InnerHTML.h @@ -16,4 +16,6 @@ namespace Web::DOMParsing { // https://w3c.github.io/DOM-Parsing/#dom-innerhtml-innerhtml DOM::ExceptionOr<void> inner_html_setter(JS::NonnullGCPtr<DOM::Node> context_object, String const& value); +DOM::ExceptionOr<JS::NonnullGCPtr<DOM::DocumentFragment>> parse_fragment(String const& markup, DOM::Element& context_element); + } |