Skip to content

Commit

Permalink
Restore collapsed-borders conflict resolution to formatting_structure…
Browse files Browse the repository at this point in the history
….build.wrap_table function
  • Loading branch information
kygoh committed Sep 11, 2023
1 parent 2a3747a commit ce46dbe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 3 additions & 0 deletions weasyprint/formatting_structure/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
from ..css import computed_values, properties, targets
from ..logger import LOGGER
from . import boxes
from ..layout.table import collapse_table_borders


# Maps values of the ``display`` CSS property to box types.
BOX_TYPE_FROM_DISPLAY = {
Expand Down Expand Up @@ -977,6 +979,7 @@ def wrap_table(box, children):
if table.style['border_collapse'] == 'collapse':
table.grid_width = grid_width
table.grid_height = grid_height
table.collapsed_border_grid = collapse_table_borders(table)

if isinstance(box, boxes.InlineTableBox):
wrapper_type = boxes.InlineBlockBox
Expand Down
3 changes: 0 additions & 3 deletions weasyprint/layout/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -812,9 +812,6 @@ def auto_table_layout(context, box, containing_block):
def table_wrapper_width(context, wrapper, containing_block):
"""Find the width of each column and derive the wrapper width."""
table = wrapper.get_wrapped_table()
collapse = table.style['border_collapse'] == 'collapse'
if collapse:
table.collapsed_border_grid = collapse_table_borders(table)
resolve_percentages(table, containing_block)

if table.style['table_layout'] == 'fixed' and table.width != 'auto':
Expand Down

0 comments on commit ce46dbe

Please sign in to comment.