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

[quickjs] domparser.html passed test

This commit is contained in:
Witold Filipczyk 2024-07-24 20:13:13 +02:00
parent 4dc436e26d
commit c01339fee9
2 changed files with 8 additions and 6 deletions

View File

@ -1444,8 +1444,10 @@ js_document_getElementById(JSContext *ctx, JSValueConst this_val, int argc, JSVa
return JS_NULL;
}
//dom_node_unref(doc);
JSValue rr = getElement(ctx, element);
dom_node_unref(element);
return getElement(ctx, element);
return rr;
}
static JSValue
@ -2004,9 +2006,9 @@ getDocument2(JSContext *ctx, void *doc)
}
init_list(doc_private->listeners);
if (doc) {
dom_node_ref((dom_node *)doc);
}
// if (doc) {
// dom_node_ref((dom_node *)doc);
// }
doc_private->node = doc;
struct ecmascript_interpreter *interpreter = (struct ecmascript_interpreter *)JS_GetContextOpaque(ctx);
doc_private->interpreter = interpreter;

View File

@ -157,7 +157,7 @@ js_event_get_property_target(JSContext *ctx, JSValueConst this_val)
if (!event) {
return JS_NULL;
}
dom_event_ref(event);
//dom_event_ref(event);
dom_event_target *target = NULL;
dom_exception exc = dom_event_get_target(event, &target);
@ -166,7 +166,7 @@ js_event_get_property_target(JSContext *ctx, JSValueConst this_val)
}
JSValue r = getElement(ctx, target);
dom_node_unref(target);
dom_event_unref(event);
//dom_event_unref(event);
RETURN_JS(r);
}