Fix the line truncation function for Emerson so that at the far left setting of...
[WebKit-https.git] / WebCore / khtml / rendering / render_flexbox.cpp
index fed151b497ce1e3371754002ca083ac6afdd3fca..138f79dfafef2b419664d0394abd2eb53f5c2893 100644 (file)
@@ -695,7 +695,7 @@ void RenderFlexibleBox::layoutVerticalBox(bool relayoutChildren)
     // really part of the XUL box model.
     bool haveLineClamp = style()->lineClamp() >= 0 && style()->lineClamp() <= 100;
     if (haveLineClamp) {
-        int maxLineCount = 1;
+        int maxLineCount = 0;
         child = iterator.first();
         while (child) {
             if (!child->isPositioned()) {
@@ -716,7 +716,7 @@ void RenderFlexibleBox::layoutVerticalBox(bool relayoutChildren)
         
         // Get the # of lines and then alter all block flow children with auto height to use the
         // specified height.
-        int numVisibleLines = int(maxLineCount*style()->lineClamp()/100.0 + 1.0);
+        int numVisibleLines = int((maxLineCount+1)*style()->lineClamp()/100.0);
         if (numVisibleLines < maxLineCount) {
             for (child = iterator.first(); child; child = iterator.next()) {
                 if (child->isPositioned() || !child->style()->height().isVariable() || !child->isBlockFlow())