1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:38:10 +00:00

LibWeb: Add the 'float' CSS property to LayoutStyle

Note that we don't use the property for anything yet, as I'm still
wrapping my head around how to implement floats.
This commit is contained in:
Andreas Kling 2020-06-26 15:08:42 +02:00
parent 53f1090b86
commit 62daa6f73c
6 changed files with 38 additions and 0 deletions

View file

@ -263,6 +263,21 @@ Optional<CSS::WhiteSpace> StyleProperties::white_space() const
return {};
}
Optional<CSS::Float> StyleProperties::float_() const
{
auto value = property(CSS::PropertyID::Float);
if (!value.has_value() || !value.value()->is_string())
return {};
auto string = value.value()->to_string();
if (string == "none")
return CSS::Float::None;
if (string == "left")
return CSS::Float::Left;
if (string == "right")
return CSS::Float::Right;
return {};
}
CSS::Display StyleProperties::display() const
{
auto display = string_or_fallback(CSS::PropertyID::Display, "inline");