ladybird/Libraries/LibWeb/XPath/XPathExpression.h
Aliaksandr Kalenik 901cc28272 LibWeb: Reduce recompilation impact of DOM/Document.h
Remove 11 heavy includes from Document.h that were only needed for
pointer/reference types (already forward-declared in Forward.h), and
extract the nested ViewportClient interface to a standalone header.

This reduces Document.h's recompilation cascade from ~1228 files to
~717 files (42% reduction). Headers like BrowsingContext.h that were
previously transitively included see even larger improvements (from
~1228 down to ~73 dependents).
2026-02-11 20:02:28 +01:00

34 lines
1,018 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 <LibWeb/XPath/XPathNSResolver.h>
#include <LibWeb/XPath/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;
};
}