Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2c2169de5e678fb93f919a291829259dd70623d0
      
https://github.com/WebKit/WebKit/commit/2c2169de5e678fb93f919a291829259dd70623d0
  Author: Alan Baradlay <[email protected]>
  Date:   2026-05-10 (Sun, 10 May 2026)

  Changed paths:
    A LayoutTests/fast/multicol/nested-columns-three-levels-expected.html
    A LayoutTests/fast/multicol/nested-columns-three-levels.html
    M Source/WebCore/rendering/RenderLayer.cpp

  Log Message:
  -----------
  Nested multicolumn (3+ levels) fails to paginate content across pages
https://bugs.webkit.org/show_bug.cgi?id=314421

Reviewed by Elika Etemad.

Bug: when you have an outer multicolumn (or top level pagination) containing a 
middle
column-count element containing an inner column-count element, content only
appears on page 1. Pages 2+ are blank, and page 1 is not clipped to the page
height.

The painting system splits layers into fragments for each pagination level by
recursing through collectFragments(). The recursion has two paths for storing
paginationOffset on fragments:

1. Outermost pagination (no parent pagination layer): stores the column offset
   plus the offset-from-root. Always correct.

2. Nested pagination (has parent pagination layer, ApplyRootOffsetToFragments):
   stores the offset for fragments that will be consumed as ancestorFragments by
   the next level up in the call stack. This was only storing the local offset,
   discarding the ancestor's page offset.

With 2 levels, the inner level calls into the outer which hits path 1 and
returns correct fragments. The inner uses them directly in moveBy(). Path 2
never executes at the inner level (it has DoNotApply from paintLayerContents).

With 3 levels (and up), the inner calls the middle, the middle calls the outer. 
The
outer hits path 1, returns correct fragments to the middle. The middle hits
path 2 - it must package those fragments for the inner to use. Path 2 was only
storing the local offset, so when the inner read 
ancestorFragment.paginationOffset
it was missing the outer page offset. This caused moveBy() to position content
identically for all pages. After clipping with the correctly-positioned page
clip rect, the intersection was empty on pages 2+.

Similarly, paginationClip was not being accumulated through intermediate levels,
so the inner level clipped against the middle set's full-height clip rather than
the tighter outer page clip, leaving page 1 unclipped.

The fix stores the full accumulated offset and intersects the clip at each
intermediate level so nested levels receive correct positioning and constraints.

Test: fast/multicol/nested-columns-three-levels.html

* Source/WebCore/rendering/RenderLayer.cpp:
(WebCore::RenderLayer::collectFragments):

Canonical link: https://commits.webkit.org/312973@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to