From 260427f0ad90b91e2865b1c69dd680ad2e262f57 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 12 Jun 2020 13:27:28 +0200 Subject: [PATCH] LibWeb: Some improvements to absolute positioning Absolutely positioned blocks now register themselves with their containing block (and note that the containing block of an absolutely positioned box is the nearest non-statically positioned block ancestor or the ICB as fallback.) Containing blocks then drive the layout of their tracked absolutely positioned descendants as a separate layout pass. This is very far from perfect but the general direction seems good. --- .../www/position-absolute-from-edges.html | 48 ++++++++ Base/home/anon/www/welcome.html | 1 + Libraries/LibWeb/Dump.cpp | 5 + Libraries/LibWeb/Layout/BoxModelMetrics.cpp | 20 ++++ Libraries/LibWeb/Layout/BoxModelMetrics.h | 2 + Libraries/LibWeb/Layout/LayoutBlock.cpp | 107 ++++++++++++++---- Libraries/LibWeb/Layout/LayoutBlock.h | 5 + Libraries/LibWeb/Layout/LayoutDocument.cpp | 2 + 8 files changed, 166 insertions(+), 24 deletions(-) create mode 100644 Base/home/anon/www/position-absolute-from-edges.html diff --git a/Base/home/anon/www/position-absolute-from-edges.html b/Base/home/anon/www/position-absolute-from-edges.html new file mode 100644 index 0000000000..e04ddf71cc --- /dev/null +++ b/Base/home/anon/www/position-absolute-from-edges.html @@ -0,0 +1,48 @@ + +
+
+
+
+
+
diff --git a/Base/home/anon/www/welcome.html b/Base/home/anon/www/welcome.html index cfbaca3176..19306ae8cd 100644 --- a/Base/home/anon/www/welcome.html +++ b/Base/home/anon/www/welcome.html @@ -28,6 +28,7 @@ span#ua {

Your user agent is:

Some small test pages: