- From: jfkthame via GitHub <sysbot+gh@w3.org>
- Date: Tue, 09 Apr 2024 17:18:20 +0000
- To: public-css-archive@w3.org
jfkthame has just created a new issue for https://github.com/w3c/csswg-drafts: == [css-text] Should text-wrap-style:balance be allowed to affect the block height? == The description of [text-wrap-style: balance](https://drafts.csswg.org/css-text-4/#valdef-text-wrap-style-balance) says that balancing "must not change the number of line boxes the block would contain if [text-wrap](https://drafts.csswg.org/css-text-4/#propdef-text-wrap) were set to auto." My assumption is that this restriction is intended to ensure that applying the 'balance' setting to a block of text will only adjust the line-breaking used within the block but will not affect layout outside it by changing its dimensions (potentially leading to overflow or moving other elements on the page). However, this restriction is not actually sufficient to ensure this "safety". Even if the number of line boxes doesn't change, content moving from one line to another may cause changes in line heights and therefore in the overall height of the block. I think that undermines the intention of the "must not change the number of lines" restriction. [Here's a codepen](https://codepen.io/jfkthame/pen/jORxBPV) with a couple of simple examples. Rendering (in Chrome Canary): ![image](https://github.com/w3c/csswg-drafts/assets/1706499/82b98302-5f11-469a-8177-cf714463c978) As this demonstrates, the revised line-breaking of text-wrap:balance has the potential to make the block either shorter or taller, either of which might have unexpected consequences for the containing layout. I propose that we should tighten up the restriction on text-wrap-style:balance to say something like "...must not change the number of line boxes the block would contain if text-wrap were set to auto, nor alter its intrinsic size." Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10186 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 9 April 2024 17:18:21 UTC