mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-30 15:41:48 +00:00
Some checks failed
e2e-test / zig build release (push) Has been cancelled
e2e-test / demo-scripts (push) Has been cancelled
e2e-test / cdp-and-hyperfine-bench (push) Has been cancelled
e2e-test / perf-fmt (push) Has been cancelled
zig-test / zig build dev (push) Has been cancelled
zig-test / browser fetch (push) Has been cancelled
zig-test / zig test (push) Has been cancelled
zig-test / perf-fmt (push) Has been cancelled
Introduces an Env.String for persistent strings
68 lines
2.4 KiB
HTML
68 lines
2.4 KiB
HTML
<!DOCTYPE html>
|
|
<body>
|
|
<div id="content">
|
|
<a id="link" href="foo" class="ok">OK</a>
|
|
<p id="para-empty" class="ok empty">
|
|
<span id="para-empty-child"></span>
|
|
</p>
|
|
<p id="para"> And</p>
|
|
<!--comment-->
|
|
</div>
|
|
</body>
|
|
|
|
<script src="../testing.js"></script>
|
|
<script id=caseInsensitve>
|
|
const Ptags = document.getElementsByTagName('P');
|
|
testing.expectEqual(2, Ptags.length);
|
|
testing.expectEqual('p', Ptags.item(0).localName);
|
|
testing.expectEqual('p', Ptags.item(1).localName);
|
|
</script>
|
|
|
|
<script id=all>
|
|
let allTags = document.getElementsByTagName('*');
|
|
testing.expectEqual(13, allTags.length);
|
|
testing.expectEqual('html', allTags.item(0).localName);
|
|
testing.expectEqual('html', allTags.item(0).localName);
|
|
testing.expectEqual('head', allTags.item(1).localName);
|
|
testing.expectEqual('html', allTags.item(0).localName);
|
|
testing.expectEqual('body', allTags.item(2).localName);
|
|
testing.expectEqual('div', allTags.item(3).localName);
|
|
testing.expectEqual('p', allTags.item(7).localName);
|
|
testing.expectEqual('span', allTags.namedItem('para-empty-child').localName);
|
|
|
|
|
|
// array like
|
|
testing.expectEqual('html', allTags[0].localName);
|
|
testing.expectEqual('p', allTags[7].localName);
|
|
testing.expectEqual(undefined, allTags[14]);
|
|
testing.expectEqual('span', allTags['para-empty-child'].localName);
|
|
testing.expectEqual(undefined, allTags['foo']);
|
|
</script>
|
|
|
|
<script id=element>
|
|
let content = $('#content');
|
|
testing.expectEqual(4, content.getElementsByTagName('*').length);
|
|
testing.expectEqual(2, content.getElementsByTagName('p').length);
|
|
testing.expectEqual(0, content.getElementsByTagName('div').length);
|
|
|
|
testing.expectEqual(1, document.children.length);
|
|
testing.expectEqual(3, content.children.length);
|
|
</script>
|
|
|
|
<script id=liveness>
|
|
const ptags = document.getElementsByTagName('p');
|
|
testing.expectEqual(2, ptags.length);
|
|
testing.expectEqual(' And', ptags.item(1).textContent);
|
|
|
|
let p = document.createElement('p');
|
|
p.textContent = 'OK live';
|
|
// hasn't been added, still 2
|
|
testing.expectEqual(2, ptags.length);
|
|
|
|
testing.expectEqual(true, content.appendChild(p) != undefined);
|
|
testing.expectEqual(3, ptags.length);
|
|
testing.expectEqual('OK live', ptags.item(2).textContent);
|
|
testing.expectEqual(true, content.insertBefore(p, $('#para-empty')) != undefined);
|
|
testing.expectEqual('OK live', ptags.item(0).textContent);
|
|
</script>
|