mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 18:20:43 +09:00
LibWeb: Add parsing and application of CSS "overflow" property
We don't actually do anything with the values yet, but now they are available for layout nodes once we are ready to implement them.
This commit is contained in:
parent
42f582bf8b
commit
21371bf6ee
Notes:
sideshowbarker
2024-07-18 22:00:39 +09:00
Author: https://github.com/awesomekling
Commit: 21371bf6ee
8 changed files with 85 additions and 0 deletions
|
@ -497,4 +497,36 @@ Optional<CSS::ListStyleType> StyleProperties::list_style_type() const
|
|||
}
|
||||
}
|
||||
|
||||
Optional<CSS::Overflow> StyleProperties::overflow_x() const
|
||||
{
|
||||
return overflow(CSS::PropertyID::OverflowX);
|
||||
}
|
||||
|
||||
Optional<CSS::Overflow> StyleProperties::overflow_y() const
|
||||
{
|
||||
return overflow(CSS::PropertyID::OverflowY);
|
||||
}
|
||||
|
||||
Optional<CSS::Overflow> StyleProperties::overflow(CSS::PropertyID property_id) const
|
||||
{
|
||||
auto value = property(property_id);
|
||||
if (!value.has_value())
|
||||
return {};
|
||||
|
||||
switch (value.value()->to_identifier()) {
|
||||
case CSS::ValueID::Auto:
|
||||
return CSS::Overflow::Auto;
|
||||
case CSS::ValueID::Visible:
|
||||
return CSS::Overflow::Visible;
|
||||
case CSS::ValueID::Hidden:
|
||||
return CSS::Overflow::Hidden;
|
||||
case CSS::ValueID::Clip:
|
||||
return CSS::Overflow::Clip;
|
||||
case CSS::ValueID::Scroll:
|
||||
return CSS::Overflow::Scroll;
|
||||
default:
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue