From d31aec25e8efa0142d9b32655416e5f4932be35a Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Fri, 22 Aug 2025 15:35:27 +0100 Subject: [PATCH] AK: Ignore possible const reference when comparing type equality in `is` --- AK/TypeCasts.h | 2 +- Libraries/LibWeb/DOM/Element.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/AK/TypeCasts.h b/AK/TypeCasts.h index 231ab466a73..1bf42a8a201 100644 --- a/AK/TypeCasts.h +++ b/AK/TypeCasts.h @@ -16,7 +16,7 @@ namespace AK { template ALWAYS_INLINE bool is(InputType& input) { - static_assert(!SameAs); + static_assert(!SameAs, RemoveCVReference>); if constexpr (requires { input.template fast_is(); }) { return input.template fast_is(); } diff --git a/Libraries/LibWeb/DOM/Element.cpp b/Libraries/LibWeb/DOM/Element.cpp index afaaa842801..57ad00eb0a3 100644 --- a/Libraries/LibWeb/DOM/Element.cpp +++ b/Libraries/LibWeb/DOM/Element.cpp @@ -3686,7 +3686,7 @@ Optional Element::contained_text_auto_directionality(bo // - an element whose dir attribute is not in the undefined state // then continue. // NOTE: "any ancestor element of descendant that is a descendant of element" will be iterated already. - auto is_one_of_the_filtered_elements = [](auto& descendant) -> bool { + auto is_one_of_the_filtered_elements = [](DOM::Node const& descendant) -> bool { return is(descendant) || is(descendant) || is(descendant)