mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Fix broken overflow, add regression test
This commit is contained in:
@@ -127,7 +127,7 @@ class StylesBuilder:
|
|||||||
"""
|
"""
|
||||||
return [attr[8:] for attr in dir(self) if attr.startswith("process_")]
|
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
|
self, name: str, tokens: list[Token], valid_values: set[str], count: int
|
||||||
) -> tuple[str, ...]:
|
) -> tuple[str, ...]:
|
||||||
"""Generic code to process a declaration with two enumerations, like overflow: auto auto"""
|
"""Generic code to process a declaration with two enumerations, like overflow: auto auto"""
|
||||||
|
|||||||
@@ -983,6 +983,18 @@ class TestParseOffset:
|
|||||||
assert styles.offset.y == parsed_y
|
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:
|
class TestParseTransition:
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"duration, parsed_duration",
|
"duration, parsed_duration",
|
||||||
|
|||||||
Reference in New Issue
Block a user