Skip to content

CSS text-wrap-style: pretty #993

Closed
Closed

Description

@kojiishi

Request for Mozilla Position on an Emerging Web Specification

Other information

Note another value balance is at #755.

Activity

  1. zcorpan commented on Mar 11, 2024

    @zcorpan
    Member

    @jfkthame thoughts?

  2. jfkthame commented on Mar 11, 2024

    @jfkthame
    Contributor

    A couple of things come to mind:

    • I agree that it's desirable to have the option of better line-breaking than the default "greedy" algorithm that all browsers have traditionally used.
    • Such an option needs to be opt-in for authors (rather than simply a change in browser behavior, even though it could be argued to be an overall improvement) because
      • it has the potential to unexpectedly disrupt the layout of existing content
      • in some cases (especially editable content) the stability of the greedy algorithm may be preferred
      • a "prettier" algorithm is likely to come at significant performance cost
    • Therefore, in principle I'm in favor of text-wrap-style: pretty (or some similar/equivalent mechanism)

    Having said that, I do have some concerns:

    • From an implementation point of view, it may be difficult to fully implement something akin to Knuth-Plass line breaking, which I think is the common understanding of what "pretty" ought to mean, or at least a good guide. The interaction with other aspects of CSS (such as floats and fragmentation) can make things pretty complex. (More so than in TeX, for instance.)
    • Some implementers (I'm particularly looking at Blink here) seem to have focused quite narrowly on preventing short last lines. I believe this is an inadequate approach that fails to deliver what text-wrap-style: pretty promises, and indeed in some cases can make a block/paragraph look substantially worse than its default layout. I would be quite unhappy to see anyone ship such a crippled implementation of `text-wrap-style: pretty", as
      • it has the potential to significantly mislead authors as to what they should expect from the feature
      • if it becomes widely used in that state, it may create compat problems for eventually shipping more complete versions.
  3. added
    ready to add
    on Mar 11, 2024
  4. moved this from Unscreened to Position identified in standards-positions reviewon Aug 5, 2024
  5. closed this as completedby moving to Position identified in standards-positions reviewon Aug 5, 2024
  6. reopened this on Aug 5, 2024
  7. moved this from Position identified to Unscreened in standards-positions reviewon Aug 5, 2024
  8. changed the title [-]CSS `text-wrap-style: pretty` property[/-] [+]CSS `text-wrap-style: pretty`[/+] on Sep 9, 2024
  9. self-assigned this
    on Sep 9, 2024
  10. removed
    ready to add
    on Dec 9, 2024
  11. moved this from Needs a PR to Position is proposed in standards-positions reviewon Dec 9, 2024
  12. added
    venue: W3C
    on Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Fields

Priority

None yet

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions