Skip to content

Commit 1333ca2

Browse files
committed
Bump dependencies
1 parent bc47188 commit 1333ca2

32 files changed

+384
-399
lines changed

Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ module.exports = function (grunt) {
4646
],
4747
display: "short",
4848
summary: true,
49-
version: "5.13.0"
49+
version: "5.13.0",
5050
},
5151
},
5252
browserify: {

package-lock.json

Lines changed: 69 additions & 87 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"dependencies": {
2828
"inlineresources": "^1.2.0",
2929
"sane-domparser-error": "~0.2.0",
30-
"url": "~0.11.0",
30+
"url": "~0.11.4",
3131
"xmlserializer": "~0.6.0"
3232
},
3333
"devDependencies": {
@@ -44,8 +44,8 @@
4444
"grunt-umd": "^3.0.0",
4545
"imagediff": "git://github.com/HumbleSoftware/js-imagediff.git#5edce005fe",
4646
"jasmine-core": "^5.13.0",
47-
"prettier": "^2.5.1",
48-
"puppeteer": "^24.29.1"
47+
"prettier": "^3.7.4",
48+
"puppeteer": "^24.35.0"
4949
},
5050
"prettier": {
5151
"tabWidth": 4

src/.jshintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"esversion": 8,
23
"curly": true,
34
"eqeqeq": true,
45
"immed": true,

src/browser.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ var browser = (function (util, proxies, sanedomparsererror, theWindow) {
3333
theWindow.document,
3434
"iframe",
3535
options.width,
36-
options.height
36+
options.height,
3737
),
3838
html = element.outerHTML,
3939
iframeErrorsMessages = [],
@@ -59,7 +59,7 @@ var browser = (function (util, proxies, sanedomparsererror, theWindow) {
5959
finishNotifyXhrProxy = proxies.finishNotifyingXhr(xhr),
6060
baseUrlXhrProxy = proxies.baseUrlRespectingXhr(
6161
finishNotifyXhrProxy,
62-
options.baseUrl
62+
options.baseUrl,
6363
);
6464

6565
iframe.onload = function () {
@@ -108,15 +108,15 @@ var browser = (function (util, proxies, sanedomparsererror, theWindow) {
108108
return createHiddenSandboxedIFrame(
109109
theWindow.document,
110110
scaledViewportWidth,
111-
scaledViewportHeight
111+
scaledViewportHeight,
112112
);
113113
};
114114

115115
var calculateZoomedContentSizeAndRoundUp = function (
116116
actualViewport,
117117
requestedWidth,
118118
requestedHeight,
119-
zoom
119+
zoom,
120120
) {
121121
return {
122122
width: Math.max(actualViewport.width * zoom, requestedWidth),
@@ -142,16 +142,16 @@ var browser = (function (util, proxies, sanedomparsererror, theWindow) {
142142
selector,
143143
requestedWidth,
144144
requestedHeight,
145-
zoom
145+
zoom,
146146
) {
147147
// clientWidth/clientHeight needed for PhantomJS
148148
var actualViewportWidth = Math.max(
149149
rootElement.scrollWidth,
150-
rootElement.clientWidth
150+
rootElement.clientWidth,
151151
),
152152
actualViewportHeight = Math.max(
153153
rootElement.scrollHeight,
154-
rootElement.clientHeight
154+
rootElement.clientHeight,
155155
),
156156
top,
157157
left,
@@ -185,11 +185,11 @@ var browser = (function (util, proxies, sanedomparsererror, theWindow) {
185185
},
186186
requestedWidth,
187187
requestedHeight,
188-
zoom
188+
zoom,
189189
);
190190

191191
rootFontSize = theWindow.getComputedStyle(
192-
rootElement.ownerDocument.documentElement
192+
rootElement.ownerDocument.documentElement,
193193
).fontSize;
194194

195195
return {
@@ -228,7 +228,7 @@ var browser = (function (util, proxies, sanedomparsererror, theWindow) {
228228
iframe = createIframeWithSizeAtZoomLevel1(
229229
options.width,
230230
options.height,
231-
zoom
231+
zoom,
232232
);
233233
// We need to add the element to the document so that its content gets loaded
234234
theWindow.document
@@ -245,7 +245,7 @@ var browser = (function (util, proxies, sanedomparsererror, theWindow) {
245245
options.clip,
246246
options.width,
247247
options.height,
248-
zoom
248+
zoom,
249249
);
250250

251251
resolve(size);
@@ -363,15 +363,15 @@ var browser = (function (util, proxies, sanedomparsererror, theWindow) {
363363
doReject(xhr.statusText);
364364
}
365365
},
366-
false
366+
false,
367367
);
368368

369369
xhr.addEventListener(
370370
"error",
371371
function (e) {
372372
doReject(e);
373373
},
374-
false
374+
false,
375375
);
376376

377377
try {

src/document2svg.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ var document2svg = (function (util, browser, documentHelper, xmlserializer) {
4040
};
4141

4242
var workAroundCollapsingMarginsAcrossSVGElementInWebKitLike = function (
43-
attributes
43+
attributes,
4444
) {
4545
var style = attributes.style || "";
4646
attributes.style = style + "float: left;";
4747
};
4848

4949
var workAroundSafariSometimesNotShowingExternalResources = function (
50-
attributes
50+
attributes,
5151
) {
5252
/* Let's hope that works some magic. The spec says SVGLoad only fires
5353
* now when all externals are available.
@@ -83,10 +83,10 @@ var document2svg = (function (util, browser, documentHelper, xmlserializer) {
8383

8484
var foreignObjectAttrs = foreignObjectAttributes(size);
8585
workAroundCollapsingMarginsAcrossSVGElementInWebKitLike(
86-
foreignObjectAttrs
86+
foreignObjectAttrs,
8787
);
8888
workAroundSafariSometimesNotShowingExternalResources(
89-
foreignObjectAttrs
89+
foreignObjectAttrs,
9090
);
9191

9292
return (

src/documentHelper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var documentHelper = (function (documentUtil) {
3030
documentUtil.rewriteCssSelectorWith(
3131
element,
3232
pseudoClass,
33-
"." + fakeActionClass
33+
"." + fakeActionClass,
3434
);
3535
};
3636

@@ -67,7 +67,7 @@ var documentHelper = (function (documentUtil) {
6767
module.rewriteTagNameSelectorsToLowerCase = function (element) {
6868
documentUtil.lowercaseCssTypeSelectors(
6969
element,
70-
documentUtil.findHtmlOnlyNodeNames(element)
70+
documentUtil.findHtmlOnlyNodeNames(element),
7171
);
7272
};
7373

src/documentUtil.js

Lines changed: 40 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -73,54 +73,56 @@ var documentUtil = (function () {
7373
var replaceSimpleSelectorsBy = function (
7474
element,
7575
simpleSelectorList,
76-
caseInsensitiveReplaceFunc
76+
caseInsensitiveReplaceFunc,
7777
) {
7878
var selectorRegex = matchingSimpleSelectorsRegex(simpleSelectorList);
7979

80-
asArray(element.querySelectorAll("style")).forEach(function (
81-
styleElement
82-
) {
83-
// SVGStyleElement doesn't have a property sheet in Safari, we need some workaround here
84-
// more details can be found here: https://github.com/cburgmer/rasterizeHTML.js/issues/158
85-
if (typeof styleElement.sheet === "undefined") {
86-
addSheetPropertyToSvgStyleElement(styleElement);
87-
}
88-
89-
var matchingRules = asArray(styleElement.sheet.cssRules).filter(
90-
function (rule) {
91-
return (
92-
rule.selectorText &&
93-
new RegExp(selectorRegex, "i").test(rule.selectorText)
94-
);
80+
asArray(element.querySelectorAll("style")).forEach(
81+
function (styleElement) {
82+
// SVGStyleElement doesn't have a property sheet in Safari, we need some workaround here
83+
// more details can be found here: https://github.com/cburgmer/rasterizeHTML.js/issues/158
84+
if (typeof styleElement.sheet === "undefined") {
85+
addSheetPropertyToSvgStyleElement(styleElement);
9586
}
96-
);
97-
98-
if (matchingRules.length) {
99-
matchingRules.forEach(function (rule) {
100-
var newSelector = rule.selectorText.replace(
101-
new RegExp(selectorRegex, "gi"),
102-
function (_, prefixMatch, selectorMatch) {
103-
return (
104-
prefixMatch +
105-
caseInsensitiveReplaceFunc(selectorMatch)
106-
);
107-
}
108-
);
10987

110-
if (newSelector !== rule.selectorText) {
111-
updateRuleSelector(rule, newSelector);
112-
}
113-
});
88+
var matchingRules = asArray(styleElement.sheet.cssRules).filter(
89+
function (rule) {
90+
return (
91+
rule.selectorText &&
92+
new RegExp(selectorRegex, "i").test(
93+
rule.selectorText,
94+
)
95+
);
96+
},
97+
);
98+
99+
if (matchingRules.length) {
100+
matchingRules.forEach(function (rule) {
101+
var newSelector = rule.selectorText.replace(
102+
new RegExp(selectorRegex, "gi"),
103+
function (_, prefixMatch, selectorMatch) {
104+
return (
105+
prefixMatch +
106+
caseInsensitiveReplaceFunc(selectorMatch)
107+
);
108+
},
109+
);
110+
111+
if (newSelector !== rule.selectorText) {
112+
updateRuleSelector(rule, newSelector);
113+
}
114+
});
114115

115-
rewriteStyleContent(styleElement);
116-
}
117-
});
116+
rewriteStyleContent(styleElement);
117+
}
118+
},
119+
);
118120
};
119121

120122
module.rewriteCssSelectorWith = function (
121123
element,
122124
oldSelector,
123-
newSelector
125+
newSelector,
124126
) {
125127
replaceSimpleSelectorsBy(element, [oldSelector], function () {
126128
return newSelector;
@@ -136,7 +138,7 @@ var documentUtil = (function () {
136138
module.findHtmlOnlyNodeNames = function (element) {
137139
var treeWalker = element.ownerDocument.createTreeWalker(
138140
element,
139-
NodeFilter.SHOW_ELEMENT
141+
NodeFilter.SHOW_ELEMENT,
140142
),
141143
htmlNodeNames = {},
142144
nonHtmlNodeNames = {},

src/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ var rasterizeHTML = (function (util, browser, rasterize) {
4343
return rasterize.rasterize(
4444
element,
4545
params.canvas,
46-
constructOptions(params)
46+
constructOptions(params),
4747
);
4848
};
4949

@@ -69,7 +69,7 @@ var rasterizeHTML = (function (util, browser, rasterize) {
6969
var workAroundFirefoxNotLoadingStylesheetStyles = function (
7070
doc,
7171
url,
72-
options
72+
options,
7373
) {
7474
var d = document.implementation.createHTMLDocument("");
7575
d.replaceChild(doc.documentElement, d.documentElement);
@@ -91,12 +91,12 @@ var rasterizeHTML = (function (util, browser, rasterize) {
9191
var workaround = workAroundFirefoxNotLoadingStylesheetStyles(
9292
doc,
9393
url,
94-
options
94+
options,
9595
);
9696
return module.drawDocument(
9797
workaround.document,
9898
canvas,
99-
workaround.options
99+
workaround.options,
100100
);
101101
});
102102
};

src/proxies.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ var proxies = (function (util) {
3131

3232
return originalOpen.apply(
3333
this,
34-
[method, joinedUrl].concat(args)
34+
[method, joinedUrl].concat(args),
3535
);
36-
}
36+
},
3737
);
3838

3939
return xhr;

0 commit comments

Comments
 (0)