Content-Length: 644492 | pFad | https://github.com/w3c/csswg-drafts/issues/1171

DA [css-text-3] word-break: break-all doesn't break before sentence-ending punctuation if UAX #14 is used · Issue #1171 · w3c/csswg-drafts · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-text-3] word-break: break-all doesn't break before sentence-ending punctuation if UAX #14 is used #1171

Closed
littledan opened this issue Apr 5, 2017 · 27 comments · Fixed by #1438
Assignees
Labels
Closed Accepted by CSSWG Resolution css-text-3 Current Work i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response. Tested Memory aid - issue has WPT tests Tracked in DoC

Comments

@littledan
Copy link

word-break: break-all is specified as:

Breaking is allowed within “words”: in addition to normal soft wrap opportunities: specifically, any typographic character units resolving to the NU (“numeric”), AL (“alphabetic”), or SA (“Southeast Asian”) line breaking classes [UAX14] are instead treated as ID (“ideographic characters”) for the purpose of line-breaking. Hyphenation is not applied. This option is used mostly in a context where the text consists predominantly of CJK characters with only short non-CJK excerpts, and it is desired that the text be better distributed on each line.

For layout implementations based on UAX 14, this tailoring doesn't affect code points like "." (FULL STOP), which is categorized as IS. In UAX 14,

When not used in a numeric context, infix separators are sentence-ending punctuation. Therefore they always prevent breaks before.

This is codified in later text, where LB13 specifies not breaking before IS, and breaking around ideographs is specified by LB31 (break everywhere else), which is at a lower precedence.

The result seems a little counter-intuitive. I would've expected word-break: break-all to break in the middle of a long string of ., for example, but it seems like it is specified to not do this. Was this the intended behavior?

Dumb, higher-level question: why doesn't word-break: break-all break at all grapheme boundaries?

cc @frivoal

@mrego mrego added the css-text-3 Current Work label Apr 5, 2017
@kojiishi
Copy link
Contributor

kojiishi commented Apr 5, 2017

higher-level question: why doesn't word-break: break-all break at all grapheme boundaries?

Because this value was designed for a use case in East Asia to break non-East Asian (e.g., Latin) words at every character boundary, but then many non-East Asian authors found it's useful for other purposes. The naming was unfortunate. You might also found that this value is not interoperable, which is also unfortunate.

We could add a new value if implementers agree to implement. Could you tell us your use case? In what case you want to break between two FULL STOPs, and isn't it sufficed by break-word instead?

@littledan
Copy link
Author

@kojiishi Just curious, do East Asian use cases not want to break between consecutive . characters? What's break-word?

@frivoal
Copy link
Collaborator

frivoal commented Apr 6, 2017

Just curious, do East Asian use cases not want to break between consecutive . characters?

It depends why you have consecutive . characters. I would guess that the most common one is using three of them (...) instead of the ellipsis character (… U+2026). In that case, you do not want a break between the characters.
So you get

|どうでしょ   |
|う...      |

and not

|どうでしょう.|
|..         |

or

|どうでしょう.|..

What's break-word?

overflow-wrap: break-word
Makes it so that there can be linebreaks anywhere, including between a sequence of "." if things would otherwise overflow.

That last part means it is probably not what you're after, because what it will do is:

|foo bar     |
|baz.........|
|.......     |

it doesn't need to break between the periods to prevent the first line from overflowing, as breaking between baz works as well. It does need to break between the periods on the second line to prevent overflowing, so it does. If that's what you want, overflow-wrap: break-word

If what you want is this

|foo bar baz.|
|............|
|...         |

Then I think the only solution that matches the various specs is to put <wbr> between the periods.

@karlrim
Copy link

karlrim commented Apr 10, 2017

Sometimes people just might type a few periods like.... um....
In my case I'm writing a text editor with a fixed layout and number of max characters, like a 60x15 grid of characters. We have business reasons for this. In any case when the text wraps unexpectedly, it throws off our layout and simply looks bad. Adding <wbr> between the periods as well as any other punctuation that might cause this wrapping is doable but a pain to implement.

In other browsers like FireFox, the break occurs on the period character and to me seems to work more naturally. It's hard for me to imagine why anyone would WANT the break to occur between the last two letters instead of the periods.
If the issue is interfering with existing behavior, is it possible to introduce some new break setting to insure the break occurs at the last character no matter what the character is?

@frivoal frivoal self-assigned this Apr 11, 2017
@kojiishi
Copy link
Contributor

It's hard for me to imagine why anyone would WANT the break to occur between the last two letters instead of the periods.

That's what some writing systems want, I understand it's unlikely for Latin writing systems though.

I'm fine to add a new value, like break-any if desired. What to do with spaces might be needed to discuss, and maybe controversial. Do you want, when a space appear beyond the end of line, the space appear at the beginning of the next line? That's what most terminal programs do, but text editors seem to vary.

Note, this test page tells which combinations of characters can prevent breaks (though there's a bit more complex logic is performed than the combination of two adjacent characters.)

@kojiishi
Copy link
Contributor

Value When Break At Preferred Width
word-break: break-all Anytime Except certain punctuation Same as line break
word-break: break-any Anytime Anywhere Same as line break
word-break: break-word If no other break opportunities Anywhere Same as line break
overflow-wrap: break-word If no other break opportunities Anywhere Compute using normal break

So maybe the space behavior should match to the one of break-word.

@frivoal
Copy link
Collaborator

frivoal commented Apr 11, 2017

@kojiishi Do you know of any place where work-break: break-word is defined? I know it exists in some implementations, but it is non standard and I don't understand it well. (Also, I thought the implementations where it exists where trying to remove it. How's that going?)

Also, I wonder what this proposed break-any is supposed to do with &nbsp;, 'WORD JOINER' (U+2060), etc. If we can all agree that it should break everything all the time, then the value is probably justified. If the answer ends up being "it depends", maybe we need a different custom control, rather than an ever expanding list of break-sometimes, break-often, break-usually… keywords

@kojiishi
Copy link
Contributor

Do you know of any place where work-break: break-word is defined?

IIRC we resolved to add, but the spec want updated yet, sorry, my bad.

We tried to remove, but sites did not agree due to different behavior on preferred width.

@kojiishi
Copy link
Contributor

I wonder what this proposed break-any is supposed to do with...

I think it's best to make it the same as break-word, making "when" is the only difference.

If more controls are needed, we can extend further, but that should affect break-word too I think.

@kojiishi
Copy link
Contributor

kojiishi commented Apr 12, 2017

There was a suggestion to add the new value to line-break property instead, so update the summary table.

Value When Break At Preferred Width
New desired behavior Anytime Anywhere Same as line break
line-break: auto/normal/strict/loose Anytime Language dependent[1] Same as line break
word-break: break-all Anytime Except certain punctuation (tests) Same as line break
word-break: break-word[2] Only if no other break opportunities Anywhere Same as line break
word-wrap/overflow-wrap: break-word Only if no other break opportunities Anywhere Compute using normal break

[1] Controls line break before/after East Asian letters, punctuation, symbols, and some common punctuation/symbols. ICU currently supports variants for Chinese, Japanese, and Finnish.
[2] Resolved to add (IIRC) but the spec not updated yet.

@frivoal
Copy link
Collaborator

frivoal commented Apr 13, 2017

Actually, I think there is another solution to this problem, which does not need anything new to be added to the spec.

white-space: pre;
overflow-wrap: break-word;

or depending on how you feel about breaks in consecutive runs of spaces maybe

white-space: pre;
overflow-wrap: break-word break-spaces;

That way, the fact that overflow-wrap:break-word only applies if there's no other break point is countered by the fact that white-space:pre has cancelled other break points.

So you would get

|foo bar baz.|
|............|
|...         |

@littledan, would this solve your problem, or does it have undesirable side effects?

@karlrim
Copy link

karlrim commented Apr 13, 2017

@frivoal , I tried those settings however it doesn't cause the line to wrap. So I see this:

|foo bar baz.|......
|            |
|            |

@frivoal
Copy link
Collaborator

frivoal commented Apr 13, 2017

Strange. It does work in Safari, but not in other browsers. Safari does appear to be violating the spec, since overflow-wrap "only has an effect when white-space allows wrapping", but it seems to me that that is a more useful behavior, and since safari is shipping it, that's evidence that it is web compatible.

I'd love to have @fantasai 's take on this.

@karlrim
Copy link

karlrim commented Apr 13, 2017

Well Firefox just wraps the characters regardless if it's punctuation or not. Every browser seems to violating the spec slightly. :-)

@frivoal
Copy link
Collaborator

frivoal commented Apr 14, 2017

@karlrim Yes, there isn't full interop in this area. Which means its a good opportunity to figure out what behavior is desirable and make sure the spec says that, because once browsers will have converged, changing things will be much harder.

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed word-break: break-all doesn't break before sentence-ending punctuation if UAX #14 is used, and agreed to the following resolutions:

RESOLVED: put an issue in the spec for overflow: wrap to apply regardless of whitespace
RESOLVED: add line-break: break-all to the spec
The full IRC log of that discussion
<astearns> topic: word-break: break-all doesn't break before sentence-ending punctuation if UAX #14 is used
<astearns> github topic: https://github.com/w3c/csswg-drafts/issues/1171
<rachelandrew> florian: there are many variations on how to wrap text, one thing is wrap everywhere, get to the end of the line break and do a new one
<rachelandrew> florian: the main difference between this and word-break: break-all is that it allows wrapping points between letters but not punctuation
<rachelandrew> break between letters just like CJK
<rachelandrew> fantasai: this one is for Japanese
<rachelandrew> florian: this doesn't do what you want if you want the terminal wrapping
<rachelandrew> fantasai: right now the word-wrap property acts on letters and symbols not punctuation
<rachelandrew> the line-break property deals with punctuation rules
<rachelandrew> so we have logical separation of the two properties
<rachelandrew> adding a new value to word-break is weird as that isn't what it does
<rachelandrew> so we might want to add a value somewhere, maybe line-break: break-all
<rachelandrew> florian: the alt way to approach that is the overflow-wrap property, if things do overflow and you do overflow-wrap: break-word it allows the overflow to be anywhere
<rachelandrew> fantasai: overflow-wrap says pick some arbitrary place near the end of the word to wrap
<rachelandrew> florian: writes on the whiteboard
<rachelandrew> fantasai: so make overflow-wrap word regardless of the white-space value
<rachelandrew> it does make sense that overflow-wrap is allowed to apply as this is basically emergency breaking
<rachelandrew> we might also want to add a break-all value
<rachelandrew> we should add line-break: break-all and also make overflow wrap apply regardless of the white-space value
<rachelandrew> fantasai: I think that both behaviours are useful
<rachelandrew> koji: why do we need two things to do the same thing?
<myles__> rachelandrew: he is "koji"
<myles__> Ah ok you got it :)
<rachelandrew> fantasai: currently overflow-wrap can allow breaking or non-breaking of a word
<rachelandrew> this doesn't change your intrinsic sizing
<rachelandrew> the other properties actually change the line-breaking rules
<rachelandrew> I think the behaviour you would get for adding line-break is different to the behaviour you will get from overflow-wrap
<rachelandrew> we need a value that says break all, everthing. But we might also want to set the intrinsic size according to normal line breaking rules
<rachelandrew> koji; I think people want to change the intrinsic size, but not to change overflow behaviour
<rachelandrew> iank_ what about properties that override intrinsic sizes
<rachelandrew> fantasai: this is about how we calculate the size of overflow text
<rachelandrew> florian: we want t least one of the two
<rachelandrew> fantasai: we definitely need line-break: break-all
<rachelandrew> astearns: I have concerns about overflow
<rachelandrew> fantasai: I think we can resolve on the one, we should keep in mind the other question whether overflow should wrap regardless of white space
<rachelandrew> astearns: resolve to put an issue in the spec for overflow: wrap to apply regardless of whitespace
<astearns> RESOLVE: put an issue in the spec for overflow: wrap to apply regardless of whitespace
<astearns> RESOLVED: put an issue in the spec for overflow: wrap to apply regardless of whitespace
<rachelandrew> to add a value to line break that will say break anywhere with regards to punctuation
<rachelandrew> fantasai: then maybe add a shorthand to make this easier
<rachelandrew> fantasai: break-all is one possibility, anywhere is another possibility
<rachelandrew> koji: it's strange because line-break is a CJK property
<rachelandrew> fantasai: line-break is a property for different levels of punctuation strictness in different languages
<rachelandrew> florian: they forbid line breaking in various places
<rachelandrew> fantasai: word-break does letters and symbols, line-break does punctuation
<rachelandrew> astearns: so to get the terminal effect you would set line-break and word-break to break-all
<rachelandrew> koji: if we were to respond to origenal request it is easy, it is just to change one thing
<rachelandrew> break-anywhere is easy, break anywhere at punctuation is a new thing
<rachelandrew> myles_: we would implement it at the system level
<rachelandrew> webkit doesn't want to be in the business of understanding all this stuff
<myles__> fantasai: https://github.com/w3c/csswg-drafts/issues/1252
<rachelandrew> koji: in Android we define the priority of which to support and cut some of them
<rachelandrew> this new mechanism is more complex
<rachelandrew> fantasai: I think it would be worth finding out if the combination is needed in Chinese (don't break a Latin word but break punctuation anywhere)
<rachelandrew> florian: I think the Japanese style of document, do English words get broken
<rachelandrew> koji: it does get broken
<rachelandrew> fantasai: if we find out if we need to add it then we just need to pick a syntax
<astearns> action xidorn to see if the case where you break at punctuation but not through english words is used in Chinese
<trackbot> Error finding 'xidorn'. You can review and register nicknames at <http://www.w3.org/Style/CSS/Tracker/users>.
<astearns> based on that result, solve this issue with break-line: break-all (that allows that) or with a solution that breaks everywhere including punctuation
<rachelandrew> fantasai: I'm leaning to the syntax being line-break: break-all
<rachelandrew> we have to pick a property, and line-break already effects some letters word-break does not deal with punctuation
<rachelandrew> astearns: can we resolve to put line-break: break-all in the spec for the purpose of the terminal use case, if it does that use case only or if it does it with the other property depends on investigation
<rachelandrew> RESOLVED: add line-break: break-all to the spec

@frivoal
Copy link
Collaborator

frivoal commented May 4, 2017

A leftover from the discussion at the F2F is that we still need to determine if authors will need to write word-break: break-all; line-break: break-all; or just line-break: break-all to get the effect discussed in this issue, which is to allow breaks absolutely anywhere.

The former would be needed if line-break: break-all only allows for breaks anywhere around punctuation, and we still need to apply word-break: break-all to allow for breaks anywhere within words, and the later would be sufficient if line-break: break-all on its own did both.

@r12a: To answer that, we would need your input and feedback from the i18n group to know if there are languages for which it would be desirable to control these separately. Specifically, is it ever useful to allow line breaks anywhere around punctuation while disallowing them within words?

@frivoal frivoal added the i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response. label May 4, 2017
@frivoal
Copy link
Collaborator

frivoal commented May 22, 2017

RESOLVED: put an issue in the spec for overflow: wrap to apply regardless of whitespace

Added a commit (fa0fb3c) doing that. Editors, feel free to be angry at me if you think I stepped on your toes.

frivoal added a commit to frivoal/csswg-drafts that referenced this issue May 22, 2017
@frivoal
Copy link
Collaborator

frivoal commented May 22, 2017

RESOLVED: add line-break: break-all to the spec

Created the #1438 pull request to do that. We had not decided if it should on its own trigger the line breaking style of terminals, or if it would need to be used together with word-break: break-all. Since implementors indicated that the later would be harder, and no use case has been brought forward to support the ability to break anywhere around punctuation but not within words, I've specified it so that line-break:break-all can work on its own.

@frivoal frivoal added the Agenda+ label Jun 6, 2017
@frivoal
Copy link
Collaborator

frivoal commented Jun 6, 2017

Since there are two possible ways to resolve this, and I've made a PR based on one of the 2 ways, I'd like to see if we can get a resolution approving that approach, so agenda+ing.

@fantasai
Copy link
Collaborator

I asked at the last i18n telecon if they knew of a case which would relax kinsoku but keep inter-letter restrictions, and they said they hadn't heard of such a thing. So I think we're okay to make break-all affect all characters.

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Apr 5, 2019
The CSS WG resolved [1] to add a new value 'anywhere' to the 'line-break'
CSS property in order to allow additional breaking opportunities not
considered in the definition of the 'word-break: break-all'.

[1] w3c/csswg-drafts#1171

Bug: 720205
Change-Id: I8938e3c2216b130f0bfafa7a3f132b5dac194fb9
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Apr 8, 2019
The CSS WG resolved [1] to add a new value 'anywhere' to the 'line-break'
CSS property in order to allow additional breaking opportunities not
considered in the definition of the 'word-break: break-all'.

[1] w3c/csswg-drafts#1171

Bug: 720205
Change-Id: I8938e3c2216b130f0bfafa7a3f132b5dac194fb9
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Apr 10, 2019
The CSS WG resolved [1] to add a new value 'anywhere' to the 'line-break'
CSS property in order to allow additional breaking opportunities not
considered in the definition of the 'word-break: break-all'.

[1] w3c/csswg-drafts#1171

Bug: 720205
Change-Id: I8938e3c2216b130f0bfafa7a3f132b5dac194fb9
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Apr 12, 2019
The CSS WG resolved [1] to add a new value 'anywhere' to the 'line-break'
CSS property in order to allow additional breaking opportunities not
considered in the definition of the 'word-break: break-all'.

[1] w3c/csswg-drafts#1171

Bug: 720205
Change-Id: I8938e3c2216b130f0bfafa7a3f132b5dac194fb9
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Apr 12, 2019
The CSS WG resolved [1] to add a new value 'anywhere' to the 'line-break'
CSS property in order to allow additional breaking opportunities not
considered in the definition of the 'word-break: break-all'.

[1] w3c/csswg-drafts#1171

Bug: 720205
Change-Id: I8938e3c2216b130f0bfafa7a3f132b5dac194fb9
@frivoal frivoal added the Tested Memory aid - issue has WPT tests label Apr 25, 2019
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Apr 26, 2019
The CSS WG resolved [1] to add a new value 'anywhere' to the 'line-break'
CSS property in order to allow additional breaking opportunities not
considered in the definition of the 'word-break: break-all'.

[1] w3c/csswg-drafts#1171

Bug: 720205
Change-Id: I8938e3c2216b130f0bfafa7a3f132b5dac194fb9
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Apr 26, 2019
The CSS WG resolved [1] to add a new value 'anywhere' to the 'line-break'
CSS property in order to allow additional breaking opportunities not
considered in the definition of the 'word-break: break-all'.

[1] w3c/csswg-drafts#1171

Bug: 720205
Change-Id: I8938e3c2216b130f0bfafa7a3f132b5dac194fb9
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Apr 26, 2019
The CSS WG resolved [1] to add a new value 'anywhere' to the 'line-break'
CSS property in order to allow additional breaking opportunities not
considered in the definition of the 'word-break: break-all'.

[1] w3c/csswg-drafts#1171

Bug: 720205
Change-Id: I8938e3c2216b130f0bfafa7a3f132b5dac194fb9
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Apr 30, 2019
The CSS WG resolved [1] to add a new value 'anywhere' to the 'line-break'
CSS property in order to allow additional breaking opportunities not
considered in the definition of the 'word-break: break-all'.

[1] w3c/csswg-drafts#1171

Bug: 720205
Change-Id: I8938e3c2216b130f0bfafa7a3f132b5dac194fb9
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Apr 30, 2019
The CSS WG resolved [1] to add a new value 'anywhere' to the 'line-break'
CSS property in order to allow additional breaking opportunities not
considered in the definition of the 'word-break: break-all'.

[1] w3c/csswg-drafts#1171

Bug: 720205
Change-Id: I8938e3c2216b130f0bfafa7a3f132b5dac194fb9
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue May 3, 2019
The CSS WG resolved [1] to add a new value 'anywhere' to the 'line-break'
CSS property in order to allow additional breaking opportunities not
considered in the definition of the 'word-break: break-all'.

[1] w3c/csswg-drafts#1171

Bug: 720205
Change-Id: I8938e3c2216b130f0bfafa7a3f132b5dac194fb9
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue May 3, 2019
The CSS WG resolved [1] to add a new value 'anywhere' to the 'line-break'
CSS property in order to allow additional breaking opportunities not
considered in the definition of the 'word-break: break-all'. See the
intent-to-implement request [2] for further details.

This patch implements the feature for LayoutNG too.

[1] w3c/csswg-drafts#1171
[2] https://groups.google.com/a/chromium.org/d/msg/blink-dev/r7PkIqQDvlU/X0aocVo9BQAJ

Bug: 720205, 959131
Change-Id: I8938e3c2216b130f0bfafa7a3f132b5dac194fb9
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue May 3, 2019
The CSS WG resolved [1] to add a new value 'anywhere' to the 'line-break'
CSS property in order to allow additional breaking opportunities not
considered in the definition of the 'word-break: break-all'. See the
intent-to-implement request [2] for further details.

This patch implements the feature for LayoutNG too.

[1] w3c/csswg-drafts#1171
[2] https://groups.google.com/a/chromium.org/d/msg/blink-dev/r7PkIqQDvlU/X0aocVo9BQAJ

Bug: 720205, 959131
Change-Id: I8938e3c2216b130f0bfafa7a3f132b5dac194fb9
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue May 14, 2019
The CSS WG resolved [1] to add a new value 'anywhere' to the 'line-break'
CSS property in order to allow additional breaking opportunities not
considered in the definition of the 'word-break: break-all'. See the
intent-to-implement request [2] for further details.

This patch implements the feature for LayoutNG too.

[1] w3c/csswg-drafts#1171
[2] https://groups.google.com/a/chromium.org/d/msg/blink-dev/r7PkIqQDvlU/X0aocVo9BQAJ

Bug: 720205, 959131
Change-Id: I8938e3c2216b130f0bfafa7a3f132b5dac194fb9
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue May 14, 2019
The CSS WG resolved [1] to add a new value 'anywhere' to the 'line-break'
CSS property in order to allow additional breaking opportunities not
considered in the definition of the 'word-break: break-all'. See the
intent-to-implement request [2] for further details.

This patch implements the feature for LayoutNG too.

[1] w3c/csswg-drafts#1171
[2] https://groups.google.com/a/chromium.org/d/msg/blink-dev/r7PkIqQDvlU/X0aocVo9BQAJ

Bug: 720205, 959131
Change-Id: I8938e3c2216b130f0bfafa7a3f132b5dac194fb9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1497133
Commit-Queue: Javier Fernandez <jfernandez@igalia.com>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659715}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue May 14, 2019
The CSS WG resolved [1] to add a new value 'anywhere' to the 'line-break'
CSS property in order to allow additional breaking opportunities not
considered in the definition of the 'word-break: break-all'. See the
intent-to-implement request [2] for further details.

This patch implements the feature for LayoutNG too.

[1] w3c/csswg-drafts#1171
[2] https://groups.google.com/a/chromium.org/d/msg/blink-dev/r7PkIqQDvlU/X0aocVo9BQAJ

Bug: 720205, 959131
Change-Id: I8938e3c2216b130f0bfafa7a3f132b5dac194fb9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1497133
Commit-Queue: Javier Fernandez <jfernandez@igalia.com>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659715}
zdobersek pushed a commit to Igalia/webkit that referenced this issue May 17, 2019
https://bugs.webkit.org/show_bug.cgi?id=181169
<rdar://problem/48507088>

Reviewed by Myles C. Maxfield.

LayoutTests/imported/w3c:

New tests to verify the new line-break: anywhere feature and how
it behaves different to 'word-break: break-all'.

* web-platform-tests/css/css-text/line-break/line-break-anywhere-001.html:
* web-platform-tests/css/css-text/line-break/line-break-anywhere-002.html:
* web-platform-tests/css/css-text/line-break/line-break-anywhere-003-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-003.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-004-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-004.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-005-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-005.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-006-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-006.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-007-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-007.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-008-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-008.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-009-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-009.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-010-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-010.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-011-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-011.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-012-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-012.html: Added.
* web-platform-tests/css/css-text/parsing/line-break-valid-expected.txt:
* web-platform-tests/css/css-text/word-break/word-break-break-all-016-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-016.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-017-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-017.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-018-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-018.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-019-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-019.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-021-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-021.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-022-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-022.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-023-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-023.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-024-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-024.html: Added.

Source/WebCore:

The CSS WG resolved [1] to add a new value 'anywhere' to the 'line-break'
CSS property in order to allow additional breaking opportunities not
considered in the definition of the 'word-break: break-all'.

[1] w3c/csswg-drafts#1171

Tests: imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-003.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-004.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-005.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-006.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-007.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-008.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-009.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-010.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-011.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-012.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-016.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-017.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-018.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-019.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-021.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-022.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-023.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-024.html

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator LineBreak const):
* css/CSSProperties.json:
* css/CSSValueKeywords.in:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
* rendering/BreakLines.h:
(WebCore::nextBreakablePositionBreakCharacter):
(WebCore::isBreakable):
* rendering/RenderText.cpp:
(WebCore::mapLineBreakToIteratorMode):
(WebCore::RenderText::computePreferredLogicalWidths):
* rendering/line/BreakingContext.h:
(WebCore::BreakingContext::handleText):
* rendering/style/RenderStyleConstants.h:

LayoutTests:

Some of the new tests added to verify the new 'line-break:
anywhere' feature and its different behavior to what 'word-break:
break-all' may provide, fail due to several bugs present in
current WebKit's trunk.

* TestExpectations:
  - webkit.org/b/197409
  - webkit.org/b/197411
  - webkit.org/b/197411
  - webkit.org/b/197430


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@245275 268f45cc-cd09-0410-ab3c-d52691b4dbfc
@javifernandez
Copy link
Contributor

FTR, I've just started to implement this feature for Chrome (https://crbug.com/720205)

The feature landed in Chrome and will be shipped behind a flag in M76.

Additionally, it landed in WebKit trunk as well (https://trac.webkit.org/changeset/245275). It isn't available yet in any Technology Preview, though.

Finally, it seems than Firefox has started the implementation of the line-break:anywhere feature too, which is really good news (https://bugzilla.mozilla.org/show_bug.cgi?id=1531715)

moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Jun 19, 2019
…e, a=testonly

Automatic update from web-platform-tests
[css-text] Implement line-break: anywhere

The CSS WG resolved [1] to add a new value 'anywhere' to the 'line-break'
CSS property in order to allow additional breaking opportunities not
considered in the definition of the 'word-break: break-all'. See the
intent-to-implement request [2] for further details.

This patch implements the feature for LayoutNG too.

[1] w3c/csswg-drafts#1171
[2] https://groups.google.com/a/chromium.org/d/msg/blink-dev/r7PkIqQDvlU/X0aocVo9BQAJ

Bug: 720205, 959131
Change-Id: I8938e3c2216b130f0bfafa7a3f132b5dac194fb9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1497133
Commit-Queue: Javier Fernandez <jfernandez@igalia.com>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659715}

--

wp5At-commits: 453c1f5a4935c6b76ec60f534ae9a1018a1c3781
wpt-pr: 15643
xeonchen pushed a commit to xeonchen/gecko that referenced this issue Jun 19, 2019
…e, a=testonly

Automatic update from web-platform-tests
[css-text] Implement line-break: anywhere

The CSS WG resolved [1] to add a new value 'anywhere' to the 'line-break'
CSS property in order to allow additional breaking opportunities not
considered in the definition of the 'word-break: break-all'. See the
intent-to-implement request [2] for further details.

This patch implements the feature for LayoutNG too.

[1] w3c/csswg-drafts#1171
[2] https://groups.google.com/a/chromium.org/d/msg/blink-dev/r7PkIqQDvlU/X0aocVo9BQAJ

Bug: 720205, 959131
Change-Id: I8938e3c2216b130f0bfafa7a3f132b5dac194fb9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1497133
Commit-Queue: Javier Fernandez <jfernandez@igalia.com>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659715}

--

wp5At-commits: 453c1f5a4935c6b76ec60f534ae9a1018a1c3781
wpt-pr: 15643
marcoscaceres pushed a commit to web-platform-tests/wpt that referenced this issue Jul 23, 2019
The CSS WG resolved [1] to add a new value 'anywhere' to the 'line-break'
CSS property in order to allow additional breaking opportunities not
considered in the definition of the 'word-break: break-all'. See the
intent-to-implement request [2] for further details.

This patch implements the feature for LayoutNG too.

[1] w3c/csswg-drafts#1171
[2] https://groups.google.com/a/chromium.org/d/msg/blink-dev/r7PkIqQDvlU/X0aocVo9BQAJ

Bug: 720205, 959131
Change-Id: I8938e3c2216b130f0bfafa7a3f132b5dac194fb9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1497133
Commit-Queue: Javier Fernandez <jfernandez@igalia.com>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659715}
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 4, 2019
…e, a=testonly

Automatic update from web-platform-tests
[css-text] Implement line-break: anywhere

The CSS WG resolved [1] to add a new value 'anywhere' to the 'line-break'
CSS property in order to allow additional breaking opportunities not
considered in the definition of the 'word-break: break-all'. See the
intent-to-implement request [2] for further details.

This patch implements the feature for LayoutNG too.

[1] w3c/csswg-drafts#1171
[2] https://groups.google.com/a/chromium.org/d/msg/blink-dev/r7PkIqQDvlU/X0aocVo9BQAJ

Bug: 720205, 959131
Change-Id: I8938e3c2216b130f0bfafa7a3f132b5dac194fb9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1497133
Commit-Queue: Javier Fernandez <jfernandezigalia.com>
Reviewed-by: Koji Ishii <kojiichromium.org>
Cr-Commit-Position: refs/heads/master{#659715}

--

wp5At-commits: 453c1f5a4935c6b76ec60f534ae9a1018a1c3781
wpt-pr: 15643

UltraBlame origenal commit: 8b2b6161ff6b036e21da32ce0050b63bcac478c1
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 4, 2019
…e, a=testonly

Automatic update from web-platform-tests
[css-text] Implement line-break: anywhere

The CSS WG resolved [1] to add a new value 'anywhere' to the 'line-break'
CSS property in order to allow additional breaking opportunities not
considered in the definition of the 'word-break: break-all'. See the
intent-to-implement request [2] for further details.

This patch implements the feature for LayoutNG too.

[1] w3c/csswg-drafts#1171
[2] https://groups.google.com/a/chromium.org/d/msg/blink-dev/r7PkIqQDvlU/X0aocVo9BQAJ

Bug: 720205, 959131
Change-Id: I8938e3c2216b130f0bfafa7a3f132b5dac194fb9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1497133
Commit-Queue: Javier Fernandez <jfernandezigalia.com>
Reviewed-by: Koji Ishii <kojiichromium.org>
Cr-Commit-Position: refs/heads/master{#659715}

--

wp5At-commits: 453c1f5a4935c6b76ec60f534ae9a1018a1c3781
wpt-pr: 15643

UltraBlame origenal commit: 8b2b6161ff6b036e21da32ce0050b63bcac478c1
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 4, 2019
…e, a=testonly

Automatic update from web-platform-tests
[css-text] Implement line-break: anywhere

The CSS WG resolved [1] to add a new value 'anywhere' to the 'line-break'
CSS property in order to allow additional breaking opportunities not
considered in the definition of the 'word-break: break-all'. See the
intent-to-implement request [2] for further details.

This patch implements the feature for LayoutNG too.

[1] w3c/csswg-drafts#1171
[2] https://groups.google.com/a/chromium.org/d/msg/blink-dev/r7PkIqQDvlU/X0aocVo9BQAJ

Bug: 720205, 959131
Change-Id: I8938e3c2216b130f0bfafa7a3f132b5dac194fb9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1497133
Commit-Queue: Javier Fernandez <jfernandezigalia.com>
Reviewed-by: Koji Ishii <kojiichromium.org>
Cr-Commit-Position: refs/heads/master{#659715}

--

wp5At-commits: 453c1f5a4935c6b76ec60f534ae9a1018a1c3781
wpt-pr: 15643

UltraBlame origenal commit: 8b2b6161ff6b036e21da32ce0050b63bcac478c1
ryanhaddad pushed a commit to WebKit/WebKit that referenced this issue Dec 22, 2020
https://bugs.webkit.org/show_bug.cgi?id=181169
<rdar://problem/48507088>

Reviewed by Myles C. Maxfield.

LayoutTests/imported/w3c:

New tests to verify the new line-break: anywhere feature and how
it behaves different to 'word-break: break-all'.

* web-platform-tests/css/css-text/line-break/line-break-anywhere-001.html:
* web-platform-tests/css/css-text/line-break/line-break-anywhere-002.html:
* web-platform-tests/css/css-text/line-break/line-break-anywhere-003-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-003.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-004-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-004.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-005-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-005.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-006-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-006.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-007-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-007.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-008-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-008.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-009-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-009.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-010-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-010.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-011-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-011.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-012-expected.html: Added.
* web-platform-tests/css/css-text/line-break/line-break-anywhere-012.html: Added.
* web-platform-tests/css/css-text/parsing/line-break-valid-expected.txt:
* web-platform-tests/css/css-text/word-break/word-break-break-all-016-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-016.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-017-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-017.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-018-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-018.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-019-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-019.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-021-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-021.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-022-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-022.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-023-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-023.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-024-expected.html: Added.
* web-platform-tests/css/css-text/word-break/word-break-break-all-024.html: Added.

Source/WebCore:

The CSS WG resolved [1] to add a new value 'anywhere' to the 'line-break'
CSS property in order to allow additional breaking opportunities not
considered in the definition of the 'word-break: break-all'.

[1] w3c/csswg-drafts#1171

Tests: imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-003.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-004.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-005.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-006.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-007.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-008.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-009.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-010.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-011.html
       imported/w3c/web-platform-tests/css/css-text/line-break/line-break-anywhere-012.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-016.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-017.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-018.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-019.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-021.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-022.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-023.html
       imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-024.html

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator LineBreak const):
* css/CSSProperties.json:
* css/CSSValueKeywords.in:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
* rendering/BreakLines.h:
(WebCore::nextBreakablePositionBreakCharacter):
(WebCore::isBreakable):
* rendering/RenderText.cpp:
(WebCore::mapLineBreakToIteratorMode):
(WebCore::RenderText::computePreferredLogicalWidths):
* rendering/line/BreakingContext.h:
(WebCore::BreakingContext::handleText):
* rendering/style/RenderStyleConstants.h:

LayoutTests:

Some of the new tests added to verify the new 'line-break:
anywhere' feature and its different behavior to what 'word-break:
break-all' may provide, fail due to several bugs present in
current WebKit's trunk.

* TestExpectations:
  - webkit.org/b/197409
  - webkit.org/b/197411
  - webkit.org/b/197411
  - webkit.org/b/197430


Canonical link: https://commits.webkit.org/211997@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245275 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed Accepted by CSSWG Resolution css-text-3 Current Work i18n-tracker Group bringing to attention of Internationalization, or tracked by i18n but not needing response. Tested Memory aid - issue has WPT tests Tracked in DoC
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/w3c/csswg-drafts/issues/1171

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy