blob: fc0c678adc8b04f3c1edce6e1c8dd811698d6ef6 [file] [log] [blame]
<!DOCTYPE html><!-- webkit-test-runner [ useFlexibleViewport=true ] -->
<html>
<head>
<meta name="viewport" content="initial-scale=0.6666">
<script>
if (window.internals) {
window.internals.settings.setTextAutosizingEnabled(true);
window.internals.settings.setTextAutosizingUsesIdempotentMode(true);
}
</script>
<script src="../../../../resources/js-test-pre.js"></script>
</head>
<body>
<div style="background: green;"><span id="target" style="font-size: 12px;">Test</span></div>
<div style="background: green;"><span style="font-size: 12px;">Test</span></div>
<div style="background: green;"><span id="target2" style="font-size: 6px;">Test</span></div>
<div style="background: green;"><span style="font-size: 6px;">Test</span></div>
<script>
let target = document.getElementById("target");
target.offsetWidth;
let result = Number.parseInt(window.getComputedStyle(target).getPropertyValue("font-size"));
shouldBeGreaterThanOrEqual("result", "13");
target = document.getElementById("target2");
target.offsetWidth;
result = Number.parseInt(window.getComputedStyle(target).getPropertyValue("font-size"));
shouldBeGreaterThanOrEqual("result", "7");
</script>
<script src="../../../../resources/js-test-post.js"></script>
</body>
</html>