Replace a couple of standard for
-loops with for...of
in src/display/font_loader.js
This commit is contained in:
parent
dcbb23d7fa
commit
9ad7746118
@ -315,8 +315,8 @@ if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) {
|
|||||||
this.insertRule(rule);
|
this.insertRule(rule);
|
||||||
|
|
||||||
const names = [];
|
const names = [];
|
||||||
for (i = 0, ii = fonts.length; i < ii; i++) {
|
for (const font of fonts) {
|
||||||
names.push(fonts[i].loadedName);
|
names.push(font.loadedName);
|
||||||
}
|
}
|
||||||
names.push(loadTestFontId);
|
names.push(loadTestFontId);
|
||||||
|
|
||||||
@ -326,10 +326,10 @@ if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) {
|
|||||||
div.style.position = "absolute";
|
div.style.position = "absolute";
|
||||||
div.style.top = div.style.left = "0px";
|
div.style.top = div.style.left = "0px";
|
||||||
|
|
||||||
for (i = 0, ii = names.length; i < ii; ++i) {
|
for (const name of names) {
|
||||||
const span = this._document.createElement("span");
|
const span = this._document.createElement("span");
|
||||||
span.textContent = "Hi";
|
span.textContent = "Hi";
|
||||||
span.style.fontFamily = names[i];
|
span.style.fontFamily = name;
|
||||||
div.appendChild(span);
|
div.appendChild(span);
|
||||||
}
|
}
|
||||||
this._document.body.appendChild(div);
|
this._document.body.appendChild(div);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user