1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 21:48:13 +00:00

LibWeb: Don't invalidate layout when setting .innerHTML on <template>

HTML template elements don't affect rendering, so invalidating the
entire document's layout after poking into a <template> was a huge waste
of work on template-heavy pages.
This commit is contained in:
Andreas Kling 2022-10-29 13:14:15 +02:00
parent ba5e511dc1
commit 64d5d633cf
2 changed files with 10 additions and 6 deletions

View file

@ -488,12 +488,6 @@ WebIDL::ExceptionOr<DOM::Element const*> Element::closest(StringView selectors)
WebIDL::ExceptionOr<void> 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 {};
}