mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb+WebContent: Partially implement the switch-to-frame endpoint
This is needed by the cookie tests for WPT.
This commit is contained in:
parent
bf60765903
commit
60fa3752ee
Notes:
github-actions[bot]
2024-09-14 23:57:15 +00:00
Author: https://github.com/trflynn89
Commit: 60fa3752ee
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1403
Reviewed-by: https://github.com/tcl3 ✅
3 changed files with 53 additions and 25 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue