Title: [187380] trunk
Revision
187380
Author
mmaxfi...@apple.com
Date
2015-07-24 20:51:06 -0700 (Fri, 24 Jul 2015)

Log Message

text-overflow: ellipsis is broken by text-align: right and padding-left
https://bugs.webkit.org/show_bug.cgi?id=121902

Reviewed by Zalan Bujtas.

Source/WebCore:

Right offsets (which include padding) are not the same as widths (which don't).

Test: fast/inline/padding-ellipsis-right.html

* rendering/RenderBlockLineLayout.cpp:
(WebCore::updateLogicalWidthForRightAlignedBlock):
(WebCore::RenderBlockFlow::checkLinesForTextOverflow):

LayoutTests:

Updating expected results.

* fast/inline/padding-ellipsis-right-expected.html: Added.
* fast/inline/padding-ellipsis-right.html: Added.
* platform/mac/fast/css/text-overflow-ellipsis-text-align-center-expected.png:
* platform/mac/fast/css/text-overflow-ellipsis-text-align-center-expected.txt:
* platform/mac/fast/css/text-overflow-ellipsis-text-align-left-expected.png:
* platform/mac/fast/css/text-overflow-ellipsis-text-align-left-expected.txt:
* platform/mac/fast/css/text-overflow-ellipsis-text-align-right-expected.png:
* platform/mac/fast/css/text-overflow-ellipsis-text-align-right-expected.txt:
* platform/mac/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.png:
* platform/mac/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.txt:
* platform/mac/fast/css/vertical-text-overflow-ellipsis-text-align-left-expected.png:
* platform/mac/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.png:
* platform/mac/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.txt:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (187379 => 187380)


--- trunk/LayoutTests/ChangeLog	2015-07-25 03:41:08 UTC (rev 187379)
+++ trunk/LayoutTests/ChangeLog	2015-07-25 03:51:06 UTC (rev 187380)
@@ -1,3 +1,26 @@
+2015-07-24  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        text-overflow: ellipsis is broken by text-align: right and padding-left
+        https://bugs.webkit.org/show_bug.cgi?id=121902
+
+        Reviewed by Zalan Bujtas.
+
+        Updating expected results.
+
+        * fast/inline/padding-ellipsis-right-expected.html: Added.
+        * fast/inline/padding-ellipsis-right.html: Added.
+        * platform/mac/fast/css/text-overflow-ellipsis-text-align-center-expected.png:
+        * platform/mac/fast/css/text-overflow-ellipsis-text-align-center-expected.txt:
+        * platform/mac/fast/css/text-overflow-ellipsis-text-align-left-expected.png:
+        * platform/mac/fast/css/text-overflow-ellipsis-text-align-left-expected.txt:
+        * platform/mac/fast/css/text-overflow-ellipsis-text-align-right-expected.png:
+        * platform/mac/fast/css/text-overflow-ellipsis-text-align-right-expected.txt:
+        * platform/mac/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.png:
+        * platform/mac/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.txt:
+        * platform/mac/fast/css/vertical-text-overflow-ellipsis-text-align-left-expected.png:
+        * platform/mac/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.png:
+        * platform/mac/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.txt:
+
 2015-07-24  Sajid Anwar  <sajidanwa...@gmail.com>
 
         [MSE] Incorrect sample timestamps when using "sequence" mode

Added: trunk/LayoutTests/fast/inline/padding-ellipsis-right-expected.html (0 => 187380)


--- trunk/LayoutTests/fast/inline/padding-ellipsis-right-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/inline/padding-ellipsis-right-expected.html	2015-07-25 03:51:06 UTC (rev 187380)
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+This test makes sure that text-align: right, text-overflow: ellipsis, and padding all play nicely with each other.
+<div style="font-size: 0px;">
+<div style="width: 140px; height: 20px; background-color: green;"></div><div style="display: inline-block; width: 20px; height: 20px; background-color: green;"></div><div style="display: inline-block; width: 100px; height: 20px; background-color: black;"></div><div style="display: inline-block; width: 20px; height: 20px; background-color: green;"></div><div style="width: 140px; height: 20px; background-color: green;"></div>
+</div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/fast/inline/padding-ellipsis-right.html (0 => 187380)


--- trunk/LayoutTests/fast/inline/padding-ellipsis-right.html	                        (rev 0)
+++ trunk/LayoutTests/fast/inline/padding-ellipsis-right.html	2015-07-25 03:51:06 UTC (rev 187380)
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+This test makes sure that text-align: right, text-overflow: ellipsis, and padding all play nicely with each other.
+<div style="font: 20px Ahem; -webkit-font-smoothing: none;">
+<div style="padding: 20px; width: 100px; background-color: green; overflow: hidden; text-overflow: ellipsis; text-align: right;">abcdefghijklmnopqrstuvwxyz</div>
+</div>
+</body>
+</html>

Modified: trunk/LayoutTests/platform/mac/fast/css/text-overflow-ellipsis-text-align-center-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/mac/fast/css/text-overflow-ellipsis-text-align-center-expected.txt (187379 => 187380)


--- trunk/LayoutTests/platform/mac/fast/css/text-overflow-ellipsis-text-align-center-expected.txt	2015-07-25 03:41:08 UTC (rev 187379)
+++ trunk/LayoutTests/platform/mac/fast/css/text-overflow-ellipsis-text-align-center-expected.txt	2015-07-25 03:51:06 UTC (rev 187380)
@@ -35,29 +35,29 @@
           text run at (0,0) width 506: "Right-To-Left containing replaced content blocking the ellipsis"
 layer at (8,119) size 310x20 clip at (9,120) size 308x18 scrollWidth 738
   RenderBlock {DIV} at (0,111) size 310x21 [border: (1px solid #000000)]
-    RenderText {#text} at (2,1) size 738x18
-      text run at (2,1) width 738: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    RenderText {#text} at (1,1) size 738x18
+      text run at (1,1) width 738: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
 layer at (8,200) size 310x74 clip at (9,201) size 308x72 scrollWidth 738
   RenderBlock {DIV} at (0,192) size 310x75 [border: (1px solid #000000)]
-    RenderText {#text} at (2,1) size 738x18
-      text run at (2,1) width 738: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    RenderText {#text} at (1,1) size 738x18
+      text run at (1,1) width 738: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     RenderBR {BR} at (0,0) size 0x0
     RenderText {#text} at (1,19) size 728x18
       text run at (1,19) width 728: "orem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     RenderBR {BR} at (0,0) size 0x0
-    RenderText {#text} at (2,37) size 720x18
-      text run at (2,37) width 720: "rem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    RenderText {#text} at (1,37) size 720x18
+      text run at (1,37) width 720: "rem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     RenderBR {BR} at (0,0) size 0x0
-    RenderText {#text} at (2,55) size 715x18
-      text run at (2,55) width 715: "em ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    RenderText {#text} at (2,55) size 714x18
+      text run at (2,55) width 714: "em ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     RenderBR {BR} at (0,0) size 0x0
 layer at (8,335) size 310x31 clip at (9,336) size 308x29 scrollWidth 766
   RenderBlock {DIV} at (0,326) size 310x32 [border: (1px solid #000000)]
-    RenderText {#text} at (1,12) size 187x18
-      text run at (1,12) width 187: "Lorem ipsum dolor sit amet, "
-    RenderImage {IMG} at (187,1) size 26x25
-    RenderText {#text} at (212,12) size 556x18
-      text run at (212,12) width 556: " consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    RenderText {#text} at (1,12) size 186x18
+      text run at (1,12) width 186: "Lorem ipsum dolor sit amet, "
+    RenderImage {IMG} at (186,1) size 26x25
+    RenderText {#text} at (211,12) size 556x18
+      text run at (211,12) width 556: " consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
 layer at (8,427) size 310x31 clip at (9,428) size 308x29 scrollWidth 762
   RenderBlock {DIV} at (0,418) size 310x32 [border: (1px solid #000000)]
     RenderText {#text} at (1,12) size 278x18
@@ -65,31 +65,31 @@
     RenderImage {IMG} at (278,1) size 26x25
     RenderText {#text} at (303,12) size 460x18
       text run at (303,12) width 460: "ipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
-layer at (8,518) size 310x20 clip at (9,519) size 308x18 scrollX 430 scrollWidth 738
+layer at (8,518) size 310x20 clip at (9,519) size 308x18 scrollX 429 scrollWidth 738
   RenderBlock {DIV} at (0,510) size 310x21 [border: (1px solid #000000)]
-    RenderText {#text} at (-429,1) size 738x18
-      text run at (-429,1) width 737 RTL override: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
-layer at (8,599) size 310x74 clip at (9,600) size 308x72 scrollX 430 scrollWidth 738
+    RenderText {#text} at (-428,1) size 738x18
+      text run at (-428,1) width 737 RTL override: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+layer at (8,599) size 310x74 clip at (9,600) size 308x72 scrollX 429 scrollWidth 738
   RenderBlock {DIV} at (0,591) size 310x75 [border: (1px solid #000000)]
-    RenderText {#text} at (-429,1) size 738x18
-      text run at (-429,1) width 737 RTL override: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    RenderText {#text} at (-428,1) size 738x18
+      text run at (-428,1) width 737 RTL override: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     RenderBR {BR} at (0,0) size 0x0
     RenderText {#text} at (-418,19) size 728x18
       text run at (-418,19) width 727 RTL override: "orem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     RenderBR {BR} at (0,0) size 0x0
-    RenderText {#text} at (-411,37) size 720x18
-      text run at (-411,37) width 719 RTL override: "rem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    RenderText {#text} at (-410,37) size 720x18
+      text run at (-410,37) width 719 RTL override: "rem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     RenderBR {BR} at (0,0) size 0x0
-    RenderText {#text} at (-406,55) size 715x18
-      text run at (-406,55) width 714 RTL override: "em ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    RenderText {#text} at (-405,55) size 714x18
+      text run at (-405,55) width 713 RTL override: "em ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     RenderBR {BR} at (0,0) size 0x0
-layer at (8,734) size 310x31 clip at (9,735) size 308x29 scrollX 458 scrollWidth 766
+layer at (8,734) size 310x31 clip at (9,735) size 308x29 scrollX 457 scrollWidth 766
   RenderBlock {DIV} at (0,725) size 310x32 [border: (1px solid #000000)]
-    RenderText {#text} at (122,12) size 187x18
-      text run at (122,12) width 187 RTL override: "Lorem ipsum dolor sit amet, "
-    RenderImage {IMG} at (97,1) size 26x25
-    RenderText {#text} at (-457,12) size 556x18
-      text run at (-457,12) width 555 RTL override: " consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    RenderText {#text} at (123,12) size 186x18
+      text run at (123,12) width 186 RTL override: "Lorem ipsum dolor sit amet, "
+    RenderImage {IMG} at (98,1) size 26x25
+    RenderText {#text} at (-456,12) size 556x18
+      text run at (-456,12) width 555 RTL override: " consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
 layer at (8,825) size 310x31 clip at (9,826) size 308x29 scrollX 453 scrollWidth 762
   RenderBlock {DIV} at (0,817) size 310x32 [border: (1px solid #000000)]
     RenderText {#text} at (31,12) size 278x18

Modified: trunk/LayoutTests/platform/mac/fast/css/text-overflow-ellipsis-text-align-left-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/mac/fast/css/text-overflow-ellipsis-text-align-left-expected.txt (187379 => 187380)


--- trunk/LayoutTests/platform/mac/fast/css/text-overflow-ellipsis-text-align-left-expected.txt	2015-07-25 03:41:08 UTC (rev 187379)
+++ trunk/LayoutTests/platform/mac/fast/css/text-overflow-ellipsis-text-align-left-expected.txt	2015-07-25 03:51:06 UTC (rev 187380)
@@ -65,31 +65,31 @@
     RenderImage {IMG} at (278,1) size 26x25
     RenderText {#text} at (303,12) size 460x18
       text run at (303,12) width 460: "ipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
-layer at (8,518) size 310x20 clip at (9,519) size 308x18 scrollX 431 scrollWidth 740
+layer at (8,518) size 310x20 clip at (9,519) size 308x18 scrollX 430 scrollWidth 739
   RenderBlock {DIV} at (0,510) size 310x21 [border: (1px solid #000000)]
-    RenderText {#text} at (-430,1) size 738x18
-      text run at (-430,1) width 737 RTL override: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
-layer at (8,599) size 310x74 clip at (9,600) size 308x72 scrollX 431 scrollWidth 740
+    RenderText {#text} at (-429,1) size 738x18
+      text run at (-429,1) width 737 RTL override: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+layer at (8,599) size 310x74 clip at (9,600) size 308x72 scrollX 430 scrollWidth 739
   RenderBlock {DIV} at (0,591) size 310x75 [border: (1px solid #000000)]
-    RenderText {#text} at (-430,1) size 738x18
-      text run at (-430,1) width 737 RTL override: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    RenderText {#text} at (-429,1) size 738x18
+      text run at (-429,1) width 737 RTL override: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     RenderBR {BR} at (0,0) size 0x0
-    RenderText {#text} at (-419,19) size 728x18
-      text run at (-419,19) width 727 RTL override: "orem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    RenderText {#text} at (-418,19) size 728x18
+      text run at (-418,19) width 727 RTL override: "orem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     RenderBR {BR} at (0,0) size 0x0
-    RenderText {#text} at (-412,37) size 720x18
-      text run at (-412,37) width 719 RTL override: "rem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    RenderText {#text} at (-411,37) size 720x18
+      text run at (-411,37) width 719 RTL override: "rem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     RenderBR {BR} at (0,0) size 0x0
-    RenderText {#text} at (-408,55) size 715x18
-      text run at (-408,55) width 714 RTL override: "em ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    RenderText {#text} at (-407,55) size 715x18
+      text run at (-407,55) width 714 RTL override: "em ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     RenderBR {BR} at (0,0) size 0x0
-layer at (8,734) size 310x31 clip at (9,735) size 308x29 scrollX 459 scrollWidth 767
+layer at (8,734) size 310x31 clip at (9,735) size 308x29 scrollX 458 scrollWidth 766
   RenderBlock {DIV} at (0,725) size 310x32 [border: (1px solid #000000)]
-    RenderText {#text} at (121,12) size 187x18
-      text run at (121,12) width 187 RTL override: "Lorem ipsum dolor sit amet, "
-    RenderImage {IMG} at (96,1) size 26x25
-    RenderText {#text} at (-458,12) size 556x18
-      text run at (-458,12) width 555 RTL override: " consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    RenderText {#text} at (122,12) size 187x18
+      text run at (122,12) width 187 RTL override: "Lorem ipsum dolor sit amet, "
+    RenderImage {IMG} at (97,1) size 26x25
+    RenderText {#text} at (-457,12) size 556x18
+      text run at (-457,12) width 555 RTL override: " consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
 layer at (8,825) size 310x31 clip at (9,826) size 308x29 scrollX 453 scrollWidth 762
   RenderBlock {DIV} at (0,817) size 310x32 [border: (1px solid #000000)]
     RenderText {#text} at (31,12) size 278x18

Modified: trunk/LayoutTests/platform/mac/fast/css/text-overflow-ellipsis-text-align-right-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/mac/fast/css/text-overflow-ellipsis-text-align-right-expected.txt (187379 => 187380)


--- trunk/LayoutTests/platform/mac/fast/css/text-overflow-ellipsis-text-align-right-expected.txt	2015-07-25 03:41:08 UTC (rev 187379)
+++ trunk/LayoutTests/platform/mac/fast/css/text-overflow-ellipsis-text-align-right-expected.txt	2015-07-25 03:51:06 UTC (rev 187380)
@@ -33,31 +33,31 @@
       RenderBlock {H3} at (0,776) size 769x23
         RenderText {#text} at (0,0) size 506x22
           text run at (0,0) width 506: "Right-To-Left containing replaced content blocking the ellipsis"
-layer at (8,119) size 310x20 clip at (9,120) size 308x18 scrollWidth 740
+layer at (8,119) size 310x20 clip at (9,120) size 308x18 scrollWidth 739
   RenderBlock {DIV} at (0,111) size 310x21 [border: (1px solid #000000)]
-    RenderText {#text} at (3,1) size 738x18
-      text run at (3,1) width 738: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
-layer at (8,200) size 310x74 clip at (9,201) size 308x72 scrollWidth 740
+    RenderText {#text} at (2,1) size 738x18
+      text run at (2,1) width 738: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+layer at (8,200) size 310x74 clip at (9,201) size 308x72 scrollWidth 739
   RenderBlock {DIV} at (0,192) size 310x75 [border: (1px solid #000000)]
-    RenderText {#text} at (3,1) size 738x18
-      text run at (3,1) width 738: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    RenderText {#text} at (2,1) size 738x18
+      text run at (2,1) width 738: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     RenderBR {BR} at (0,0) size 0x0
-    RenderText {#text} at (2,19) size 728x18
-      text run at (2,19) width 728: "orem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    RenderText {#text} at (1,19) size 728x18
+      text run at (1,19) width 728: "orem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     RenderBR {BR} at (0,0) size 0x0
-    RenderText {#text} at (3,37) size 720x18
-      text run at (3,37) width 720: "rem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    RenderText {#text} at (2,37) size 720x18
+      text run at (2,37) width 720: "rem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     RenderBR {BR} at (0,0) size 0x0
-    RenderText {#text} at (4,55) size 715x18
-      text run at (4,55) width 715: "em ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    RenderText {#text} at (3,55) size 715x18
+      text run at (3,55) width 715: "em ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     RenderBR {BR} at (0,0) size 0x0
-layer at (8,335) size 310x31 clip at (9,336) size 308x29 scrollWidth 767
+layer at (8,335) size 310x31 clip at (9,336) size 308x29 scrollWidth 766
   RenderBlock {DIV} at (0,326) size 310x32 [border: (1px solid #000000)]
-    RenderText {#text} at (2,12) size 187x18
-      text run at (2,12) width 187: "Lorem ipsum dolor sit amet, "
-    RenderImage {IMG} at (188,1) size 26x25
-    RenderText {#text} at (213,12) size 556x18
-      text run at (213,12) width 556: " consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    RenderText {#text} at (1,12) size 187x18
+      text run at (1,12) width 187: "Lorem ipsum dolor sit amet, "
+    RenderImage {IMG} at (187,1) size 26x25
+    RenderText {#text} at (212,12) size 556x18
+      text run at (212,12) width 556: " consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
 layer at (8,427) size 310x31 clip at (9,428) size 308x29 scrollWidth 762
   RenderBlock {DIV} at (0,418) size 310x32 [border: (1px solid #000000)]
     RenderText {#text} at (1,12) size 278x18

Modified: trunk/LayoutTests/platform/mac/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/mac/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.txt (187379 => 187380)


--- trunk/LayoutTests/platform/mac/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.txt	2015-07-25 03:41:08 UTC (rev 187379)
+++ trunk/LayoutTests/platform/mac/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.txt	2015-07-25 03:51:06 UTC (rev 187380)
@@ -29,36 +29,36 @@
           text run at (0,0) width 506: "Right-To-Left containing replaced content blocking the ellipsis"
 layer at (8,49) size 20x310 clip at (9,50) size 18x308 scrollHeight 737
   RenderBlock {DIV} at (0,40) size 20x311 [border: (1px solid #000000)]
-    RenderText {#text} at (1,1) size 18x738
+    RenderText {#text} at (1,1) size 18x737
       text run at (1,1) width 737: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
 layer at (8,419) size 74x310 clip at (9,420) size 72x308 scrollHeight 737
   RenderBlock {DIV} at (0,411) size 74x311 [border: (1px solid #000000)]
-    RenderText {#text} at (1,1) size 18x738
+    RenderText {#text} at (1,1) size 18x737
       text run at (1,1) width 737: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     RenderBR {BR} at (0,0) size 0x0
-    RenderText {#text} at (19,1) size 18x728
+    RenderText {#text} at (19,1) size 18x727
       text run at (19,1) width 727: "orem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     RenderBR {BR} at (0,0) size 0x0
-    RenderText {#text} at (37,1) size 18x720
+    RenderText {#text} at (37,1) size 18x719
       text run at (37,1) width 719: "rem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     RenderBR {BR} at (0,0) size 0x0
-    RenderText {#text} at (55,1) size 18x715
+    RenderText {#text} at (55,1) size 18x714
       text run at (55,1) width 714: "em ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     RenderBR {BR} at (0,0) size 0x0
 layer at (8,790) size 31x310 clip at (9,791) size 29x308 scrollHeight 766
   RenderBlock {DIV} at (0,782) size 31x311 [border: (1px solid #000000)]
-    RenderText {#text} at (12,1) size 18x187
+    RenderText {#text} at (12,1) size 18x186
       text run at (12,1) width 186: "Lorem ipsum dolor sit amet, "
-    RenderImage {IMG} at (1,187) size 25x26
-    RenderText {#text} at (12,212) size 18x556
-      text run at (12,212) width 555: " consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    RenderImage {IMG} at (1,186) size 25x26
+    RenderText {#text} at (12,211) size 18x556
+      text run at (12,211) width 555: " consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
 layer at (8,1161) size 31x310 clip at (9,1162) size 29x308 scrollHeight 762
   RenderBlock {DIV} at (0,1152) size 31x311 [border: (1px solid #000000)]
-    RenderText {#text} at (12,1) size 18x279
+    RenderText {#text} at (12,1) size 18x278
       text run at (12,1) width 278: "Lorem ipsum dolor sit amet, consectetur ad"
-    RenderImage {IMG} at (1,279) size 25x26
-    RenderText {#text} at (12,304) size 18x460
-      text run at (12,304) width 459: "ipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    RenderImage {IMG} at (1,278) size 25x26
+    RenderText {#text} at (12,303) size 18x460
+      text run at (12,303) width 459: "ipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
 layer at (8,1532) size 20x310 clip at (9,1533) size 18x308 scrollY 428 scrollHeight 737
   RenderBlock {DIV} at (0,1523) size 20x311 [border: (1px solid #000000)]
     RenderText {#text} at (1,-427) size 18x737

Modified: trunk/LayoutTests/platform/mac/fast/css/vertical-text-overflow-ellipsis-text-align-left-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/mac/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/mac/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.txt (187379 => 187380)


--- trunk/LayoutTests/platform/mac/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.txt	2015-07-25 03:41:08 UTC (rev 187379)
+++ trunk/LayoutTests/platform/mac/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.txt	2015-07-25 03:51:06 UTC (rev 187380)
@@ -27,38 +27,38 @@
       RenderBlock {H3} at (0,2595) size 769x23
         RenderText {#text} at (0,0) size 506x22
           text run at (0,0) width 506: "Right-To-Left containing replaced content blocking the ellipsis"
-layer at (8,49) size 20x310 clip at (9,50) size 18x308 scrollHeight 738
+layer at (8,49) size 20x310 clip at (9,50) size 18x308 scrollHeight 737
   RenderBlock {DIV} at (0,40) size 20x311 [border: (1px solid #000000)]
-    RenderText {#text} at (1,2) size 18x737
-      text run at (1,2) width 737: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
-layer at (8,419) size 74x310 clip at (9,420) size 72x308 scrollHeight 738
+    RenderText {#text} at (1,1) size 18x737
+      text run at (1,1) width 737: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+layer at (8,419) size 74x310 clip at (9,420) size 72x308 scrollHeight 737
   RenderBlock {DIV} at (0,411) size 74x311 [border: (1px solid #000000)]
-    RenderText {#text} at (1,2) size 18x737
-      text run at (1,2) width 737: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    RenderText {#text} at (1,1) size 18x737
+      text run at (1,1) width 737: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     RenderBR {BR} at (0,0) size 0x0
-    RenderText {#text} at (19,2) size 18x727
-      text run at (19,2) width 727: "orem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    RenderText {#text} at (19,1) size 18x727
+      text run at (19,1) width 727: "orem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     RenderBR {BR} at (0,0) size 0x0
-    RenderText {#text} at (37,2) size 18x719
-      text run at (37,2) width 719: "rem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    RenderText {#text} at (37,1) size 18x719
+      text run at (37,1) width 719: "rem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     RenderBR {BR} at (0,0) size 0x0
-    RenderText {#text} at (55,2) size 18x714
-      text run at (55,2) width 714: "em ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    RenderText {#text} at (55,1) size 18x714
+      text run at (55,1) width 714: "em ipsum dolor sit amet, consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
     RenderBR {BR} at (0,0) size 0x0
-layer at (8,790) size 31x310 clip at (9,791) size 29x308 scrollHeight 767
+layer at (8,790) size 31x310 clip at (9,791) size 29x308 scrollHeight 766
   RenderBlock {DIV} at (0,782) size 31x311 [border: (1px solid #000000)]
-    RenderText {#text} at (12,2) size 18x186
-      text run at (12,2) width 186: "Lorem ipsum dolor sit amet, "
-    RenderImage {IMG} at (1,187) size 25x26
-    RenderText {#text} at (12,212) size 18x556
-      text run at (12,212) width 555: " consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
-layer at (8,1161) size 31x310 clip at (9,1162) size 29x308 scrollHeight 763
+    RenderText {#text} at (12,1) size 18x186
+      text run at (12,1) width 186: "Lorem ipsum dolor sit amet, "
+    RenderImage {IMG} at (1,186) size 25x26
+    RenderText {#text} at (12,211) size 18x556
+      text run at (12,211) width 555: " consectetur adipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+layer at (8,1161) size 31x310 clip at (9,1162) size 29x308 scrollHeight 762
   RenderBlock {DIV} at (0,1152) size 31x311 [border: (1px solid #000000)]
-    RenderText {#text} at (12,2) size 18x278
-      text run at (12,2) width 278: "Lorem ipsum dolor sit amet, consectetur ad"
-    RenderImage {IMG} at (1,279) size 25x26
-    RenderText {#text} at (12,304) size 18x460
-      text run at (12,304) width 459: "ipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
+    RenderText {#text} at (12,1) size 18x278
+      text run at (12,1) width 278: "Lorem ipsum dolor sit amet, consectetur ad"
+    RenderImage {IMG} at (1,278) size 25x26
+    RenderText {#text} at (12,303) size 18x460
+      text run at (12,303) width 459: "ipiscing elit. Vivamus vitae eros non libero faucibus sagittis sed ut eros."
 layer at (8,1532) size 20x310 clip at (9,1533) size 18x308 scrollY 428 scrollHeight 737
   RenderBlock {DIV} at (0,1523) size 20x311 [border: (1px solid #000000)]
     RenderText {#text} at (1,-427) size 18x737

Modified: trunk/Source/WebCore/ChangeLog (187379 => 187380)


--- trunk/Source/WebCore/ChangeLog	2015-07-25 03:41:08 UTC (rev 187379)
+++ trunk/Source/WebCore/ChangeLog	2015-07-25 03:51:06 UTC (rev 187380)
@@ -1,3 +1,18 @@
+2015-07-24  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        text-overflow: ellipsis is broken by text-align: right and padding-left
+        https://bugs.webkit.org/show_bug.cgi?id=121902
+
+        Reviewed by Zalan Bujtas.
+
+        Right offsets (which include padding) are not the same as widths (which don't).
+
+        Test: fast/inline/padding-ellipsis-right.html
+
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::updateLogicalWidthForRightAlignedBlock):
+        (WebCore::RenderBlockFlow::checkLinesForTextOverflow):
+
 2015-07-24  Dan Bernstein  <m...@apple.com>
 
         Tried to fix the iOS 9 build after r187375.

Modified: trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp (187379 => 187380)


--- trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2015-07-25 03:41:08 UTC (rev 187379)
+++ trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2015-07-25 03:51:06 UTC (rev 187380)
@@ -416,8 +416,7 @@
             totalLogicalWidth -= trailingSpaceRun->box()->logicalWidth();
             trailingSpaceRun->box()->setLogicalWidth(0);
         }
-        if (totalLogicalWidth < availableLogicalWidth)
-            logicalLeft += availableLogicalWidth - totalLogicalWidth;
+        logicalLeft += std::max(0.f, availableLogicalWidth - totalLogicalWidth);
         return;
     }
 
@@ -1991,7 +1990,7 @@
     // Determine the width of the ellipsis using the current font.
     // FIXME: CSS3 says this is configurable, also need to use 0x002E (FULL STOP) if horizontal ellipsis is "not renderable"
     const FontCascade& font = style().fontCascade();
-    DEPRECATED_DEFINE_STATIC_LOCAL(AtomicString, ellipsisStr, (&horizontalEllipsis, 1));
+    static NeverDestroyed<AtomicString> ellipsisStr(&horizontalEllipsis, 1);
     const FontCascade& firstLineFont = firstLineStyle().fontCascade();
     float firstLineEllipsisWidth = firstLineFont.width(constructTextRun(this, firstLineFont, &horizontalEllipsis, 1, firstLineStyle()));
     float ellipsisWidth = (font == firstLineFont) ? firstLineEllipsisWidth : font.width(constructTextRun(this, font, &horizontalEllipsis, 1, style()));
@@ -2019,8 +2018,8 @@
                 float totalLogicalWidth = curr->placeEllipsis(ellipsisStr, ltr, blockLeftEdge, blockRightEdge, width);
 
                 float logicalLeft = 0; // We are only interested in the delta from the base position.
-                float truncatedWidth = logicalRightOffsetForLine(curr->lineTop(), firstLine);
-                updateLogicalWidthForAlignment(textAlign, curr, 0, logicalLeft, totalLogicalWidth, truncatedWidth, 0);
+                float truncatedWidth = availableLogicalWidthForLine(curr->lineTop(), firstLine);
+                updateLogicalWidthForAlignment(textAlign, curr, nullptr, logicalLeft, totalLogicalWidth, truncatedWidth, 0);
                 if (ltr)
                     curr->adjustLogicalPosition(logicalLeft, 0);
                 else
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to