Refactor tree_builder.rs into module directory with 7 files implementing all 23 insertion modes per WHATWG HTML §13.2.6.4 as an explicit state machine. Includes active formatting elements list with Noah's Ark clause, scope checking for all 5 scope types, context-sensitive fragment parsing, and iterative token reprocessing via ProcessResult enum. Code review fixes: fix formatting element end tag truncation bug (save node_id before truncate), replace manual element creation in catch-all StartTag with insert_element_maybe_self_closing, add skip_next_newline for pre/listing/textarea per spec, add QuirksMode to Document with basic DOCTYPE detection, refactor all 23 handlers from Token to &Token to eliminate clone per dispatch, fix self_closing handling for pre/listing/textarea/plaintext, improve golden test 276 fixture coverage and foster-parent test assertion. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
119 lines
4.7 KiB
Plaintext
119 lines
4.7 KiB
Plaintext
LayoutBox node=#1 tag=html box=block
|
|
content: (0, 0, 800, 202.17601)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#8 tag=body box=block
|
|
content: (8, 18.72, 784, 164.73601)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 8 8 8 8
|
|
LayoutBox node=#10 tag=h3 box=block
|
|
content: (8, 18.72, 784, 22.464003)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 18.72 0 18.72 0
|
|
inline_context: 1 lines, height=22.464003, max_width=99.35894
|
|
line[0]: rect=(8, 18.72, 99.35894, 22.464003) fragments=3
|
|
frag[0]: rect=(8, 20.592001, 9.208811, 18.72) text="I." start=true end=true
|
|
frag[1]: rect=(20.78238, 20.592001, 54.99172, 18.72) text="Chapter" start=false end=false
|
|
frag[2]: rect=(79.347664, 20.592001, 28.011276, 18.72) text="One" start=false end=false
|
|
LayoutBox node=#22 tag=anonymous box=inline
|
|
content: (0, -8, 0, 0)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#23 tag=anonymous box=anon
|
|
content: (0, -8, 12.782379, 18.72)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "I. "
|
|
LayoutBox node=#11 tag=anonymous box=anon
|
|
content: (0, -8, 86.57656, 18.72)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "Chapter One"
|
|
LayoutBox node=#13 tag=h3 box=block
|
|
content: (8, 59.904, 784, 22.464)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 18.72 0 18.72 0
|
|
inline_context: 1 lines, height=22.464, max_width=104.98044
|
|
line[0]: rect=(8, 59.904, 104.98044, 22.464003) fragments=3
|
|
frag[0]: rect=(8, 61.776, 14.555418, 18.72) text="II." start=true end=true
|
|
frag[1]: rect=(26.128986, 61.776, 54.99172, 18.72) text="Chapter" start=false end=false
|
|
frag[2]: rect=(84.694275, 61.776, 28.286167, 18.72) text="Two" start=false end=false
|
|
LayoutBox node=#24 tag=anonymous box=inline
|
|
content: (0, 10.719999, 0, 0)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#25 tag=anonymous box=anon
|
|
content: (0, 10.719999, 18.128986, 18.72)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "II. "
|
|
LayoutBox node=#14 tag=anonymous box=anon
|
|
content: (0, 10.719999, 86.851456, 18.72)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "Chapter Two"
|
|
LayoutBox node=#16 tag=h3 box=block
|
|
content: (8, 101.088005, 784, 22.464005)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 18.72 0 18.72 0
|
|
inline_context: 1 lines, height=22.464005, max_width=121.4601
|
|
line[0]: rect=(8, 101.088005, 121.4601, 22.464003) fragments=3
|
|
frag[0]: rect=(8, 102.96001, 19.902027, 18.72) text="III." start=true end=true
|
|
frag[1]: rect=(31.475595, 102.96001, 54.99172, 18.72) text="Chapter" start=false end=false
|
|
frag[2]: rect=(90.040886, 102.96001, 39.41921, 18.72) text="Three" start=false end=false
|
|
LayoutBox node=#26 tag=anonymous box=inline
|
|
content: (0, 10.719999, 0, 0)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#27 tag=anonymous box=anon
|
|
content: (0, 10.719999, 23.475595, 18.72)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "III. "
|
|
LayoutBox node=#17 tag=anonymous box=anon
|
|
content: (0, 10.719999, 97.98449, 18.72)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "Chapter Three"
|
|
LayoutBox node=#19 tag=h3 box=block
|
|
content: (8, 142.272, 784, 22.464005)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 18.72 0 18.72 0
|
|
inline_context: 1 lines, height=22.464005, max_width=111.49533
|
|
line[0]: rect=(8, 142.272, 111.49533, 22.464003) fragments=3
|
|
frag[0]: rect=(8, 144.14401, 18.14273, 18.72) text="IV." start=true end=true
|
|
frag[1]: rect=(29.7163, 144.14401, 54.99172, 18.72) text="Chapter" start=false end=false
|
|
frag[2]: rect=(88.281586, 144.14401, 31.213745, 18.72) text="Four" start=false end=false
|
|
LayoutBox node=#28 tag=anonymous box=inline
|
|
content: (0, 10.719999, 0, 0)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#29 tag=anonymous box=anon
|
|
content: (0, 10.719999, 21.7163, 18.72)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "IV. "
|
|
LayoutBox node=#20 tag=anonymous box=anon
|
|
content: (0, 10.719999, 89.77903, 18.72)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "Chapter Four"
|