RESOLVED FIXED 24186
Regression RTL: text truncation with text-overflow:ellipsis does not work correctly
https://bugs.webkit.org/show_bug.cgi?id=24186
Summary Regression RTL: text truncation with text-overflow:ellipsis does not work cor...
Xiaomei Ji
Reported 2009-02-26 00:28:01 PST
This is a regression, happens in nightly build r41128, but not in Safari 3.2.1. Bidi text "MSN Arabia رياضه، أخبار، مرآة، أفلام، موسيقى، جمال، سيارات، اقتصاد و المزيد على" was truncated wrong when the following style was specified: display:block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 207px; The truncation seems wrongly truncated the leading English characters. test case is attached.
Attachments
text overflow truncation (659 bytes, text/html)
2009-02-26 00:29 PST, Xiaomei Ji
no flags
Patch 1 (3.55 KB, patch)
2009-04-10 14:55 PDT, Jeremy Moskovich
no flags
Patch 2 (3.66 KB, patch)
2009-04-10 15:03 PDT, Jeremy Moskovich
no flags
Xiaomei Ji
Comment 1 2009-02-26 00:29:00 PST
Created attachment 28008 [details] text overflow truncation
Xiaomei Ji
Comment 2 2009-02-26 00:32:59 PST
Jeremy Moskovich
Comment 3 2009-04-10 14:48:58 PDT
The reason that the English text run is truncated is because of the way the loop in InlineFlowBox::placeEllipsisBox() works. It iterates over all of it's children from left to right till it finds the one containing the ellipsis, all boxes after that one are marked as hidden. This happens when foundBox is set to true. The fix is to change the order of iteration for the RTL case so we can correctly truncate the children to the left of the ellipsis.
Jeremy Moskovich
Comment 4 2009-04-10 14:55:32 PDT
Created attachment 29400 [details] Patch 1 Vary the order of iteration based on direction.
Jeremy Moskovich
Comment 5 2009-04-10 15:03:38 PDT
Created attachment 29401 [details] Patch 2 Add bug URL to changelog
Jeremy Moskovich
Comment 6 2009-05-01 15:22:54 PDT
Comment on attachment 29401 [details] Patch 2 Clearing review flag since I'm rolling this fix into the patch for bug 25135.
Dimitri Glazkov (Google)
Comment 7 2009-05-13 15:33:50 PDT
Note You need to log in before you can comment on or make changes to this bug.