Bug 20957

Summary: offsetLeft is wrong for span-tags in some conditions
Product: WebKit Reporter: Arne <arne>
Component: Layout and RenderingAssignee: zalan <zalan>
Status: NEW    
Severity: Normal CC: ahmad.saleem792, ap, bfulgham, rniwa, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: All   
Attachments:
Description Flags
Testcase
none
Safari 15.6 differs from other browsers none

Arne
Reported 2008-09-20 04:39:03 PDT
A span-tag at the end of a paragraph, e.g: <p>Text <span></span></p> Does not have a proper offsetLeft when there is a whitespace between the text and span-tag.
Attachments
Testcase (676 bytes, text/html)
2008-09-20 04:41 PDT, Arne
no flags
Safari 15.6 differs from other browsers (616.87 KB, image/png)
2022-08-03 04:28 PDT, Ahmad Saleem
no flags
Arne
Comment 1 2008-09-20 04:41:21 PDT
Created attachment 23600 [details] Testcase A testcase for this, that will print an error if a strange wrong offsetLeft is received. It passes on FireFox/3.0.1.
Ahmad Saleem
Comment 2 2022-08-03 04:28:21 PDT
Created attachment 461375 [details] Safari 15.6 differs from other browsers I am able to reproduce this bug based on attached test case and Safari show extra line (Expected offsetLeft for empty span-tag...), which is not present in other browsers as can be seen from attached screenshot. I am changing "bug" status to NEW. Thanks!
Radar WebKit Bug Importer
Comment 3 2022-08-03 13:03:05 PDT
zalan
Comment 5 2023-06-14 09:28:37 PDT
This is about WebKit's useTrailingWhitespaceMeasuringOptimization (see TextUtil::width)
Note You need to log in before you can comment on or make changes to this bug.