Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

display: flex with align-items: baseline fails to render #765

Closed
alvassin opened this Issue Jan 7, 2019 · 0 comments

Comments

2 participants
@alvassin
Copy link

alvassin commented Jan 7, 2019

This HTML ruins WeasyPrint:

<div class="references" style="display: flex; align-items: baseline;">
  <div></div>
</div>

I see following error:

File "/Users/alvassin/Work/pdf-templates/env/lib/python3.6/site-packages/weasyprint/__init__.py", line 198, in write_pdf
    font_config=font_config).write_pdf(
  File "/Users/alvassin/Work/pdf-templates/env/lib/python3.6/site-packages/weasyprint/__init__.py", line 159, in render
    font_config)
  File "/Users/alvassin/Work/pdf-templates/env/lib/python3.6/site-packages/weasyprint/document.py", line 361, in _render
    [Page(p, enable_hinting) for p in page_boxes],
  File "/Users/alvassin/Work/pdf-templates/env/lib/python3.6/site-packages/weasyprint/document.py", line 361, in <listcomp>
    [Page(p, enable_hinting) for p in page_boxes],
  File "/Users/alvassin/Work/pdf-templates/env/lib/python3.6/site-packages/weasyprint/layout/__init__.py", line 126, in layout_document
    context, root_box, html, cascaded_styles, computed_styles, pages))
  File "/Users/alvassin/Work/pdf-templates/env/lib/python3.6/site-packages/weasyprint/layout/pages.py", line 788, in make_all_pages
    i, context, root_box, html, cascaded_styles, computed_styles)
  File "/Users/alvassin/Work/pdf-templates/env/lib/python3.6/site-packages/weasyprint/layout/pages.py", line 726, in remake_page
    page_number, page_state)
  File "/Users/alvassin/Work/pdf-templates/env/lib/python3.6/site-packages/weasyprint/layout/pages.py", line 554, in make_page
    positioned_boxes, positioned_boxes, adjoining_margins)
  File "/Users/alvassin/Work/pdf-templates/env/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 55, in block_level_layout
    adjoining_margins)
  File "/Users/alvassin/Work/pdf-templates/env/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 71, in block_level_layout_switch
    adjoining_margins)
  File "/Users/alvassin/Work/pdf-templates/env/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 125, in block_box_layout
    page_is_empty, absolute_boxes, fixed_boxes, adjoining_margins)
  File "/Users/alvassin/Work/pdf-templates/env/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 495, in block_container_layout
    adjoining_margins)
  File "/Users/alvassin/Work/pdf-templates/env/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 55, in block_level_layout
    adjoining_margins)
  File "/Users/alvassin/Work/pdf-templates/env/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 71, in block_level_layout_switch
    adjoining_margins)
  File "/Users/alvassin/Work/pdf-templates/env/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 125, in block_box_layout
    page_is_empty, absolute_boxes, fixed_boxes, adjoining_margins)
  File "/Users/alvassin/Work/pdf-templates/env/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 495, in block_container_layout
    adjoining_margins)
  File "/Users/alvassin/Work/pdf-templates/env/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 55, in block_level_layout
    adjoining_margins)
  File "/Users/alvassin/Work/pdf-templates/env/lib/python3.6/site-packages/weasyprint/layout/blocks.py", line 86, in block_level_layout_switch
    device_size, page_is_empty, absolute_boxes, fixed_boxes)
  File "/Users/alvassin/Work/pdf-templates/env/lib/python3.6/site-packages/weasyprint/layout/flex.py", line 669, in flex_layout
    child.baseline = child._baseline - position_cross
TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'

Can you help please?

@liZe liZe added crash bug labels Jan 8, 2019

@liZe liZe removed the bug label Mar 7, 2019

@liZe liZe closed this in a5e9127 Mar 19, 2019

@liZe liZe added this to the 46 milestone Mar 19, 2019

liZe added a commit that referenced this issue Mar 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.