forked from web-platform-tests/wpt
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into taskcluster-stability-2
- Loading branch information
Showing
1,918 changed files
with
27,105 additions
and
14,503 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-371 Bytes
(75%)
2dcontext/drawing-text-to-the-canvas/2d.text.draw.fill.basic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-371 Bytes
(75%)
2dcontext/drawing-text-to-the-canvas/2d.text.draw.fill.maxWidth.large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-371 Bytes
(75%)
2dcontext/drawing-text-to-the-canvas/2d.text.draw.fill.rtl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-430 Bytes
(79%)
2dcontext/drawing-text-to-the-canvas/2d.text.draw.stroke.basic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 51 additions & 0 deletions
51
2dcontext/drawing-text-to-the-canvas/2d.text.measure.actualBoundingBox.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<!DOCTYPE html> | ||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> | ||
<title>Canvas test: 2d.text.measure.actualBoundingBox</title> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/common/canvas-tests.js"></script> | ||
<link rel="stylesheet" href="/common/canvas-tests.css"> | ||
<style> | ||
@font-face { | ||
font-family: CanvasTest; | ||
src: url("/fonts/CanvasTest.ttf"); | ||
} | ||
</style> | ||
<body class="show_output"> | ||
|
||
<h1>2d.text.measure.actualBoundingBox</h1> | ||
<p class="desc">Testing actualBoundingBox</p> | ||
|
||
|
||
<span style="font-family: CanvasTest; position: absolute; visibility: hidden">A</span> | ||
<p class="output">Actual output:</p> | ||
<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> | ||
|
||
<ul id="d"></ul> | ||
<script> | ||
var t = async_test("Testing actualBoundingBox"); | ||
_addTest(function(canvas, ctx) { | ||
|
||
deferTest(); | ||
step_timeout(t.step_func_done(function () { | ||
ctx.font = '50px CanvasTest'; | ||
ctx.direction = 'ltr'; | ||
ctx.align = 'left' | ||
ctx.baseline = 'alphabetic' | ||
// Some platforms may return '-0'. | ||
_assertSame(Math.abs(ctx.measureText('A').actualBoundingBoxLeft), 0, "Math.abs(ctx.measureText('A').actualBoundingBoxLeft)", "0"); | ||
// Different platforms may render text slightly different. | ||
_assert(ctx.measureText('A').actualBoundingBoxRight >= 50, "ctx.measureText('A').actualBoundingBoxRight >= 50"); | ||
_assert(ctx.measureText('A').actualBoundingBoxAscent >= 35, "ctx.measureText('A').actualBoundingBoxAscent >= 35"); | ||
_assertSame(Math.abs(ctx.measureText('A').actualBoundingBoxDescent), 0, "Math.abs(ctx.measureText('A').actualBoundingBoxDescent)", "0"); | ||
|
||
_assertSame(Math.abs(ctx.measureText('ABCD').actualBoundingBoxLeft), 0, "Math.abs(ctx.measureText('ABCD').actualBoundingBoxLeft)", "0"); | ||
_assert(ctx.measureText('ABCD').actualBoundingBoxRight >= 200, "ctx.measureText('ABCD').actualBoundingBoxRight >= 200"); | ||
_assert(ctx.measureText('ABCD').actualBoundingBoxAscent >= 85, "ctx.measureText('ABCD').actualBoundingBoxAscent >= 85"); | ||
_assert(ctx.measureText('ABCD').actualBoundingBoxDescent >= 37, "ctx.measureText('ABCD').actualBoundingBoxDescent >= 37"); | ||
}), 500); | ||
|
||
|
||
}); | ||
</script> | ||
|
53 changes: 53 additions & 0 deletions
53
2dcontext/drawing-text-to-the-canvas/2d.text.measure.advances.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<!DOCTYPE html> | ||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> | ||
<title>Canvas test: 2d.text.measure.advances</title> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/common/canvas-tests.js"></script> | ||
<link rel="stylesheet" href="/common/canvas-tests.css"> | ||
<style> | ||
@font-face { | ||
font-family: CanvasTest; | ||
src: url("/fonts/CanvasTest.ttf"); | ||
} | ||
</style> | ||
<body class="show_output"> | ||
|
||
<h1>2d.text.measure.advances</h1> | ||
<p class="desc">Testing width advances</p> | ||
|
||
|
||
<span style="font-family: CanvasTest; position: absolute; visibility: hidden">A</span> | ||
<p class="output">Actual output:</p> | ||
<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> | ||
|
||
<ul id="d"></ul> | ||
<script> | ||
var t = async_test("Testing width advances"); | ||
_addTest(function(canvas, ctx) { | ||
|
||
deferTest(); | ||
step_timeout(t.step_func_done(function () { | ||
ctx.font = '50px CanvasTest'; | ||
ctx.direction = 'ltr'; | ||
ctx.align = 'left' | ||
// Some platforms may return '-0'. | ||
_assertSame(Math.abs(ctx.measureText('Hello').advances[0]), 0, "Math.abs(ctx.measureText('Hello').advances[\""+(0)+"\"])", "0"); | ||
// Different platforms may render text slightly different. | ||
_assert(ctx.measureText('Hello').advances[1] >= 36, "ctx.measureText('Hello').advances[\""+(1)+"\"] >= 36"); | ||
_assert(ctx.measureText('Hello').advances[2] >= 58, "ctx.measureText('Hello').advances[\""+(2)+"\"] >= 58"); | ||
_assert(ctx.measureText('Hello').advances[3] >= 70, "ctx.measureText('Hello').advances[\""+(3)+"\"] >= 70"); | ||
_assert(ctx.measureText('Hello').advances[4] >= 80, "ctx.measureText('Hello').advances[\""+(4)+"\"] >= 80"); | ||
|
||
var tm = ctx.measureText('Hello'); | ||
_assertSame(ctx.measureText('Hello').advances[0], tm.advances[0], "ctx.measureText('Hello').advances[\""+(0)+"\"]", "tm.advances[\""+(0)+"\"]"); | ||
_assertSame(ctx.measureText('Hello').advances[1], tm.advances[1], "ctx.measureText('Hello').advances[\""+(1)+"\"]", "tm.advances[\""+(1)+"\"]"); | ||
_assertSame(ctx.measureText('Hello').advances[2], tm.advances[2], "ctx.measureText('Hello').advances[\""+(2)+"\"]", "tm.advances[\""+(2)+"\"]"); | ||
_assertSame(ctx.measureText('Hello').advances[3], tm.advances[3], "ctx.measureText('Hello').advances[\""+(3)+"\"]", "tm.advances[\""+(3)+"\"]"); | ||
_assertSame(ctx.measureText('Hello').advances[4], tm.advances[4], "ctx.measureText('Hello').advances[\""+(4)+"\"]", "tm.advances[\""+(4)+"\"]"); | ||
}), 500); | ||
|
||
|
||
}); | ||
</script> | ||
|
46 changes: 46 additions & 0 deletions
46
2dcontext/drawing-text-to-the-canvas/2d.text.measure.baselines.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<!DOCTYPE html> | ||
<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> | ||
<title>Canvas test: 2d.text.measure.baselines</title> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/common/canvas-tests.js"></script> | ||
<link rel="stylesheet" href="/common/canvas-tests.css"> | ||
<style> | ||
@font-face { | ||
font-family: CanvasTest; | ||
src: url("/fonts/CanvasTest.ttf"); | ||
} | ||
</style> | ||
<body class="show_output"> | ||
|
||
<h1>2d.text.measure.baselines</h1> | ||
<p class="desc">Testing baselines</p> | ||
|
||
|
||
<span style="font-family: CanvasTest; position: absolute; visibility: hidden">A</span> | ||
<p class="output">Actual output:</p> | ||
<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> | ||
|
||
<ul id="d"></ul> | ||
<script> | ||
var t = async_test("Testing baselines"); | ||
_addTest(function(canvas, ctx) { | ||
|
||
deferTest(); | ||
step_timeout(t.step_func_done(function () { | ||
ctx.font = '50px CanvasTest'; | ||
ctx.direction = 'ltr'; | ||
ctx.align = 'left' | ||
_assertSame(Math.abs(ctx.measureText('A').getBaselines().alphabetic), 0, "Math.abs(ctx.measureText('A').getBaselines().alphabetic)", "0"); | ||
_assertSame(ctx.measureText('A').getBaselines().ideographic, -39, "ctx.measureText('A').getBaselines().ideographic", "-39"); | ||
_assertSame(ctx.measureText('A').getBaselines().hanging, 68, "ctx.measureText('A').getBaselines().hanging", "68"); | ||
|
||
_assertSame(Math.abs(ctx.measureText('ABCD').getBaselines().alphabetic), 0, "Math.abs(ctx.measureText('ABCD').getBaselines().alphabetic)", "0"); | ||
_assertSame(ctx.measureText('ABCD').getBaselines().ideographic, -39, "ctx.measureText('ABCD').getBaselines().ideographic", "-39"); | ||
_assertSame(ctx.measureText('ABCD').getBaselines().hanging, 68, "ctx.measureText('ABCD').getBaselines().hanging", "68"); | ||
}), 500); | ||
|
||
|
||
}); | ||
</script> | ||
|
Oops, something went wrong.