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:
parent
4b82ac3c8e
commit
8ac2b30de7
3 changed files with 43 additions and 7 deletions
|
@ -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 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue