-
Notifications
You must be signed in to change notification settings - Fork 56
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
text-wrap: pretty #864
Comments
@LeaVerou asked me to explain this feature and the potential compat impact etc.
This is not an accurate description. The
Avoiding too-short last lines is certainly one aspect that can be considered by a UA for This presents a risk that authors, who really really want last-line length adjustment, will interpret I'll note there's also been discussion over the years of having a specific control for last line length; there's no draft yet because implementations weren't interested until now. But we do have the possibility of providing a specific feature for this specific implementation feature, and that may be a better path forward for this feature request. |
Hi there, We looked at this in the plenary on Wednesday. In general, we recommend explainers to be in Markdown, and are in the process of merging guidance to that effect in the Explainer Explainer. We were also a little confused about the name, since it seems that this feature is about controlling orphan words and If the intent of the spec is to have many varied heuristics into making text wrapping more aesthetically pleasing, I am a little worried about whether the current implementation can evolve into this eventually. I can easily see authors starting to use it as a property to control orphans, and before we know it, we can’t change it due to web compat. If all this property does is prevent orphan words, I wonder if a property to control exactly that would be preferable, possibly as a longhand of (To clarify, everything using first singular is my personal opinion, and does not necessarily reflect TAG consensus — I use first plural to express that) |
To clarify Blink's intent, this property value should be able to do more, but the initial implementation in Blink focused on preventing orphaned words. Please see the discussion in Blink I2S and the "Overview" section of the design doc. Blink is planning to add more typographic improvements to the |
To clarify, I think it's ok for it to ship with fewer heuristics and evolve over time, but it needs to implement at least two to avoid authors using it as a proxy for a more specific thing. |
That's a very good point, thank you. We saw many strong feedback on avoiding orphans from web developers (example 1, 2) and it wasn't easy to determine the next strong request from the feature candidates. But it's also not difficult to pick one more feature, if we put the request priority aside. I'll think about it. |
It may still be a good idea to expose orphans via a more targeted property as well, e.g. see this issue about a property specifically about orphans. That would satisfy the golden rule of API design: common things should be easy, complex things should be possible. |
Yes, thank you, we're aware of the resolution at csswg#3473.
We're willing to support the new value once the syntax is finalized. |
From our prototypes, adjusting hyphenation penalties under certain conditions seems doable without hitting the performance much, so I'm planning to add it to |
Hi Koji, We discussed this today in a breakout. This sounds like a plan. It may be good to try and ship orphan control at the same time as We think the specific heuristics to employ are better decided within the CSS WG (not necessarily as a normative part of the spec), however we'd recommend the multiple heuristics employed by |
This patch extends the conditions to optimize line breaking by `NGScoreLineBreaker` to include when two consecutive hyphenated lines at the end of a paragraph. At the TAG review[1], one pointed out that it's better to have at least two conditions to avoid authors using `pretty` as a proxy for a more specific thing. This change resolves the concern. [1] w3ctag/design-reviews#864 (comment) Bug: 1432798 Change-Id: Ic8ced19cf922bfc4c16d351271ec4ea36428a638 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4755013 Reviewed-by: Kent Tamura <[email protected]> Auto-Submit: Koji Ishii <[email protected]> Commit-Queue: Koji Ishii <[email protected]> Cr-Commit-Position: refs/heads/main@{#1180294}
Thank you for commenting to the issue, that helps. For your second part, sorry I don't understand what the neuance of "caliber" is, please disregard if I seem to misunderstand, but if you consider hyphenation is minor and you're looking for some other major features in Knuth-Plass, it may be difficult. The 3 top areas Knuth-Plass can improve are hyphenation, justification, and typographic widows/orphans control. For example, w3c/csswg-drafts#672 has 8 candidate improvements, 3 are about typographic widows/orphans, 2 are about hyphenations, and 3 are about justification. Another example, this article expects I fully agree having a separate control for typographic orphans is good, but if |
Thanks for bearing with us - we realize this response is late. There's no way to quantify what is minor, the end goal is to ensure that authors do not use this as a proxy for a single feature (preventing orphans) which would prevent it from including more heuristics in the future. So in addition to preventing orphans, the property should control at least one more factor that is noticeable in common usage. Preventing "rivers of white space" in justified text is certainly not minor, but we'd love to also see something that makes a visible difference in other text alignment modes as well. Again, this becomes less of a concern if lower level control over orphans ships at the same time (or earlier). Also - can you please elaborate on the multi-implementer support - we see that the Chrome Status page lists Webkit and Mozilla as positive but does not link to standards positions. |
Hi @kojiishi any response to Lea's questions above? |
The TAG looked at this again in a breakout today, and we returned to the naming issue. The name
If this feature gets over-adopted by authors eager to improve their sites, to the point where it starts affecting benchmark scores, browser engines will be disincentivized to implement We encourage the working group to rename the property value to something that reflects its costs as well as its benefits. |
I've filed w3c/csswg-drafts#10785 to encourage the CSSWG to discuss the naming question. My sense from the discussion today was that the TAG will accept the CSSWG's expertise on this issue, as long as they've actually considered it. I also got the sense that including hyphenation in |
As noted in w3c/csswg-drafts#10785, it's been a year since the original TAG review request; at this point it's far too late to do naming changes unless something is genuinely broken (which I think it's clear isn't the case here). |
While we recognize that the author pain points this is designed to solve are real and prominent, we still have several concerns about this solution, both in terms of its current definition, and its timing. In general, shipping high level features is a good idea when In this case, neither of these appear to be true: we do not have a good sense of what One author's reaction to this feature appears to validate this concern: they wanted control over orphans and are frustrated they have to accept re-hyphenation to get it. Given this, we are concerned that the behavior of this feature will need to change a lot over time, and that after a certain amount of adoption, those changes will either break web compatibility, or will require a high enough performance cost that browsers won't be able to ship them. We encourage the CSSWG to:
We think the CSSWG is the right place to pursue those goals and that parallel discussion within the TAG won't help anyone. Thus, we're closing this as |
Hello TAG!
I'm requesting a TAG review of
text-wrap: pretty
.This feature adjusts line breaking to avoid a short single word on the last line (also known as typographic orphans.) This is another value of the
text-wrap
property, once reviewed forbalance
at #822.balance
andpretty
)Further details:
💬 leave review feedback as a comment in this issue and @-notify [github usernames]
The text was updated successfully, but these errors were encountered: