Created attachment 249321 [details] test cases In webkit, if an empty or all-space inline element has space(s) before or after it, and has white-space:pre, word-spacing on its parent, the width of the line will be wrong. In following lines, widths between two "M"s should be the same. But in Webkit, widths in the third and following lines are narrower than the first 2 lines: <div style="white-space:pre; word-spacing:1em;"> <div>M M (4 spaces in text)</div> <div>M<span style="background-color:red;"> </span>M (4 space in a inline)</div> <div>M <span style="background-color:red;"></span> M (2 space before, 2 space after, 0 space in the inline)</div> <div>M <span style="background-color:red;"> </span> M (1 space before and after, 2 space in the inline)</div> <div>M<span style="background-color:red;"> </span> M (0 space before, 2 space after, 2 space in the inline)</div> <div>M <span style="background-color:red;"> </span>M (2 space before, 0 space after, 2 space in the inline)</div> </div> You can also reproduce this issue by opening the attachment.
Created attachment 249574 [details] Test case2