ladybird/Libraries/LibHTML/Layout/ComputedStyle.h
Andreas Kling 62cbaa74f3 LibHTML: Respect the CSS "color" property for text
Also remove the color values from the ComputedStyle object and get them
via StyleProperties instead.

At the moment, we only handle colors that Color::from_string() parses.
2019-09-28 22:57:46 +02:00

46 lines
942 B
C++

#pragma once
#include <LibDraw/Size.h>
#include <LibHTML/CSS/LengthBox.h>
enum FontStyle {
Normal,
Bold,
};
class ComputedStyle {
public:
ComputedStyle();
~ComputedStyle();
LengthBox& margin() { return m_margin; }
LengthBox& padding() { return m_padding; }
LengthBox& border() { return m_border; }
const LengthBox& margin() const { return m_margin; }
const LengthBox& padding() const { return m_padding; }
const LengthBox& border() const { return m_border; }
FontStyle font_style() const { return m_font_style; }
const Size& size() const { return m_size; }
Size& size() { return m_size; }
struct PixelBox {
int top;
int right;
int bottom;
int left;
};
PixelBox full_margin() const;
private:
LengthBox m_margin;
LengthBox m_padding;
LengthBox m_border;
Size m_size;
FontStyle m_font_style { FontStyle::Normal };
};