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:
parent
ac6d22fe38
commit
ca4e1451ca
@ -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;
|
||||
|
||||
|
@ -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');
|
||||
|
Loading…
Reference in New Issue
Block a user