mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:17:46 +00:00
LibWeb: Sort and group CSS Length units as they are in the spec
They previously weren't sorted at all. Alphabetical would be nice, but then things like `em` and `rem` would be separated. So, let's copy the spec's order. That way it's easier to keep track of which units we have or haven't implemented. (Since there are so many...)
This commit is contained in:
parent
e54ee7de96
commit
6ea84a7c87
2 changed files with 81 additions and 74 deletions
|
@ -17,24 +17,31 @@ namespace Web::CSS {
|
|||
class Length {
|
||||
public:
|
||||
enum class Type {
|
||||
Auto,
|
||||
Cm,
|
||||
In,
|
||||
Mm,
|
||||
Q,
|
||||
Px,
|
||||
Pt,
|
||||
Pc,
|
||||
Ex,
|
||||
// Font-relative
|
||||
Em,
|
||||
Ch,
|
||||
Rem,
|
||||
Vh,
|
||||
Vw,
|
||||
Vmax,
|
||||
Vmin,
|
||||
Ex,
|
||||
Ch,
|
||||
Lh,
|
||||
Rlh,
|
||||
|
||||
// Viewport-relative
|
||||
Vw,
|
||||
Vh,
|
||||
Vmin,
|
||||
Vmax,
|
||||
|
||||
// Absolute
|
||||
Cm,
|
||||
Mm,
|
||||
Q,
|
||||
In,
|
||||
Pt,
|
||||
Pc,
|
||||
Px,
|
||||
|
||||
// FIXME: Remove auto somehow
|
||||
Auto,
|
||||
};
|
||||
|
||||
static Optional<Type> unit_from_name(StringView);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue