1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-29 06:55:07 +00:00
serenity/Libraries/LibWeb/Layout
Andreas Kling e1a24edfa9 LibWeb: Reorganize layout system in terms of formatting contexts
This is a first (huge) step towards modernizing the layout architecture
and bringing it closer to spec language.

Layout is now performed by a stack of formatting contexts, operating on
the box tree (or layout tree, if you will.)

There are currently three types of formatting context:

- BlockFormattingContext (BFC)
- InlineFormattingContext (IFC)
- TableFormattingContext (TFC)

Document::layout() creates the initial BlockFormattingContext (BFC)
which lays out the initial containing block (ICB), and then we recurse
through the tree, creating BFC, IFC or TFC as appropriate and handing
over control at the context boundaries.

The majority of this patch is just refactoring the old logic spread out
in LayoutBlock and LayoutTableRowGroup, and turning into these context
classes instead. A lot more cleanup will be needed.

There are many architectural wins here, the main one being that layout
is no longer performed by boxes themselves, which gives us much greater
flexibility in the outer/inner layout of a given box.
2020-11-22 14:36:56 +01:00
..
BlockFormattingContext.cpp LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
BlockFormattingContext.h LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
BoxModelMetrics.cpp LibWeb: Turn BoxModelMetrics into a simple struct 2020-06-24 11:22:34 +02:00
BoxModelMetrics.h LibWeb: Move CSS classes into the Web::CSS namespace 2020-07-26 20:05:15 +02:00
FormattingContext.cpp LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
FormattingContext.h LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
InlineFormattingContext.cpp LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
InlineFormattingContext.h LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutBlock.cpp LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutBlock.h LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutBox.cpp LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutBox.h LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutBreak.cpp LibWeb: Make layout tree have non-const pointers to the DOM 2020-07-28 19:48:57 +02:00
LayoutBreak.h LibWeb: Make layout tree have non-const pointers to the DOM 2020-07-28 19:48:57 +02:00
LayoutButton.cpp LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutButton.h LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutCanvas.cpp LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutCanvas.h LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutCheckBox.cpp LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutCheckBox.h LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutDocument.cpp LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutDocument.h LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutFrame.cpp LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutFrame.h LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutImage.cpp LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutImage.h LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutInline.cpp LibWeb: Make layout tree have non-const pointers to the DOM 2020-07-28 19:48:57 +02:00
LayoutInline.h LibWeb: Make layout tree have non-const pointers to the DOM 2020-07-28 19:48:57 +02:00
LayoutListItem.cpp LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutListItem.h LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutListItemMarker.cpp LibWeb: Move CSS classes into the Web::CSS namespace 2020-07-26 20:05:15 +02:00
LayoutListItemMarker.h LibWeb: Move DOM classes into the Web::DOM namespace 2020-07-26 20:05:15 +02:00
LayoutNode.cpp LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutNode.h LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutPosition.cpp LibWeb: Add LayoutRange::normalized() 2020-06-29 00:39:51 +02:00
LayoutPosition.h Meta+LibHTTP through LibWeb: Make clang-format-10 clean 2020-09-25 21:18:17 +02:00
LayoutReplaced.cpp LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutReplaced.h LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutStyle.h LibWeb: Move CSS classes into the Web::CSS namespace 2020-07-26 20:05:15 +02:00
LayoutSVG.cpp LibWeb: Create LayoutNodes for each SVG element 2020-10-10 23:28:41 +02:00
LayoutSVG.h LibWeb: Create LayoutNodes for each SVG element 2020-10-10 23:28:41 +02:00
LayoutSVGGraphics.cpp LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutSVGGraphics.h LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutSVGPath.cpp LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutSVGPath.h LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutSVGSVG.cpp LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutSVGSVG.h LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutTable.cpp LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutTable.h LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutTableCell.cpp LibWeb: Make layout tree have non-const pointers to the DOM 2020-07-28 19:48:57 +02:00
LayoutTableCell.h LibWeb: Make layout tree have non-const pointers to the DOM 2020-07-28 19:48:57 +02:00
LayoutTableRow.cpp LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutTableRow.h LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutTableRowGroup.cpp LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutTableRowGroup.h LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LayoutText.cpp LibWeb: Avoid some heap churn during text splitting 2020-11-22 13:48:43 +01:00
LayoutText.h LibWeb: Add a blinking text cursor :^) 2020-08-02 17:34:50 +02:00
LayoutTreeBuilder.cpp LibWeb: Move CSS classes into the Web::CSS namespace 2020-07-26 20:05:15 +02:00
LayoutTreeBuilder.h LibWeb: Move DOM classes into the Web::DOM namespace 2020-07-26 20:05:15 +02:00
LayoutWidget.cpp LibWeb: Make Frame point weakly to Page 2020-11-12 18:29:55 +01:00
LayoutWidget.h LibWeb: Make layout tree have non-const pointers to the DOM 2020-07-28 19:48:57 +02:00
LineBox.cpp Meta+LibHTTP through LibWeb: Make clang-format-10 clean 2020-09-25 21:18:17 +02:00
LineBox.h LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
LineBoxFragment.cpp LibWeb: Fix sometimes missing text selection highlight 2020-08-26 21:00:26 +02:00
LineBoxFragment.h Meta+LibHTTP through LibWeb: Make clang-format-10 clean 2020-09-25 21:18:17 +02:00
TableFormattingContext.cpp LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00
TableFormattingContext.h LibWeb: Reorganize layout system in terms of formatting contexts 2020-11-22 14:36:56 +01:00