Truly independent web browser
<!DOCTYPE html>
<script src="../../include.js"></script>
<script src="../../work-test.js"></script>
<style>
#target {
border: 0.75px solid black;
outline: 0.75px solid black;
}
</style>
<div id="target">target</div>
<script>
test(() => {
const target = document.getElementById("target");
internals.setDevicePixelRatio(1);
internals.updateStyle();
println(`initial device pixel ratio: ${devicePixelRatio}`);
println(`initial border width: ${getComputedStyle(target).borderTopWidth}`);
println(`initial outline width: ${getComputedStyle(target).outlineWidth}`);
const work = styleWork(() => internals.setDevicePixelRatio(2));
println(`updated device pixel ratio: ${devicePixelRatio}`);
println(`updated border width: ${getComputedStyle(target).borderTopWidth}`);
println(`updated outline width: ${getComputedStyle(target).outlineWidth}`);
println(`passes: [${work.passes().join(", ")}], restyled: [${work.restyled().map(shortStyleName).join(", ")}]`);
});
</script>