diff --git a/Userland/Libraries/LibWeb/DOM/Element.cpp b/Userland/Libraries/LibWeb/DOM/Element.cpp index dcdd9a2ed5..50457f081d 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.cpp +++ b/Userland/Libraries/LibWeb/DOM/Element.cpp @@ -488,12 +488,6 @@ WebIDL::ExceptionOr Element::closest(StringView selectors) WebIDL::ExceptionOr Element::set_inner_html(String const& markup) { TRY(DOMParsing::inner_html_setter(*this, markup)); - - set_needs_style_update(true); - - // NOTE: Since the DOM has changed, we have to rebuild the layout tree. - document().invalidate_layout(); - document().set_needs_layout(); return {}; } diff --git a/Userland/Libraries/LibWeb/DOMParsing/InnerHTML.cpp b/Userland/Libraries/LibWeb/DOMParsing/InnerHTML.cpp index 1210f241ae..a63c123201 100644 --- a/Userland/Libraries/LibWeb/DOMParsing/InnerHTML.cpp +++ b/Userland/Libraries/LibWeb/DOMParsing/InnerHTML.cpp @@ -5,6 +5,7 @@ */ #include +#include #include #include #include @@ -47,6 +48,15 @@ WebIDL::ExceptionOr inner_html_setter(JS::NonnullGCPtr context_ // 4. Replace all with fragment within the context object. context_object->replace_all(fragment); + // NOTE: We don't invalidate style & layout for