Index: LayoutTests/fast/canvas/canvas-set-font-with-updated-style.html |
diff --git a/LayoutTests/fast/canvas/canvas-set-font-with-updated-style.html b/LayoutTests/fast/canvas/canvas-set-font-with-updated-style.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a6b90fa686a6e2d7e79b83fcbf275a8567ef82f9 |
--- /dev/null |
+++ b/LayoutTests/fast/canvas/canvas-set-font-with-updated-style.html |
@@ -0,0 +1,30 @@ |
+<!DOCTYPE HTML> |
+<html> |
+<body onload="runTest();"> |
+<div> |
+<span>Tests that setting font of Canvas 2d context always uses up-to-date style and has font value: <span id="result"></span></span><br> |
+<canvas id="canvasTest"></canvas> |
+</div> |
+<script type="text/javascript"> |
+if (window.testRunner) |
+ testRunner.dumpAsText(); |
+ |
+function drawCanvasText(id, text) |
+{ |
+ var canvasElement = document.getElementById(id); |
+ var context = canvasElement.getContext('2d'); |
+ canvasElement.style.fontSize = '64px'; |
+ context.font = '1em Calibri'; |
+ context.fillText(text, 0, 100); |
+ return context.font; |
+} |
+ |
+function runTest() |
+{ |
+ var fontSize = drawCanvasText('canvasTest', 'Some Text'); |
+ var resultElement = document.getElementById('result'); |
+ resultElement.textContent = fontSize; |
+} |
+</script> |
+</body> |
+</html> |