-
Notifications
You must be signed in to change notification settings - Fork 719
[css-overflow-4] [css-break] How does widows
and similar properties affecting fragmentation interact with continue: discard
?
#9235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
And similarly for orphans, actually... <div style="continue: discard; height: 4lh; orphans:2; widows:1;">
Line 1<br>
Line 2<br>
Line 3<br>
<div>
Line 4<br>
Line 5
div>
div> I agree that it's somewhat surprising for orphans and widows to have an effect here. By the way, Chromium has received numerous bug reports over the years on orphans / widows being honored at all in multicol, especially with tall 100% wide images or inline blocks where authors expect a perfect break opportunity between every line. That said, as long as continue:discard is defined as establishing a fragmentation container, what else can we do? Is continue:discard mostly a way of defining line-clamp [1], a shorthand? In that case, maybe just define that line-clamp != none as also setting orphans and widows to 1? |
Yeah this makes me think that the @emilio 's solution is more desirable still. Fragmentation has lots of side-effects which aren't desirable for line-clamping. |
One possible solution to this is to have the |
widows
interact with continue: discard
?widows
and similar properties affecting fragmentation interact with continue: discard
?
The spec now says:
I think it would be fine to have a Note indicating that in the First, a question: why include "break-inside" in the list of excluded properties? Unlike Either way, I think we can accomplish the desired effect in two ways:
|
Uh oh!
There was an error while loading. Please reload this page.
continue: discard
makes the div into a fragmentainer and discards any content after the first break, forced or unforced. Since the height is4lh
, "Line 5" is certainly after the first break, but what about "Line 4"? If following fragments were not discarded, "Line 4" would be after the unforced break in order to avoid a single widow in the second fragment, but should that work the same if the second fragment is discarded?The spec text for
continue: discard
does not say anything about how an unforced break is computed, so it is reasonable to assume that the same behavior applies as for non-discarding fragmentation. On the other hand, since the spec text forwidows
talks about lines in a fragment, you could see this as not applying to discarded fragments.One thing to note is that the inital value of
widows
is 2, so it might come as a surprise to developers that the clamping sometimes happens one line earlier than it should, depending on the number of lines in thecontinue: discard
box. And importantly, there would be no indication anywhere that it'swidows
that is causing this effect. (It certainly came as a surprise to me when working on my in-progress implementation ofcontinue: discard
in Chromium, taking me a while to realize it was not a bug in my layout code.)The text was updated successfully, but these errors were encountered: