1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 19:38:12 +00:00

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
parent 95cc4c7e74
commit 660ec504ca
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) {