mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 21:29:06 +00:00
LibWeb+WebContent: Implement the WebDriver JSON clone steps for elements
This is needed by WPT to serialize NodeList instances.
This commit is contained in:
parent
2dc8cad785
commit
bf60765903
Notes:
github-actions[bot]
2024-09-14 23:57:21 +00:00
Author: https://github.com/trflynn89
Commit: bf60765903
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1403
Reviewed-by: https://github.com/tcl3 ✅
5 changed files with 36 additions and 1 deletions
|
@ -4,6 +4,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/DOM/Element.h>
|
||||
#include <LibWeb/DOM/Node.h>
|
||||
#include <LibWeb/DOM/ShadowRoot.h>
|
||||
|
@ -61,6 +62,13 @@ ErrorOr<Web::DOM::Element*, Web::WebDriver::Error> get_known_connected_element(S
|
|||
return static_cast<Web::DOM::Element*>(node);
|
||||
}
|
||||
|
||||
// https://w3c.github.io/webdriver/#dfn-is-stale
|
||||
bool is_element_stale(Web::DOM::Node const& element)
|
||||
{
|
||||
// An element is stale if its node document is not the active document or if it is not connected.
|
||||
return !element.document().is_active() || !element.is_connected();
|
||||
}
|
||||
|
||||
// https://w3c.github.io/webdriver/#dfn-get-or-create-a-shadow-root-reference
|
||||
ByteString get_or_create_a_shadow_root_reference(Web::DOM::ShadowRoot const& shadow_root)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue