Bug 143000

Summary: Empty or all-space inline element with spaces around it, and has white-space:pre, word-spacing on its parent, causes wrong rendered width
Product: WebKit Reporter: Duan Yao <duanyao>
Component: TextAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: koivisto, mmaxfield, zalan
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
test cases
none
Test case2 none

Duan Yao
Reported 2015-03-24 01:20:15 PDT
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.
Attachments
test cases (937 bytes, text/html)
2015-03-24 01:20 PDT, Duan Yao
no flags
Test case2 (891 bytes, text/html)
2015-03-27 09:38 PDT, alan
no flags
alan
Comment 1 2015-03-27 09:38:10 PDT
Created attachment 249574 [details] Test case2
Note You need to log in before you can comment on or make changes to this bug.