Truly independent web browser
<!doctype html>
<html id="html">
<script src="../include.js"></script>
<script src="../work-test.js"></script>
<style>
body { margin: 0; font: 16px/20px monospace; }
#a, #b { position: relative; width: 200px; }
.row { padding: 2px; border-bottom: 1px solid #ccc; }
</style>
<body id="body">
<div id="a"><div class="row" id="a0">A 0</div><div class="row" id="a1">A 1</div></div>
<div id="b"></div>
<script>
displayListTest({
setup: () => {
removeBodyWhitespace();
for (let i = 0; i < 2; ++i) {
const row = document.createElement("div");
row.id = `b${i}`;
row.className = "row";
row.textContent = `B ${i}`;
b.appendChild(row);
}
},
steps: [
{
name: "quiet siblings",
expect: `
@canvas RECORD (empty)
@viewport COPY
`
},
{
name: "change inside B",
mutate: () => { b0.style.color = "red"; },
expect: `
@canvas RECORD (empty)
@viewport ASSEMBLE
@viewport/preamble COPY
@viewport/scroll-metadata COPY
@viewport/background COPY
@viewport/border COPY
BlockContainer<HTML>#html/descendants(background-and-borders) ASSEMBLE
@viewport/foreground COPY
BlockContainer<HTML>#html/descendants(foreground) ASSEMBLE
BlockContainer<HTML>#html ASSEMBLE
BlockContainer<HTML>#html/preamble COPY
BlockContainer<HTML>#html/scroll-metadata COPY
BlockContainer<HTML>#html/background COPY
BlockContainer<HTML>#html/border COPY
BlockContainer<BODY>#body/descendants(background-and-borders) ASSEMBLE
BlockContainer<BODY>#body/scroll-metadata COPY
BlockContainer<BODY>#body/background COPY
BlockContainer<BODY>#body/border COPY
BlockContainer<DIV>#a/descendants(background-and-borders) COPY
BlockContainer<DIV>#b/descendants(background-and-borders) ASSEMBLE
BlockContainer<HTML>#html/foreground COPY
BlockContainer<BODY>#body/descendants(foreground) ASSEMBLE
BlockContainer<BODY>#body/foreground COPY
BlockContainer<DIV>#a/descendants(foreground) COPY
BlockContainer<DIV>#b/descendants(foreground) ASSEMBLE
BlockContainer<BODY>#body/outline COPY
BlockContainer<BODY>#body/overlay COPY
BlockContainer<DIV>#a COPY
BlockContainer<DIV>#b ASSEMBLE
BlockContainer<DIV>#b/scroll-metadata COPY
BlockContainer<DIV>#b/background COPY
BlockContainer<DIV>#b/border COPY
BlockContainer<DIV>#b0.row/descendants(background-and-borders) ASSEMBLE
BlockContainer<DIV>#b0.row/scroll-metadata RECORD (empty)
BlockContainer<DIV>#b0.row/background SKIP
BlockContainer<DIV>#b0.row/border RECORD
BlockContainer<DIV>#b1.row/descendants(background-and-borders) COPY
BlockContainer<DIV>#b0.row/descendants(floats) ASSEMBLE
BlockContainer<DIV>#b1.row/descendants(floats) COPY
BlockContainer<DIV>#b0.row/descendants(inline-background-and-borders) ASSEMBLE
BlockContainer<DIV>#b1.row/descendants(inline-background-and-borders) COPY
BlockContainer<DIV>#b/foreground COPY
BlockContainer<DIV>#b0.row/descendants(foreground) ASSEMBLE
BlockContainer<DIV>#b0.row/foreground RECORD
BlockContainer<DIV>#b0.row/outline SKIP
BlockContainer<DIV>#b0.row/overlay SKIP
BlockContainer<DIV>#b1.row/descendants(foreground) COPY
BlockContainer<DIV>#b/outline COPY
BlockContainer<DIV>#b/overlay COPY
BlockContainer<HTML>#html/outline COPY
@viewport/outline COPY
`
},
{
name: "change inside A while B is clean",
mutate: () => { a0.style.color = "red"; },
expect: `
@canvas RECORD (empty)
@viewport ASSEMBLE
@viewport/preamble COPY
@viewport/scroll-metadata COPY
@viewport/background COPY
@viewport/border COPY
BlockContainer<HTML>#html/descendants(background-and-borders) ASSEMBLE
@viewport/foreground COPY
BlockContainer<HTML>#html/descendants(foreground) ASSEMBLE
BlockContainer<HTML>#html ASSEMBLE
BlockContainer<HTML>#html/preamble COPY
BlockContainer<HTML>#html/scroll-metadata COPY
BlockContainer<HTML>#html/background COPY
BlockContainer<HTML>#html/border COPY
BlockContainer<BODY>#body/descendants(background-and-borders) ASSEMBLE
BlockContainer<BODY>#body/scroll-metadata COPY
BlockContainer<BODY>#body/background COPY
BlockContainer<BODY>#body/border COPY
BlockContainer<DIV>#a/descendants(background-and-borders) ASSEMBLE
BlockContainer<DIV>#b/descendants(background-and-borders) COPY
BlockContainer<HTML>#html/foreground COPY
BlockContainer<BODY>#body/descendants(foreground) ASSEMBLE
BlockContainer<BODY>#body/foreground COPY
BlockContainer<DIV>#a/descendants(foreground) ASSEMBLE
BlockContainer<DIV>#b/descendants(foreground) COPY
BlockContainer<BODY>#body/outline COPY
BlockContainer<BODY>#body/overlay COPY
BlockContainer<DIV>#a ASSEMBLE
BlockContainer<DIV>#a/scroll-metadata COPY
BlockContainer<DIV>#a/background COPY
BlockContainer<DIV>#a/border COPY
BlockContainer<DIV>#a0.row/descendants(background-and-borders) ASSEMBLE
BlockContainer<DIV>#a0.row/scroll-metadata RECORD (empty)
BlockContainer<DIV>#a0.row/background SKIP
BlockContainer<DIV>#a0.row/border RECORD
BlockContainer<DIV>#a1.row/descendants(background-and-borders) COPY
BlockContainer<DIV>#a0.row/descendants(floats) ASSEMBLE
BlockContainer<DIV>#a1.row/descendants(floats) COPY
BlockContainer<DIV>#a0.row/descendants(inline-background-and-borders) ASSEMBLE
BlockContainer<DIV>#a1.row/descendants(inline-background-and-borders) COPY
BlockContainer<DIV>#a/foreground COPY
BlockContainer<DIV>#a0.row/descendants(foreground) ASSEMBLE
BlockContainer<DIV>#a0.row/foreground RECORD
BlockContainer<DIV>#a0.row/outline SKIP
BlockContainer<DIV>#a0.row/overlay SKIP
BlockContainer<DIV>#a1.row/descendants(foreground) COPY
BlockContainer<DIV>#a/outline COPY
BlockContainer<DIV>#a/overlay COPY
BlockContainer<DIV>#b COPY
BlockContainer<HTML>#html/outline COPY
@viewport/outline COPY
`
}
]
});
</script>