mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2026-04-18 18:00:31 +00:00
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.
32 lines
789 B
C++
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;
|
|
};
|
|
|
|
}
|