1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

[spidermonkey] Fixes in element.remove()

This commit is contained in:
Witold Filipczyk 2024-07-06 10:26:57 +02:00
parent 6e07af8e50
commit 815c8f684b
2 changed files with 12 additions and 2 deletions

View File

@ -147,5 +147,13 @@ domparser_parseFromString(JSContext *ctx, unsigned int argc, JS::Value *vp)
args.rval().setNull();
return true;
}
return getDocument(ctx, doc);
JSObject *obj = getDocument(ctx, doc);
if (!obj) {
args.rval().setNull();
return true;
}
args.rval().setObject(*obj);
return true;
}

View File

@ -5144,10 +5144,12 @@ element_remove(JSContext *ctx, unsigned int argc, JS::Value *rval)
if (exc != DOM_NO_ERR || !parent) {
return true;
}
exc = dom_node_remove_child(parent, el, NULL);
dom_node *res = NULL;
exc = dom_node_remove_child(parent, el, &res);
dom_node_unref(parent);
if (exc == DOM_NO_ERR) {
dom_node_unref(res);
interpreter->changed = 1;
}