Repeated table headers lose content

Blink>Layout / fragmentation 3 issues, 3 stacked CLs In review

At a glance

IssueSymptom in a repeated headerCLState
400996807 <button>, <select>, <input>, <textarea> paint on the first page only 8650938 Fixed
350858753 <g transform> inside <svg> paints on one page only 8654238 Fixed
434108536 painting and hit-testing fall back to LayoutObject traversal 8654438 Fixed
Kill switches, all default on: RepeatableFormControls · RepeatableSvgContent · ReplacedContentFragmentTraversal. Every Before image below is the same binary with that flag off. Click any image for full size.

1. Form controls

CL 8650938 · #400996807
Was
CanPaintMultipleFragments() refused every form control.
Why
Text controls were not fragment-traversable, so repeating one hit a duplicated display item id and hit-testing only ever reached the first fragment.
Now
The inner-editor hit test moved into the fragment traversal path, both LayoutTextControl*::NodeAtPoint() overrides are gone, and both exceptions with them.

<button>, printed across 2 pages

button on page one only
button on both pages
diff mask
2086 px differ, all on page two.

<input> and <textarea>, printed across 2 pages

input missing on page two
input and its value on both pages
455 px differ.
textarea missing on page two
textarea on both pages
698 px differ.

On screen: <button> and <select> across 3 column fragments

Live in your browser: unpatched Chrome fills the first fragment only.
button in the first fragment only
button in every fragment
4116 px differ.
select in every fragment
<select>, after: 1330 px differ from before.
Why <input> text does not repeat on screen

The inner editor is a scroll container, and CanPaintMultipleFragments() refuses repeated scroll containers outside printing. Untouched by this stack; the box repeats, the value does not.

2. Transformed SVG

CL 8654238 · #350858753
Was
Reproduces on stock Chromium 154: translated groups vanish from the repeated header.
Why
SVG children generate no fragments, PrePaintTreeWalk skipped them, so every SVG object had one FragmentData and the transform node stayed anchored to one page. The others painted outside their page clip.
Now
SVG children are walked once per container fragment, and the SVG painters take the fragment being painted from PaintInfo.

Reporter's case, printed across 3 pages

repeated headers keep only the untransformed rect
Only the untransformed green rect survives.
all three rects on every page
diff mask
3200 px differ.
Print this page to see it; on screen it is fine.
Confirmation on stock Chromium 154 and the half-fix that fails

Printed with Page.printToPDF, no patches. Page one has all three rects, the repeated header on page two keeps only the untransformed one.

stock Chromium 154, page two

Walking the SVG subtree per fragment alone is not a fix: there is still one FragmentData to write into, so the last fragment wins and the bug flips to page one.

intermediate build with the bug flipped to page one

3. Replaced content

CL 8654438 · #434108536
Was
Replaced content was the last type excluded from CanTraversePhysicalFragments().
Why
ReplacedPainter and EmbeddedContentPainter know nothing about fragments; deleting the exception alone fails 190 paint unit tests, because they then paint nothing.
Now
BoxFragmentPainter hands them the fragment to paint or hit test. What is still excluded generates no fragments at all: table columns and non-block SVG.
Repeating an <iframe> is a separate policy call

CanPaintMultipleFragments() allows repeated images and SVG roots but not other replaced content, so an <iframe> in a repeated header is unchanged by this stack (diff 0). Lifting that restriction was tried: the embedded view then painted on no page at all, so it is left to the owners.

empty diff mask for the iframe case

Verification

Reproducing the images

node capture.mjs after    # screen, 3 column fragments
node capture.mjs before   # same binary, kill switch off

# printed pages, via the web test runner
cp print-cases/*.html third_party/blink/web_tests/printing/scratch/
run_web_tests.py -t Default --reset-results printing/scratch
run_web_tests.py -t Default --reset-results \
  --additional-driver-flag=--disable-blink-features=RepeatableFormControls \
  printing/scratch
CL 8650938 CL 8654238 CL 8654438 capture.mjs