RESOLVED DUPLICATE of bug 131214 289850
`break-after: avoid-column;` not working
https://bugs.webkit.org/show_bug.cgi?id=289850
Summary `break-after: avoid-column;` not working
Jorn Mineur
Reported 2025-03-15 07:11:02 PDT
Created attachment 474577 [details] Screenshot of the web page showing the bug, with inspector opened This website, https://marcellosplace.com/ , has an index of recipe category groups at the bottom of every page. Each category group is marked up as a UL preceded by an H3. The H3 has `break-after: avoid-column;` to prevent it from being widowed from the UL items. This `break-after` is ignored. The problem is 100% reproducible (not random). Expected behavior: based on the code, the H3 should always be wrapped to the next column. Other browsers: Blink renders the code as expected. Relevant part of the HTML: ``` <div class="grouping"> <h3>Dish Type</h3> <ul class="categories"> <li> <a href="/categories/biscuit/">biscuit</a> <span class="count">1</span> </li> <li> <a href="/categories/cake/">cake</a> <span class="count">8</span> </li> ``` Associated CSS: ``` /*****************************************************/ /* CATEGORY INDEX */ /*****************************************************/ div.recipe-categories-container { max-width: calc(4 * 9rem + 5 * 28px); margin: 4rem auto; .recipe-categories { font-family: var(--sans-serif); margin: 2rem 28px; } .grouping-container { columns: 9rem 4; gap: 28px; .grouping { font-size: var(--small); margin-bottom: 1em; } } h2 { font-family: var(--sans-serif); font-weight: 300; font-feature-settings: 'smcp'; margin: 1.5em auto; text-align: center; } h3 { break-after: avoid-column; font-weight: bold; margin-bottom: .5em; } ul.categories { li { margin: .25em 0; /* Avoid widows and orphans */ &:nth-child(-n+2) { break-after: avoid-column; } &:nth-last-child(-n + 2) { break-before: avoid-column; } } a { text-decoration-color: var(--lighter-cyan); } span.count { color: var(--lighter-grey); font-size: var(--small); margin-left: .25em; } } } ```
Attachments
Screenshot of the web page showing the bug, with inspector opened (399.32 KB, image/png)
2025-03-15 07:11 PDT, Jorn Mineur
no flags
Karl Dubost
Comment 1 2025-03-21 02:44:27 PDT
This is also working on Firefox.
Karl Dubost
Comment 2 2025-03-21 02:46:40 PDT
Thanks Jorn. This is a duplicate of Bug 131214 It's part of the issues for fragmentation code. https://wpt.fyi/results/css/css-break?label=master&label=experimental&aligned *** This bug has been marked as a duplicate of bug 131214 ***
Note You need to log in before you can comment on or make changes to this bug.