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:
Brian Gianforcaro 2021-04-10 10:34:58 -07:00 committed by Andreas Kling
commit 0f8932d7ab
Notes: sideshowbarker 2024-07-18 20:33:26 +09:00
2 changed files with 12 additions and 0 deletions

View file

@ -25,4 +25,15 @@ afterInitialPageLoad(() => {
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();
});
});