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

Side by Side Diff: LayoutTests/fast/canvas/script-tests/canvas-frameless-document-text.js

Issue 186063003: Prevent crash when calling text-related methods on a 2D canvas in a frame-less document. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fixed test Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 description("This verifies that the browser does not crash when drawing text to a canvas in a frame-less document.");
2
3 // It is not clear frome the spec whether this is supposed to work and how.
4 // Therefore, we do not validate the rendering results. We just make sure
5 // this does not crash the browser.
6 var canvas1 = document.createElement('canvas');
7 var ctx1 = canvas1.getContext('2d');
8 var htmlDoc = document.implementation.createHTMLDocument('', '', null);
9 htmlDoc.adoptNode(canvas1);
10 var canvas2 = htmlDoc.createElement('canvas');
11 var ctx2 = canvas2.getContext('2d');
12
13 ctx1.font = 'italic 30px Arial';
14 ctx2.font = 'italic 30px Arial';
15 ctx1.fillText('Text1', 0, 30);
16 ctx2.fillText('Text1', 0, 30);
17 ctx1.strokeText('Text2', 0, 60);
18 ctx2.strokeText('Text2', 0, 60);
19 ctx1.measureText('Text3');
20 ctx2.measureText('Text3');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698