Skip to content

Container created with createsStackingContext as default causing html content to be parsed by display type #3245

@viktorolund

Description

@viktorolund

This results in the html content to be parsed by display type and not by the real stacking context which becomes an issue when using this library via jsPDF, e.g. in the following example canvas fillText would call in this order "Hello" "!" "This" "is" "me!" "world"

<div>
  <p>Hello<em>world</em>!</p>
  <p>This is me!</p>
</div>

I figured out a hack to set the container element (html2pdf__container) to opacity 0.9 which then will enforce createsRealStackingContext enabling parsing by the stacking context and this works great (not sure about defects), but is there another way to achieve this or can a new property be provided to enable parsing by the real/actual stacking context?

References:
parseStackTree:

const parseStackTree = (

createsRealStackingContext:
const createsRealStackingContext = (node: Element, container: ElementContainer, root: ElementContainer): boolean => {

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions