1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:48:12 +00:00
serenity/Libraries/LibHTML/Layout
Andreas Kling 4814253589 LibHTML: Introduce LayoutBox and LayoutNodeWithStyleAndBoxModelMetrics
To streamline the layout tree and remove irrelevant data from classes
that don't need it, this patch adds two new LayoutNode subclasses.

LayoutNodeWithStyleAndBoxModelMetrics should be inherited by any layout
node that cares about box model metrics (margin, border, and padding.)
LayoutBox should be inherited by any layout node that can have a rect.

This makes LayoutText significantly smaller (from 140 to 40 bytes) and
clarifies a lot of things about the layout tree.

I'm also adding next_sibling() and previous_sibling() overloads to
LayoutBlock that return a LayoutBlock*. This is okay since blocks only
ever have block siblings.

Do also note that the semantics of is<T> slightly change in this patch:
is<T>(nullptr) now returns true, to facilitate allowing to<T>(nullptr).
2019-10-15 16:48:38 +02:00
..
BoxModelMetrics.cpp LibHTML: Rename ComputedStyle to BoxModelMetrics 2019-10-04 15:50:50 +02:00
BoxModelMetrics.h LibHTML: Rename ComputedStyle to BoxModelMetrics 2019-10-04 15:50:50 +02:00
LayoutBlock.cpp LibHTML: Introduce LayoutBox and LayoutNodeWithStyleAndBoxModelMetrics 2019-10-15 16:48:38 +02:00
LayoutBlock.h LibHTML: Introduce LayoutBox and LayoutNodeWithStyleAndBoxModelMetrics 2019-10-15 16:48:38 +02:00
LayoutBox.cpp LibHTML: Introduce LayoutBox and LayoutNodeWithStyleAndBoxModelMetrics 2019-10-15 16:48:38 +02:00
LayoutBox.h LibHTML: Introduce LayoutBox and LayoutNodeWithStyleAndBoxModelMetrics 2019-10-15 16:48:38 +02:00
LayoutBreak.cpp LibHTML: Introduce LayoutBox and LayoutNodeWithStyleAndBoxModelMetrics 2019-10-15 16:48:38 +02:00
LayoutBreak.h LibHTML: Introduce LayoutBox and LayoutNodeWithStyleAndBoxModelMetrics 2019-10-15 16:48:38 +02:00
LayoutDocument.cpp LibHTML: Introduce LayoutBox and LayoutNodeWithStyleAndBoxModelMetrics 2019-10-15 16:48:38 +02:00
LayoutDocument.h LibHTML: LayoutText should always use parent's style properties 2019-10-04 12:12:39 +02:00
LayoutImage.cpp LibHTML: Implement the <blink> element 2019-10-09 21:25:29 +02:00
LayoutImage.h LibHTML: Implement basic layout for inline <img alt> 2019-10-05 23:29:01 +02:00
LayoutInline.cpp LibHTML: Introduce LayoutBox and LayoutNodeWithStyleAndBoxModelMetrics 2019-10-15 16:48:38 +02:00
LayoutInline.h LibHTML: Introduce LayoutBox and LayoutNodeWithStyleAndBoxModelMetrics 2019-10-15 16:48:38 +02:00
LayoutListItem.cpp LibHTML: Add some convenient geometry getters on LayoutNode 2019-10-13 18:47:16 +02:00
LayoutListItem.h LibHTML: Add LayoutNode classes for "display: list-item" and its marker 2019-10-11 23:16:53 +02:00
LayoutListItemMarker.cpp LibHTML: Introduce LayoutBox and LayoutNodeWithStyleAndBoxModelMetrics 2019-10-15 16:48:38 +02:00
LayoutListItemMarker.h LibHTML: Introduce LayoutBox and LayoutNodeWithStyleAndBoxModelMetrics 2019-10-15 16:48:38 +02:00
LayoutNode.cpp LibHTML: Introduce LayoutBox and LayoutNodeWithStyleAndBoxModelMetrics 2019-10-15 16:48:38 +02:00
LayoutNode.h LibHTML: Introduce LayoutBox and LayoutNodeWithStyleAndBoxModelMetrics 2019-10-15 16:48:38 +02:00
LayoutReplaced.cpp LibHTML: Introduce LayoutBox and LayoutNodeWithStyleAndBoxModelMetrics 2019-10-15 16:48:38 +02:00
LayoutReplaced.h LibHTML: Introduce LayoutBox and LayoutNodeWithStyleAndBoxModelMetrics 2019-10-15 16:48:38 +02:00
LayoutText.cpp LibHTML: Add some convenient geometry getters on LayoutNode 2019-10-13 18:47:16 +02:00
LayoutText.h LibHTML: Add is<T> and to<T> helpers for LayoutNode class family 2019-10-15 14:24:26 +02:00
LayoutTreeBuilder.cpp LibHTML: Simplify Node::create_layout_node() 2019-10-15 15:06:16 +02:00
LayoutTreeBuilder.h LibHTML: Move layout tree building to a LayoutTreeBuilder class 2019-10-15 14:24:26 +02:00
LineBox.cpp LibHTML: Rewrite inline and text layout 2019-10-03 15:20:13 +02:00
LineBox.h LibHTML: Rewrite inline and text layout 2019-10-03 15:20:13 +02:00
LineBoxFragment.cpp LibHTML: Add is<T> and to<T> helpers for LayoutNode class family 2019-10-15 14:24:26 +02:00
LineBoxFragment.h LibHTML: Rewrite inline and text layout 2019-10-03 15:20:13 +02:00