Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[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
merged 1 commit into from
Dec 9, 2020

Conversation

fantasai
Copy link
Collaborator

@fantasai fantasai commented Dec 2, 2020

No description provided.

@fantasai
Copy link
Collaborator Author

fantasai commented Dec 2, 2020

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

Copy link
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
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
Copy link
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
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.

@@ -2537,7 +2537,7 @@ Horizontal-in-Vertical Composition: the 'text-combine-upright' property</h3>
Name: text-combine-upright
Value: none | all | [ digits &lt;integer&gt;? ]
Initial: none
Applies to: non-replaced inline elements
Applies to: [=inline boxes=] and text
Copy link
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
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
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
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
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.

css-text-3/Overview.bs Show resolved Hide resolved
css-text-4/Overview.bs Show resolved Hide resolved
…ss-color-adjust] Be explicit about which properties apply to text. w3c#5303
@Loirooriol
Copy link
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
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
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.

None yet

5 participants