Bug 232191

Summary: [LFC][IFC] Breaking before hyphen is only allowed when line-break is loose
Product: WebKit Reporter: zalan <zalan>
Component: Layout and RenderingAssignee: zalan <zalan>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, bfulgham, cdumez, cmarcelo, darin, ews-watchlist, koivisto, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description zalan 2021-10-22 18:50:48 PDT
The following breaks are allowed for loose line breaking if the preceding character belongs to the Unicode line breaking class ID [UAX14] (including when the preceding character is treated as ID due to word-break: break-all), and are otherwise forbidden:
breaks before hyphens:
‐ U+2010, – U+2013

https://drafts.csswg.org/css-text-3/#line-break-property
Comment 1 zalan 2021-10-22 20:34:22 PDT
Created attachment 442245 [details]
Patch
Comment 2 EWS 2021-10-23 08:54:13 PDT
Committed r284744 (243453@main): <https://commits.webkit.org/243453@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 442245 [details].
Comment 3 Radar WebKit Bug Importer 2021-10-23 08:55:17 PDT
<rdar://problem/84580370>
Comment 4 Darin Adler 2021-10-23 09:11:49 PDT
Comment on attachment 442245 [details]
Patch

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

> Source/WTF/wtf/unicode/CharacterNames.h:64
> +constexpr UChar endash = 0x2013;

Typically we try to exactly follow the naming scheme from Unicode here, which I think would be enDash, two words.
Comment 5 zalan 2021-10-23 09:28:46 PDT
(In reply to Darin Adler from comment #4)
> Comment on attachment 442245 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=442245&action=review
> 
> > Source/WTF/wtf/unicode/CharacterNames.h:64
> > +constexpr UChar endash = 0x2013;
> 
> Typically we try to exactly follow the naming scheme from Unicode here,
> which I think would be enDash, two words.
Makes sense. Will change it. I was using the postscript name endash, see at  https://www.compart.com/en/unicode/U+2013