1
0
mirror of https://github.com/rkd77/elinks.git synced 2025-01-03 14:57:44 -05:00

[quickjs] element.contains(element) is true

This commit is contained in:
Witold Filipczyk 2024-06-22 21:25:33 +02:00
parent ac6d22fe38
commit ca4e1451ca
2 changed files with 6 additions and 0 deletions

View File

@ -2846,6 +2846,10 @@ js_element_contains(JSContext *ctx, JSValueConst this_val, int argc, JSValueCons
return JS_FALSE;
}
if (el == el2) {
dom_node_unref(el);
return JS_TRUE;
}
bool result_set = false;
bool result = false;

View File

@ -26,8 +26,10 @@ function myFunction() {
var span2 = document.getElementById("mySPAN2");
var div = document.getElementById("myDIV").contains(span);
var div2 = document.getElementById("myDIV").contains(span2);
var itself = document.getElementById("mySPAN").contains(span);
console.assert(div, 'myDIV contains mySPAN');
console.assert(!div2, '!myDIV contains mySPAN2');
console.assert(itself, 'element contains itself');
}
console.error('element.contains.html');