8000
  • [css-text][css-text-decor][css-writing-modes][css-color][css-fonts][css-color-adjust] Be explicit about which properties apply to text. #5303 by fantasai · Pull Request #5761 · w3c/csswg-drafts · GitHub
    Skip to content

    [css-text][css-text-decor][css-writing-modes][css-color][css-fonts][css-color-adjust] Be explicit about which properties apply to text. #5303#5761

    Merged
    svgeesus merged 1 commit into
    w3c:masterfrom
    fantasai:applies-to-text
    Dec 9, 2020
    Merged

    [css-text][css-text-decor][css-writing-modes][css-color][css-fonts][css-color-adjust] Be explicit about which properties apply to text. #5303#5761
    svgeesus merged 1 commit into
    w3c:masterfrom
    fantasai:applies-to-text

    Conversation

    @fantasai
    Copy link
    Copy Markdown
    Collaborator

    @fantasai fantasai commented Dec 2, 2020

    No description provided.

    @fantasai
    Copy link
    Copy Markdown
    Collaborator Author

    fantasai commented Dec 2, 2020

    Not sure I caught them all, but I tried. :)

    Copy link
    Copy Markdown
    Contributor

    @svgeesus svgeesus left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Yes, this seems correct to me.

    @Loirooriol
    Copy link
    Copy Markdown
    Contributor

    Are you trying to cover all the specs here? At quick glance, things like cursor from css-ui should probably be added too.

    @fantasai
    10BC0 Copy link
    Copy Markdown
    Collaborator Author

    fantasai commented Dec 3, 2020

    @Loirooriol I think cursor is a bit tricky. We don't define the geometric bounds of text, except insofar as the glyph outline is defined, so if we were to say it applies to text, we wouldn't be able to say where it applies.

    Copy link
    Copy Markdown
    Contributor

    @Loirooriol Loirooriol left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Looks good, but I think some surrounding text may need to be tweaked.

    Value: none | all | [ digits <integer>? ]
    Initial: none
    Applies to: non-replaced inline elements
    Applies to: [=inline boxes=] and text
    Copy link
    Copy Markdown
    Contributor

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    text-combine-upright: all is defined with

    Attempt to typeset horizontally all consecutive typographic character units within the box

    So it's not clear what happens for text. Maybe "within the box or text run"?

    Copy link
    Copy Markdown
    Collaborator Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Hmm... this is an interesting point. I was originally thinking that applying this to text would only make sense for the digits value (which is why I didn't edit css-writing-modes-3) and not the all value. Can make that clearer, or can say that it only applies to boxes, or can apply it to text runs as you say. I'm not sure there's a real use case for the last one, so I think we should go with whatever makes the most sense to implementers. CC @litherum @kojiishi @jfkthame What do you think? The situation is span { display: contents; text-combine-upright: <something>; }: should this have an effect or have no effect? If so should it work for both all and digits or only for one of them? It doesn't seem particularly useful, so the question is what's easiest to implement. :)

    Copy link
    Copy Markdown
    Contributor

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    <div style="writing-mode: vertical-lr">
      <span style="display: contents; text-combine-upright: all">foo</span>

    has effect in Firefox and Chromium. They don't support digits.

    Copy link
    Copy Markdown
    Collaborator Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    OK, made the fixes in 0b31fa9

    Copy link
    Copy Markdown
    Contributor

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Seems WebKit has -webkit-text-combine: horizontal instead of text-combine-upright: all, and it has no effect with display: contents. But it's a non-inherited property, so it's expected that the text doesn't inherit it, I guess.

    Comment thread css-text-3/Overview.bs
    Comment thread css-text-4/Overview.bs
    …ss-color-adjust] Be explicit about which properties apply to text. w3c#5303
    @Loirooriol
    Copy link
    Copy Markdown
    Contributor

    Should writing-mode apply to text?

    <span style="display: contents; writing-mode: vertical-lr">foo</span>

    In Firefox it works just like without display: contents. In Chromium, the letters are upright, but each one in a different line, and the lines are shifted to the right, weird.

    @svgeesus svgeesus merged commit 39ded77 into w3c:master Dec 9, 2020
    @fantasai fantasai deleted the applies-to-text branch December 9, 2020 14:28
    @fantasai
    Copy link
    Copy Markdown
    Collaborator Author

    fantasai commented Dec 9, 2020

    @Loirooriol I think not, it's supposed to create an inline block and I think that needs a box!!

    @Loirooriol
    Copy link
    Copy Markdown
    Contributor

    Yes, but we could say that text with an orthogonal writing mode is placed inside an anonymous inline-block with the writing mode of the text.

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

    Labels

    None yet

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    5 participants