|
|
@@ -26,7 +26,7 @@ this.imagesMinifier = this.imagesMinifier || (() => {
|
|
|
const SVG_NS = "http://www.w3.org/2000/svg";
|
|
|
const PREFIX_DATA_URI_IMAGE_SVG = "data:image/svg+xml";
|
|
|
const SINGLE_FILE_IMAGE_ATTRIBUTE = "single-file-ref";
|
|
|
- const IGNORED_ATTRIBUTES = ["src", "viewBox", "preserveAspectRatio", "xlink:href", "title", "class"];
|
|
|
+ const IGNORED_ATTRIBUTES = ["src", "viewBox", "preserveAspectRatio", "xlink:href", "title", "class", "style"];
|
|
|
const SINGLE_FILE_SELECTOR = {
|
|
|
type: "attribute",
|
|
|
action: "exists",
|
|
|
@@ -178,6 +178,8 @@ this.imagesMinifier = this.imagesMinifier || (() => {
|
|
|
svgElement.appendChild(titleElement);
|
|
|
}
|
|
|
svgElement.setAttribute(SINGLE_FILE_IMAGE_ATTRIBUTE, "");
|
|
|
+ const style = svgElement.getAttribute("style") || "";
|
|
|
+ svgElement.setAttribute("style", style + (style && ";") + "box-sizing:content-box!important;width:" + imageData.clientWidth + "px!important;" + "height:" + imageData.clientHeight + "px!important");
|
|
|
svgElement.setAttributeNS(SVG_NS, "viewBox", "0 0 " + width + " " + height);
|
|
|
svgElement.setAttributeNS(SVG_NS, "width", imageData.clientWidth);
|
|
|
svgElement.setAttributeNS(SVG_NS, "height", imageData.clientHeight);
|