Fix broken overflow, add regression test

This commit is contained in:
Darren Burns
2022-05-04 12:11:12 +01:00
parent 8f861f86e1
commit 07c14c6e64
2 changed files with 13 additions and 1 deletions

View File

@@ -127,7 +127,7 @@ class StylesBuilder:
"""
return [attr[8:] for attr in dir(self) if attr.startswith("process_")]
def _get_process_enum_multiple(
def _process_enum_multiple(
self, name: str, tokens: list[Token], valid_values: set[str], count: int
) -> tuple[str, ...]:
"""Generic code to process a declaration with two enumerations, like overflow: auto auto"""

View File

@@ -983,6 +983,18 @@ class TestParseOffset:
assert styles.offset.y == parsed_y
class TestParseOverflow:
def test_multiple_enum(self):
css = "#some-widget { overflow: hidden auto; }"
stylesheet = Stylesheet()
stylesheet.add_source(css)
styles = stylesheet.rules[0].styles
assert len(stylesheet.rules) == 1
assert styles.overflow_x == "hidden"
assert styles.overflow_y == "auto"
class TestParseTransition:
@pytest.mark.parametrize(
"duration, parsed_duration",