1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:08:12 +00:00

LibWeb: CSS: Add "position: absolute" with top and left

This momentarily handles the CSS property "position: absolute;" in
combination with the properties "top" and "left", so that elements can
be placed anywhere on the page independently from their parents.

Statically positioned elements ignore absolute positioned elements when
calculating their position as they don't take up space.
This commit is contained in:
myphs 2020-03-23 17:29:15 +01:00 committed by Andreas Kling
parent 494df52961
commit f42f300ba3
7 changed files with 137 additions and 10 deletions

View file

@ -39,10 +39,12 @@ public:
LengthBox& margin() { return m_margin; }
LengthBox& padding() { return m_padding; }
LengthBox& border() { return m_border; }
LengthBox& offset() { return m_offset; }
const LengthBox& margin() const { return m_margin; }
const LengthBox& padding() const { return m_padding; }
const LengthBox& border() const { return m_border; }
const LengthBox& offset() const { return m_offset; }
struct PixelBox {
float top;
@ -57,6 +59,7 @@ private:
LengthBox m_margin;
LengthBox m_padding;
LengthBox m_border;
LengthBox m_offset;
};
}