Bug 5919 - Bidi algorithm should ignore empty inline containers
Summary: Bidi algorithm should ignore empty inline containers
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-02 13:05 PST by mitz
Modified: 2010-11-30 08:07 PST (History)
2 users (show)

See Also:


Attachments
testcase (1.51 KB, text/html)
2005-12-02 13:09 PST, mitz
no flags Details
WebKit rendering (8.91 KB, image/png)
2005-12-02 13:10 PST, mitz
no flags Details
Firefox rendering (9.86 KB, image/png)
2005-12-02 13:11 PST, mitz
no flags Details
WinIE rendering (3.66 KB, image/png)
2005-12-02 13:12 PST, mitz
no flags Details
WinIE8 rendering (5.13 KB, image/png)
2010-11-30 05:27 PST, Aharon (Vladimir) Lanin
no flags Details
Firefox 3.6.12 rendering (4.96 KB, image/png)
2010-11-30 05:32 PST, Aharon (Vladimir) Lanin
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2005-12-02 13:05:06 PST
The bidi algorithm considers an empty inline container, such (e.g. <span></span>) as an "other neutral". 
Firefox and WinIE ignore it completely. The difference affects the ordering of the rest of the line.

See the testcase and how it's rendered by TOT WebKit, Firefox 1.5 and WinIE. Obviously when the empty 
inline is left out of the reordering algorithm, Firefox and IE don't know where to put it (it should be visibly 
due to padding). You can see their original solutions to this problem.

I think a good solution for WebKit is to stick empty inilne containers in the last bidi run preceding them 
(and think of something to do if they're first in their line).
Comment 1 mitz 2005-12-02 13:09:35 PST
Created attachment 4907 [details]
testcase
Comment 2 mitz 2005-12-02 13:10:32 PST
Created attachment 4908 [details]
WebKit rendering
Comment 3 mitz 2005-12-02 13:11:11 PST
Created attachment 4909 [details]
Firefox rendering
Comment 4 mitz 2005-12-02 13:12:35 PST
Created attachment 4910 [details]
WinIE rendering

This is what is expected in terms of the ordering of Hebrew and Latin in each
case.
Comment 5 Eric Seidel (no email) 2005-12-27 23:56:30 PST
I'm surprised mitz hasn't fixed this one yet. :)  After all, he knows this code as well as anybody...
Comment 6 Aharon (Vladimir) Lanin 2010-11-30 05:27:33 PST
Created attachment 75128 [details]
WinIE8 rendering

This is the rendering in WinIE8. Now looks identical to WebKit rendering (which has not changed since 2005!) except for the "Nothing" case, which has nothing to do with this bug.
Comment 7 Aharon (Vladimir) Lanin 2010-11-30 05:32:54 PST
Created attachment 75129 [details]
Firefox 3.6.12 rendering

Now looks identical to WebKit rendering (which has not changed since 2005!), except for the "An image" case, where the difference seems to be due to Firefox's way of dealing with an img that has no src and hyas nothing to do with this bug.
Comment 8 Aharon (Vladimir) Lanin 2010-11-30 05:37:54 PST
As far as I can see, there is no bug here. The current versions of IE and Firefox do exactly the same thing as WebKit always did for empty spans.
Comment 9 mitz 2010-11-30 08:07:51 PST
Thanks for the update!