ladybird/Libraries/LibWeb/Layout
Aliaksandr Kalenik e190f3ec23 LibWeb: Compute SVG mask/clip transforms using layout tree hierarchy
No observable behavior change — this is a refactoring of how SVG
transforms are computed for mask and clip content.

Previously, SVGGraphicsElement::get_transform() computed accumulated
transforms by walking the DOM tree. This didn't work correctly for masks
and clips because their DOM structure differs from layout: in the DOM,
mask/clip elements are siblings or ancestors of their targets, but in
the layout tree they become children of the target element. Walking the
DOM tree caused transforms from the target's ancestors to incorrectly
leak into mask/clip content.

The fix walks the layout tree instead of the DOM tree, which means
transform computation must happen during layout (where we have access to
the layout tree structure) rather than on-demand from the DOM element.
This moves the logic to SVGFormattingContext and removes get_transform()
since it can no longer serve its purpose — the DOM element only provides
element_transform() for its own transform now.

During layout, we walk up the layout tree and stop at mask/clip
boundaries, ensuring mask/clip content stays in its own coordinate
space. The target's accumulated transform is applied separately at paint
time.
2026-02-05 09:00:56 +01:00
..
AudioBox.cpp LibWeb/Layout: Don't inject natural size in prepare_for_replaced_layout 2026-02-02 14:36:49 +00:00
AudioBox.h LibWeb/Layout: Don't inject natural size in prepare_for_replaced_layout 2026-02-02 14:36:49 +00:00
AvailableSpace.cpp
AvailableSpace.h
BlockContainer.cpp LibWeb: Add missing type-isolating GC allocators for some types 2026-01-18 10:10:04 +01:00
BlockContainer.h LibWeb: Add missing type-isolating GC allocators for some types 2026-01-18 10:10:04 +01:00
BlockFormattingContext.cpp LibWeb: Resolve horizontal box model metrics for table captions 2026-02-03 14:47:51 +01:00
BlockFormattingContext.h LibWeb: Resolve horizontal box model metrics for table captions 2026-02-03 14:47:51 +01:00
Box.cpp LibWeb/Layout: Don't inject natural size in prepare_for_replaced_layout 2026-02-02 14:36:49 +00:00
Box.h LibWeb/Layout: Don't inject natural size in prepare_for_replaced_layout 2026-02-02 14:36:49 +00:00
BreakNode.cpp LibWeb: Make CSS::ComputedProperties GC-allocated 2024-12-22 10:12:49 +01:00
BreakNode.h Everywhere: Change west consts caught by clang-format-21 to east consts 2025-08-29 18:18:55 +01:00
CanvasBox.cpp LibWeb/Layout: Don't inject natural size in prepare_for_replaced_layout 2026-02-02 14:36:49 +00:00
CanvasBox.h LibWeb/Layout: Don't inject natural size in prepare_for_replaced_layout 2026-02-02 14:36:49 +00:00
CheckBox.cpp LibWeb/Layout: Don't inject natural size in prepare_for_replaced_layout 2026-02-02 14:36:49 +00:00
CheckBox.h LibWeb/Layout: Don't inject natural size in prepare_for_replaced_layout 2026-02-02 14:36:49 +00:00
FieldSetBox.cpp Meta: Disallow links to single-page HTML spec 2025-02-05 16:04:50 -07:00
FieldSetBox.h LibWeb: Make CSS::ComputedProperties GC-allocated 2024-12-22 10:12:49 +01:00
FlexFormattingContext.cpp LibWeb: Definite size overrides intrinsic aspect ratio contribution 2026-02-02 14:36:49 +00:00
FlexFormattingContext.h LibWeb: Mark flex item main size definite if resolved from aspect-ratio 2025-11-07 16:42:32 +01:00
FormAssociatedLabelableNode.h LibWeb: Replace usages of dynamic_cast with as and as_if 2025-08-22 20:26:09 +02:00
FormattingContext.cpp LibWeb/Layout: Don't inject natural size in prepare_for_replaced_layout 2026-02-02 14:36:49 +00:00
FormattingContext.h LibWeb: Add debug tracing for FormattingContext::run() calls 2026-01-09 08:12:21 +01:00
GridFormattingContext.cpp LibWeb: Fix fit-content() row clamping with indefinite available height 2026-02-02 20:33:05 +01:00
GridFormattingContext.h LibWeb: Make LengthBox hold LengthPercentageOrAuto 2025-09-04 13:31:24 +01:00
ImageBox.cpp LibWeb/Layout: Don't inject natural size in prepare_for_replaced_layout 2026-02-02 14:36:49 +00:00
ImageBox.h LibWeb/Layout: Don't inject natural size in prepare_for_replaced_layout 2026-02-02 14:36:49 +00:00
ImageProvider.cpp Everywhere: Avoid large rebuilds when editing (Immutable)Bitmap headers 2025-11-28 18:32:48 +01:00
ImageProvider.h LibWeb: Add ImageProvider virtual to access the DecodedImageData 2025-11-05 09:11:49 +01:00
InlineFormattingContext.cpp LibWeb: Add debug tracing for FormattingContext::run() calls 2026-01-09 08:12:21 +01:00
InlineFormattingContext.h
InlineLevelIterator.cpp LibWeb/Layout: Don't inject natural size in prepare_for_replaced_layout 2026-02-02 14:36:49 +00:00
InlineLevelIterator.h LibWeb: Pre-generate items in InlineLevelIterator 2026-01-11 11:10:19 +01:00
InlineNode.cpp LibWeb: Split PaintableWithLines from PaintableBox 2026-01-12 11:00:14 +00:00
InlineNode.h LibWeb: Add fast_is<T> optimization for Layout::InlineNode 2025-09-22 15:00:50 +02:00
LabelableNode.cpp
LabelableNode.h LibWeb: Allow Layout::ImageBox to be anonymous 2025-07-28 22:46:27 +02:00
LayoutState.cpp LibWeb: Store StickyInsets on ScrollFrame 2026-02-01 19:57:14 +01:00
LayoutState.h LibWeb: Simplify UsedValues::static_position() 2025-08-28 13:45:37 +02:00
LegendBox.cpp LibWeb: Make CSS::ComputedProperties GC-allocated 2024-12-22 10:12:49 +01:00
LegendBox.h LibWeb: Make CSS::ComputedProperties GC-allocated 2024-12-22 10:12:49 +01:00
LineBox.cpp LibWeb: Store correct text offsets in PaintableFragment 2025-09-12 15:34:09 -04:00
LineBox.h LibWeb: Make fragment start/length size_t instead of int 2025-06-13 15:08:26 +02:00
LineBoxFragment.cpp LibWeb: Store correct text offsets in PaintableFragment 2025-09-12 15:34:09 -04:00
LineBoxFragment.h LibWeb: Store correct text offsets in PaintableFragment 2025-09-12 15:34:09 -04:00
LineBuilder.cpp LibWeb/Layout: Honor hanging and each-line in text-indent 2025-11-20 16:02:40 +01:00
LineBuilder.h LibWeb/Layout: Honor hanging and each-line in text-indent 2025-11-20 16:02:40 +01:00
ListItemBox.cpp LibWeb: Make CSS::ComputedProperties GC-allocated 2024-12-22 10:12:49 +01:00
ListItemBox.h Meta: Enforce newlines around namespaces 2025-05-14 02:01:59 -06:00
ListItemMarkerBox.cpp AK+LibWeb/CSS: Add lower-greek counter style 2025-07-21 15:18:17 +01:00
ListItemMarkerBox.h LibWeb: Improve graphical list item marker positioning 2025-07-17 09:35:09 +01:00
NavigableContainerViewport.cpp LibWeb/Layout: Don't inject natural size in prepare_for_replaced_layout 2026-02-02 14:36:49 +00:00
NavigableContainerViewport.h LibWeb/Layout: Don't inject natural size in prepare_for_replaced_layout 2026-02-02 14:36:49 +00:00
Node.cpp LibWeb: Don't return unnecessary optional when propagating border radius 2026-02-03 10:33:04 +00:00
Node.h LibWeb: Implement auto_content_box_size for textarea and input 2026-02-02 14:36:49 +00:00
RadioButton.cpp LibWeb/Layout: Don't inject natural size in prepare_for_replaced_layout 2026-02-02 14:36:49 +00:00
RadioButton.h LibWeb/Layout: Don't inject natural size in prepare_for_replaced_layout 2026-02-02 14:36:49 +00:00
ReplacedBox.cpp LibWeb: Allow Layout::ImageBox to be anonymous 2025-07-28 22:46:27 +02:00
ReplacedBox.h LibWeb/Layout: Don't inject natural size in prepare_for_replaced_layout 2026-02-02 14:36:49 +00:00
SVGBox.cpp LibGC: Enforce that a Cell type must declare the allocator to use 2026-01-20 12:00:11 +01:00
SVGBox.h LibGC: Enforce that a Cell type must declare the allocator to use 2026-01-20 12:00:11 +01:00
SVGClipBox.cpp LibWeb: Make CSS::ComputedProperties GC-allocated 2024-12-22 10:12:49 +01:00
SVGClipBox.h LibWeb: Add fast_is<T> for hotly dynamic_cast'ed things on imdb.com 2025-09-25 21:42:52 +02:00
SVGForeignObjectBox.cpp LibWeb: Make CSS::ComputedProperties GC-allocated 2024-12-22 10:12:49 +01:00
SVGForeignObjectBox.h LibWeb: Make SVG foreignObject establish a new stacking context 2025-07-09 14:36:08 +02:00
SVGFormattingContext.cpp LibWeb: Compute SVG mask/clip transforms using layout tree hierarchy 2026-02-05 09:00:56 +01:00
SVGFormattingContext.h LibWeb: Compute SVG mask/clip transforms using layout tree hierarchy 2026-02-05 09:00:56 +01:00
SVGGeometryBox.cpp LibWeb: Make CSS::ComputedProperties GC-allocated 2024-12-22 10:12:49 +01:00
SVGGeometryBox.h LibWeb: Make CSS::ComputedProperties GC-allocated 2024-12-22 10:12:49 +01:00
SVGGraphicsBox.cpp LibGC: Enforce that a Cell type must declare the allocator to use 2026-01-20 12:00:11 +01:00
SVGGraphicsBox.h LibGC: Enforce that a Cell type must declare the allocator to use 2026-01-20 12:00:11 +01:00
SVGImageBox.cpp LibGC: Enforce that a Cell type must declare the allocator to use 2026-01-20 12:00:11 +01:00
SVGImageBox.h LibGC: Enforce that a Cell type must declare the allocator to use 2026-01-20 12:00:11 +01:00
SVGMaskBox.cpp LibWeb: Make CSS::ComputedProperties GC-allocated 2024-12-22 10:12:49 +01:00
SVGMaskBox.h AK+Everywhere: Rename verify_cast to as 2025-01-21 11:34:06 -05:00
SVGSVGBox.cpp LibWeb/Layout: Don't inject natural size in prepare_for_replaced_layout 2026-02-02 14:36:49 +00:00
SVGSVGBox.h LibWeb/Layout: Don't inject natural size in prepare_for_replaced_layout 2026-02-02 14:36:49 +00:00
SVGTextBox.cpp LibWeb: Make CSS::ComputedProperties GC-allocated 2024-12-22 10:12:49 +01:00
SVGTextBox.h LibWeb: Make CSS::ComputedProperties GC-allocated 2024-12-22 10:12:49 +01:00
SVGTextPathBox.cpp LibWeb: Make CSS::ComputedProperties GC-allocated 2024-12-22 10:12:49 +01:00
SVGTextPathBox.h LibWeb: Make CSS::ComputedProperties GC-allocated 2024-12-22 10:12:49 +01:00
TableFormattingContext.cpp LibWeb: Set automatic content height for table captions with auto height 2026-02-04 20:25:04 +00:00
TableFormattingContext.h LibWeb: Constrain table caption available space to table's border-box 2026-02-03 14:47:51 +01:00
TableGrid.cpp LibWeb/Layout: Spec-comment Table "algorithm for processing rows" 2025-11-30 11:48:14 +01:00
TableGrid.h LibWeb: Avoid having the same code in two files 2025-12-24 14:10:27 +01:00
TableWrapper.cpp LibWeb: Make CSS::ComputedProperties GC-allocated 2024-12-22 10:12:49 +01:00
TableWrapper.h LibWeb: Make CSS::ComputedProperties GC-allocated 2024-12-22 10:12:49 +01:00
TextAreaBox.cpp LibWeb: Implement auto_content_box_size for textarea and input 2026-02-02 14:36:49 +00:00
TextAreaBox.h LibWeb: Implement auto_content_box_size for textarea and input 2026-02-02 14:36:49 +00:00
TextInputBox.cpp LibWeb: Implement auto_content_box_size for textarea and input 2026-02-02 14:36:49 +00:00
TextInputBox.h LibWeb: Implement auto_content_box_size for textarea and input 2026-02-02 14:36:49 +00:00
TextNode.cpp LibWeb: Add ASCII fast path for bidi class lookups in text layout 2026-01-11 11:10:19 +01:00
TextNode.h LibWeb: Prefer non-emoji font when deciding width of space between words 2025-11-06 23:42:01 +01:00
TreeBuilder.cpp LibWeb: Do not generate marker boxes for list-style-type: none 2026-01-26 16:41:42 +01:00
TreeBuilder.h LibWeb/Layout: Replace existing ::backdrop layout nodes when necessary 2026-01-22 13:52:31 +00:00
VideoBox.cpp LibWeb/Layout: Don't inject natural size in prepare_for_replaced_layout 2026-02-02 14:36:49 +00:00
VideoBox.h LibWeb/Layout: Don't inject natural size in prepare_for_replaced_layout 2026-02-02 14:36:49 +00:00
Viewport.cpp LibWeb: Rename is_generated to is_generated_for_pseudo_element 2025-09-24 12:33:17 +01:00
Viewport.h Everywhere: Change west consts caught by clang-format-21 to east consts 2025-08-29 18:18:55 +01:00