RESOLVED CONFIGURATION CHANGED Bug 38222
"word-wrap: break-word" should not override "white-space: pre"
https://bugs.webkit.org/show_bug.cgi?id=38222
Summary "word-wrap: break-word" should not override "white-space: pre"
Xianzhu Wang
Reported 2010-04-27 15:06:10 PDT
Other browsers tested: Add OK or FAIL after other browsers where you have tested this issue: Chrome 5: FAIL Firefox 3.x: OK IE 8: OK What steps will reproduce the problem? 1. Open the attached test case. What is the expected result? Line won't wrap. What happens instead? Line wraps Please provide any additional information below. Attach a screenshot if possible. According to the CSS3 specification about word-wrap (http://www.w3.org/TR/css3-text/#word-wrap), the value of word-wrap only controls if the UA may break unbreakable words. It shouldn't force line- wrapping, and shouldn't override "white-space: pre". Though the title says "force", the content doesn't say it. "normal Lines may break only at allowed break points. break-word An unbreakable "word" may be broken at an arbitrary point if there are no otherwise-acceptable break points in the line..." http://crbug.com/42680
Attachments
testcase (126 bytes, text/html)
2010-04-28 10:59 PDT, Xianzhu Wang
no flags
Xianzhu Wang
Comment 1 2010-04-28 10:59:09 PDT
Created attachment 54586 [details] testcase
Chris Rebert
Comment 2 2014-06-24 14:41:44 PDT
Current analogous Chrome bug seems to be https://code.google.com/p/chromium/issues/detail?id=373502
Ahmad Saleem
Comment 3 2022-11-02 04:51:37 PDT
Changing this: https://github.com/WebKit/WebKit/blob/4032d1d4de923b3fa6b16e5174c4aa88041f0107/Source/WebCore/rendering/style/RenderStyle.h#L2334 Line: ``` return wordBreak() == WordBreak::BreakWord || overflowWrap() == OverflowWrap::BreakWord || overflowWrap() == OverflowWrap::Anywhere; ``` to: ``` return (wordBreak() == WordBreak::BreakWord || overflowWrap() == OverflowWrap::BreakWord || overflowWrap() == OverflowWrap::Anywhere) && whiteSpace() != WhiteSpace::Pre && whiteSpace() != WhiteSpace::NoWrap; _____ Just wanted to update.
Ahmad Saleem
Comment 4 2022-11-02 04:54:31 PDT
Although it seems - Safari Technology Preview 156 passes all WPT Tests cases: https://wpt.fyi/results/css/css-text?label=master&label=experimental&aligned&view=subtest&q=break-word and even attached test case seems to render same in Safari 16.1 as Chrome Canary 109 and Firefox Nightly 108. Do we need to do any changes? Thanks!
zalan
Comment 5 2022-11-02 08:24:53 PDT
IFC surely gets this right and in legacy line layout this must have been addressed in BreakingContext (and not in the RenderStyle helper function).
Note You need to log in before you can comment on or make changes to this bug.