mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-09 12:42:54 +00:00
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.
46 lines
942 B
C++
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 };
|
|
};
|