layout/reftests/canvas/text-font-lang-notref.html

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

michael@0 1 <!DOCTYPE HTML>
michael@0 2 <html>
michael@0 3 <head>
michael@0 4 <title>Test for language-sensitive font prefs on canvas</title>
michael@0 5 <script type="text/javascript">
michael@0 6 function test(canvasID) {
michael@0 7 var canvas = document.getElementById(canvasID);
michael@0 8 var ctx = canvas.getContext('2d');
michael@0 9
michael@0 10 var str = 'Hello world! \u4F60\u597D\u5417\uFF1F';
michael@0 11 ctx.font = '2em sans-serif';
michael@0 12 ctx.fillStyle = 'black';
michael@0 13 ctx.textAlign = 'left';
michael@0 14 ctx.textBaseline = 'top';
michael@0 15 ctx.fillText(str, 10, 10);
michael@0 16 };
michael@0 17 </script>
michael@0 18 </head>
michael@0 19 <body>
michael@0 20
michael@0 21 <div lang="en" style="margin:20px; height:100px;">
michael@0 22 <canvas id="c1" width="400" height="50"></canvas>
michael@0 23 <script type="text/javascript">
michael@0 24 test("c1");
michael@0 25 </script>
michael@0 26 </div>
michael@0 27
michael@0 28 <div lang="en" style="margin:20px; height:100px;">
michael@0 29 <canvas id="c2" width="400" height="50"></canvas>
michael@0 30 <script type="text/javascript">
michael@0 31 test("c2");
michael@0 32 </script>
michael@0 33 </div>
michael@0 34
michael@0 35 <div lang="en" style="margin:20px; height:100px;">
michael@0 36 <canvas id="c3" width="400" height="50"></canvas>
michael@0 37 <script type="text/javascript">
michael@0 38 test("c3");
michael@0 39 </script>
michael@0 40 </div>
michael@0 41
michael@0 42 <div lang="en" style="margin:20px; height:100px;">
michael@0 43 <canvas id="c4" width="400" height="50"></canvas>
michael@0 44 <script type="text/javascript">
michael@0 45 test("c4");
michael@0 46 </script>
michael@0 47 </div>
michael@0 48
michael@0 49 </body>
michael@0 50 </html>

mercurial