ladybird/Libraries/LibWeb/Layout
Tim Ledbetter b67d73a661 LibWeb: Apply ::first-letter pseudo-element styles
We now apply first letter styles by splitting text with a first-letter
style applied into 2 `TextSliceNode` objects.  The
`DOM::Text` layout  node always points at the non first-letter slice
and the first-letter slice is  reachable via
`TextSliceNode::first_letter_slice()`.

First letter splitting works by `TreeBuilder` walking a block
container's inline descendants to find the first typographic letter
unit per the pattern given in  css-pseudo level 4, which is then
wrapped in an anonymous inline box styled with the `::first-letter`
computed properties.

Consumers that map between DOM offsets and layout geometry
are updated to visit all slices of a `DOM::Text` through
`TextOffsetMapping`.
2026-05-20 12:09:19 +01:00
..
AudioBox.cpp LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
AudioBox.h LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
AvailableSpace.cpp Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
AvailableSpace.h Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
BlockContainer.cpp LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
BlockContainer.h LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
BlockFormattingContext.cpp LibWeb: Keep intrinsic heights indefinite for percentage children 2026-05-16 17:06:03 +02:00
BlockFormattingContext.h LibWeb: Position list marker to the right of right-to-left text 2026-04-30 16:20:10 +02:00
Box.cpp LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
Box.h LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02: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: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
CanvasBox.h LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
CheckBox.cpp LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
CheckBox.h LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
DominantBaseline.h LibWeb: Implement dominant-baseline for SVG text 2026-02-26 09:23:23 +01:00
FieldSetBox.cpp LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
FieldSetBox.h LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
FlexFormattingContext.cpp LibWeb: Place single-line flex lines at cross-start 2026-05-17 10:15:38 +02:00
FlexFormattingContext.h LibWeb: Fix flex abspos static positions on reversed cross axes 2026-04-03 14:29:44 +02:00
FormattingContext.cpp LibWeb: Resolve table wrappers from grid areas 2026-05-19 10:41:52 +02:00
FormattingContext.h LibWeb: Resolve table wrappers from grid areas 2026-05-19 10:41:52 +02:00
GridFormattingContext.cpp LibWeb: Resolve table wrappers from grid areas 2026-05-19 10:41:52 +02:00
GridFormattingContext.h LibWeb: Resolve table wrappers from grid areas 2026-05-19 10:41:52 +02:00
ImageBox.cpp LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
ImageBox.h LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
ImageProvider.cpp LibGfx+LibWeb: Make DecodedImageFrame a value type 2026-05-07 16:08:13 +02:00
ImageProvider.h LibGfx+LibWeb: Make DecodedImageFrame a value type 2026-05-07 16:08:13 +02:00
InlineFormattingContext.cpp LibWeb: Mark ellipsized fragments as hidden rather than removing them 2026-04-17 08:03:26 +02:00
InlineFormattingContext.h LibWeb: Apply text-overflow ellipsis as line box post-processing 2026-03-26 00:19:50 +00:00
InlineLevelIterator.cpp LibWeb: Make every HTMLElement potentially form-associated 2026-03-25 13:18:15 +00:00
InlineLevelIterator.h LibWeb: Implement word-break functionality using UAX#14 line breaking 2026-02-14 16:23:18 -05:00
InlineNode.cpp LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
InlineNode.h LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
LayoutState.cpp LibWeb: Apply ::first-letter pseudo-element styles 2026-05-20 12:09:19 +01:00
LayoutState.h LibWeb: Resolve table wrappers from grid areas 2026-05-19 10:41:52 +02:00
LegendBox.cpp LibWeb: Make CSS::ComputedProperties GC-allocated 2024-12-22 10:12:49 +01:00
LegendBox.h LibWeb: Remove Document.h include from Layout/Node.h 2026-02-08 18:51:13 +01:00
LineBox.cpp LibWeb/Layout: Use is_empty() when fragment text has nothing to trim 2026-03-31 13:48:50 +01: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: Mark ellipsized fragments as hidden rather than removing them 2026-04-17 08:03:26 +02:00
LineBuilder.cpp LibWeb: Apply calculated vertical-align offsets in LineBuilder 2026-04-15 21:49:40 +02:00
LineBuilder.h LibWeb: Keep track of trailing whitespace for wrapped lines 2026-02-06 10:47:50 +00: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 LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
ListItemMarkerBox.h LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
NavigableContainerViewport.cpp LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
NavigableContainerViewport.h LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
Node.cpp LibWeb: Add AttachToDOMNode parameter to Layout::Node constructor 2026-05-20 12:09:19 +01:00
Node.h LibWeb: Apply ::first-letter pseudo-element styles 2026-05-20 12:09:19 +01:00
RadioButton.cpp LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
RadioButton.h LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02: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
ReplacedWithChildrenFormattingContext.cpp LibWeb: Allow replaced elements to host children 2026-02-23 07:27:31 +01:00
ReplacedWithChildrenFormattingContext.h LibWeb: Allow replaced elements to host children 2026-02-23 07:27:31 +01: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 Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
SVGClipBox.h LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
SVGForeignObjectBox.cpp LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
SVGForeignObjectBox.h LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
SVGFormattingContext.cpp LibWeb: Move standalone SVG document layout handling out of BFC 2026-03-31 10:49:15 +02: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 Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
SVGGeometryBox.h LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
SVGGraphicsBox.cpp LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
SVGGraphicsBox.h LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
SVGImageBox.cpp LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
SVGImageBox.h LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
SVGMaskBox.cpp LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
SVGMaskBox.h LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
SVGPatternBox.cpp LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
SVGPatternBox.h LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
SVGSVGBox.cpp LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
SVGSVGBox.h LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
SVGTextBox.cpp LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
SVGTextBox.h LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
SVGTextPathBox.cpp LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
SVGTextPathBox.h LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
TableFormattingContext.cpp LibWeb: Resolve table width constraints as content widths 2026-05-19 10:41:52 +02:00
TableFormattingContext.h LibWeb: Restrict throwaway layout states to their subtree 2026-02-27 19:11:41 +01:00
TableGrid.cpp LibWeb: Use unsafe layout/paintable accessors where appropriate 2026-02-26 21:09:08 +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: Apply ::first-letter pseudo-element styles 2026-05-20 12:09:19 +01:00
TextNode.h LibWeb: Apply ::first-letter pseudo-element styles 2026-05-20 12:09:19 +01:00
TextOffsetMapping.cpp LibWeb: Apply ::first-letter pseudo-element styles 2026-05-20 12:09:19 +01:00
TextOffsetMapping.h LibWeb: Apply ::first-letter pseudo-element styles 2026-05-20 12:09:19 +01:00
TreeBuilder.cpp LibWeb: Apply ::first-letter pseudo-element styles 2026-05-20 12:09:19 +01:00
TreeBuilder.h LibWeb: Apply ::first-letter pseudo-element styles 2026-05-20 12:09:19 +01:00
VideoBox.cpp LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
VideoBox.h LibWeb: Make Paintable tree ref-counted 2026-05-07 15:03:44 +02:00
Viewport.cpp LibWeb: Apply ::first-letter pseudo-element styles 2026-05-20 12:09:19 +01:00
Viewport.h LibWeb: Apply ::first-letter pseudo-element styles 2026-05-20 12:09:19 +01:00