Skip to content
Christoph Burgmer edited this page Jun 24, 2017 · 27 revisions

Limitations of rasterizeHTML.js due to implementation details or browser bugs. Also see issues for open issues. Browser issues that have a workaround implemented are listed under Browser issues.

Pull request for working around those limitations are welcome.

General

  • All resources (HTML page, CSS, images, fonts and JS) that are needed for drawing the page can only be loaded if from the same origin, unless techniques like CORS are used.
  • External resources created through JavaScript are not loaded (e.g. "lazy-loaded" images). To work around these resources could be provided inline instead.
  • Options hover, active, focus will only apply user specified pseudo-class styles and not user-agent specific presets. This e.g. includes the button outline in Chrome or the padding-left offset in Firefox on active state.
  • Manipulating scrollTop or similar attributes will have no effect on the visible viewport area.

Currently unsupported HTML

  • Neither the content of a canvas nor its actual size are correctly rendered.
  • iframes are not supported.
  • External background-images on inline style declarations are not rendered (see inlineresources).
  • Images defined in srcset are not loaded (see inlineresources).
  • Media queries defined on link elements are ignored (see inlineresources).
  • Media queries defined on import rules are ignored (see inlineresources).
  • HTML elements may only contain colons if the prefix is treated as a namespace and has it declared as it would be in XHTML (see xmlserializer).

Browser issues

All

  • Background set on HTML or BODY are generally propagated up to be set on the whole canvas. This currently is not applied to documents inside foreignObject and thus the background is only applied to the element themselves (only spanning the size of the actual HTML/BODY element). (Firefox issue https://bugzilla.mozilla.org/show_bug.cgi?id=1143405)

Firefox

Webkit origin

Chrome

  • While font-kerning: auto is the default setting, Chrome can decide to treat kerning for normal text and text rendered in the SVG differently (see https://github.com/cburgmer/rasterizeHTML.js/issues/77). An easy work around is to apply font-kerning: normal to the document if the exact same treatment is required.

Safari

IE

Microsoft Edge

  • ...