-
Notifications
You must be signed in to change notification settings - Fork 660
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-4] move "balance | stable | pretty" out of text-wrap #9102
Comments
isn't, like, at least one value of them already shipping? |
Correct. |
so, like .... isn't this impossible? |
It was specifically pointed out (by @fantasai ) during the intent to ship that:
@kojiishi 's answer was:
So, while we should not change just for the sake of changing, if there are good reasons to change, my understanding is that Chrome has indicated that this is a risk they were willing to take when shipping early. |
Yes, but there is already quite a bit of usage in Chromium-based browsers. Making these sites migrate to a new syntax is possible but would need a good enough reason. I can see why it would make sense to change around For this reason I'm opposed to changing the feature's syntax for the already-shipped values. |
I understand the reluctance to make compat affecting changes to features that have shipped. But that's in tension with using "we can always change it after we ship" as an argument to justify shipping prior to spec stability. |
This seems relevant here: WebKit/WebKit#16723 |
I agree with @chrishtr that with Chrome having shipped |
With my css author hat on. We quickly adopted We even added it in a bunch of places before Chrome shipped it in stable because it was so harmless. I wouldn't mind having to do a find/replace if this was taken out of
In this specific case I don't think it will cause that. As a maintainer of |
It seems to me that the There are several aspects of wrapping that authors should be able to control independently, something like:
|
The CSS Working Group just discussed
The full IRC log of that discussion<Rossen_> Zakim, open queue<Zakim> ok, Rossen_, the speaker queue is open <emeyer> fantasai: Originally, text-wrap had two values, wrap and no-wrap <emeyer> …Since then, we’ve added various values for not just whather wrapping occurs, but what KIND of wrapping occurs <emeyer> …The more we add, the worse it becomes that this is mixed with wrapping and how <emeyer> …Some of the values should cascade, and some shouldn’t <emeyer> …I would like to split `text-wrap` into two properties <emeyer> …One takes wrap and no-wrap, and the other takes all the others <florian> q+ <Rossen_> q? <Rossen_> ack florian <emeyer> …Since `text-wrap` is shipping, I’m happy to dedicate it to how things are wrapped, and move the wrap/no-wrap to another property <lea> ;? <emeyer> florian: Completely agree <lea> q? <emeyer> …We do have some tension in the naming <emeyer> …How bad is it to ask Chrome to break here <lea> q+ <emeyer> …When they asked about shipping, they said it would be okay to rename later <fantasai> wrap-style vs text-wrap would indeed be more understandable if that's possible ... <emeyer> …I would prefer that we kept `text-wrap` for yes/no on wrapping at use `wrap-style` for the others <emeyer> iank_: I think the situation has changed from that time period <emeyer> …I don’t know if renaming is viable <emeyer> florian: This is going to make it more difficult to do this sort of thing int he future <emeyer> …We asked explicitly if it would be okay, and now it’s been waklked back <emeyer> lea: I agree these should be separated, and we shoudl have more granular control over wrapping <emeyer> …I don’t tknow that we need to break backwards compatibility to do that <emeyer> …most of these are useless without wrapping, so it seems like a win that some of these values cause wrapping <emeyer> …If you say `text-wrap: balance`, we can be smart and also set `wrap` <Rossen_> q? <Rossen_> ack lea <emeyer> fantasai: What you’re proposing is we keep `text-wrap` as a shorthand that incorporates text wrapping on/off? <emeyer> lea: Yes <emeyer> fantasai: That could work, we need a better name than `text-wrap-on-off` <fantasai> s|text wrapping on/off|text-wrap-style and text-wrap-onoff/ <emeyer> Rossen_: Let’s bikeshed the name offline <jfkthame> q+ <fantasai> s/text-wrap-onoff/, where text-wrap-onoff is also a longhand of white-space/ <Rossen_> ack jfkthame <emeyer> jfkthame: I wanted to add something slightly orthogonal <emeyer> …balance really needs to be separated from stable versus pretty <emeyer> florian: I’m unconvinced, it’s not obvious to me you’d want a stable balance that becomes stateful <fantasai> +1 florian <lea> s/…most of these are useless without wrapping, so it seems like a win that some of these values cause wrapping/…values like balance or pretty are useless without wrapping, so it seems like a win if setting text-wrap to one of these values would also enable wrapping (if you have no provided a separate wrap/no-wrap keyword)/ <emeyer> …Balance is a style of wrapping, it’s not clear that I want greedy balancing or whatever other options we could have <lea> q? <emeyer> jfkthame: The spec text suggests balance is only attempted up to a limited number of lines, and it then falls back to wrap, but what kind of wrapping? <emeyer> florian: We could fix this in the spec; do you mean that if you set balance, we ignore the style of wrapping unless we fall back? <emeyer> jfkthame: You could specify stable or pretty or balance, but if you do balance and then there’s a fallback, what happens? <emeyer> florian: So you’re saying you want balancing, but you want to be able to choose how you fall back. <lea> There is a continuum between balance and greedy wrapping. Authors often want some degree of balancing but less "draconian" than full-blown balance. Not sure if the solution is to separate balance out, or to just provide more control over exactly how the balancing happens <emeyer> jfkthame: I’m not entirely sure <emeyer> florian: I suspect what you want is orthogonal so it’s probably find as a pullout <Rossen_> ack fantasai <Zakim> fantasai, you wanted to suggest that these don't need to be separate properties <emeyer> fantasai: I don’t see that these need to be separate properties; we could allow multiple keywords <emeyer> …I think balancing is interesting because an implementation could use different approaches <emeyer> …We want flexibility for user agents <emeyer> …I do really like Lea’s proposal and it seems to address cascading problems we have with the current setup <emeyer> fantasai: Propose text-wrap becomes a shorthand for two properties, text-wrap-style and text-wrap-on-off <fantasai> PROPOSED: text-wrap becomes a shorthand for text-wrap-style and text-wrap-onoff, and only text-wrap-onoff is a longhand of white-space <emeyer> …ONLY text-wrap-on-off is a longhand for whitespace <emeyer> …(names to be bikeshedded) <emeyer> florian: Is the complete value space of text-wrap the same as currently? <fantasai> text-wrap: <'text-wrap-style'> || <'text-wrap-onoff'> <emeyer> fantasai: Yes <fantasai> text-wrap-onoff: wrap | nowrap <emeyer> Rossen_: Hearing no objections… <fantasai> text-wrap-style: stable | pretty | balance | auto | etc. <emeyer> RESOVLED: text-wrap becomes a shorthand for text-wrap-style and text-wrap-onoff, and only text-wrap-onoff is a longhand of white-space <emeyer> RESOLVED: text-wrap becomes a shorthand for text-wrap-style and text-wrap-onoff, and only text-wrap-onoff is a longhand of white-space <emeyer> github-bit, take up https://github.com//issues/8539 |
Was |
Yes, it's a placeholder. |
text-wrap becomes a shorthand of text-wrap-mode and text-wrap-style, and text-wrap-mode, rather than text-wrap, is a longhand of white-space. See #9102
I made the corresponding edits (using a Will do the corresponding test work shortly. |
Agenda+ to bikeshed As a reminder the updated shorthand structure is:
This is urgent because implementations are already shipping |
To justify my vote above: |
Ouch, that's a pretty good point :/ |
|
Also, the wrapping still usually only happens where there is white space, so it isn't totally wrong to think of this as a white-space-based property. |
By the way, whatever we call the property, have we considered if |
@bradkemper I edited your vote in, @astearns can we fix the permissions so that Brad can vote in the future? +1 for folding |
@LeaVerou thank you. Should I open a separate issue for folding wrap-inside inside this? It would mean it would be inheritable, but i think that's better anyway. |
Yes please. |
Done: #9448 Also, I have edit power now. Thank you. |
While the assumption that lines predominantly wrap at white spaces might hold true for English, the proportion of lines wrapping at white spaces can vary significantly from language to language, and even within different types of content. Take my own language, Norwegian, as an example: we often use long compound words. To ensure proper line endings, it's essential to wrap lines at soft break opportunities within these words. Otherwise, we risk having less than optimal line endings, or “bad rags”. In a casual analysis of a random Norwegian book, I observed that around 20% of the line wraps occurred within words, not at white spaces. On the web, inputting soft-break characters is quite challenging. This leads to web content in Norwegian (and likely in other languages) often suffering from bad rags. I feel that naming the property My vote, if I had one, would be for |
Your point is well taken, but there is little to no chance that we wouldn't consider the needs of non-English languages. We actively work against English bias when designing how the features work. This, to me, is primarily about the name, and whether we make Since we can't go back in time to rename |
The CSS Working Group just discussed
The full IRC log of that discussion<lea> https://github.com//issues/9102#issuecomment-1747785298<fantasai> lea: This async poll had a difference, that did not allow input from WG members (because we did it first, before deciding to add emojis) <fantasai> lea: I think the version with emojis worked really well <fantasai> lea: the reactions also bumped the comment up which made the comment more visible <fantasai> lea: and also we were able to get both opinions at a glance, whereas here we only get WG perspecive <fantasai> lea: here we got 10 votes, `text-wrap-mode` seems to be a clear winner, but not as definitive <florian> q+ <Rossen_> q? <fantasai> lea: both me and Brad said they would prefer `white-space-wrap` if it were an option <Rossen_> ack florian <fantasai> florian: between two choices, I did abstain. i would be against white-space-wrap <fantasai> Rossen_: poll is leaning text-wrap-mode <fantasai> Rossen_: any objections? <fantasai> RESOLVED: text-wrap-mode |
Unfortunately, with Chrome 114 shipping Do we need Chrome to be updated as soon as possible to match the latest specifications? cc @kojiishi |
I've just filed https://bugs.chromium.org/p/chromium/issues/detail?id=1501748, as I didn't find an existing bug report about this. It's clearly wrong behavior, and will lead to webcompat pain. 😞 |
Thanks @jfkthame |
Adjusted WPT to make sure that |
While discussing #3473 @fantasai pointed out that the decision of whether to wrap, and of which line breaking algo to use when wrapping ought to be separate, to cascade independently, and therefore to be separate properties.
I agree, and therefore think we should move
balance | stable | pretty
out oftext-wrap
. And likely, that new property is where we should add the new value that solves #3473 (which could be called something likeavoid-oprhans
).It should be an inherited property.
As for its name, here's a first suggestion to entice people to propose something better:
wrap-style
The text was updated successfully, but these errors were encountered: