[css-text] Should text-wrap-style:balance be allowed to affect the block height? · Issue #10186 · w3c/csswg-drafts · GitHub
Skip to content

[css-text] Should text-wrap-style:balance be allowed to affect the block height? #10186

Closed
@jfkthame

Description

The description of text-wrap-style: balance says that balancing "must not change the number of line boxes the block would contain if 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 with a couple of simple examples. Rendering (in Chrome Canary):
image

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."

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions