1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:48:11 +00:00
serenity/Userland/Libraries/LibWeb/Layout
Andreas Kling 80ce0419b6 LibWeb: Fix abspos flex container with height:auto getting zero height
When laying out abspos boxes, we compute the height twice: before and
after the inside of the box has been laid out.

The first pass allows percentage vertical values inside the box to be
resolved against the box's height. The second pass resolves the final
used value for the height of the box itself.

In cases where the box height depends on the results of inside layout,
we were incorrectly setting the box to having a definite zero height.
This led to incorrect results when sizing an abspos flex container,
since the FFC sizes containers (in row layouts) based on whether the
container has a definite height.

To avoid this problem, this patch adds an enum so we can differentiate
between the two abspos height computation passes. If the first pass
discovers a dependency on the inside layout, we simply bail out of
computing the height, leaving it as indefinite. This allows the FFC
to size its container correctly, and the correct height gets set by
the second pass.
2023-01-06 21:12:55 +01:00
..
AvailableSpace.cpp LibWeb: Convert FormattingContext to new pixel units 2023-01-05 17:42:31 +01:00
AvailableSpace.h LibWeb: Convert FormattingContext to new pixel units 2023-01-05 17:42:31 +01:00
BlockContainer.cpp LibWeb: Convert Layout Boxes to new pixel units 2023-01-05 17:42:31 +01:00
BlockContainer.h LibWeb: Convert Layout Boxes to new pixel units 2023-01-05 17:42:31 +01:00
BlockFormattingContext.cpp LibWeb: Convert LayoutState to new pixel units 2023-01-05 17:42:31 +01:00
BlockFormattingContext.h LibWeb: Convert BlockFormattingContext to new pixel units 2023-01-05 17:42:31 +01:00
Box.cpp LibWeb+WebContent: Convert BrowsingContext to new pixel units 2023-01-05 17:42:31 +01:00
Box.h LibWeb: Convert Layout Boxes to new pixel units 2023-01-05 17:42:31 +01:00
BoxModelMetrics.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
BoxModelMetrics.h LibWeb+Browser+WebContent: Convert BoxModelMetrics to new pixel units 2023-01-05 17:42:31 +01:00
BreakNode.cpp LibWeb: Remove Layout::Node::set_inline() 2022-10-06 15:29:38 +02:00
BreakNode.h LibWeb: Make the layout tree GC-allocated 2022-10-20 15:16:23 +02:00
ButtonBox.cpp LibGfx: Move other font-related files to LibGfx/Font/ 2022-04-09 23:48:18 +02:00
ButtonBox.h LibWeb: Make the layout tree GC-allocated 2022-10-20 15:16:23 +02:00
CanvasBox.cpp Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
CanvasBox.h LibWeb: Make the layout tree GC-allocated 2022-10-20 15:16:23 +02:00
CheckBox.cpp LibGfx: Move other font-related files to LibGfx/Font/ 2022-04-09 23:48:18 +02:00
CheckBox.h LibWeb: Make the layout tree GC-allocated 2022-10-20 15:16:23 +02:00
FlexFormattingContext.cpp LibWeb: Resolve Lengths to CSSPixels 2023-01-05 17:42:31 +01:00
FlexFormattingContext.h LibWeb: Convert FlexFormattingContext to new pixel units 2023-01-05 17:42:31 +01:00
FormAssociatedLabelableNode.h LibWeb: Make the layout tree GC-allocated 2022-10-20 15:16:23 +02:00
FormattingContext.cpp LibWeb: Fix abspos flex container with height:auto getting zero height 2023-01-06 21:12:55 +01:00
FormattingContext.h LibWeb: Fix abspos flex container with height:auto getting zero height 2023-01-06 21:12:55 +01:00
FrameBox.cpp LibWeb+WebContent: Convert BrowsingContext to new pixel units 2023-01-05 17:42:31 +01:00
FrameBox.h LibWeb: Make the layout tree GC-allocated 2022-10-20 15:16:23 +02:00
GridFormattingContext.cpp LibWeb: Convert LayoutState to new pixel units 2023-01-05 17:42:31 +01:00
GridFormattingContext.h LibWeb: Convert GridFormattingContext to new pixel units 2023-01-05 17:42:31 +01:00
ImageBox.cpp LibWeb: Convert Layout Boxes to new pixel units 2023-01-05 17:42:31 +01:00
ImageBox.h LibWeb: Convert Layout Boxes to new pixel units 2023-01-05 17:42:31 +01:00
InitialContainingBlock.cpp LibWeb: Convert Paintable coordinates to new pixel units 2022-12-14 16:47:57 +00:00
InitialContainingBlock.h LibWeb: Make the layout tree GC-allocated 2022-10-20 15:16:23 +02:00
InlineFormattingContext.cpp LibWeb: Convert LayoutState to new pixel units 2023-01-05 17:42:31 +01:00
InlineFormattingContext.h LibWeb: Convert InlineFormattingContext to new pixel units 2023-01-05 17:42:31 +01:00
InlineLevelIterator.cpp LibWeb: Convert InlineLevelIterator/LineBox/LineBuilder to new px units 2023-01-05 17:42:31 +01:00
InlineLevelIterator.h LibWeb: Convert InlineLevelIterator/LineBox/LineBuilder to new px units 2023-01-05 17:42:31 +01:00
InlineNode.cpp LibWeb: Remove Layout::Node::set_inline() 2022-10-06 15:29:38 +02:00
InlineNode.h LibWeb: Make the layout tree GC-allocated 2022-10-20 15:16:23 +02:00
Label.cpp LibWeb: Convert Paintable coordinates to new pixel units 2022-12-14 16:47:57 +00:00
Label.h LibWeb+WebContent+headless-browser: Use CSSPixels for PageClient events 2022-12-10 12:03:19 +00:00
LabelableNode.cpp LibWeb: Move mouse event and label logic from layout to painting tree 2022-03-11 00:21:49 +01:00
LabelableNode.h LibWeb: Make the layout tree GC-allocated 2022-10-20 15:16:23 +02:00
LayoutPosition.cpp LibWeb: Make the layout tree GC-allocated 2022-10-20 15:16:23 +02:00
LayoutPosition.h LibWeb: Make the layout tree GC-allocated 2022-10-20 15:16:23 +02:00
LayoutState.cpp LibWeb: Convert LayoutState to new pixel units 2023-01-05 17:42:31 +01:00
LayoutState.h LibWeb: Convert LayoutState to new pixel units 2023-01-05 17:42:31 +01:00
LineBox.cpp LibWeb: Convert InlineLevelIterator/LineBox/LineBuilder to new px units 2023-01-05 17:42:31 +01:00
LineBox.h LibWeb: Convert InlineLevelIterator/LineBox/LineBuilder to new px units 2023-01-05 17:42:31 +01:00
LineBoxFragment.cpp LibWeb: Convert Paintable coordinates to new pixel units 2022-12-14 16:47:57 +00:00
LineBoxFragment.h LibWeb: Convert Paintable coordinates to new pixel units 2022-12-14 16:47:57 +00:00
LineBuilder.cpp LibWeb: Convert Layout::Node to new pixel units 2023-01-05 17:42:31 +01:00
LineBuilder.h LibWeb: Convert InlineLevelIterator/LineBox/LineBuilder to new px units 2023-01-05 17:42:31 +01:00
ListItemBox.cpp LibWeb: Make the layout tree GC-allocated 2022-10-20 15:16:23 +02:00
ListItemBox.h LibWeb: Make the layout tree GC-allocated 2022-10-20 15:16:23 +02:00
ListItemMarkerBox.cpp AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
ListItemMarkerBox.h AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
Node.cpp LibWeb: Resolve Lengths to CSSPixels 2023-01-05 17:42:31 +01:00
Node.h LibWeb: Convert Layout::Node to new pixel units 2023-01-05 17:42:31 +01:00
Progress.cpp Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
Progress.h LibWeb: Make the layout tree GC-allocated 2022-10-20 15:16:23 +02:00
RadioButton.cpp LibWeb: Set 1:1 intrinsic aspect ratio for radio buttons 2022-07-11 18:57:45 +02:00
RadioButton.h LibWeb: Make the layout tree GC-allocated 2022-10-20 15:16:23 +02:00
ReplacedBox.cpp LibWeb: Remove Layout::Node::set_inline() 2022-10-06 15:29:38 +02:00
ReplacedBox.h LibWeb: Convert Layout Boxes to new pixel units 2023-01-05 17:42:31 +01:00
SVGBox.cpp LibWeb: Make SVG <svg> elements behave as CSS replaced elements 2022-03-19 12:42:10 +01:00
SVGBox.h LibWeb: Make the layout tree GC-allocated 2022-10-20 15:16:23 +02:00
SVGFormattingContext.cpp LibWeb: Convert LayoutState to new pixel units 2023-01-05 17:42:31 +01:00
SVGFormattingContext.h LibWeb: Convert FormattingContext to new pixel units 2023-01-05 17:42:31 +01:00
SVGGeometryBox.cpp LibWeb: Convert Layout Boxes to new pixel units 2023-01-05 17:42:31 +01:00
SVGGeometryBox.h LibWeb: Convert Layout Boxes to new pixel units 2023-01-05 17:42:31 +01:00
SVGGraphicsBox.cpp LibWeb: Let Paintable perform the painting 2022-03-11 00:21:49 +01:00
SVGGraphicsBox.h LibWeb: Make the layout tree GC-allocated 2022-10-20 15:16:23 +02:00
SVGSVGBox.cpp LibWeb: Convert Layout Boxes to new pixel units 2023-01-05 17:42:31 +01:00
SVGSVGBox.h LibWeb: Make the layout tree GC-allocated 2022-10-20 15:16:23 +02:00
TableBox.cpp Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
TableBox.h LibWeb: Make the layout tree GC-allocated 2022-10-20 15:16:23 +02:00
TableCellBox.cpp LibWeb: Take rowspan into account while table formatting 2022-12-05 17:47:48 +01:00
TableCellBox.h LibWeb: Take rowspan into account while table formatting 2022-12-05 17:47:48 +01:00
TableFormattingContext.cpp LibWeb: Consider percent and fixed widths in table column distribution 2023-01-06 12:01:46 +01:00
TableFormattingContext.h LibWeb: Consider percent and fixed widths in table column distribution 2023-01-06 12:01:46 +01:00
TableRowBox.cpp Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
TableRowBox.h LibWeb: Make the layout tree GC-allocated 2022-10-20 15:16:23 +02:00
TableRowGroupBox.cpp LibWeb: Start implementation of CSS Table 3 spec 2022-12-05 17:47:48 +01:00
TableRowGroupBox.h LibWeb: Start implementation of CSS Table 3 spec 2022-12-05 17:47:48 +01:00
TextNode.cpp LibWeb: Apply CSS text-transform during layout 2022-12-24 12:27:46 +01:00
TextNode.h AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
TreeBuilder.cpp LibWeb: Generate missing parents for table elements 2023-01-05 00:07:44 +01:00
TreeBuilder.h LibWeb: Use HashMap::try_ensure_capacity in StyleComputer 2022-12-10 14:29:46 +01:00