1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:47:44 +00:00

LibHTML: Add LengthStyleValue and create those when parsing number values.

This commit is contained in:
Andreas Kling 2019-07-03 07:55:22 +02:00
parent 4b82ac3c8e
commit 8ac2b30de7
3 changed files with 43 additions and 7 deletions

View file

@ -1,5 +1,7 @@
#pragma once
#include <AK/AKString.h>
class Length {
public:
enum class Type {
@ -20,6 +22,13 @@ public:
int value() const { return m_value; }
String to_string() const
{
if (is_auto())
return "auto";
return String::format("%d [Length/Absolute]", m_value);
}
private:
Type m_type { Type::Auto };
int m_value { 0 };