OLD | NEW |
| (Empty) |
1 <p> | |
2 This tests that when the user style sheet location is set to a data: | |
3 URL with base64-encoded UTF-8 data, the style sheet is processed | |
4 synchronously, instead of invoking the asynchronous loader. | |
5 </p> | |
6 <script> | |
7 var testObjects = [ | |
8 {result:true, size:"100px", url:"data:text/css;charset=utf-8;base64,Ym9
keSB7Zm9udC1zaXplOiAxMDBweH0="}, | |
9 {result:true, size:"110px", url:encodeURI("data:text/css;charset=utf-8;
base64, Ym9keSB7Zm9udC1zaXplOiAxMTBweH0=
")}, | |
10 {result:true, size:"120px", url:encodeURI("data:text/css;charset=utf-8;
base64,\n \r \t Ym9k \t eSB7 \r Zm9ud \n \n C1zaXp \r lOiAxM \t jBweH0= \t \r \n
")}, | |
11 {result:true, size:"130px", url:encodeURI("data:text/css;charset=utf-8;
base64,\u0059 \u006D \u0039 \u006B eSB7Zm9ud C1zaXplOiAxMzBwe \u0048 \u0030 \u00
3D")}, | |
12 {result:false, size:"140px", url:"data:text/css;charset=utf-8;base64,Ym9
k$#eSB7Zm#9ud(C1zaXp)lOiAxNDBweH0="}, | |
13 {result:false, size:"150px", url:"data:text/css;charset=utf-8;base64,Ym9
ke%00SB7Z%20m9udC1z\n\taXplO#iAx%03NTBw%eH0="}, | |
14 {result:false, size:"160px", url:"%50%30%10%00%20%40"} | |
15 ]; | |
16 | |
17 if (window.testRunner) { | |
18 testRunner.dumpAsText(); | |
19 testRunner.setUserStyleSheetEnabled(true); | |
20 | |
21 for (var i = 0; i < testObjects.length; i++) { | |
22 var obj = testObjects[i]; | |
23 testRunner.setUserStyleSheetLocation(obj.url); | |
24 | |
25 document.body.offsetTop; | |
26 var result = getComputedStyle(document.body).fontSize == obj.size; | |
27 document.write((result == obj.result ? "PASS" : "FAIL") + " " + obj.
size + "<br>"); | |
28 | |
29 testRunner.setUserStyleSheetLocation(""); | |
30 } | |
31 } else | |
32 document.write("This test can only be run in DumpRenderTree."); | |
33 </script> | |
OLD | NEW |