@@ -301,6 +301,88 @@ def test_column_span_6():
301
301
assert section .children [0 ].children [0 ].text == 'line1'
302
302
assert (section .position_x , section .position_y ) == (0 , 0 )
303
303
304
+
305
+ @assert_no_logs
306
+ def test_column_span_7 ():
307
+ page1 , page2 = render_pages ('''
308
+ <style>
309
+ @font-face { src: url(weasyprint.otf); font-family: weasyprint }
310
+ @page { margin: 0; size: 8px 3px }
311
+ body { font-family: weasyprint; font-size: 1px }
312
+ div { columns: 2; column-gap: 0; line-height: 1 }
313
+ section { column-span: all; font-size: 2px }
314
+ </style>
315
+ <div>
316
+ abc def
317
+ ghi jkl
318
+ <section>l1</section>
319
+ mno pqr
320
+ </div>
321
+ ''' )
322
+ html , = page1 .children
323
+ body , = html .children
324
+ div , = body .children
325
+ column1 , column2 = div .children
326
+ assert (column1 .position_x , column1 .position_y ) == (0 , 0 )
327
+ assert (column2 .position_x , column2 .position_y ) == (4 , 0 )
328
+
329
+ assert column1 .children [0 ].children [0 ].children [0 ].text == 'abc'
330
+ assert column1 .children [0 ].children [1 ].children [0 ].text == 'def'
331
+ assert column2 .children [0 ].children [0 ].children [0 ].text == 'ghi'
332
+ assert column2 .children [0 ].children [1 ].children [0 ].text == 'jkl'
333
+
334
+ html , = page2 .children
335
+ body , = html .children
336
+ div , = body .children
337
+ section , column1 , column2 = div .children
338
+ assert (section .position_x , section .position_y ) == (0 , 0 )
339
+ assert (column1 .position_x , column1 .position_y ) == (0 , 2 )
340
+ assert (column2 .position_x , column2 .position_y ) == (4 , 2 )
341
+
342
+ assert section .children [0 ].children [0 ].text == 'l1'
343
+ assert column1 .children [0 ].children [0 ].children [0 ].text == 'mno'
344
+ assert column2 .children [0 ].children [0 ].children [0 ].text == 'pqr'
345
+
346
+
347
+ @assert_no_logs
348
+ def test_column_span_8 ():
349
+ page1 , page2 = render_pages ('''
350
+ <style>
351
+ @font-face { src: url(weasyprint.otf); font-family: weasyprint }
352
+ @page { margin: 0; size: 8px 2px }
353
+ body { font-family: weasyprint; font-size: 1px }
354
+ div { columns: 2; column-gap: 0; line-height: 1 }
355
+ section { column-span: all }
356
+ </style>
357
+ <div>
358
+ abc def
359
+ ghi jkl
360
+ mno pqr
361
+ <section>line1</section>
362
+ </div>
363
+ ''' )
364
+ html , = page1 .children
365
+ body , = html .children
366
+ div , = body .children
367
+ column1 , column2 = div .children
368
+ assert (column1 .position_x , column1 .position_y ) == (0 , 0 )
369
+ assert (column2 .position_x , column2 .position_y ) == (4 , 0 )
370
+
371
+ assert column1 .children [0 ].children [0 ].children [0 ].text == 'abc'
372
+ assert column1 .children [0 ].children [1 ].children [0 ].text == 'def'
373
+ assert column2 .children [0 ].children [0 ].children [0 ].text == 'ghi'
374
+ assert column2 .children [0 ].children [1 ].children [0 ].text == 'jkl'
375
+
376
+ html , = page2 .children
377
+ body , = html .children
378
+ div , = body .children
379
+ column1 , column2 , section = div .children
380
+ assert (column1 .position_x , column1 .position_y ) == (0 , 0 )
381
+ assert (column2 .position_x , column2 .position_y ) == (4 , 0 )
382
+ assert (section .position_x , section .position_y ) == (0 , 1 )
383
+
384
+ assert column1 .children [0 ].children [0 ].children [0 ].text == 'mno'
385
+ assert column2 .children [0 ].children [0 ].children [0 ].text == 'pqr'
304
386
assert section .children [0 ].children [0 ].text == 'line1'
305
387
306
388
0 commit comments