Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Unified Diff: LayoutTests/fast/canvas/canvas-set-font-with-updated-style.html

Issue 552053003: CanvasRenderingContext2D should update the render tree to avoid stale computed style. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed unnecessary code from tests! Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/canvas/canvas-set-font-with-updated-style-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | LayoutTests/fast/canvas/canvas-set-font-with-updated-style-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698