Skip to content

Commit b2c6cba

Browse files
committed
Allow uppercase identifiers for grid lines
Related to #2383.
1 parent 73a342e commit b2c6cba

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

tests/css/test_validation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -964,12 +964,12 @@ def test_grid_template_areas_invalid(rule):
964964
@pytest.mark.parametrize('rule, value', (
965965
('auto', 'auto'),
966966
('4', (None, 4, None)),
967-
('C', (None, None, 'c')),
967+
('C', (None, None, 'C')),
968968
('4 c', (None, 4, 'c')),
969969
('col -4', (None, -4, 'col')),
970970
('span c 4', ('span', 4, 'c')),
971971
('span 4 c', ('span', 4, 'c')),
972-
('4 span c', ('span', 4, 'c')),
972+
('4 span C', ('span', 4, 'C')),
973973
('super 4 span', ('span', 4, 'super')),
974974
))
975975
def test_grid_line(rule, value):

weasyprint/css/validation/properties.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,7 +1626,7 @@ def grid_line(tokens):
16261626
if keyword == 'auto':
16271627
return keyword
16281628
elif keyword != 'span':
1629-
return (None, None, keyword)
1629+
return (None, None, token.value)
16301630
elif token.type == 'number' and token.is_integer and token.value:
16311631
return (None, token.int_value, None)
16321632
return
@@ -1640,7 +1640,7 @@ def grid_line(tokens):
16401640
span = 'span'
16411641
continue
16421642
elif keyword and ident is None:
1643-
ident = keyword
1643+
ident = token.value
16441644
continue
16451645
elif token.type == 'number' and token.is_integer and token.value:
16461646
if number is None:

0 commit comments

Comments
 (0)