summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/canvas/canvas-set-font-with-updated-style.html
diff options
context:
space:
mode:
authorjunov@chromium.org <junov@chromium.org>2015-07-21 16:54:23 +0000
committerjunov@chromium.org <junov@chromium.org>2015-07-21 16:54:23 +0000
commita0a14768abf019aa377fbcf9ea72d7c54c5fb45b (patch)
treeb445aecc756c797b6d65c2b4d6030fd98517ee6b /third_party/WebKit/LayoutTests/fast/canvas/canvas-set-font-with-updated-style.html
parent1ef39cf4a2a5a6276c0744a45c789f4cc01a2a74 (diff)
downloadchromium_src-a0a14768abf019aa377fbcf9ea72d7c54c5fb45b.zip
chromium_src-a0a14768abf019aa377fbcf9ea72d7c54c5fb45b.tar.gz
chromium_src-a0a14768abf019aa377fbcf9ea72d7c54c5fb45b.tar.bz2
Adding a canvas-specific cache for style-dependent font resolution
This change adds a cache very similar to the one added in https://src.chromium.org/viewvc/blink?view=rev&revision=198618 The difference is that this cache is specifically for canvases that are attached to the DOM. These canvases have font resolution logic that depends on the style of the canvas element. Therefore, the cache has to be element-specific rather than global to the document. BUG=497864 Review URL: https://codereview.chromium.org/1234503007 git-svn-id: svn://svn.chromium.org/blink/trunk@199230 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Diffstat (limited to 'third_party/WebKit/LayoutTests/fast/canvas/canvas-set-font-with-updated-style.html')
-rw-r--r--third_party/WebKit/LayoutTests/fast/canvas/canvas-set-font-with-updated-style.html6
1 files changed, 6 insertions, 0 deletions
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-set-font-with-updated-style.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-set-font-with-updated-style.html
index a6b90fa..9290f32 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-set-font-with-updated-style.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-set-font-with-updated-style.html
@@ -13,6 +13,12 @@ function drawCanvasText(id, text)
{
var canvasElement = document.getElementById(id);
var context = canvasElement.getContext('2d');
+
+ // Pre-draw pass to add the font to the font cache. This way, the test also
+ // verifies that the style change correctly invalidates the font resolution cache.
+ context.font = '1em Calibri';
+ context.fillText(text, 0, 100);
+
canvasElement.style.fontSize = '64px';
context.font = '1em Calibri';
context.fillText(text, 0, 100);