[I noticed this when looking at the test case for bug 13071] The last character of the last word in white-space:pre-wrap that is too wide to fit gets wrapped to the next line. This regressed in <http://trac.webkit.org/projects/webkit/changeset/15617>.
Created attachment 13634 [details] Test case
This is the change in r15617: if (lBreak == start && !lBreak.obj->isBR()) { // we just add as much as possible - if (style()->whiteSpace() == PRE) { + if (style()->preserveNewline()) { // FIXME: Don't really understand this case. if (pos != 0) { And this is the explanation from the change log: + * rendering/bidi.cpp: (WebCore::RenderBlock::findNextLineBreak): Took a rule + that specifically called out the pre whitespace mode and made it work for all + the modes that preserve newlines. This makes sure we get a last line box for + text after the last "\n" even in cases where there is no <br> afterward. I'm not sure that rule was about preserving newlines. I don't understand it either, but at least the (pos != 0) case seems wrong even for PRE. Reverting the above change fixes the present bug and passes all layout tests.
Attach a patch and I will r= this.
Created attachment 13638 [details] Patch
Comment on attachment 13638 [details] Patch My guess is this was just unintentional cleanup. r=me
Landed in r20200.