styleSheet.insertRule(rule, styleSheet.length);
var div = document.createElement("div");
- div.innerHTML += "<div style='font-family:" +
- fontName +
- ";'>j</div>";
+ var style = 'font-family:"' + fontName +
+ '";position: absolute;top:-99999;left:-99999;z-index:-99999';
+ div.setAttribute("style", style);
document.body.appendChild(div);
Fonts[fontName].loading = true;
pageNum = parseInt(queryParams().page) || 1;
var fileName = userInput;
if (!userInput) {
- fileName = "canvas.pdf";
+ fileName = queryParams().file || "compressed.tracemonkey-pldi-09.pdf";
}
open(fileName);
}
</script>
<link rel="stylesheet" href="viewer.css"></link>
</head>
-
<body>
- <div id="fonts" style="position: absolute;display:block;z-index:-1;"></div>
<div id="controls">
<input type="file" style="float: right; margin: auto 32px;" onChange="load(this.value.toString());"></input>
<!-- This only opens supported PDFs from the source path...
// seems it's loaded once Gecko notices it's used. Therefore,
// add a div on the page using the loaded font.
var div = document.createElement("div");
- document.getElementById("fonts").innerHTML += "<div style='font-family:" + data.fontName + "'>j</div>";
+ var style = 'font-family:"' + data.fontName +
+ '";position: absolute;top:-99999;left:-99999;z-index:-99999';
+ div.setAttribute("style", style);
+ document.body.appendChild(div);
},
"jpeg_stream": function(data) {