Skip to content

Commit abebfff

Browse files
authored
Merge pull request #68 from jonboland/min-max-height
Fixed min_height_003 and 25 other tests.
2 parents 3afd0f4 + 4f0a04b commit abebfff

2 files changed

Lines changed: 9 additions & 27 deletions

File tree

colosseum/engine.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,9 +647,17 @@ def calculate_block_non_replaced_normal_flow_height(node, context):
647647
# elif node.children and node.children[-1] top margin non collapsing with bottom margin:
648648
# content_height = bottom border edge of bottom margin
649649
else:
650-
content_height = 0
650+
if node.style.min_height is not AUTO: # 10.4 Minimum height
651+
content_height = node.style.min_height.px(**context)
652+
else:
653+
content_height = 0
654+
651655
else:
652656
content_height = node.style.height.px(**context)
657+
if node.style.max_height is not None: # 10.4 Maximum height
658+
content_max_height = node.style.max_height.px(**context)
659+
if content_height > content_max_height:
660+
content_height = content_max_height
653661

654662
node.layout.content_height = content_height
655663
node.layout.content_top += node.layout.border_top_width + node.layout.padding_top

tests/web_platform/CSS2/normal_flow/not_implemented

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -298,40 +298,20 @@ inlines_013
298298
inlines_016
299299
inlines_017
300300
inlines_020
301-
max_height_002
302-
max_height_003
303-
max_height_004
304-
max_height_005
305301
max_height_006
306302
max_height_007
307-
max_height_013
308-
max_height_014
309-
max_height_015
310-
max_height_016
311303
max_height_017
312304
max_height_018
313-
max_height_024
314305
max_height_025
315-
max_height_026
316-
max_height_027
317306
max_height_028
318307
max_height_029
319-
max_height_035
320308
max_height_036
321-
max_height_037
322-
max_height_038
323309
max_height_039
324310
max_height_040
325-
max_height_046
326311
max_height_047
327-
max_height_048
328-
max_height_049
329312
max_height_050
330313
max_height_051
331-
max_height_057
332314
max_height_058
333-
max_height_059
334-
max_height_060
335315
max_height_061
336316
max_height_062
337317
max_height_068
@@ -349,8 +329,6 @@ max_height_084
349329
max_height_091
350330
max_height_094
351331
max_height_095
352-
max_height_100
353-
max_height_102
354332
max_height_104
355333
max_height_105
356334
max_height_106
@@ -367,7 +345,6 @@ max_height_applies_to_005
367345
max_height_applies_to_006
368346
max_height_applies_to_007
369347
max_height_applies_to_008
370-
max_height_applies_to_009
371348
max_height_applies_to_010
372349
max_height_applies_to_012
373350
max_height_applies_to_013
@@ -419,10 +396,8 @@ max_width_applies_to_015
419396
max_width_applies_to_016
420397
max_width_percentage_002
421398
max_width_percentage_003
422-
min_height_003
423399
min_height_006
424400
min_height_007
425-
min_height_014
426401
min_height_017
427402
min_height_018
428403
min_height_025
@@ -460,7 +435,6 @@ min_height_applies_to_005
460435
min_height_applies_to_006
461436
min_height_applies_to_007
462437
min_height_applies_to_008
463-
min_height_applies_to_009
464438
min_height_applies_to_010
465439
min_height_applies_to_012
466440
min_height_applies_to_013

0 commit comments

Comments
 (0)