diff --git a/tests/draw/test_box.py b/tests/draw/test_box.py index faf60b7d..6437a2d8 100644 --- a/tests/draw/test_box.py +++ b/tests/draw/test_box.py @@ -92,6 +92,13 @@ def test_small_borders_2(): HTML(string=html % style).write_pdf() +@assert_no_logs +def test_em_borders(): + # Regression test for https://github.com/Kozea/WeasyPrint/issues/1378 + html = '' + HTML(string=html).write_pdf() + + @assert_no_logs def test_margin_boxes(): assert_pixels('margin_boxes', 15, 15, ''' diff --git a/weasyprint/css/computed_values.py b/weasyprint/css/computed_values.py index 1132e201..4bf9cecf 100644 --- a/weasyprint/css/computed_values.py +++ b/weasyprint/css/computed_values.py @@ -386,8 +386,8 @@ def background_size(style, name, values): @register_computer('outline-width') def border_width(style, name, value): """Compute the ``border-*-width`` properties.""" - style = style[name.replace('width', 'style')] - if style in ('none', 'hidden'): + border_style = style[name.replace('width', 'style')] + if border_style in ('none', 'hidden'): return 0 if value in BORDER_WIDTH_KEYWORDS: