Commit Graph

5 Commits

Author SHA1 Message Date
Andreas Kling
afebbd1cd7 LibWeb: Serialize Length::Type::Percentage with a "%" suffix
"10 percentage" looked rather silly. :^)
2020-06-25 15:53:23 +02:00
Andreas Kling
ecacab8618 LibWeb: Move width into LayoutStyle
This patch also adds the ability for Length to contain percentage
values. This is a little off-spec, but will make storing and dealing
with lengths a lot easier.

To resolve a Length to a px-or-auto Length, there are now helpers
for that. After calling them, you no longer have to think about
em, rem, %, and such things.
2020-06-24 16:49:51 +02:00
Andreas Kling
90edaabc4b LibWeb: Add an "undefined" state to Length
A default-constructed Length now gives you an undefined length value,
which can be used to signify the absence of a value.
2020-06-24 11:24:00 +02:00
Andreas Kling
ae181e1573 LibWeb: Always inline absolute Length to_px() conversion
Only do the relative Length units out of line.
2020-06-23 23:21:58 +02:00
Andreas Kling
731685468a LibWeb: Start fleshing out support for relative CSS units
This patch introduces support for more than just "absolute px" units in
our Length class. It now also supports "em" and "rem", which are units
relative to the font-size of the current layout node and the <html>
element's layout node respectively.
2020-06-07 17:55:46 +02:00