RESOLVED FIXED 121902
text-overflow: ellipsis is broken by text-align: right and padding-left
https://bugs.webkit.org/show_bug.cgi?id=121902
Summary text-overflow: ellipsis is broken by text-align: right and padding-left
Rob Crowther
Reported 2013-09-25 05:05:37 PDT
Created attachment 212554 [details] Test case demonstrating problem (middle div) If an element has both text-align: right and a value for padding-left then text-overflow: ellipsis is broken, no ellipses appear and the text is flush to the edge of the box.
Attachments
Test case demonstrating problem (middle div) (1.15 KB, text/html)
2013-09-25 05:05 PDT, Rob Crowther
no flags
Correct display of test case in Firefox 25 (31.83 KB, image/png)
2013-09-25 05:06 PDT, Rob Crowther
no flags
Incorrect display of test case in iOS7 (90.89 KB, image/png)
2013-09-25 05:07 PDT, Rob Crowther
no flags
Patch (24.68 KB, patch)
2014-02-19 00:46 PST, Deepak Mittal
no flags
Archive of layout-test-results from webkit-ews-12 for mac-mountainlion-wk2 (703.89 KB, application/zip)
2014-02-19 01:44 PST, Build Bot
no flags
Archive of layout-test-results from webkit-ews-02 for mac-mountainlion (789.61 KB, application/zip)
2014-02-19 02:34 PST, Build Bot
no flags
Patch (237.19 KB, patch)
2014-02-24 21:25 PST, Deepak Mittal
no flags
Patch (665.84 KB, patch)
2015-07-24 19:36 PDT, Myles C. Maxfield
no flags
Rob Crowther
Comment 1 2013-09-25 05:06:37 PDT
Created attachment 212555 [details] Correct display of test case in Firefox 25
Rob Crowther
Comment 2 2013-09-25 05:07:14 PDT
Created attachment 212556 [details] Incorrect display of test case in iOS7
Deepak Mittal
Comment 3 2014-02-13 04:47:26 PST
I am working on this issue.. I found the cause of this issue..if possible pleased assigned it to me..
Deepak Mittal
Comment 4 2014-02-19 00:46:28 PST
Build Bot
Comment 5 2014-02-19 01:44:43 PST
Comment on attachment 224604 [details] Patch Attachment 224604 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/4645716538425344 New failing tests: fast/ruby/ruby-base-merge-block-children-crash-2.html fast/css/vertical-text-overflow-ellipsis-text-align-right.html fast/css/text-alignment.html fast/css/text-overflow-ellipsis-text-align-right.html
Build Bot
Comment 6 2014-02-19 01:44:45 PST
Created attachment 224612 [details] Archive of layout-test-results from webkit-ews-12 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-12 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.5
Build Bot
Comment 7 2014-02-19 02:34:56 PST
Comment on attachment 224604 [details] Patch Attachment 224604 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/4604709801295872 New failing tests: fast/ruby/ruby-base-merge-block-children-crash-2.html fast/css/vertical-text-overflow-ellipsis-text-align-right.html fast/css/text-alignment.html fast/css/text-overflow-ellipsis-text-align-right.html
Build Bot
Comment 8 2014-02-19 02:34:58 PST
Created attachment 224615 [details] Archive of layout-test-results from webkit-ews-02 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-02 Port: mac-mountainlion Platform: Mac OS X 10.8.5
Deepak Mittal
Comment 9 2014-02-21 01:32:28 PST
I have found that in void RenderBlockFlow::checkLinesForTextOverflow() in RenderBlockLineLayout.cpp file The renderbox is getting shifted by the logicalLeft when TextAlign is RIGHT, that is in this case is 61 and 21, So due to this ellipsis are not showing in the second div element and for the third div ellipsis dots are touching right edge of the box. If I stop this adjustLogicalPosition call as : if (ltr) { if (textAlign == RIGHT) logicalLeft = 0; curr->adjustLogicalPosition(logicalLeft, 0); } Then the issue is not getting reproduced. But with this below test cases are failing.. fast/ruby/ruby-base-merge-block-children-crash-2.html fast/css/vertical-text-overflow-ellipsis-text-align-right.html fast/css/text-alignment.html fast/css/text-overflow-ellipsis-text-align-right.html
Deepak Mittal
Comment 10 2014-02-24 21:25:37 PST
Deepak Mittal
Comment 11 2014-02-24 22:36:53 PST
Please review this patch, and let me know if any query..
zalan
Comment 12 2014-03-01 21:51:16 PST
Comment on attachment 225120 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=225120&action=review > Source/WebCore/rendering/RenderBlockLineLayout.cpp:2089 > + logicalLeft = 0; Override the value here which is calculated a few line above (in updateLogicalWidthForAlignment()) does not seem to be the right thing to do. I'd look into updateLogicalWidthForAlignment() to figure out why it returns invalid logicalLeft.
Deepak Mittal
Comment 13 2014-03-13 01:46:05 PDT
(In reply to comment #12) > (From update of attachment 225120 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=225120&action=review > > > Source/WebCore/rendering/RenderBlockLineLayout.cpp:2089 > > + logicalLeft = 0; > > Override the value here which is calculated a few line above (in updateLogicalWidthForAlignment()) does not seem to be the right thing to do. I'd look into updateLogicalWidthForAlignment() to figure out why it returns invalid logicalLeft. This is happening as updateLogicalWidthForAlignment() when textAline is RIGHT, Then logicalLeft will get set to the difference of availableLogicalWidth and the totalLogicalWidth. As if (totalLogicalWidth < availableLogicalWidth) logicalLeft += availableLogicalWidth - totalLogicalWidth; That is causing the shift of the second box.as a part of adjustLogicalPosition() call.I have checked that in the FF this shifting is not happening so second box is coming properly..
zalan
Comment 14 2014-03-14 10:51:53 PDT
(In reply to comment #13) > (In reply to comment #12) > > (From update of attachment 225120 [details] [details]) > > View in context: https://bugs.webkit.org/attachment.cgi?id=225120&action=review > > > > > Source/WebCore/rendering/RenderBlockLineLayout.cpp:2089 > > > + logicalLeft = 0; > > > > Override the value here which is calculated a few line above (in updateLogicalWidthForAlignment()) does not seem to be the right thing to do. I'd look into updateLogicalWidthForAlignment() to figure out why it returns invalid logicalLeft. > > This is happening as updateLogicalWidthForAlignment() when textAline is RIGHT, Then logicalLeft will get set to the difference of availableLogicalWidth and the totalLogicalWidth. As > > if (totalLogicalWidth < availableLogicalWidth) > logicalLeft += availableLogicalWidth - totalLogicalWidth; > > That is causing the shift of the second box.as a part of adjustLogicalPosition() call.I have checked that in the FF this shifting is not happening so second box is coming properly.. updateLogicalWidthForRightAlignedBlock() seems to have a very specific calculation about this. Your best bet to figure it out is to talk to David Hyatt at #webkit.
Deepak Mittal
Comment 15 2014-03-19 23:32:18 PDT
Hi David Hyatt, Can you please give your opinion on my patch ..Thanks..
Ben Frain
Comment 16 2015-07-22 03:15:41 PDT
This is problem for us. We have a situation where we are displaying a score board header for Live sports events. The team on the right of the scoreboard that is right aligned fails to get truncated name in Safari/iOS. Fine everywhere else. Any chance this fix will be in before iOS9? Otherwise we have another year to wait!!
Ben Frain
Comment 17 2015-07-22 03:54:56 PDT
Here is a reduction of our use case, showing the problem that Safari exhibits: http://codepen.io/benfrain/full/JdavXM
Myles C. Maxfield
Comment 18 2015-07-24 19:36:50 PDT
WebKit Commit Bot
Comment 19 2015-07-24 20:52:32 PDT
Comment on attachment 257505 [details] Patch Clearing flags on attachment: 257505 Committed r187380: <http://trac.webkit.org/changeset/187380>
WebKit Commit Bot
Comment 20 2015-07-24 20:52:40 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 21 2015-07-25 01:25:22 PDT
Alexey Proskuryakov
Comment 22 2015-07-25 18:44:07 PDT
This change broke multiple tests on Windows. Myles, will you have a moment to update the results (assuming that this is all that's needed)? fast/css/text-overflow-ellipsis-text-align-center.html fast/css/text-overflow-ellipsis-text-align-left.html fast/css/text-overflow-ellipsis-text-align-right.html fast/css/vertical-text-overflow-ellipsis-text-align-center.html fast/css/vertical-text-overflow-ellipsis-text-align-right.html fast/inline/padding-ellipsis-right.html
Myles C. Maxfield
Comment 23 2015-07-27 14:54:18 PDT
Committed r187452
Note You need to log in before you can comment on or make changes to this bug.