Truly independent web browser
<!DOCTYPE html>
<script src="include.js"></script>
<script src="work-test.js"></script>
<style>
body { margin: 0; }
#spacer { height: 30px; }
#cached {
display: inline-block;
width: 150px;
}
#content { width: 100px; height: 45px; }
</style>
<div id="spacer"></div>
<div id="cached"><div id="content"></div></div>
<script>
layoutTest({
steps: [
{
name: "reused inline-block retains its automatic height",
mutate: () => {
spacer.style.height = "60px";
},
expect: `
layout FULL
@viewport/block RUN (cache=bypass)
BlockContainer<HTML>/block RUN (cache=miss)
BlockContainer(anonymous) REUSE IN-FLOW SUBTREE
`,
check: equal => {
const rect = cached.getBoundingClientRect();
equal(rect.top, 60, "cached top");
equal(rect.width, 150, "cached width");
equal(rect.height, 45, "cached height");
},
},
],
});
</script>