diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index b5ed5db770..e2730c4d47 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -894,7 +894,7 @@ void Document::update_layout() if (needs_full_style_update || node.child_needs_style_update()) { if (node.is_element()) { - if (auto* shadow_root = static_cast(node).shadow_root()) { + if (auto* shadow_root = static_cast(node).shadow_root_internal()) { if (needs_full_style_update || shadow_root->needs_style_update() || shadow_root->child_needs_style_update()) needs_relayout |= update_style_recursively(*shadow_root); } diff --git a/Userland/Libraries/LibWeb/DOM/Element.h b/Userland/Libraries/LibWeb/DOM/Element.h index 48356195f3..1fe9b02258 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.h +++ b/Userland/Libraries/LibWeb/DOM/Element.h @@ -131,8 +131,8 @@ public: JS::NonnullGCPtr get_elements_by_class_name(DeprecatedFlyString const&); - ShadowRoot* shadow_root() { return m_shadow_root.ptr(); } - ShadowRoot const* shadow_root() const { return m_shadow_root.ptr(); } + ShadowRoot* shadow_root_internal() { return m_shadow_root.ptr(); } + ShadowRoot const* shadow_root_internal() const { return m_shadow_root.ptr(); } void set_shadow_root(JS::GCPtr); void set_custom_properties(HashMap custom_properties) { m_custom_properties = move(custom_properties); } diff --git a/Userland/Libraries/LibWeb/DOM/Node.cpp b/Userland/Libraries/LibWeb/DOM/Node.cpp index 8de25502e8..08165a3d9d 100644 --- a/Userland/Libraries/LibWeb/DOM/Node.cpp +++ b/Userland/Libraries/LibWeb/DOM/Node.cpp @@ -247,7 +247,7 @@ void Node::invalidate_style() node.m_needs_style_update = true; if (node.has_children()) node.m_child_needs_style_update = true; - if (auto* shadow_root = node.is_element() ? static_cast(node).shadow_root() : nullptr) { + if (auto* shadow_root = node.is_element() ? static_cast(node).shadow_root_internal() : nullptr) { node.m_child_needs_style_update = true; shadow_root->m_needs_style_update = true; if (shadow_root->has_children()) diff --git a/Userland/Libraries/LibWeb/DOM/ShadowRoot.h b/Userland/Libraries/LibWeb/DOM/ShadowRoot.h index b4d33a8df4..37e1add258 100644 --- a/Userland/Libraries/LibWeb/DOM/ShadowRoot.h +++ b/Userland/Libraries/LibWeb/DOM/ShadowRoot.h @@ -53,7 +53,7 @@ inline IterationDecision Node::for_each_shadow_including_descendant(Callback cal return IterationDecision::Break; for (auto* child = first_child(); child; child = child->next_sibling()) { if (child->is_element()) { - if (JS::GCPtr shadow_root = static_cast(child)->shadow_root()) { + if (JS::GCPtr shadow_root = static_cast(child)->shadow_root_internal()) { if (shadow_root->for_each_shadow_including_descendant(callback) == IterationDecision::Break) return IterationDecision::Break; } diff --git a/Userland/Libraries/LibWeb/HTML/Focus.cpp b/Userland/Libraries/LibWeb/HTML/Focus.cpp index 5eeef7f8c0..e74322da62 100644 --- a/Userland/Libraries/LibWeb/HTML/Focus.cpp +++ b/Userland/Libraries/LibWeb/HTML/Focus.cpp @@ -218,7 +218,7 @@ void run_unfocusing_steps(DOM::Node* old_focus_target) // context's DOM anchor, then set old focus target to that currently focused area of a top-level browsing // context. if (is_shadow_host(old_focus_target)) { - auto* shadow_root = static_cast(old_focus_target)->shadow_root(); + auto* shadow_root = static_cast(old_focus_target)->shadow_root_internal(); if (shadow_root->delegates_focus()) { auto& top_level_browsing_context = old_focus_target->document().browsing_context()->top_level_browsing_context(); if (auto currently_focused_area = top_level_browsing_context.currently_focused_area()) { diff --git a/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp b/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp index 659bff0487..d3f89c4c5e 100644 --- a/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp +++ b/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp @@ -239,7 +239,7 @@ ErrorOr TreeBuilder::create_layout_tree(DOM::Node& dom_node, TreeBuilder:: insert_node_into_inline_or_block_ancestor(*layout_node, display, AppendOrPrepend::Append); } - auto* shadow_root = is(dom_node) ? verify_cast(dom_node).shadow_root() : nullptr; + auto* shadow_root = is(dom_node) ? verify_cast(dom_node).shadow_root_internal() : nullptr; if ((dom_node.has_children() || shadow_root) && layout_node->can_have_children()) { push_parent(verify_cast(*layout_node)); diff --git a/Userland/Services/WebContent/WebDriverConnection.cpp b/Userland/Services/WebContent/WebDriverConnection.cpp index ec4116072d..2f5310ac43 100644 --- a/Userland/Services/WebContent/WebDriverConnection.cpp +++ b/Userland/Services/WebContent/WebDriverConnection.cpp @@ -996,7 +996,7 @@ Messages::WebDriverClient::GetElementShadowRootResponse WebDriverConnection::get auto* element = TRY(get_known_connected_element(element_id)); // 4. Let shadow root be element's shadow root. - auto* shadow_root = element->shadow_root(); + auto* shadow_root = element->shadow_root_internal(); // 5. If shadow root is null, return error with error code no such shadow root. if (!shadow_root)