fix: a table cell's metrics follow LibreOffice, not the browser

Two measured deviations, both worth ~1mm a row on a fixture: a cell's first block
got the space above that LibreOffice adds nowhere in a cell, and a repeating
header row rendered centred and bold because it is a <th> and the UA says so.
Pagination's page-top-drop detection now skips cell leaves, or the space that
is never there would read as a decoration to add back.
This commit is contained in:
Steffen Becker committed 2026-08-10 13:49:12 +00:00
1 parent 7b8c7e21f5
commit 7a4174cd07
3 files changed
+25 -1

No files matched your search

+10
View File
@@ -487,6 +487,12 @@
padding-top: 0;
margin-top: var(--space-before);
}
/* LibreOffice adds no space above the first block of a table cell (measured; its
AddParaTableSpacingAtStart), Word does — so it follows the document's spacing model. */
.paper:not([data-spacing-model='max']) .tiptap :is(td, th) > :first-child {
padding-top: 0;
margin-top: 0;
}
/* The line box: the paragraph's spacing factor times its font's natural line height.
Either half may come from the style rule or, nearer, from the block's own attrs
@@ -636,6 +642,10 @@
border: 1px solid #000;
padding: var(--cell-pad, 0 0.19cm);
vertical-align: top;
/* A repeating header row is a <th>, and no word processor centres or bolds its text
for that reason — drop the two UA defaults so the cell follows its own style. */
text-align: inherit;
font-weight: inherit;
/* Positioning context for the column-resize handle widget (a child div the
resize plugin places at the cell's right edge). */
position: relative;