LibWeb: Move get_element_by_id() to a NonElementParentNode mixin class

This matches the current version of the DOM spec. And since C++ doesn't
have mixins this is actually a CRTP class.
This commit is contained in:
Andreas Kling 2020-03-28 09:12:13 +01:00
commit 660ec504ca
Notes: sideshowbarker 2024-07-19 08:06:06 +09:00
5 changed files with 68 additions and 17 deletions

View file

@ -382,7 +382,7 @@ void HtmlView::scroll_to_anchor(const StringView& name)
if (!document())
return;
auto* element = document()->get_element_by_id(name);
const auto* element = document()->get_element_by_id(name);
if (!element) {
auto candidates = document()->get_elements_by_name(name);
for (auto* candidate : candidates) {