Skip to content

test(html): keep page margins in the output tests - #672

Merged
andiwand merged 1 commit into
mainfrom
test/output-paging
Aug 9, 2026
Merged

test(html): keep page margins in the output tests#672
andiwand merged 1 commit into
mainfrom
test/output-paging

Conversation

@andiwand

@andiwand andiwand commented Aug 9, 2026

Copy link
Copy Markdown
Member

html_output_test.cpp left text_document_margin at its default, so every text document in the reference output was rendered reflowed to the viewport.

The Android viewer defaults the setting to on (PaginationSetting.DEFAULT_ENABLED"On unless the user says otherwise: the margins are the document as it was written."). So the output the tests have been showing is the one most readers never see, and the paged path was covered by nothing at all.

What changes

Only text documents move — presentations and drawings are paged either way, and spreadsheets ignore the setting. For those 48 files the output gains:

  • <body class="odr-body odr-background"> and the .odr-pages / .odr-page-outer / .odr-page-inner boxes, carrying the document's real page size and margins
  • a fit-width viewport instead of initial-scale=1.0, since is_paged_content now holds for text
-<body class="odr-body">
-  <div>
-    <x-p style="display:block;margin-top:0in;…">
+<body class="odr-body odr-background">
+  <div class="odr-pages">
+    <div class="odr-page-outer" style="width:8.2673in;min-height:11.6925in;">
+      <div class="odr-page-inner" style="margin-right:0.7874in;margin-top:0.7874in;…">
+        <x-p style="display:block;margin-top:0in;…">

Worth being precise about the name: the flag is the page margins, not pagination. The document stays one continuous sheet — it does not break into pages.

Test plan

  • odr_test --gtest_filter='*HtmlOutput*' — 234 passed, 9 skipped (the pre-existing skips), 0 failed
  • Reference output needs regenerating before this merges — 48 html files under odt/, docx/, doc/, … change

🤖 Generated with Claude Code

`text_document_margin` was left at its default, so every text document in the
reference output was rendered reflowed to the viewport. The Android viewer
defaults the setting to on, which means the output the tests have been showing
is the one most readers never see, and the paged path — page box, backdrop,
fit-width viewport — was covered by nothing at all.

Turn it on. Only text documents move; presentations and drawings are paged
either way, and spreadsheets ignore the setting. 101 reference files gain the
`.odr-pages` / `.odr-page-outer` / `.odr-page-inner` boxes and lose
`initial-scale=1.0`; the pins follow.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017ACZ1RcX9pxoMZWBaTdDRU
@andiwand
andiwand force-pushed the test/output-paging branch from 1f38185 to ee7fcbf Compare August 9, 2026 13:00
@andiwand
andiwand marked this pull request as ready for review August 9, 2026 13:02
@andiwand
andiwand merged commit 02bf134 into main Aug 9, 2026
32 of 33 checks passed
@andiwand
andiwand deleted the test/output-paging branch August 9, 2026 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant