Revert "LibWeb: Make "assign slottables for a tree" fast when there are no slots"

This reverts commit adc25af8e2.

This caused images to stop loading on https://reddit.com/ and needs
more investigation.
This commit is contained in:
Andreas Kling 2025-02-04 22:19:25 +01:00
parent 67c950b002
commit b8537f760d
Notes: github-actions[bot] 2025-02-04 21:29:19 +00:00
4 changed files with 11 additions and 49 deletions

View file

@ -8,7 +8,6 @@
#include <LibWeb/Bindings/HTMLSlotElementPrototype.h>
#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/DOM/Element.h>
#include <LibWeb/DOM/ShadowRoot.h>
#include <LibWeb/DOM/Text.h>
#include <LibWeb/HTML/HTMLSlotElement.h>
@ -148,21 +147,4 @@ void HTMLSlotElement::attribute_changed(FlyString const& local_name, Optional<St
}
}
void HTMLSlotElement::inserted()
{
Base::inserted();
auto& root = this->root();
if (!root.is_shadow_root())
return;
static_cast<DOM::ShadowRoot&>(root).increment_slot_count();
}
void HTMLSlotElement::removed_from(Node* old_parent, Node& old_root)
{
Base::removed_from(old_parent, old_root);
if (!old_root.is_shadow_root())
return;
static_cast<DOM::ShadowRoot&>(old_root).decrement_slot_count();
}
}