mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:17:44 +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
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