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:

Christopher
Alexander
ate pizza
too.

The only way to avoid the single-word last line in this example is

Christopher
Alexander
ate
pizza too.

which is not a improvement (and should show up as worse in any score-based 
evaluation of the paragraph)

On Thursday, June 22, 2023 at 5:53:51 PM UTC+1 ko...@chromium.org wrote:

> Hi, thank you for the question.
>
> On Thu, Jun 22, 2023 at 5:15 PM Thomas Steiner <to...@google.com> wrote:
>
>> 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?
>>
>
> The short answer at this point is no, we're not changing the user-agent 
> stylesheets, but as you pointed out, there are two aspects in your question 
> -- whether it should be or not, and how.
>
> I think I can come up with cases where it should be, but at this point, I 
> don't have enough confidence that it always should be. There are a wide 
> variety of situations where browser's text rendering is used, including 
> apps like text editors, games, forms, ASCII arts, and so forth. Also 
> different languages have different typographic rules. Among them, I can 
> find certain cases where it should not be. When changing the default 
> settings, all such cases will need to be inspected. Web compatibility and 
> the performance implication also need to be investigated more.
>
> When a conclusion is reached, then the "how" part. Generally speaking, the 
> user-agent stylesheets are where browsers are expected to be interoperable, 
> so I think it should be discussed at the CSSWG. If you have opinions, you 
> can post at <https://github.com/w3c/csswg-drafts/issues>.
>
> On the other hand, the initial value `wrap` of the `text-wrap` property 
> <https://github.com/w3c/csswg-drafts/issues> allows UA to use the 
> algorithm for `pretty`, so UA can choose to do it without changing the 
> user-agent stylesheets. I don't have a plan for doing it at this point as 
> above, but if we reach a conclusion that Blink should do so, we will go 
> through this "Intent to Ship" process as it will be a breaking change.
>
> I hope this clarifies your question.
>

-- 
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+unsubscr...@chromium.org.
To view this discussion on the web visit 
https://groups.google.com/a/chromium.org/d/msgid/blink-dev/3376befc-4159-4ecd-bb4c-c4572b8e14e7n%40chromium.org.

Reply via email to