mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 23:59:49 +00:00
LibWeb/DOM: Copy document's allow declarative shadow roots when cloning
Corresponds to 77920094a4
This commit is contained in:
parent
5c365884dd
commit
a424a06d45
Notes:
github-actions[bot]
2025-07-08 16:10:00 +00:00
Author: https://github.com/AtkinsSJ
Commit: a424a06d45
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5353
Reviewed-by: https://github.com/tcl3 ✅
4 changed files with 25 additions and 1 deletions
|
@ -1446,13 +1446,15 @@ WebIDL::ExceptionOr<GC::Ref<Node>> Node::clone_single_node(Document& document) c
|
||||||
}
|
}
|
||||||
}();
|
}();
|
||||||
|
|
||||||
// Set copy’s encoding, content type, URL, origin, type, and mode to those of node.
|
// Set copy’s encoding, content type, URL, origin, type, mode, allow declarative shadow roots, and custom element registry to those of node.
|
||||||
document_copy->set_encoding(document_.encoding());
|
document_copy->set_encoding(document_.encoding());
|
||||||
document_copy->set_content_type(document_.content_type());
|
document_copy->set_content_type(document_.content_type());
|
||||||
document_copy->set_url(document_.url());
|
document_copy->set_url(document_.url());
|
||||||
document_copy->set_origin(document_.origin());
|
document_copy->set_origin(document_.origin());
|
||||||
document_copy->set_document_type(document_.document_type());
|
document_copy->set_document_type(document_.document_type());
|
||||||
document_copy->set_quirks_mode(document_.mode());
|
document_copy->set_quirks_mode(document_.mode());
|
||||||
|
document_copy->set_allow_declarative_shadow_roots(document_.allow_declarative_shadow_roots());
|
||||||
|
// FIXME: Custom element registry.
|
||||||
copy = move(document_copy);
|
copy = move(document_copy);
|
||||||
} else if (is_document_type()) {
|
} else if (is_document_type()) {
|
||||||
// -> DocumentType
|
// -> DocumentType
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
Harness status: OK
|
||||||
|
|
||||||
|
Found 1 tests
|
||||||
|
|
||||||
|
1 Pass
|
||||||
|
Pass cloneNode() and document's allow declarative shadow roots
|
|
@ -0,0 +1,8 @@
|
||||||
|
<!doctype html>
|
||||||
|
<meta charset=utf-8>
|
||||||
|
|
||||||
|
<script src="../../resources/testharness.js"></script>
|
||||||
|
<script src="../../resources/testharnessreport.js"></script>
|
||||||
|
|
||||||
|
<div id=log></div>
|
||||||
|
<script src="../../dom/nodes/Node-cloneNode-document-allow-declarative-shadow-roots.window.js"></script>
|
|
@ -0,0 +1,8 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
test(() => {
|
||||||
|
const doc = document.cloneNode(document);
|
||||||
|
doc.write('<div><template shadowrootmode=open>test</template></div>');
|
||||||
|
assert_true(!!doc.body.firstChild.shadowRoot);
|
||||||
|
assert_equals(doc.body.firstChild.shadowRoot.textContent, "test");
|
||||||
|
}, "cloneNode() and document's allow declarative shadow roots");
|
Loading…
Add table
Add a link
Reference in a new issue