1 <script src=
"../../resources/testharness.js"></script>
2 <script src=
"test-helpers.js?pipe=sub"></script>
6 function load_image(url
, cross_origin
) {
7 var img
= document
.createElement('img');
8 if (cross_origin
!= '') {
9 img
.crossOrigin
= cross_origin
;
14 function load_script(url
, cross_origin
) {
15 var script
= document
.createElement('script');
17 if (cross_origin
!= '') {
18 script
.crossOrigin
= cross_origin
;
20 document
.body
.appendChild(script
);
23 function load_css(url
, cross_origin
) {
24 var link
= document
.createElement('link');
25 link
.rel
= 'stylesheet'
27 link
.type
= 'text/css';
28 if (cross_origin
!= '') {
29 link
.crossOrigin
= cross_origin
;
31 document
.body
.appendChild(link
);
34 function load_font(url
) {
35 var fontFace
= new FontFace(url
, 'url(' + url
+ ')');
39 function load_css_image(url
, type
) {
40 var div
= document
.createElement('div');
41 document
.body
.appendChild(div
);
42 div
.style
[type
] = 'url(' + url
+ ')';
45 function load_css_image_set(url
, type
) {
46 var div
= document
.createElement('div');
47 document
.body
.appendChild(div
);
48 div
.style
[type
] = '-webkit-image-set(url(' + url
+ ') 1x)';