1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:08:10 +00:00
serenity/Userland/Libraries/LibWeb/Layout
Andreas Kling f25203f245 LibWeb: Don't re-resolve "auto" flex item sizes after definitizing them
This is rather subtle and points to our architecture around definite
sizes not being exactly right, but...

At some points during flexbox layout, the spec tells us that the sizes
of certain flex items are considered definite from this point on.
We implement this by marking each item's associated UsedValues as
"has-definite-width/height".

However, this breaks code that tries to resolve computed "auto" sizes
by taking the corresponding size from the containing block. The end
result was that the 1st sizing pass in flexbox would find the right size
for an "auto" sized item, but the 2nd pass would override the correct
size with the containing block's content size in that axis instead.

To work around the issue, FFC now remembers when it "definitizes" an
item, and future attempts to resolve an "auto" computed size for that
value will bypass the computed-auto-is-resolved-against-containing-block
step of the algorithm. It's not perfect, and we'll need to think more
about how to really represent these intermediate states relating to
box sizes being definite..
2022-09-14 14:43:17 +02:00
..
BlockContainer.cpp Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
BlockContainer.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
BlockFormattingContext.cpp LibWeb: Use PercentageOr<T>::contains_percentage() in CSS layout 2022-09-14 14:43:17 +02:00
BlockFormattingContext.h LibWeb: Treat percentage width/height as "auto" more consistently in BFC 2022-09-13 17:03:31 +02:00
Box.cpp LibWeb: Make Layout::Box::set_needs_display() work for all boxes 2022-04-12 00:11:48 +02:00
Box.h LibWeb: Move Layout::Box::is_out_of_flow() to Layout::Node 2022-03-22 19:26:51 +01:00
BoxModelMetrics.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
BoxModelMetrics.h LibWeb: Rename "offset" in box model metrics to "inset" 2022-03-26 17:31:01 +01:00
BreakNode.cpp Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
BreakNode.h LibWeb: Let Paintable perform the painting 2022-03-11 00:21:49 +01:00
ButtonBox.cpp LibGfx: Move other font-related files to LibGfx/Font/ 2022-04-09 23:48:18 +02:00
ButtonBox.h LibWeb: Refactor all LabelableNode subclasses + input event handling :^) 2022-03-16 00:38:31 +01:00
CanvasBox.cpp Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
CanvasBox.h LibWeb: Make Paintable ref-counted 2022-03-11 00:21:49 +01:00
CheckBox.cpp LibGfx: Move other font-related files to LibGfx/Font/ 2022-04-09 23:48:18 +02:00
CheckBox.h LibWeb: Refactor all LabelableNode subclasses + input event handling :^) 2022-03-16 00:38:31 +01:00
FlexFormattingContext.cpp LibWeb: Don't re-resolve "auto" flex item sizes after definitizing them 2022-09-14 14:43:17 +02:00
FlexFormattingContext.h LibWeb: Don't re-resolve "auto" flex item sizes after definitizing them 2022-09-14 14:43:17 +02:00
FormAssociatedLabelableNode.h LibWeb: Remove inheritance of FormAssociatedElement from HTMLElement 2022-03-24 03:35:11 +01:00
FormattingContext.cpp LibWeb: Don't include abspos children in containing block's auto width 2022-09-14 00:09:49 +02:00
FormattingContext.h LibWeb: Factor out compute_y_position 2022-08-14 11:22:52 +02:00
FrameBox.cpp Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
FrameBox.h LibWeb: Make Paintable ref-counted 2022-03-11 00:21:49 +01:00
GridFormattingContext.cpp LibWeb: Inform the parent context of the grid's size 2022-09-14 00:09:14 +02:00
GridFormattingContext.h LibWeb: Add GridFormattingContext 2022-08-25 13:47:48 +02:00
ImageBox.cpp LibWeb: Cache width of "alt" text in ImageBox 2022-09-07 17:47:33 +02:00
ImageBox.h LibWeb: Cache width of "alt" text in ImageBox 2022-09-07 17:47:33 +02:00
InitialContainingBlock.cpp LibWeb: Ignore non-painting layout nodes when building stacking contexts 2022-04-07 17:06:02 +02:00
InitialContainingBlock.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
InlineFormattingContext.cpp LibWeb: Break lines until we have enough space between floats 2022-09-13 17:03:31 +02:00
InlineFormattingContext.h LibWeb: Break lines until we have enough space between floats 2022-09-13 17:03:31 +02:00
InlineLevelIterator.cpp LibWeb: Add accessors for UsedValues::computed_{width,height} 2022-07-19 15:40:41 +02:00
InlineLevelIterator.h LibWeb: Rename LayoutState::NodeState => LayoutState::UsedValues 2022-07-17 14:11:37 +02:00
InlineNode.cpp Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
InlineNode.h LibWeb: Make Paintable ref-counted 2022-03-11 00:21:49 +01:00
Label.cpp Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
Label.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01: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: Move mouse event and label logic from layout to painting tree 2022-03-11 00:21:49 +01:00
LayoutPosition.cpp LibWeb: Make AbstractRange and subclasses GC-allocated 2022-09-06 00:27:09 +02:00
LayoutPosition.h LibWeb: Make AbstractRange and subclasses GC-allocated 2022-09-06 00:27:09 +02:00
LayoutState.cpp LibWeb: Don't re-resolve "auto" flex item sizes after definitizing them 2022-09-14 14:43:17 +02:00
LayoutState.h LibWeb: Don't re-resolve "auto" flex item sizes after definitizing them 2022-09-14 14:43:17 +02:00
LineBox.cpp LibWeb: Respect inline-axis margins between line box fragments :^) 2022-03-09 18:47:32 +01:00
LineBox.h LibWeb: Bring CSS line-height implementation closer to spec 2022-03-24 22:52:44 +01:00
LineBoxFragment.cpp LibWeb: Rename FormattingState to LayoutState 2022-07-17 14:11:36 +02:00
LineBoxFragment.h LibWeb: Rename FormattingState to LayoutState 2022-07-17 14:11:36 +02:00
LineBuilder.cpp LibWeb: Break lines until we have enough space between floats 2022-09-13 17:03:31 +02:00
LineBuilder.h LibWeb: Break lines until we have enough space between floats 2022-09-13 17:03:31 +02:00
ListItemBox.cpp Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
ListItemBox.h LibWeb: Make display: foo box constructors take the Element by pointer 2022-02-25 19:35:34 +01:00
ListItemMarkerBox.cpp LibWeb: Convert images to common AbstractImageStyleValue base 2022-08-08 22:39:06 +02:00
ListItemMarkerBox.h LibWeb: Convert images to common AbstractImageStyleValue base 2022-08-08 22:39:06 +02:00
Node.cpp LibWeb: Create stacking context for flex/grid items with z-index != auto 2022-09-14 00:09:49 +02:00
Node.h LibWeb+LibJS: Make the EventTarget hierarchy (incl. DOM) GC-allocated 2022-09-06 00:27:09 +02:00
Progress.cpp Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
Progress.h LibWeb: Make Paintable ref-counted 2022-03-11 00:21:49 +01:00
RadioButton.cpp LibWeb: Set 1:1 intrinsic aspect ratio for radio buttons 2022-07-11 18:57:45 +02:00
RadioButton.h LibWeb: Refactor all LabelableNode subclasses + input event handling :^) 2022-03-16 00:38:31 +01:00
ReplacedBox.cpp Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
ReplacedBox.h LibWeb: Add some fast_is<T> helpers for hot classes on GitHub :^) 2022-03-13 18:09:43 +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 SVG <svg> elements behave as CSS replaced elements 2022-03-19 12:42:10 +01:00
SVGFormattingContext.cpp LibWeb: Add accessors for UsedValues::computed_{width,height} 2022-07-19 15:40:41 +02:00
SVGFormattingContext.h LibWeb: Rename FormattingState to LayoutState 2022-07-17 14:11:36 +02:00
SVGGeometryBox.cpp LibWeb: Remove a bunch of no-longer needed #includes 2022-03-11 00:21:49 +01:00
SVGGeometryBox.h LibWeb: Make Paintable ref-counted 2022-03-11 00:21:49 +01:00
SVGGraphicsBox.cpp LibWeb: Let Paintable perform the painting 2022-03-11 00:21:49 +01:00
SVGGraphicsBox.h LibWeb: Let Paintable perform the painting 2022-03-11 00:21:49 +01:00
SVGSVGBox.cpp LibWeb: Try to work out the intrinsic size of <svg> elements 2022-07-11 18:57:45 +02:00
SVGSVGBox.h LibWeb: Try to work out the intrinsic size of <svg> elements 2022-07-11 18:57:45 +02:00
TableBox.cpp Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
TableBox.h LibWeb: Rename Layout::BlockBox => BlockContainer 2021-10-06 20:10:36 +02:00
TableCellBox.cpp Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
TableCellBox.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
TableFormattingContext.cpp LibWeb: Add accessors for UsedValues::computed_{width,height} 2022-07-19 15:40:41 +02:00
TableFormattingContext.h LibWeb: Rename FormattingState to LayoutState 2022-07-17 14:11:36 +02:00
TableRowBox.cpp Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
TableRowBox.h LibWeb: Start work towards modern CSS "display" values 2021-10-06 19:12:52 +02:00
TableRowGroupBox.cpp Libraries: Use default constructors/destructors in LibWeb 2022-03-17 17:23:49 +00:00
TableRowGroupBox.h LibWeb: Make display: foo box constructors take the Element by pointer 2022-02-25 19:35:34 +01:00
TextNode.cpp LibWeb: Express intrinsic size layout via size constraints 2022-07-11 18:57:45 +02:00
TextNode.h LibWeb: Express intrinsic size layout via size constraints 2022-07-11 18:57:45 +02:00
TreeBuilder.cpp LibWeb+LibJS: Make the EventTarget hierarchy (incl. DOM) GC-allocated 2022-09-06 00:27:09 +02:00
TreeBuilder.h LibWeb: Tidy up Layout::TreeBuilder ancestor stack a little bit 2022-04-13 19:52:25 +02:00