[Webkit-unassigned] [Bug 211822] New: Line wrapping is incorrect when both ("overflow-wrap: break-word"/"word-break:break-word") and ("white-space: pre") are set
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue May 12 18:19:18 PDT 2020
https://bugs.webkit.org/show_bug.cgi?id=211822
Bug ID: 211822
Summary: Line wrapping is incorrect when both ("overflow-wrap:
break-word"/"word-break:break-word") and
("white-space: pre") are set
Product: WebKit
Version: WebKit Nightly Build
Hardware: All
OS: All
Status: NEW
Severity: Normal
Priority: P2
Component: CSS
Assignee: webkit-unassigned at lists.webkit.org
Reporter: josh9051 at gmail.com
Line wrapping is incorrect when both ("overflow-wrap: break-word"/"word-break:break-word") and ("white-space: pre") are set.
If you set "overflow-wrap: break-word" or "word-break:break-word" and "white-space: pre", the element will wrap. This is contrary to the spec:
https://drafts.csswg.org/css-text-3/#propdef-overflow-wrap
> This property specifies whether the UA may break at otherwise disallowed points within a line to prevent overflow, when an otherwise-unbreakable string is too long to fit within the line box. **It only has an effect when white-space allows wrapping**...
See the example below: https://jsfiddle.net/nw30cvtu/
```
<style>
.wrapper {
width: 100px;
border: 2px solid black;
}
* {
word-break: break-word;
}
.el {
white-space: pre;
}
</style>
<div class="wrapper">
<span class="el">Lorem ipsum dolor sit amet, consectetur adipiscing elit. </span>
</div>
```
Both chrome and firefox follow the spec correctly and don't wrap.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200513/2375c90e/attachment.htm>
More information about the webkit-unassigned
mailing list