Bug 20957 - offsetLeft is wrong for span-tags in some conditions
Summary: offsetLeft is wrong for span-tags in some conditions
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac All
: P2 Normal
Assignee: zalan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2008-09-20 04:39 PDT by Arne
Modified: 2023-06-29 16:32 PDT (History)
7 users (show)

See Also:


Attachments
Testcase (676 bytes, text/html)
2008-09-20 04:41 PDT, Arne
no flags Details
Safari 15.6 differs from other browsers (616.87 KB, image/png)
2022-08-03 04:28 PDT, Ahmad Saleem
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Arne 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.
Comment 1 Arne 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.
Comment 2 Ahmad Saleem 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!
Comment 3 Radar WebKit Bug Importer 2022-08-03 13:03:05 PDT
<rdar://problem/98070891>
Comment 5 zalan 2023-06-14 09:28:37 PDT
This is about WebKit's useTrailingWhitespaceMeasuringOptimization (see TextUtil::width)