ladybird/Libraries/LibWeb/HTML/PopoverInvokerElement.h
sideshowbarker 0c6a6d4457 LibWeb: Normalize getter name for reflected “Element?” IDL types
This change updates the bindings generator for the case defined at
https://html.spec.whatwg.org/#reflecting-content-attributes-in-idl-attributes:element;
that is, the case “If a reflected IDL attribute has the type T?, where T
is either Element or an interface that inherits from Element”.

The change “normalizes” the generator behavior for that case — such that
the generated code expects a getter with a name of the form used in
other cases; e.g., popover_target_element().

Otherwise, without this change, the generator expects a name of the form
get_popover_target_element() for that case.
2024-12-28 08:34:40 -08:00

32 lines
752 B
C++

/*
* Copyright (c) 2024, Nathan van der Kamp <nbvdkamp@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibGC/Ptr.h>
#include <LibJS/Heap/Cell.h>
#include <LibWeb/Forward.h>
namespace Web::HTML {
class PopoverInvokerElement {
public:
PopoverInvokerElement() { }
GC::Ptr<DOM::Element> popover_target_element() { return m_popover_target_element; }
void set_popover_target_element(GC::Ptr<DOM::Element> value) { m_popover_target_element = value; }
protected:
void visit_edges(JS::Cell::Visitor&);
void associated_attribute_changed(FlyString const& name, Optional<String> const& value, Optional<FlyString> const& namespace_);
private:
GC::Ptr<DOM::Element> m_popover_target_element;
};
}