Layout Regression Tests

This EPUB exercises recent parser edge cases around nested block styles and image wrappers.

Recommended settings: Embedded Style ON, Paragraph Alignment set to Book Style or Justify.

Nested horizontal margin inheritance for sibling blocks

Vertical paragraph spacing should not explode with nested wrappers

Image wrapper spacing should apply to the image, not leak into following text

Hidden images should not leave a large blank gap before the next paragraph

Nested Horizontal Margin Inheritance

This chapter mirrors the c1/c2/c3/c4 example behind PR 1582.

Expected: the first paragraph is visibly more indented than the second, but both still inherit the outer wrapper indentation.

C3 paragraph. This text should have the largest left indent because it inherits c1, c2, and c3. Repeat text to make the paragraph wrap across multiple lines and make the effective left inset obvious while reading.

C4 paragraph. This text should still inherit the outer c1 indent, but not the inner c2 indent. It should therefore appear less indented than the paragraph above, not flush with the body text.

Reference paragraph outside the wrappers. This paragraph should align with the normal body text and helps compare the wrapper indentation against the baseline.

Nested Vertical Margin Sanity

Expected: wrapper nesting should not create an oversized blank vertical gulf between these paragraphs.

Nested vertical spacing paragraph. There should be some breathing room above and below, but not dramatically more than a normal section break.

Sibling paragraph after the nested block. Spacing before this paragraph should feel normal and should not keep growing with every ancestor wrapper.

Baseline paragraph after the wrapper section. This should not be pushed far down the page.

Image Wrapper Spacing

Expected: the wrapper's margins should create space around the image, and the paragraph after the image should start with normal spacing rather than inheriting a second copy of that gap.

Paragraph after wrapped image. If the wrapper spacing leaks, this paragraph will begin too far down the page. If container width is ignored, the image may also appear too wide for the wrapper.

Hidden Image Spacing Reset

Expected: the hidden image wrapper should not leave a large blank gap before the following paragraph.

Paragraph after hidden image. This should follow with near-normal spacing, not the large gap that would be appropriate for a visible wrapped image.