LibWeb: Rename Element::shadow_root_internal() to shadow_root()

And let the old shadow_root(), which was only supposed to be used by
bindings, be called shadow_root_for_bindings() instead.

This makes it much easier to read DOM code, and we don't have to worry
about when to use shadow_root_internal() or why.
This commit is contained in:
Andreas Kling
2024-06-25 11:28:58 +02:00
committed by Andreas Kling
parent c7d9c1c0b2
commit f4bdf56212
18 changed files with 27 additions and 28 deletions

View File

@@ -119,7 +119,7 @@ void HTMLDetailsElement::queue_a_details_toggle_event_task(String old_state, Str
// https://html.spec.whatwg.org/#the-details-and-summary-elements
WebIDL::ExceptionOr<void> HTMLDetailsElement::create_shadow_tree_if_needed()
{
if (shadow_root_internal())
if (shadow_root())
return {};
auto& realm = this->realm();
@@ -145,7 +145,7 @@ WebIDL::ExceptionOr<void> HTMLDetailsElement::create_shadow_tree_if_needed()
void HTMLDetailsElement::update_shadow_tree_slots()
{
if (!shadow_root_internal())
if (!shadow_root())
return;
Vector<HTMLSlotElement::SlottableHandle> summary_assignment;
@@ -177,7 +177,7 @@ void HTMLDetailsElement::update_shadow_tree_slots()
// https://html.spec.whatwg.org/#the-details-and-summary-elements:the-details-element-6
void HTMLDetailsElement::update_shadow_tree_style()
{
if (!shadow_root_internal())
if (!shadow_root())
return;
if (has_attribute(HTML::AttributeNames::open)) {