mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[quickjs] Fix in fragment.removeChild
Allow other types of Nodes, not only DocumentFragment.
This commit is contained in:
parent
763e70b8fc
commit
46d133e906
@ -1508,9 +1508,13 @@ js_fragment_removeChild(JSContext *ctx, JSValueConst this_val, int argc, JSValue
|
|||||||
}
|
}
|
||||||
//dom_node_ref(el);
|
//dom_node_ref(el);
|
||||||
JSValue node = argv[0];
|
JSValue node = argv[0];
|
||||||
dom_node *el2 = (dom_node *)(js_getopaque_fragment(node, js_fragment_class_id));
|
dom_node *el2 = (dom_node *)js_getopaque_any(node);
|
||||||
|
|
||||||
|
if (!el2) {
|
||||||
|
return JS_NULL;
|
||||||
|
}
|
||||||
dom_exception exc;
|
dom_exception exc;
|
||||||
dom_node *spare;
|
dom_node *spare = NULL;
|
||||||
exc = dom_node_remove_child(el, el2, &spare);
|
exc = dom_node_remove_child(el, el2, &spare);
|
||||||
|
|
||||||
if (exc == DOM_NO_ERR && spare) {
|
if (exc == DOM_NO_ERR && spare) {
|
||||||
|
Loading…
Reference in New Issue
Block a user