1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:48:12 +00:00
serenity/Libraries/LibWeb
Andreas Kling c7d9229a0f LibWeb: Reorganize layout algorithm
Previously, layout recursively performed these steps (roughly):

1. Compute own width
2. Compute own position
3. Layout in-flow children
4. Compute own height
5. Layout absolutely positioned descendants

However, step (2) was pretty inconsistent. Some things computed their
own position, others had their parent do it for them, etc.
To get closer to CSS spec language, and make things easier in general,
this patch reorganizes the algorithm into:

1. Compute own width & height
2. Compute width & height of in-flow managed descendants
3. Move in-flow managed descendants to their final position
4. Layout absolutely positioned descendants

Block layout is now driven by the containing block, which will iterate
the descendants it's responsible for. There are a lot of inefficient
patterns in this logic right now, but they can easily be replaced with
better iteration functions once we settle on a long-term architecture.

Since the ICB (LayoutDocument) is at (0, 0), it doesn't rely on a
containing block to move it into place.

This code is still evolving along with my understanding of CSS layout,
so it's likely that we'll reorganize this again sooner or later. :^)
2020-06-14 19:01:54 +02:00
..
Bindings LibJS: Consolidate error messages into ErrorTypes.h 2020-06-11 07:46:20 +02:00
CodeGenerators AK: JsonParser improvements 2020-06-13 12:43:22 +02:00
CSS LibWeb: Expand background:none into background-color:transparent 2020-06-13 20:03:41 +02:00
DOM LibWeb: Don't choke when trying to render a document-less <iframe> 2020-06-14 15:32:38 +02:00
Frame LibGfx: Rename Rect,Point,Size => IntRect,IntPoint,IntSize 2020-06-10 10:59:04 +02:00
Layout LibWeb: Reorganize layout algorithm 2020-06-14 19:01:54 +02:00
Loader LibWeb: Split out image loading logic from HTMLImageElement 2020-06-13 22:22:54 +02:00
Parser LibWeb: Fully implement HTML parser "in table" insertion mode 2020-06-14 14:07:07 +02:00
Scripts LibWeb: Rename directory LibHTML => LibWeb 2020-03-07 10:32:51 +01:00
CMakeLists.txt LibWeb: Add basic <object> element support 2020-06-13 22:24:49 +02:00
DOMTreeModel.cpp LibWeb: Rename directory LibHTML => LibWeb 2020-03-07 10:32:51 +01:00
DOMTreeModel.h LibWeb: Rename directory LibHTML => LibWeb 2020-03-07 10:32:51 +01:00
Dump.cpp LibWeb: Reorganize layout algorithm 2020-06-14 19:01:54 +02:00
Dump.h LibWeb: Add naive support for document.querySelectorAll() 2020-03-30 11:35:39 +02:00
FontCache.cpp LibWeb: Rename directory LibHTML => LibWeb 2020-03-07 10:32:51 +01:00
FontCache.h LibWeb: Use FlyString in FontCache keys 2020-05-26 23:45:48 +02:00
Forward.h LibWeb: Reorganize layout algorithm 2020-06-14 19:01:54 +02:00
LayoutTreeModel.cpp LibWeb+Browser: Add a barebones LayoutTreeModel to the inspector window 2020-06-12 22:30:11 +02:00
LayoutTreeModel.h LibWeb+Browser: Add a barebones LayoutTreeModel to the inspector window 2020-06-12 22:30:11 +02:00
Origin.h LibWeb: Add Origin concept (protocol, host, port tuple) 2020-04-07 23:01:45 +02:00
Page.cpp LibGfx: Rename Rect,Point,Size => IntRect,IntPoint,IntSize 2020-06-10 10:59:04 +02:00
Page.h LibGfx: Rename Rect,Point,Size => IntRect,IntPoint,IntSize 2020-06-10 10:59:04 +02:00
PageView.cpp LibWeb: Add basic support for position:fixed 2020-06-12 14:20:07 +02:00
PageView.h LibGfx: Rename Rect,Point,Size => IntRect,IntPoint,IntSize 2020-06-10 10:59:04 +02:00
RenderingContext.h LibWeb: Add basic support for position:fixed 2020-06-12 14:20:07 +02:00
StylePropertiesModel.cpp LibWeb: Sort style properties by name in the inspector window 2020-06-13 19:53:28 +02:00
StylePropertiesModel.h LibWeb: replace some tab characters with spaces 2020-05-28 17:01:31 +02:00
TreeNode.h LibWeb: Add a way to opt out of TreeNode::append_child() notifications 2020-05-24 23:54:22 +02:00
URLEncoder.cpp LibWeb: Make the URL encoding function a little less copy-happy 2020-05-05 15:50:28 +02:00
URLEncoder.h LibWeb: Make the URL encoding function a little less copy-happy 2020-05-05 15:50:28 +02:00