/* * Copyright (c) 2025, Johannes Gustafsson * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #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 resolver); virtual ~XPathExpression() override; virtual void visit_edges(Cell::Visitor&) override; virtual void initialize(JS::Realm&) override; WebIDL::ExceptionOr> evaluate(DOM::Node const& context_node, WebIDL::UnsignedShort type = 0, GC::Ptr result = nullptr); private: String m_expression; GC::Ptr m_resolver; }; }