mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 20:47:45 +00:00
LibWeb: Connect existing implementation of Node::is_connected to JS.
I was looking at implementing something else, and saw this was low hanging fruit, that brings the browser closer to standards conformance. Add a basic test as well to validate it's implementation.
This commit is contained in:
parent
437a214085
commit
0f8932d7ab
2 changed files with 12 additions and 0 deletions
|
@ -12,6 +12,7 @@ interface Node : EventTarget {
|
||||||
readonly attribute Node? nextSibling;
|
readonly attribute Node? nextSibling;
|
||||||
readonly attribute Node? parentNode;
|
readonly attribute Node? parentNode;
|
||||||
readonly attribute Element? parentElement;
|
readonly attribute Element? parentElement;
|
||||||
|
readonly attribute boolean isConnected;
|
||||||
attribute DOMString textContent;
|
attribute DOMString textContent;
|
||||||
|
|
||||||
Node appendChild(Node node);
|
Node appendChild(Node node);
|
||||||
|
|
|
@ -25,4 +25,15 @@ afterInitialPageLoad(() => {
|
||||||
HIDDEN TEXT
|
HIDDEN TEXT
|
||||||
`);
|
`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("Node.isConnected", () => {
|
||||||
|
var element = document.createElement("p");
|
||||||
|
expect(element.isConnected).toBeFalse();
|
||||||
|
|
||||||
|
document.body.appendChild(element);
|
||||||
|
expect(element.isConnected).toBeTrue();
|
||||||
|
|
||||||
|
document.body.removeChild(element);
|
||||||
|
expect(element.isConnected).toBeFalse();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue