Bug 124037 - Non-zero offsetWidth of an empty element
Summary: Non-zero offsetWidth of an empty element
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.9
: P2 Normal
Assignee: Nobody
URL: http://dev.ckeditor.com/ticket/11111
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-08 03:58 PST by Aleksander Nowodziński
Modified: 2022-06-02 14:11 PDT (History)
7 users (show)

See Also:


Attachments
Sample to reproduce the issue (448 bytes, text/html)
2013-11-08 03:58 PST, Aleksander Nowodziński
no flags Details
Safari 15.5 matches other browsers (269.06 KB, image/png)
2022-06-02 12:19 PDT, Ahmad Saleem
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aleksander Nowodziński 2013-11-08 03:58:56 PST
Created attachment 216373 [details]
Sample to reproduce the issue

Since Safari 7 (OSX 10.9), empty elements seem to have a non-zero offsetWidth under certain circumstances, which
obviously is invalid and leads to other issues. For example:

	// OffsetWidth of <b> is 1, why?
	<p>bold1 <i><b></b>x</i></p> 

	// OffsetWidth of <b> is 0.
	<p>bold3 <b></b></p> 

It looks like a regression in browser's engine as neither previous Safari nor other browsers behave like that.
I'm attaching a simple sample to reproduce the issue.

This issue refers to http://dev.ckeditor.com/ticket/11111
Comment 1 Piotrek Koszuliński (Reinmar) 2014-09-05 06:39:19 PDT
The same bug now got to the Chrome :D https://code.google.com/p/chromium/issues/detail?id=395136
Comment 2 m.lewandowski 2016-06-06 23:43:33 PDT
Chrome team seems to have fixed the bug, so now it's only WebKit left with this bug.
Comment 3 Ahmad Saleem 2022-06-02 12:19:03 PDT
Created attachment 459971 [details]
Safari 15.5 matches other browsers

I was not able to reproduce this bug in Safari 15.5 on macOS 12.4 and it matches other browsers as shown in the picture.

Since it was fixed along the line, can this be marked as "RESOLVED CONFIGURATION CHANGED". Thanks!
Comment 4 zalan 2022-06-02 14:11:18 PDT
Thank you for looking into it!