Truly independent web browser
<!DOCTYPE html>
<script src="include.js"></script>
<script src="work-test.js"></script>
<style>
body { margin: 0; }
#spacer { width: 100px; height: 50px; }
#cached {
width: 300px;
overflow: hidden;
text-transform: uppercase;
}
</style>
<div id="spacer"></div>
<div id="cached" lang="en">istanbul</div>
<script>
layoutTest({
steps: [
{
name: "a language change invalidates the cached text layout",
mutate: () => {
// Reusing the English run would preserve the wrong uppercased glyphs.
cached.setAttribute("lang", "tr");
spacer.style.height = "80px";
},
expect: `
layout FULL
@viewport/block RUN (cache=bypass)
BlockContainer<HTML>/block RUN (cache=miss)
BlockContainer<DIV>#cached/block RUN (cache=miss)
`,
},
],
});
</script>