Created attachment 196563 [details] Repro When an inline text block contains only whitespace, the word-spacing around the whitespace will get double-counted in some cases. A repro is attached.
Created attachment 196566 [details] Patch
I tried to review this, but I didn't know why wordMeasurement.startOffset was an appropriate test for ruling out a word that was only a single space character. Perhaps this would be obvious to a text expert. Otherwise, you should probably explain it in your ChangeLog.
(In reply to comment #2) > I tried to review this, but I didn't know why wordMeasurement.startOffset was an appropriate test for ruling out a word that was only a single space character. Perhaps this would be obvious to a text expert. Otherwise, you should probably explain it in your ChangeLog. Since we determine in that conditional that the wordLength is 1, if the start of the word is 0 and the character is a space, we can guarantee that the space is the only thing in that text run. Although you're right that that isn't obvious, and I should perhaps leave a comment.
Comment on attachment 196566 [details] Patch OK, I get it. r=me
It seems this r+ patch didn't landed while checking on Webkit GitHub with bug ID and this is current line of code, which this patch was trying to modify: https://github.com/WebKit/WebKit/blob/89d57a6f366a8abe5d012e38f160f81388b46429/Source/WebCore/rendering/LegacyLineLayout.cpp#L506 Test Case from Patch - https://jsfiddle.net/u0rc1z2t/show