Adjusts line breaking to avoid a short single word on the last line (also known as typographic orphans.) When `text-wrap: pretty` is specified, paragraphs that will end up with a short single word on the last line are adjusted so that the last line has two or more words. The algorithm is based on the Knuth-Plass algorithm, as used by TeX. It computes scores for all candidates, and chooses the best one. To balance between the typographic benefits and the performance impacts, it adjsuts the last 4 lines of paragraphs that meet certain conditions.
Low. This value only sets a bias for better layout over speed, without any particular requirements. Browsers that don't support this value will fall back to their default line breaking algorithm, but both the exact line breaking results for this value and for the default value are not defined.
Another related value of this property `text-wrap: balance` improves line breaking for headlines, while this value improves typography for body text.
Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
None.
Shipping on desktop | 117 |
Shipping on Android | 117 |
Shipping on WebView | 117 |
Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).
None.--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAHe_1dKPpadQmZeRkXjmXax73OTN7MjgG1hQxQ5rfjN8uTcEDg%40mail.gmail.com.
Just as a side question: is this and the headlines feature too opinionated to become part of user-agent stylesheets? I’m not immediately saying it should be, I’m just curious if this was considered?
As one of the spec authors, I support the intent to ship the text-wrap:pretty value.
But I think we should be careful to avoid associating this value with only avoiding single-word last lines in a paragraph. Avoiding short last lines is one thing an engine can do with a more elaborate line-breaking algorithm. The intent of the value is to allow more experimentation in this space to eventually get more consistent line breaks and spacing overall. So while I am perfectly happy with this first step to avoid single-word last lines with a four-line window evaluation, we should be clear that future improvements are also welcome (like fixing a short last line with more than one word, or evaluating more than four lines in the paragraph to find a better solution).
We will also need to be clear that this value will not always guarantee that paragraphs will never end with a single-word line. There will always be degenerate cases where there is no improved score that can fix the last line. A toy example is:
[snip]
which is not a improvement (and should show up as worse in any score-based evaluation of the paragraph)
>> Avoiding a short single word on the last line (typographic orphans) is one
of the most visible advantages of the paragraph-level algorithm.
What does it mean to “avoid a short single word” in quantitative terms (and
across languages)?
>> Following are the limitations as of ToT/WIP. The list may change in future.
Can you confirm that this table means that the “pretty” algorithm is disabled,
rather than the feature listed being disabled in favor of “pretty”? :)
[snip]
So I agree largely agree with Alan Stearns's comments, and in the context of
those comments, I want to ask, if the primary goal is to avoid short last
lines, is “text-wrap: pretty” the right approach, or should we be considering
a proposal that allows more configuration?
For example, there have been in the past a proposals for a property like
last-line-length: <length-percentage>
which is discussed in the issue you linked to:
https://github.com/w3c/csswg-drafts/issues/3473
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAHe_1dJHcCJ8TzS6nG27Uem_6keVwTgArBPtFzg29KHiUOPumQ%40mail.gmail.com.
LGTM2
/Daniel
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAFUtAY_Cexu-4srZ7cOKKYrpz6AGu7ed1xnFU7gBjiGmPLzmkg%40mail.gmail.com.
LGTM1
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAHe_1dJHcCJ8TzS6nG27Uem_6keVwTgArBPtFzg29KHiUOPumQ%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
LGTM1
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAHe_1dJHcCJ8TzS6nG27Uem_6keVwTgArBPtFzg29KHiUOPumQ%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/63834b8b-a61f-4a00-b9ea-48c650ab2129n%40chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.