Skip to content

v3.0.1-rc.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@IDisposable IDisposable released this 16 Jan 04:00

What's Changed

Breaking Change Notice

The 3.x release branch will include some breaking changes in the vary infrequently used ability to configure some utility methods used in this internal processing of dom-to-image-more. As browsers have matured, many of the hacks we're accumulated over the years are not needed, or better ways have been found to handle some edge-cases. With the help of folks like @meche-gh, in #99 we're stripping out the following members:

  • .mimes - was the not-very-comprehensive list of mime types used to handle inlining things
  • .parseExtension - was a method to extract the extension from a filename, used to guess mime types
  • .mimeType - was a method to map file extensions to mime types
  • .dataAsUrl - was a method to reassemble a data: URI from a Base64 representation and mime type

The 3.x release branch should also fix more node compatibility and iframe issues.

Externally visible changes

  • Cleaned up how root node is being handled and remove spurious delay 3ed4ef5
  • Skip the sandbox we inject to do default style detection when cloning to ensure we don't pollute the clone's DOM (with @meche-gh) 3ed4ef5
  • Cleanup of child-node cloning to ensure we don't make too many Promises :) b1e296d and
  • Switch from emitting a . in the sandbox element to emitting a zero-width-space '1\u200B'so we get more accurate sizing 40d2314
  • Never clone SCRIPT elements (they should never land in the SVG!) eeed471
  • Create the element used to detect default styles in the sandbox, not in the main DOM, to isolate it from document-wide styling b51f0d0
  • Correct the destruction logic of the sandbox, it was preemptively killing the timer used to clear the style cache, which would cause issues when doing lots of conversions quickly ada8f8c
  • Simplified the SVG emitted to place the width and height on the foreignObject and not emit x="0" y="0" because that irritates BIMI b844a49
  • Attempts to handle non-px widths and heights of the target node, while honoring any explicitly-set size (and falling back to scrollWidth based values like before eeed471
  • Fix getWindow(node) fallback by @meche-gh in #97
  • Ensure there's a mimetype in all inlined images by @meche-gh in #98
  • Bypass Trusted Types policy requirement by @meche-gh in #100
  • Work on table padding issue #95 by @IDisposable in #104
  • Catch up to master's clone-cleanups by @IDisposable in #107

Internal changes

  • Removed imagediff from testing use and added semver and NPM scripts for using them
  • Cleaned up tests (especially the OCR-based ones) to ensure repeatability and general housekeeping on tests: 8a80c31
  • Added some unit tests for issue #95 (solution still coming, but workaround is use TH, TD { padding: 0.000001px; } for now b51f0d0
  • Cleaned up and prettiered everything and added that to the release process. Lots of code-style cleanup in source, documentation, and tests 8a80c31
  • The unit test jig now leverages the onclone event to insure the cloned node into the test page for easier deciphers of what styles were not inlined correctly. Follow this pattern in you jsfiddles too :) 6e44967

New Contributors

  • @meche-gh made their first contribution in #97

Full Changelog: v2.14.0...v3.0.1-rc.0