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

LibHTML: Add ComputedStyle::full_margin()

This is an utility to easily get the full margin size
(the sum of margin proper, border and padding) of an
element in pixels.
This commit is contained in:
Sergey Bugaev 2019-09-25 12:00:50 +03:00 committed by Andreas Kling
parent a42f4c078e
commit 3be897a3d5
2 changed files with 20 additions and 1 deletions

View file

@ -1,8 +1,8 @@
#pragma once
#include <LibHTML/CSS/LengthBox.h>
#include <LibDraw/Color.h>
#include <LibDraw/Size.h>
#include <LibHTML/CSS/LengthBox.h>
enum FontStyle {
Normal,
@ -30,6 +30,15 @@ public:
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:
Color m_text_color;
Color m_background_color;