Files
rust_browser/tests/goldens/expected/132-img-inline.layout.txt
Zachary D. Rowitsch e0aae716b0 Add vertical-align support for inline-block elements
Inline-block elements now participate in vertical alignment within
inline formatting contexts. Previously, inline-blocks were positioned
at the parent's content origin regardless of their vertical-align
property. Now they are correctly repositioned based on CSS 2.1 §10.8.1
baseline calculation rules.

Key changes:
- Extended AtomicInline with vertical-align, baseline-offset fields
- Create positioning-only InlineFragment for each atomic inline
- Reposition inline-block LayoutBoxes after vertical alignment
- Compute baseline from last line box (or bottom margin edge)
- Made offset_layout_box pub(crate) for reuse across modules
- Skip atomic fragments in display list builder
- Comprehensive test coverage (23 new tests)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-06 17:00:04 -05:00

40 lines
1.4 KiB
Plaintext

LayoutBox node=#1 tag=html box=block
content: (0, 0, 800, 35.2)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
LayoutBox node=#3 tag=body box=block
content: (8, 8, 784, 19.2)
padding: 0 0 0 0
border: 0 0 0 0
margin: 8 8 8 8
LayoutBox node=#5 tag=div box=block
content: (8, 8, 784, 19.2)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
inline_context: 1 lines, height=19.2, max_width=68.0558
line[0]: rect=(8, 8, 68.0558, 19.2) fragments=3
frag[0]: rect=(8, 8, 28.499266, 16) text="Hello" start=false end=false
frag[1]: rect=(39.5536, 18.558002, 2, 2) text=(none) start=false end=false
frag[2]: rect=(44.607933, 8, 31.447872, 16) text="world" start=false end=false
LayoutBox node=#6 tag=anonymous box=anon
content: (0, 0, 31.553596, 16)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
text: "Hello "
LayoutBox node=#7 tag=img box=inline-block
content: (39.5536, 18.558002, 2, 2)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
image: img#0 (intrinsic: 2x2)
inline_context: 0 lines, height=0, max_width=0
LayoutBox node=#8 tag=anonymous box=anon
content: (0, 0, 34.502205, 16)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
text: " world"