html2canvas-pro 2.3.3 → 2.3.5
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 +30 -17
- package/dist/html2canvas-pro.cjs.map +1 -1
- package/dist/html2canvas-pro.esm.js +30 -17
- package/dist/html2canvas-pro.esm.js.map +1 -1
- package/dist/html2canvas-pro.js +30 -17
- package/dist/html2canvas-pro.js.map +1 -1
- package/dist/html2canvas-pro.min.js +3 -3
- package/dist/lib/css/index.js +8 -1
- package/dist/lib/css/syntax/parser.js +5 -4
- package/dist/lib/dom/node-parser.js +42 -30
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* html2canvas-pro 2.3.
|
|
2
|
+
* html2canvas-pro 2.3.5 <https://yorickshan.github.io/html2canvas-pro/>
|
|
3
3
|
* Copyright (c) 2024-present yorickshan and html2canvas-pro contributors
|
|
4
4
|
* Released under MIT License
|
|
5
5
|
*/
|
|
@@ -1727,9 +1727,10 @@ const parseFunctionArgs = (tokens) => {
|
|
|
1727
1727
|
let arg = [];
|
|
1728
1728
|
tokens.forEach((token) => {
|
|
1729
1729
|
if (token.type === 4) {
|
|
1730
|
-
if (arg.length
|
|
1731
|
-
|
|
1732
|
-
|
|
1730
|
+
if (arg.length) {
|
|
1731
|
+
args.push(arg);
|
|
1732
|
+
arg = [];
|
|
1733
|
+
}
|
|
1733
1734
|
return;
|
|
1734
1735
|
}
|
|
1735
1736
|
if (token.type !== 31) arg.push(token);
|
|
@@ -6728,7 +6729,8 @@ var CSSParsedCounterDeclaration = class {
|
|
|
6728
6729
|
};
|
|
6729
6730
|
const parseCache = /* @__PURE__ */ new Map();
|
|
6730
6731
|
const parse = (context, descriptor, style) => {
|
|
6731
|
-
|
|
6732
|
+
let rawValue = style !== null && typeof style !== "undefined" ? style.toString() : descriptor.initialValue;
|
|
6733
|
+
if (rawValue.trim() === "") rawValue = descriptor.initialValue;
|
|
6732
6734
|
let valueCache = parseCache.get(descriptor);
|
|
6733
6735
|
if (valueCache) {
|
|
6734
6736
|
const cached = valueCache.get(rawValue);
|
|
@@ -8177,18 +8179,29 @@ const LIST_OWNERS = [
|
|
|
8177
8179
|
const parseNodeTree = (context, node, parent, root) => {
|
|
8178
8180
|
for (let childNode = node.firstChild, nextNode; childNode; childNode = nextNode) {
|
|
8179
8181
|
nextNode = childNode.nextSibling;
|
|
8180
|
-
|
|
8181
|
-
|
|
8182
|
-
|
|
8183
|
-
|
|
8184
|
-
|
|
8185
|
-
|
|
8186
|
-
|
|
8187
|
-
|
|
8188
|
-
|
|
8189
|
-
|
|
8190
|
-
|
|
8191
|
-
|
|
8182
|
+
parseChildNode(context, childNode, parent, root);
|
|
8183
|
+
}
|
|
8184
|
+
};
|
|
8185
|
+
/**
|
|
8186
|
+
* Parse a single node as a child of `parent`.
|
|
8187
|
+
*
|
|
8188
|
+
* Separated from the tree walk so that nodes assigned to a `<slot>` (including
|
|
8189
|
+
* bare text nodes, which have no child nodes) can be parsed directly. Without
|
|
8190
|
+
* this, slotted shadow-DOM content such as web component labels was silently
|
|
8191
|
+
* dropped because `parseNodeTree` only iterates `node.firstChild` (issue #226).
|
|
8192
|
+
*/
|
|
8193
|
+
const parseChildNode = (context, childNode, parent, root) => {
|
|
8194
|
+
if (isTextNode(childNode) && childNode.data.length > 0) parent.textNodes.push(new TextContainer(context, childNode, parent.styles));
|
|
8195
|
+
else if (isElementNode(childNode)) if (isSlotElement(childNode) && childNode.assignedNodes) childNode.assignedNodes().forEach((assignedNode) => parseChildNode(context, assignedNode, parent, root));
|
|
8196
|
+
else {
|
|
8197
|
+
const container = createContainer(context, childNode);
|
|
8198
|
+
if (container.styles.isVisible()) {
|
|
8199
|
+
if (createsRealStackingContext(childNode, container, root)) container.createsRealStackingContext = true;
|
|
8200
|
+
else if (createsStackingContext(container.styles)) container.createsStackingContext = true;
|
|
8201
|
+
if (LIST_OWNERS.indexOf(childNode.tagName) !== -1) container.isListOwner = true;
|
|
8202
|
+
parent.elements.push(container);
|
|
8203
|
+
if (childNode.shadowRoot) parseNodeTree(context, childNode.shadowRoot, container, root);
|
|
8204
|
+
else if (!isTextareaElement(childNode) && !isSVGElement(childNode) && !isSelectElement(childNode)) parseNodeTree(context, childNode, container, root);
|
|
8192
8205
|
}
|
|
8193
8206
|
}
|
|
8194
8207
|
};
|