Changing the white-space and -webkit-line-break properties in the attached test case should not affect the text at all, regardless of the text-align property value. Currently you get extra white space at the end of the lines (or no justification at all).
Created attachment 19875 [details] Test case
Note that since -webkit-line-break: after-white-space is the default for editable HTML, this affects editing.
Firefox sort of agrees with WebKit's current behavior for pre-wrap, so maybe only -webkit-line-break needs fixing.
Created attachment 20675 [details] Correct trailing whitespace behavior
Comment on attachment 20675 [details] Correct trailing whitespace behavior This code is pretty hard for me to follow, but probably necessarily so. I'd assert that run->m_previous is 0 in prependRun. 668 trailingSpaceWidth = (min(trailingSpaceRun->m_box->width(), (availableWidth - totWidth + 1) / 2)); This has an extra space and unneeded parentheses. 949 if (current != ' ' && current != '\t' && current != softHyphen && (current != '\n' || lastText->style()->preserveNewline()) && (current != noBreakSpace || lastText->style()->nbspMode() == NBNORMAL)) It seems like this line would read better if there was a helper function for it. 957 bool shouldSeparateSpaces = style()->direction() == RTL || trailingSpaceRun != start.lastRun() || trailingSpaceRun->m_level % 2 || textAlign != LEFT && textAlign != WEBKIT_LEFT && textAlign != TAAUTO; This is such a long condition that it might need some comments or be moved into an inline function or something. It also might be nice to make the common case faster -- I can't tell if this is so in the current version. r=me
Fixed in <http://trac.webkit.org/projects/webkit/changeset/32226>.