-
Notifications
You must be signed in to change notification settings - Fork 719
[css-break][css-display] box-decoration-break and multi-box inline elements #1706
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
I still consider "multi-box" inline elements created by block box intrusion contradicting the Priority of Constituencies principle. I see completely no reason for them to be any different from inline boxes fragmented between different page or column boxes, other than theoretical difficuilty to describe the the box tree in the first case. And I see no reasons for the author to expect them to render differently. Are there really no other way to resolve the box tree problem in that case other than making inline element "multi-box"? Can't we, for example, consider two anonymous block boxes created by the block intrusion a single anonymous block box fragmented into two parts instead, with single, but fragmented, inline box inside? |
@SelenIT I don't disagree, saying that the inline element is broken into multiple boxes seems an ad-hoc solution which doesn't completely work. But I prefer the box tree to be a well-defined tree, and I don't see any great solution. You propose that the anonymous blocks should be a single box, fragmented. And I guess there would be a single inline box which would be the child of the anonymous box. But then where do you place the block-level which splits the inline in the box tree? I guess it should be a sibling of the anonymous box, but should it be the previous or the following sibling? I guess it can't be the previous one, this could break the determination of the first formatted line of the parent. Not sure if there are problems if it's the following sibling. |
This is a case of a single box with multiple fragments. See https://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level |
@fantasai Sorry but @tabatkins disagrees. It's not a single box with multiple fragments, the element generates multiple boxes instead. See #1477. |
Yes, this is very much not "a single box with multiple fragments", or at least, it's very unclear precisely what it is right now. We talk about it in terms of splitting into several boxes, with the block box descendant becoming a sibling box to the top-level inline box. For many purposes, it's indistinguishable from that; that is, the end effect of:
is identical to the end effect of:
Not for all purposes, certainly, but layout treats the two equivalently, for instance. (Unless the inline's container intervenes before splitting can happen and blockifies or inlinifies the element, of course.) |
Sorry, but browsers seem to disagree (see a fork of @Loirooriol's example). The rendering effect, regarging borders, paddings etc, is clearly different. Yes, CSS2.1 describes this difference (not expressible in CSS2.1 terms!) as a special case of two boxes rendering, but this was before the fragmentation concept, and visually the behavior of inline content in this situation looks rather indistinguishable from the fragmentation of inline content fragmented between fragments of a block box fragmented between two column or page boxes. Also, the CSS2.1 uses the term "the block-level box contained in the inline box". Maybe, if the box is now a pre-rendering concept (according to your explanation in #1604), it would be better really to consider this situation as a three block boxes contained in the single inline box, and two inline box fragments divided between two of them? |
A proposal:
|
Minutes from the WG discussion on block-in-inline splits: the two parts of the inline are fragments of a single box. https://lists.w3.org/Archives/Public/www-style/2018May/0043.html |
Tagging against display, since we might want to reference these effects from its Introduction, to clarify that they're considered cases of fragmentation. |
Added cross-references about fragments being caused by bidi and X-in-Y splits to CSS Display and CSS Fragmentation: 7f6b964 a049017 Remaining question is, should we allow |
Patch (which could maybe use some wordsmithing): column spanner)
+ splits an incompatible ancestor
+ (such as an inline box / block container).
+ Otherwise such breaks are always handled as ''slice''.
+ See [[css-writing-modes-3#bidi-algo|Applying the Bidirectional Reorderign Algorithm]]
+ in [[css-writing-modes-3#text-direction|CSS Writing Modes]],
+ CSS2§9.2 Block-level elements and block boxes,
+ and CSS Multi-column Layout §6 Spanning Columns.
- For inline elements, which side of a fragment is considered the broken edge"> diff --git a/css-break-3/Overview.bs b/css-break-3/Overview.bs index f3cab08..a7748ed 100644 --- a/css-break-3/Overview.bs +++ b/css-break-3/Overview.bs @@ -1036,10 +1036,19 @@ Fragmented Borders and Backgrounds: the 'box-decoration-break' property on the left, the value ''slice'', on the right the value ''clone''. UAs may also apply 'box-decoration-break' to control rendering - at bidi-imposed breaks, i.e. when bidi reordering causes an inline - to split into non-contiguous fragments. Otherwise such breaks are - always handled as ''slice''. +UAs may also apply 'box-decoration-break' + to control rendering at bidi-imposed breaks-- + i.e. when bidi reordering causes an inline to split into non-contiguous fragments-- + and/or at display-type–imposed breaks-- + i.e. when a higher-level display type + (such as a block-level box / column spanner) + splits an incompatible ancestor + (such as an inline box / block container). + Otherwise such breaks are always handled as ''slice''. + See [[css-writing-modes-3#bidi-algo|Applying the Bidirectional Reorderign Algorithm]] + in [[css-writing-modes-3#text-direction|CSS Writing Modes]], + CSS2§9.2 Block-level elements and block boxes, + and CSS Multi-column Layout §6 Spanning Columns.For inline elements, which side of a fragment is considered the broken edge |
The CSS Working Group just discussed The full IRC log of that discussion |
CSS Break says that
box-decoration-break
controls what happens when a box has multiple fragments.It does not say anything about an element which generates multiple boxes, each one with a single fragment. This can happen when an inline element is broken by a block-level descendant.
So my understanding is that if you have (jsfiddle)
then the element styles are assigned to each box independently (according to CSS Display), so each box has it's own border, padding and background, even if
box-decoration-break
isslice
. However, no browser seems to do this:Should this case be treated like when a box has multiple fragments, i.e. should all boxes share the same margin, border, padding and background? Should only some be shared? None?
The text was updated successfully, but these errors were encountered: