2020-01-18 11:38:21 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
2021-04-22 11:24:48 +03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 11:38:21 +03:00
|
|
|
*/
|
|
|
|
|
2019-06-16 14:44:09 +03:00
|
|
|
#pragma once
|
|
|
|
|
2020-02-06 14:04:00 +03:00
|
|
|
#include <LibGfx/Size.h>
|
2022-11-08 14:48:31 +03:00
|
|
|
#include <LibWeb/PixelUnits.h>
|
2019-06-16 14:44:09 +03:00
|
|
|
|
2020-11-22 17:53:01 +03:00
|
|
|
namespace Web::Layout {
|
2020-03-07 12:27:02 +03:00
|
|
|
|
2020-06-24 12:22:34 +03:00
|
|
|
struct PixelBox {
|
2022-11-08 14:48:31 +03:00
|
|
|
CSSPixels top { 0 };
|
|
|
|
CSSPixels right { 0 };
|
|
|
|
CSSPixels bottom { 0 };
|
|
|
|
CSSPixels left { 0 };
|
2020-06-24 12:22:34 +03:00
|
|
|
};
|
2019-06-16 14:44:09 +03:00
|
|
|
|
2020-06-24 12:22:34 +03:00
|
|
|
struct BoxModelMetrics {
|
|
|
|
public:
|
2020-12-12 23:02:06 +03:00
|
|
|
PixelBox margin;
|
|
|
|
PixelBox padding;
|
|
|
|
PixelBox border;
|
2022-03-26 15:26:42 +03:00
|
|
|
PixelBox inset;
|
2019-09-25 12:00:50 +03:00
|
|
|
|
2020-12-12 23:02:06 +03:00
|
|
|
PixelBox margin_box() const;
|
|
|
|
PixelBox padding_box() const;
|
|
|
|
PixelBox border_box() const;
|
2019-06-16 14:44:09 +03:00
|
|
|
};
|
2020-03-07 12:27:02 +03:00
|
|
|
|
|
|
|
}
|