Bug 179896 - overflow-wrap: break-word and word-break: break-all don't work with grapheme clusters
Summary: overflow-wrap: break-word and word-break: break-all don't work with grapheme ...
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-20 13:09 PST by Myles C. Maxfield
Modified: 2023-09-28 07:10 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Myles C. Maxfield 2017-11-20 13:09:53 PST
When breaking in the middle of a word, BreakingContext::handleText() will erroneously try to break at every single code point, rather than considering grapheme clusters unbreakable (which it should).
Comment 1 Brendan Donovan 2021-11-18 04:07:22 PST
I am having an issue on Safari only (Version 15) where some emojis are being rendered with a visual artefact when the `overflow-wrap: break-word;` is applied and the width of the containing div is too small compared to the `font-size` of the emoji.

I suspect that it is related to this issue.

Here is a reproduction of the issue, https://codepen.io/brendandonovan/pen/rNzPyzW.
Comment 2 Myles C. Maxfield 2021-11-18 10:56:46 PST
Yep, that sounds like this bug.
Comment 3 Ahmad Saleem 2023-09-27 16:07:19 PDT
(In reply to Brendan Donovan from comment #1)
> I am having an issue on Safari only (Version 15) where some emojis are being
> rendered with a visual artefact when the `overflow-wrap: break-word;` is
> applied and the width of the containing div is too small compared to the
> `font-size` of the emoji.
> 
> I suspect that it is related to this issue.
> 
> Here is a reproduction of the issue,
> https://codepen.io/brendandonovan/pen/rNzPyzW.

At least this test now run fine in Safari 17, Chrome Canary 119 and Firefox Nightly 120.

@Myles - is this still applicable in general?
Comment 4 zalan 2023-09-28 07:10:27 PDT
IFC does not break inside grapheme clusters. (IFC progression)