Bug 206133 - [LFC][IFC] Visually collapse hanging pre-wrap content.
Summary: [LFC][IFC] Visually collapse hanging pre-wrap content.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: zalan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-01-11 12:12 PST by zalan
Modified: 2020-01-11 16:29 PST (History)
6 users (show)

See Also:


Attachments
Patch (5.58 KB, patch)
2020-01-11 12:16 PST, zalan
koivisto: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description zalan 2020-01-11 12:12:31 PST
"If white-space is set to pre-wrap, the UA must (unconditionally) hang this sequence, unless the sequence is followed by a forced line break, in which case it must conditionally hang the sequence is instead. It ___may___ also visually collapse the character advance widths of any that would otherwise overflow."
Comment 1 Radar WebKit Bug Importer 2020-01-11 12:12:50 PST
<rdar://problem/58505750>
Comment 2 zalan 2020-01-11 12:16:29 PST
Created attachment 387441 [details]
Patch
Comment 3 Antti Koivisto 2020-01-11 12:42:59 PST
Comment on attachment 387441 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=387441&action=review

> Source/WebCore/layout/inlineformatting/InlineLineBuilder.cpp:237
> +    visuallyCollapsePreWrapOverflowContent();

Shouldn't this depend on alignment somehow?
Comment 4 zalan 2020-01-11 13:06:21 PST
(In reply to Antti Koivisto from comment #3)
> Comment on attachment 387441 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=387441&action=review
> 
> > Source/WebCore/layout/inlineformatting/InlineLineBuilder.cpp:237
> > +    visuallyCollapsePreWrapOverflowContent();
> 
> Shouldn't this depend on alignment somehow?
Yup, you are right
Comment 5 zalan 2020-01-11 15:25:00 PST
(In reply to zalan from comment #4)
> (In reply to Antti Koivisto from comment #3)
> > Comment on attachment 387441 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=387441&action=review
> > 
> > > Source/WebCore/layout/inlineformatting/InlineLineBuilder.cpp:237
> > > +    visuallyCollapsePreWrapOverflowContent();
> > 
> > Shouldn't this depend on alignment somehow?
> Yup, you are right
It is actually the other way around. The unconditionally hanging whitespace should be ignored when it comes to horizontal alignment even if it places the trailing whitespace outside of the line box. ->
"As the preserved spaces at the end of lines without a forced break must hang, they are not considered when placing the rest of the line during text alignment. When aligning towards the end, this means any such spaces will overflow, and will not prevent the rest of the line’s content from being flush with the edge of the line."
Comment 6 zalan 2020-01-11 15:25:50 PST
There are some very nice visual examples at https://www.w3.org/TR/css-text-3/#white-space-phase-2
Comment 7 zalan 2020-01-11 15:43:24 PST
SLL seems to be retrofitting the hanging content width.
Comment 8 zalan 2020-01-11 15:48:02 PST
Committed r254402: <https://trac.webkit.org/changeset/254402>