Meta: Fix “shadow-including-ancestors-descendant” generator check

This change fixes the IDLGenerators.cpp implementation of the “If
reflectedTarget's explicitly set attr-element is a descendant of any of
element's shadow-including ancestors” step from the “If a reflected IDL
attribute has the type T?, where T is either Element or an interface
that inherits from Element” case in the HTML spec at
http://whatwg.org/html/#reflecting-content-attributes-in-idl-attributes
This commit is contained in:
sideshowbarker 2025-01-01 09:04:51 +09:00 committed by Tim Ledbetter
parent f9d4852a22
commit e1b4aa94db
Notes: github-actions[bot] 2025-01-01 11:01:53 +00:00

View file

@ -3821,7 +3821,7 @@ JS_DEFINE_NATIVE_FUNCTION(@class_name@::@attribute.getter_callback@)
attribute_generator.append(R"~~~(
auto const explicitly_set_attr = TRY(throw_dom_exception_if_needed(vm, [&] { return impl->@attribute.cpp_name@(); }));
if (explicitly_set_attr) {
if (&impl->shadow_including_root() == &explicitly_set_attr->shadow_including_root()) {
if (&impl->shadow_including_root() == &explicitly_set_attr->root()) {
retval = explicitly_set_attr;
} else {
retval = GC::Ptr<Element> {};