mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-25 17:39:27 +00:00
34 lines
964 B
C++
34 lines
964 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 <LibWeb/WebIDL/Types.h>
|
|
|
|
#include "XPathResult.h"
|
|
|
|
namespace Web::XPath {
|
|
|
|
class XPathExpression final : public Bindings::PlatformObject {
|
|
WEB_PLATFORM_OBJECT(XPathExpression, Bindings::PlatformObject);
|
|
GC_DECLARE_ALLOCATOR(XPathExpression);
|
|
|
|
public:
|
|
explicit XPathExpression(JS::Realm&, String const& expression, GC::Ptr<XPathNSResolver> resolver);
|
|
virtual ~XPathExpression() override;
|
|
virtual void visit_edges(Cell::Visitor&) override;
|
|
virtual void initialize(JS::Realm&) override;
|
|
|
|
WebIDL::ExceptionOr<GC::Ref<XPathResult>> evaluate(DOM::Node const& context_node, WebIDL::UnsignedShort type = 0, GC::Ptr<XPathResult> result = nullptr);
|
|
|
|
private:
|
|
String m_expression;
|
|
GC::Ptr<XPathNSResolver> m_resolver;
|
|
};
|
|
|
|
}
|