mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-28 10:37:17 +02:00
LibWeb+WebContent: Partially implement the switch-to-frame endpoint
This is needed by the cookie tests for WPT.
This commit is contained in:
committed by
Tim Ledbetter
parent
bf60765903
commit
60fa3752ee
Notes:
github-actions[bot]
2024-09-14 23:57:15 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/60fa3752ee8 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1403 Reviewed-by: https://github.com/tcl3 ✅
@@ -45,6 +45,20 @@ JsonObject web_element_reference_object(Web::DOM::Node const& element)
|
||||
return object;
|
||||
}
|
||||
|
||||
// https://w3c.github.io/webdriver/#dfn-represents-a-web-element
|
||||
bool represents_a_web_element(JsonValue const& value)
|
||||
{
|
||||
// An ECMAScript Object represents a web element if it has a web element identifier own property.
|
||||
if (!value.is_object())
|
||||
return false;
|
||||
|
||||
auto const& object = value.as_object();
|
||||
if (!object.has_string("name"sv) || !object.has_string("value"sv))
|
||||
return false;
|
||||
|
||||
return object.get_byte_string("name"sv) == web_element_identifier;
|
||||
}
|
||||
|
||||
// https://w3c.github.io/webdriver/#dfn-get-a-known-connected-element
|
||||
ErrorOr<Web::DOM::Element*, Web::WebDriver::Error> get_known_connected_element(StringView element_id)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user