Inline loadStyles
calls in the rasterization classes in test/driver.js
The wrapper functions in this case only really added indirection, so this commit simplifies the code a bit.
This commit is contained in:
parent
a58700b0dc
commit
1d1f713bfc
@ -154,10 +154,6 @@ var rasterizeTextLayer = (function rasterizeTextLayerClosure() {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
function getTextLayerStyle() {
|
|
||||||
return loadStyles(styles);
|
|
||||||
}
|
|
||||||
|
|
||||||
// eslint-disable-next-line no-shadow
|
// eslint-disable-next-line no-shadow
|
||||||
function rasterizeTextLayer(
|
function rasterizeTextLayer(
|
||||||
ctx,
|
ctx,
|
||||||
@ -180,7 +176,7 @@ var rasterizeTextLayer = (function rasterizeTextLayerClosure() {
|
|||||||
foreignObject.setAttribute("width", viewport.width + "px");
|
foreignObject.setAttribute("width", viewport.width + "px");
|
||||||
foreignObject.setAttribute("height", viewport.height + "px");
|
foreignObject.setAttribute("height", viewport.height + "px");
|
||||||
var style = document.createElement("style");
|
var style = document.createElement("style");
|
||||||
var stylePromise = getTextLayerStyle();
|
var stylePromise = loadStyles(styles);
|
||||||
foreignObject.appendChild(style);
|
foreignObject.appendChild(style);
|
||||||
var div = document.createElement("div");
|
var div = document.createElement("div");
|
||||||
div.className = "textLayer";
|
div.className = "textLayer";
|
||||||
@ -237,10 +233,6 @@ var rasterizeAnnotationLayer = (function rasterizeAnnotationLayerClosure() {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
function getAnnotationLayerStyle() {
|
|
||||||
return loadStyles(styles);
|
|
||||||
}
|
|
||||||
|
|
||||||
// eslint-disable-next-line no-shadow
|
// eslint-disable-next-line no-shadow
|
||||||
function rasterizeAnnotationLayer(
|
function rasterizeAnnotationLayer(
|
||||||
ctx,
|
ctx,
|
||||||
@ -264,7 +256,7 @@ var rasterizeAnnotationLayer = (function rasterizeAnnotationLayerClosure() {
|
|||||||
foreignObject.setAttribute("width", viewport.width + "px");
|
foreignObject.setAttribute("width", viewport.width + "px");
|
||||||
foreignObject.setAttribute("height", viewport.height + "px");
|
foreignObject.setAttribute("height", viewport.height + "px");
|
||||||
var style = document.createElement("style");
|
var style = document.createElement("style");
|
||||||
var stylePromise = getAnnotationLayerStyle();
|
var stylePromise = loadStyles(styles);
|
||||||
foreignObject.appendChild(style);
|
foreignObject.appendChild(style);
|
||||||
var div = document.createElement("div");
|
var div = document.createElement("div");
|
||||||
div.className = "annotationLayer";
|
div.className = "annotationLayer";
|
||||||
@ -322,10 +314,6 @@ var rasterizeXfaLayer = (function rasterizeXfaLayerClosure() {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
function getXfaLayerStyle() {
|
|
||||||
return loadStyles(styles);
|
|
||||||
}
|
|
||||||
|
|
||||||
// eslint-disable-next-line no-shadow
|
// eslint-disable-next-line no-shadow
|
||||||
function rasterizeXfaLayer(
|
function rasterizeXfaLayer(
|
||||||
ctx,
|
ctx,
|
||||||
@ -349,7 +337,7 @@ var rasterizeXfaLayer = (function rasterizeXfaLayerClosure() {
|
|||||||
foreignObject.setAttribute("width", viewport.width + "px");
|
foreignObject.setAttribute("width", viewport.width + "px");
|
||||||
foreignObject.setAttribute("height", viewport.height + "px");
|
foreignObject.setAttribute("height", viewport.height + "px");
|
||||||
const style = document.createElement("style");
|
const style = document.createElement("style");
|
||||||
const stylePromise = getXfaLayerStyle();
|
const stylePromise = loadStyles(styles);
|
||||||
foreignObject.appendChild(style);
|
foreignObject.appendChild(style);
|
||||||
const div = document.createElement("div");
|
const div = document.createElement("div");
|
||||||
foreignObject.appendChild(div);
|
foreignObject.appendChild(div);
|
||||||
|
Loading…
Reference in New Issue
Block a user