html2canvas-pro 2.0.2 → 2.0.3

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * html2canvas-pro 2.0.2 <https://yorickshan.github.io/html2canvas-pro/>
2
+ * html2canvas-pro 2.0.3 <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
  */
@@ -6586,10 +6586,11 @@ class DocumentCloner {
6586
6586
  return iframe;
6587
6587
  });
6588
6588
  /**
6589
- * The baseURI of the document will be lost after documentClone.open().
6590
- * We save it before open() to preserve the original base URI for resource resolution.
6591
- * */
6592
- const baseUri = documentClone.baseURI;
6589
+ * The base URI used for resolving relative URLs (e.g. background-image) in the clone.
6590
+ * Must come from the source document: the iframe document is about:blank, so
6591
+ * documentClone.baseURI would break getComputedStyle() for relative background URLs.
6592
+ */
6593
+ const baseUri = ownerDocument.baseURI;
6593
6594
  documentClone.open();
6594
6595
  const rawHTML = serializeDoctype(document.doctype) + '<html></html>';
6595
6596
  try {