From f42f300ba3dca60160258fec831fede552016bc3 Mon Sep 17 00:00:00 2001 From: myphs Date: Mon, 23 Mar 2020 17:29:15 +0100 Subject: [PATCH] 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. --- .../anon/www/position-absolute-top-left.html | 67 +++++++++++++++++++ Base/home/anon/www/welcome.html | 1 + Libraries/LibWeb/CSS/StyleProperties.cpp | 16 +++++ Libraries/LibWeb/CSS/StyleProperties.h | 2 + Libraries/LibWeb/CSS/StyleValue.h | 10 +++ Libraries/LibWeb/Layout/BoxModelMetrics.h | 3 + Libraries/LibWeb/Layout/LayoutBlock.cpp | 48 ++++++++++--- 7 files changed, 137 insertions(+), 10 deletions(-) create mode 100644 Base/home/anon/www/position-absolute-top-left.html diff --git a/Base/home/anon/www/position-absolute-top-left.html b/Base/home/anon/www/position-absolute-top-left.html new file mode 100644 index 0000000000..2c3601f8d1 --- /dev/null +++ b/Base/home/anon/www/position-absolute-top-left.html @@ -0,0 +1,67 @@ + + + + + absolute + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Base/home/anon/www/welcome.html b/Base/home/anon/www/welcome.html index d4d99a920a..719d910ff4 100644 --- a/Base/home/anon/www/welcome.html +++ b/Base/home/anon/www/welcome.html @@ -23,6 +23,7 @@ h1 {

This is a very simple browser built on the LibWeb engine.

Some small test pages: