File tree 3 files changed +50
-0
lines changed
html/canvas/offscreen/manual/text
3 files changed +50
-0
lines changed Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html class ="reftest-wait ">
3
+ < head >
4
+ < title > HTML 5 Canvas Test: fillText() after loading a FontFace and transferControlToOffscreen draws text</ title >
5
+ < link rel ="mismatch " href ="empty-ref.html ">
6
+ < meta charset ="utf-8 ">
7
+ < meta name ="assert " content ="fillText() after loading a FontFace and transferControlToOffscreen() draws text ">
8
+ < script src ="/common/reftest-wait.js "> </ script >
9
+ </ head >
10
+ < body onload ="runTest() ">
11
+ < canvas id ="c "> </ canvas >
12
+ < script >
13
+ function runTest ( ) {
14
+ let test_font = new FontFace (
15
+ "Lato-Medium" ,
16
+ "url(/fonts/Lato-Medium.ttf)"
17
+ ) ;
18
+
19
+ test_font . load ( ) . then ( font => {
20
+ const c = document . getElementById ( "c" ) ;
21
+ const ctx = c . transferControlToOffscreen ( ) . getContext ( "2d" ) ;
22
+ // This should also draw text without setting the font.
23
+ ctx . fillText ( "T" , 5 , 50 ) ;
24
+ takeScreenshot ( ) ;
25
+ } ) ;
26
+ }
27
+ </ script >
28
+ </ body >
29
+ </ html >
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html class ="reftest-wait ">
3
+ < head >
4
+ < title > HTML 5 Canvas Test: fillText() after transferControlToOffscreen draws text</ title >
5
+ < link rel ="mismatch " href ="empty-ref.html ">
6
+ < meta charset ="utf-8 ">
7
+ < meta name ="assert " content ="fillText() after transferControlToOffscreen() draws text ">
8
+ < script src ="/common/reftest-wait.js "> </ script >
9
+ </ head >
10
+ < body onload ="runTest() ">
11
+ < canvas id ="c "> </ canvas >
12
+ < script >
13
+ function runTest ( ) {
14
+ const c = document . getElementById ( "c" ) ;
15
+ const ctx = c . transferControlToOffscreen ( ) . getContext ( "2d" ) ;
16
+ ctx . fillText ( "T" , 5 , 50 ) ;
17
+ takeScreenshot ( ) ;
18
+ }
19
+ </ script >
20
+ </ body >
21
+ </ html >
You can’t perform that action at this time.
0 commit comments