From eda246d9f36344092a1b0d7085fa3cd6aa3baf43 Mon Sep 17 00:00:00 2001 From: Ojan Vafai Date: Fri, 21 Nov 2014 11:26:05 -0800 Subject: [PATCH] Fix text-overflow:ellipsis. This regressed in 3db9471ae80bd492f2a346113d2323ba8eee0c09. Accidentally sent some code down the override by sending the top LayoutUnit instead of the left/right LayoutUnit. The root problem was bad overloading, which is also fixed in this patch. Inlined the overloaded method since one of the calls was only called from one place. The new test demonstrates the ellipsizing, but that doesn't show through in the render tree dump. We don't get real test coverage here until we either start doing pixel tests or start exposing ellipsis in the render tree dumps. R=esprehn@chromium.org Review URL: https://codereview.chromium.org/751483002 --- .../tests/layout/ellipsis-expected.txt | 22 ++++++++++++++++ engine/src/flutter/tests/layout/ellipsis.sky | 25 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 engine/src/flutter/tests/layout/ellipsis-expected.txt create mode 100644 engine/src/flutter/tests/layout/ellipsis.sky diff --git a/engine/src/flutter/tests/layout/ellipsis-expected.txt b/engine/src/flutter/tests/layout/ellipsis-expected.txt new file mode 100644 index 0000000000..5d3ada6bfa --- /dev/null +++ b/engine/src/flutter/tests/layout/ellipsis-expected.txt @@ -0,0 +1,22 @@ +layer at (0,0) size 800x600 + RenderView {#document} at (0,0) size 800x600 +layer at (0,0) size 800x94 + RenderBlock {sky} at (0,0) size 800x94 +layer at (372,0) size 56x69 clip at (375,3) size 50x63 scrollWidth 93 + RenderBlock {div} at (372,0) size 56x69 [border: (3px solid #0000FF)] + RenderBlock (anonymous) at (3,3) size 50x19 + RenderText {#text} at (0,0) size 91x19 + text run at (0,0) width 91: "These lines" + RenderBlock (anonymous) at (3,47) size 50x19 + RenderText {#text} at (0,0) size 94x19 + text run at (0,0) width 94: "all ellipsize." +layer at (375,22) size 56x25 backgroundClip at (375,22) size 50x25 clip at (378,25) size 47x19 outlineClip at (375,3) size 50x63 scrollWidth 53 + RenderBlock {p} at (3,22) size 56x25 [border: (3px solid #FF0000)] + RenderText {#text} at (3,3) size 54x19 + text run at (3,3) width 54: "should" +layer at (372,69) size 56x25 clip at (375,72) size 50x19 scrollWidth 117 + RenderBlock {p} at (372,69) size 56x25 [border: (3px solid #FF0000)] + RenderInline {span} at (0,0) size 117x19 + RenderText {#text} at (3,3) size 117x19 + text run at (3,3) width 117: "As should this." + diff --git a/engine/src/flutter/tests/layout/ellipsis.sky b/engine/src/flutter/tests/layout/ellipsis.sky new file mode 100644 index 0000000000..08288a42a0 --- /dev/null +++ b/engine/src/flutter/tests/layout/ellipsis.sky @@ -0,0 +1,25 @@ + + + +
These lines

should

all ellipsize.
+

As should this.

+