html2canvas-pro 2.3.3 → 2.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -2
- package/dist/html2canvas-pro.cjs +7 -5
- package/dist/html2canvas-pro.cjs.map +1 -1
- package/dist/html2canvas-pro.esm.js +7 -5
- package/dist/html2canvas-pro.esm.js.map +1 -1
- package/dist/html2canvas-pro.js +7 -5
- package/dist/html2canvas-pro.js.map +1 -1
- package/dist/html2canvas-pro.min.js +2 -2
- package/dist/lib/css/index.js +8 -1
- package/dist/lib/css/syntax/parser.js +5 -4
- package/package.json +1 -1
package/dist/lib/css/index.js
CHANGED
|
@@ -258,7 +258,14 @@ class CSSParsedCounterDeclaration {
|
|
|
258
258
|
exports.CSSParsedCounterDeclaration = CSSParsedCounterDeclaration;
|
|
259
259
|
const parseCache = new Map();
|
|
260
260
|
const parse = (context, descriptor, style) => {
|
|
261
|
-
|
|
261
|
+
let rawValue = style !== null && typeof style !== 'undefined' ? style.toString() : descriptor.initialValue;
|
|
262
|
+
// A whitespace-only (or empty) computed value makes the tokenizer emit only an
|
|
263
|
+
// EOF token, which parseComponentValue() turns into a "unexpected EOF" SyntaxError.
|
|
264
|
+
// Some browsers produce such values for web-component shadow styles (see #225);
|
|
265
|
+
// fall back to the descriptor's initialValue so capture never crashes on them.
|
|
266
|
+
if (rawValue.trim() === '') {
|
|
267
|
+
rawValue = descriptor.initialValue;
|
|
268
|
+
}
|
|
262
269
|
let valueCache = parseCache.get(descriptor);
|
|
263
270
|
if (valueCache) {
|
|
264
271
|
const cached = valueCache.get(rawValue);
|
|
@@ -112,11 +112,12 @@ const parseFunctionArgs = (tokens) => {
|
|
|
112
112
|
let arg = [];
|
|
113
113
|
tokens.forEach((token) => {
|
|
114
114
|
if (token.type === 4 /* TokenType.COMMA_TOKEN */) {
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
// Skip empty arguments (e.g. "1px,,2px") instead of throwing —
|
|
116
|
+
// real-world computed styles can produce them.
|
|
117
|
+
if (arg.length) {
|
|
118
|
+
args.push(arg);
|
|
119
|
+
arg = [];
|
|
117
120
|
}
|
|
118
|
-
args.push(arg);
|
|
119
|
-
arg = [];
|
|
120
121
|
return;
|
|
121
122
|
}
|
|
122
123
|
if (token.type !== 31 /* TokenType.WHITESPACE_TOKEN */) {
|