summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-font-ex-units-crash.js
blob: 2f275ad93b13d011691196ff21996522f4481824 (plain)
1
2
3
4
5
6
7
8
9
10
11
description("Test that setting a font with size in 'ex' units doesn't crash.");

ctx = document.createElement('canvas').getContext('2d');

ctx.font = "5ex sans-serif";

size = parseInt(ctx.font.substr(0, 2));
family = ctx.font.substr(5);

shouldBeCloseTo("size", 25, 10);
shouldBe("family", "'sans-serif'");