mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Test for bug 667947. r=dbaron
This commit is contained in:
parent
2d44f17e62
commit
796f9a5bc4
@ -41,6 +41,8 @@ asserts-if(cocoaWidget,0-2) == size-change-1.html size-change-1-ref.html
|
||||
|
||||
fails-if(Android) != text-font-lang.html text-font-lang-notref.html
|
||||
|
||||
== text-measure.html text-measure-ref.html
|
||||
|
||||
== strokeText-path.html strokeText-path-ref.html
|
||||
|
||||
# gradient off-by-one, fails on windows and linux
|
||||
|
15
layout/reftests/canvas/text-measure-ref.html
Normal file
15
layout/reftests/canvas/text-measure-ref.html
Normal file
@ -0,0 +1,15 @@
|
||||
<html>
|
||||
<script>
|
||||
function load() {
|
||||
var ctx = document.getElementById("canvas").getContext("2d");
|
||||
|
||||
ctx.font = "bold 12px sans-serif";
|
||||
ctx.scale(4, 4);
|
||||
var str = "HeHeHeHe";
|
||||
ctx.fillText(str, 0, 15);
|
||||
}
|
||||
</script>
|
||||
<body onload="load();">
|
||||
<canvas id="canvas" width="400" height="200"></canvas>
|
||||
</body>
|
||||
</html>
|
19
layout/reftests/canvas/text-measure.html
Normal file
19
layout/reftests/canvas/text-measure.html
Normal file
@ -0,0 +1,19 @@
|
||||
<html>
|
||||
<script>
|
||||
function load() {
|
||||
var ctx = document.getElementById("canvas").getContext("2d");
|
||||
|
||||
ctx.font = "bold 12px sans-serif";
|
||||
ctx.scale(4, 4);
|
||||
var str = "HeHeHeHe";
|
||||
var x = 0;
|
||||
for (var i = 0; i < str.length; ++i) {
|
||||
ctx.fillText(str[i], x, 15);
|
||||
x += ctx.measureText(str[i]).width;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<body onload="load();">
|
||||
<canvas id="canvas" width="400" height="200"></canvas>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user