Skip to content

[css-text-4] Renaming text-space-* to white-space-* #8273

Closed

Description

@fantasai

In #448 @SebastianZ asked about renaming the text-space-collapse/trim properties to white-space-*. Historically there was some kind of conflict problem with XSL:FO's white-space-collapse, which takes a different set of values, which is why we had to rename it to something else.

I'm filing this issue to ask two questions:

  • Do we still have a conflict problem with XSL:FO?
  • If not, do we want to switch up the names to white-space-*?

CC @MurakamiShinyu @liamquin

Activity

  1. liamquin commented on Dec 31, 2022

    @liamquin

    white-space-collapse in XSL-FO [1] when true replaces sequences of white space other than linefeed with the first white space in a sequence, so e.g. multiple spaces get turned into a single space everywhere.

    white-space-treatment in XSL-FO [2] controls whether spaces go away around linefeeds, e.g. including after wrapping.

    Although XSL-FO is certainly being used, and there are multiple active implementations, i'm not sure how much it matters if CSS itself has a property with a name used by XSL-FO. You could think of XSL-FO as an XML vocabulary that incorporates CSS for styling, though. Because of weird W3C process rules, the XSL-FO spec actually includes a copy of the CSS 2.1 properties, so that it could be published as a Recommendation, but the intent was that they would be the same. However, XSL-FO property values are generally expressions, almost as if they were implicitly surrounded with "calc(...)", so there are limits on how compatible they can be.

    Antenna House have a product that implements both CSS and XSL-FO, so they might be affected, but, again, in FO mode the values are interpreted differently anyway.

    A bigger question is whether users would be confused. However, XSL-FO is primarily used in cases where CSS for paged media isn't ready or isn't sophisticated enough, and the stylesheet authors are more likely to cope with the confusion than many other users. I do think it would be better to avoid the confusion if possible, though. It also seems to me that white-space-collapse might be confused with margin-collapse, so that inline-space-collapse might be better?

    [1] https://www.w3.org/TR/xsl/#white-space-collapse
    [2] https://www.w3.org/TR/xsl/#white-space-treatment

  2. MurakamiShinyu commented on Jan 3, 2023

    @MurakamiShinyu

    I worked on Antenna House's XSL-FO & CSS implementation in the past, but presently I am not in that position. So this is my guess, but they and their users will not be much troubled by this renaming, because properties of XSL-FO and CSS are already quite different.

    My impression is that "white-space-*" is a natural naming for the longhand properties of the "white-space" shorthand property.

  3. fantasai commented on Jan 26, 2023

    @fantasai
    CollaboratorAuthor

    Thanks very much, @MurakamiShinyu and @liamquin ! Agenda+ to propose renaming.

    It also seems to me that white-space-collapse might be confused with margin-collapse, so that inline-space-collapse might be better?

    No, CSS authors are used to white-space referring to actual space characters and not to margins or padding. Meanwhile inline is currently used as a prefix/suffix indicating things affecting the inline axis vs the block axis (e.g. we have margin-inline as a shorthand for margin-inline-start and margin-inline-end, which are our equivalents to XSL's margin-start and margin-end).

  4. SebastianZ commented on Jan 30, 2023

    @SebastianZ
    Contributor

    Another reason to rename text-space-* is that it can easily get confused with text-spacing (and possible longhands as discussed in #4246).

    And the reason why I proposed to rename them to white-space-* is that those properties are meant to be longhands for the white-space property.

    Sebastian

  5. fantasai commented on Feb 2, 2023

    @fantasai
    CollaboratorAuthor

    @SebastianZ There's no doubt in my mind that white-space-collapse is the better name. We were asked to move away from that by the XSL:FO folks a couple decades ago; but since Liam and Murakami think it's okay I think the obvious thing is to rename them back.

  6. css-meeting-bot commented on Feb 22, 2023

    @css-meeting-bot
    Member

    The CSS Working Group just discussed [css-text-4] Renaming text-space-* to white-space-*, and agreed to the following:

    • RESOLVED: rename `text-space-collapse` back to `white-space-collapse`
    The full IRC log of that discussion <dbaron> fantasai: This issue... a long time ago we had a `white-space-collapse` which together with `text-wrap` were longhands of `white-space`.
    <dbaron> fantasai: XSLFO folks complained that, since we organized the value space to be spimpler than XSLFOs, complained about naming collisoon, so we renamed (but less clear)
    <dbaron> fantasai: 2 decades later, we want to rename back, confirmation from Liam Quin and Murakami-san that it's OK to rename back to the more easily understood name.
    <dbaron> astearns: Implementation status of text-space properties?
    <dbaron> fantasai: AS far as I know, nobody.
    <fantasai> s/we want/someone asked/
    <dbaron> astearns: so good time to rename
    <dbaron> astearns: any concerns with going back to `white-space-collapse`?
    <dbaron> RESOLVED: rename `text-space-collapse` back to `white-space-collapse`
    <SebastianZ> Perfect!
  7. fantasai commented on Mar 1, 2023

    @fantasai
    CollaboratorAuthor

    Fixed in 3050d05

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

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