ladybird/Libraries/LibWeb/XPath/XPathNSResolver.h
Shannon Booth e555edd770 LibWeb/Bindings: Implement callback interface object bindings
Generate correct bindings for callback interfaces: only create an
interface object when the interface declares constants, and set up
the prototype correctly.

This also lets us tidy up some IDL for these callback interfaces.
2026-03-11 21:16:44 +01:00

32 lines
789 B
C++

/*
* Copyright (c) 2025, Johannes Gustafsson <johannesgu@outlook.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/Bindings/PlatformObject.h>
#include <LibWeb/Forward.h>
#include "XPathResult.h"
namespace Web::XPath {
class XPathNSResolver final : public JS::Object {
JS_OBJECT(XPathNSResolver, JS::Object);
GC_DECLARE_ALLOCATOR(XPathNSResolver);
public:
[[nodiscard]] static GC::Ref<XPathNSResolver> create(JS::Realm&, GC::Ref<WebIDL::CallbackType>);
XPathNSResolver(JS::Realm&, GC::Ref<WebIDL::CallbackType>);
virtual ~XPathNSResolver() = default;
virtual void visit_edges(Cell::Visitor&) override;
WebIDL::CallbackType& callback() { return *m_callback; }
private:
GC::Ref<WebIDL::CallbackType> m_callback;
};
}