mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 21:29:06 +00:00
LibWeb: Fix some FIXMEs related to ExceptionOr<T>
This fixes a few FIXMEs mentioned in 5beacf08a2
,
which depended on #6075 being fixed.
This commit is contained in:
parent
8ba2b5f36f
commit
9c201767a0
Notes:
sideshowbarker
2024-07-18 20:24:30 +09:00
Author: https://github.com/alimpfard
Commit: 9c201767a0
Pull-request: https://github.com/SerenityOS/serenity/pull/6293
Issue: https://github.com/SerenityOS/serenity/issues/6075
Reviewed-by: https://github.com/Lubrsi ✅
Reviewed-by: https://github.com/linusg
4 changed files with 16 additions and 24 deletions
|
@ -743,17 +743,13 @@ void Document::adopt_node(Node& node)
|
|||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-document-adoptnode
|
||||
NonnullRefPtr<Node> Document::adopt_node_binding(NonnullRefPtr<Node> node)
|
||||
ExceptionOr<NonnullRefPtr<Node>> Document::adopt_node_binding(NonnullRefPtr<Node> node)
|
||||
{
|
||||
if (is<Document>(*node)) {
|
||||
dbgln("Document::adopt_node_binding: Cannot adopt a document into a document (FIXME: throw as NotSupportedError exception, see issue #6075");
|
||||
return node;
|
||||
}
|
||||
if (is<Document>(*node))
|
||||
return DOM ::NotSupportedError::create("Cannot adopt a document into a document");
|
||||
|
||||
if (is<ShadowRoot>(*node)) {
|
||||
dbgln("Document::adopt_node_binding: Cannot adopt a shadow root into a document (FIXME: throw as HierarchyRequestError exception, see issue #6075");
|
||||
return node;
|
||||
}
|
||||
if (is<ShadowRoot>(*node))
|
||||
return DOM::HierarchyRequestError::create("Cannot adopt a shadow root into a document");
|
||||
|
||||
if (is<DocumentFragment>(*node) && downcast<DocumentFragment>(*node).host())
|
||||
return node;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue