Skip to content

fix(odf): put a page-anchored frame on the page, and lay a document out on the master page it names - #690

Merged
andiwand merged 2 commits into
mainfrom
fix/odf-page-anchored-frames
Aug 14, 2026
Merged

fix(odf): put a page-anchored frame on the page, and lay a document out on the master page it names#690
andiwand merged 2 commits into
mainfrom
fix/odf-page-anchored-frames

Conversation

@andiwand

@andiwand andiwand commented Aug 14, 2026

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

Stacked on #689. Both found on Din_5008_business_letter.ott, the letter template #688 adds, compared against LibreOffice's render of the same file.

A frame took its placement from its text wrap alone. Only as-char was special-cased; everything else went to a float or a margin box. All five frames in that template are text:anchor-type="page" with svg:x/svg:y, so the address block, the contact block, the date and the footer floated into the running text and the body wrapped around them in a narrow column. A frame anchored to the page now sits at its own coordinates on the page box; only a frame anchored in the text reads the wrap. Text does not flow around a page-anchored frame — css cannot both place a box away from where it sits in the flow and let the flow react to it, and the frame's place in the flow is not where it lands on the page.

A text document took the first master page in the file. A paragraph may name the one its page uses (ODF 20.283), which is how that template asks for the 9.85cm top margin that leaves room for its letterhead — without it the body started at 2cm and ran under the address boxes. One page box is all this renders, so only a name that still precedes every written word counts: taking the first one named anywhere put mixed-layout.odt (portrait) and style+svm-various-2.odt (landscape) onto the page a single later section had asked for, both of which now keep the orientation LibreOffice opens them at. Frames are passed over on the way — they are anchored, not written.

Three documents change: the template above, and ruski.odt and efficiency+style-big+various-1.odt, which each name a First Page master of their own and now get its margins.

Also: the reference output's shipped css and js are refreshed. They had drifted from what the engine emits (document.css still carried *{margin:0;position:relative} from before #685; text.css was 394 bytes against 1317 today, from #679/#682/#683). Since every page links ../../resources/, the same html rendered differently in the reference tree than freshly generated — confusing to look at, and it makes CI's screenshot compare compare two stylesheets as much as two renders. The drift was deliberately left alone in an earlier pass; this refreshes it.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5a0e00d1a3

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/odr/internal/html/document_style.cpp
@andiwand
andiwand force-pushed the fix/pdf-text-baseline-cmyk-jpx branch from 2aac9d2 to fab329c Compare August 14, 2026 18:43
@andiwand
andiwand force-pushed the fix/odf-page-anchored-frames branch from 5a0e00d to 6d6a58f Compare August 14, 2026 18:44
@andiwand andiwand changed the title fix(html): put a page-anchored frame on the page, not in the text fix(odf): put a page-anchored frame on the page, and lay a document out on the master page it names Aug 14, 2026
Base automatically changed from fix/pdf-text-baseline-cmyk-jpx to main August 14, 2026 18:47
@andiwand
andiwand force-pushed the fix/odf-page-anchored-frames branch from 6d6a58f to 522c4cc Compare August 14, 2026 18:50
andiwand and others added 2 commits August 14, 2026 20:52
A frame took its placement from its wrap alone, so one anchored to the
page floated into the running text: a letter's address, date and footer
boxes landed between the paragraphs instead of in their fields. Only a
frame anchored in the text reads the wrap now; one anchored to the page
sits at its own coordinates on it.

The reference output also picks up the shipped css and js, which had
drifted from what the engine emits since #679, #682, #683 and #685 - the
same html rendered differently there than freshly generated.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J8PCMZUVxuGstmmgQzEdif
A text document took the first master page in the file. A paragraph may
name the one its page uses (20.283), which is how a letter template asks
for the margins that leave room for its letterhead - 9.85cm at the top of
the DIN 5008 template, where the address boxes sit.

One page box is all this renders, so only a name that still precedes
every written word counts; taking a later one put a whole document on the
landscape page a single section had asked for. Frames are passed over on
the way: they are anchored, not written.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J8PCMZUVxuGstmmgQzEdif
@andiwand
andiwand force-pushed the fix/odf-page-anchored-frames branch from 522c4cc to 968c0d1 Compare August 14, 2026 18:53
@andiwand
andiwand merged commit dc51b5d into main Aug 14, 2026
23 checks passed
@andiwand
andiwand deleted the fix/odf-page-anchored-frames branch August 14, 2026 18:53
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