Files
rust_browser/tests/goldens/expected/051-child-vs-descendant.dl.txt
Zachary D. Rowitsch 9c05fb503a Fix CSS selector descendant combinators lost during reconstruction
The tokenizer strips whitespace before each token, and the selector
reconstruction heuristic only re-inserted spaces before Ident tokens.
This caused descendant combinators to be lost when the right-hand side
started with `.`, `#`, `:`, or `[` (e.g. `.foo .bar` became `.foo.bar`).

Replace token-by-token selector text reconstruction with raw text
extraction from the original CSS source using byte offsets already
tracked by the tokenizer. This preserves whitespace, comments are
stripped separately, and whitespace is normalized.

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

25 lines
1.8 KiB
Plaintext

DisplayList items=23
SolidRect rect=(8, 8, 784, 19.2) color=#0000ff
Text rect=(8, 8, 32.963287, 16) text="Direct" color=#000000 font_size=16
Text rect=(44.01762, 8, 26.18502, 16) text="child" color=#000000 font_size=16
Text rect=(73.256966, 8, 41.033775, 16) text="(should" color=#000000 font_size=16
Text rect=(117.34507, 8, 13.85022, 16) text="be" color=#000000 font_size=16
Text rect=(134.24962, 8, 27.6652, 16) text="blue)" color=#000000 font_size=16
Text rect=(8, 27.2, 24.634361, 16) text="NOT" color=#000000 font_size=16
Text rect=(35.688694, 27.2, 6.590308, 16) text="a" color=#000000 font_size=16
Text rect=(45.333336, 27.2, 31.612335, 16) text="direct" color=#000000 font_size=16
Text rect=(80, 27.2, 26.18502, 16) text="child" color=#000000 font_size=16
Text rect=(109.23935, 27.2, 11.148312, 16) text="of" color=#000000 font_size=16
Text rect=(123.44199, 27.2, 39.94126, 16) text=".parent" color=#000000 font_size=16
Text rect=(166.43759, 27.2, 17.891336, 16) text="(no" color=#000000 font_size=16
Text rect=(187.38327, 27.2, 27.6652, 16) text="blue)" color=#000000 font_size=16
SolidRect rect=(8, 46.4, 784, 19.200005) color=#008000
Text rect=(8, 46.4, 32.963287, 16) text="Direct" color=#000000 font_size=16
Text rect=(44.01762, 46.4, 64.317184, 16) text="descendant" color=#000000 font_size=16
Text rect=(111.38914, 46.4, 39.635826, 16) text="(green)" color=#000000 font_size=16
SolidRect rect=(8, 65.600006, 784, 19.199997) color=#008000
Text rect=(8, 65.600006, 39.27166, 16) text="Nested" color=#000000 font_size=16
Text rect=(50.325993, 65.600006, 64.317184, 16) text="descendant" color=#000000 font_size=16
Text rect=(117.6975, 65.600006, 25.879587, 16) text="(also" color=#000000 font_size=16
Text rect=(146.63142, 65.600006, 36.111603, 16) text="green)" color=#000000 font_size=16