Re: [csswg-drafts] [css-text-4] add 'avoid' to text-wrap-mode (#9448)

> Does an inherited `text-wrap-mode: avoid` still allow the children of an element that already avoids text wrapping to more strongly avoiding wrapping?

Not in any obvious way I can think of, and that ability is the reason why it is designed the way it is at the moment.

> Also, something I'm not sure about from the current `wrap-inside: avoid` language of «If boxes with [avoid](https://drafts.csswg.org/css-text-4/#valdef-wrap-inside-avoid) are nested and the UA must break within these boxes, a break in an outer box must be used before a break within an inner box may be used.»: if a break has already occurred in an outer box, and a break is used within an inner box, may that outer break be collapsed/reversed if there's space? 

I agree that is not 100% clear from the spec. I'd say no, you don't get skip/undo breaking on the outer box just because you had to break in the inner one, that would go against the sense of hierarchy.

In example 4, I think you could take the break after `h` rather than before, because either breaks are at at the same level of hierarchy. What you don't get to do is put `h` and `i` on the same line in case 5 (assuming the `h` somehow still starts the line: let's pretend for instance that there are two `h`s at the same level in the tree): even though the break between `k` and `l` mean you could now fit `h` and `i j k` onto one line, you don't get to undo the break between `h` and `i`.

But I guess that's open to interpretation, and that there's (at least) two questions:
* if an inner box had to be broken, and there's space left over on the end of the line after it, can you fill that space with subsequent content, or do you have to first take a break at the end-edge of that inner box, to respect the hierarchy? (that's case 4 as you were talking about)
    → I'd say it's fine, you can fill that space. (If the thing you're filling it with would itself fit.) 
* When an inner box has to be broken be cause it is too long to fit a line even if it is alone in it, are you allowed to place the now shorter first chunk of it on an earlier line if there's room enough for that?
    → I'd say no, that breaks the hierarchy.

But I do realize that this preference of mind isn't symmetric. I think I'd be more willing to change my mind on the first one than on the second.

-- 
GitHub Notification of comment by frivoal
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9448#issuecomment-1859763851 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 18 December 2023 08:26:54 UTC