mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-23 00:47:31 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
29
layout/reftests/canvas/text-ltr-alignment-test.html
Normal file
29
layout/reftests/canvas/text-ltr-alignment-test.html
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test to ensure left/right and start/end are offset by text width for ltr text</title>
|
||||
</head>
|
||||
<body>
|
||||
<canvas id="c" width="128" height="64" style="direction:ltr"></canvas>
|
||||
<script type="text/javascript">
|
||||
var canvas = document.getElementById('c');
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
|
||||
ctx.fillStyle = 'black';
|
||||
ctx.font = '20px sans-serif';
|
||||
ctx.textBaseline = 'top';
|
||||
|
||||
var str = 'TEXT';
|
||||
var wid = ctx.measureText(str).width;
|
||||
|
||||
ctx.textAlign = 'right';
|
||||
ctx.fillText(str, 64+wid, 0);
|
||||
ctx.textAlign = 'end';
|
||||
ctx.fillText(str, 64+wid, 20);
|
||||
ctx.textAlign = 'left';
|
||||
ctx.fillText(str, 64-wid/2, 40);
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue