Truly independent web browser
/*
* Copyright (c) 2022, Tobias Christiansen <[email protected]>
* Copyright (c) 2022, Tim Flynn <[email protected]>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/String.h>
#include <AK/Utf16FlyString.h>
#include <AK/Variant.h>
#include <LibGC/Ptr.h>
#include <LibWeb/DOM/NodeList.h>
#include <LibWeb/Export.h>
#include <LibWeb/Forward.h>
#include <LibWebCommon/WebDriver/Error.h>
namespace Web::WebDriver {
// https://w3c.github.io/webdriver/#dfn-table-of-location-strategies
enum class LocationStrategy {
CssSelector,
LinkText,
PartialLinkText,
TagName,
XPath,
};
WEB_API Optional<LocationStrategy> location_strategy_from_string(StringView type);
WEB_API ErrorOr<GC::Ref<DOM::NodeList>, Error> invoke_location_strategy(LocationStrategy type, DOM::ParentNode& start_node,
Variant<String, Utf16FlyString> const& selector);
}