Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Side by Side Diff: Source/core/rendering/RenderBlockLineLayout.cpp

Issue 160583002: Pass the correct value for the available width to updateLogicalWidthForAlignment() after placing an… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased patch again against master Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « LayoutTests/platform/linux/fast/css/text-overflow-ellipsis-block-with-border-and-padding-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ight reserved. 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ight reserved.
4 * Copyright (C) 2010 Google Inc. All rights reserved. 4 * Copyright (C) 2010 Google Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 1941 matching lines...) Expand 10 before | Expand all | Expand 10 after
1952 // can be truncated. In order for truncation to be possible, the li ne must have sufficient space to 1952 // can be truncated. In order for truncation to be possible, the li ne must have sufficient space to
1953 // accommodate our truncation string, and no replaced elements (imag es, tables) can overlap the ellipsis 1953 // accommodate our truncation string, and no replaced elements (imag es, tables) can overlap the ellipsis
1954 // space. 1954 // space.
1955 1955
1956 LayoutUnit width = firstLine ? firstLineEllipsisWidth : ellipsisWidt h; 1956 LayoutUnit width = firstLine ? firstLineEllipsisWidth : ellipsisWidt h;
1957 LayoutUnit blockEdge = ltr ? blockRightEdge : blockLeftEdge; 1957 LayoutUnit blockEdge = ltr ? blockRightEdge : blockLeftEdge;
1958 if (curr->lineCanAccommodateEllipsis(ltr, blockEdge, lineBoxEdge, wi dth)) { 1958 if (curr->lineCanAccommodateEllipsis(ltr, blockEdge, lineBoxEdge, wi dth)) {
1959 float totalLogicalWidth = curr->placeEllipsis(ellipsisStr, ltr, blockLeftEdge, blockRightEdge, width); 1959 float totalLogicalWidth = curr->placeEllipsis(ellipsisStr, ltr, blockLeftEdge, blockRightEdge, width);
1960 1960
1961 float logicalLeft = 0; // We are only intersted in the delta fro m the base position. 1961 float logicalLeft = 0; // We are only intersted in the delta fro m the base position.
1962 float truncatedWidth = pixelSnappedLogicalRightOffsetForLine(cur r->lineTop(), firstLine); 1962 float snappedLogicalLeft = pixelSnappedLogicalLeftOffsetForLine( curr->lineTop(), firstLine);
1963 updateLogicalWidthForAlignment(textAlign, curr, 0, logicalLeft, totalLogicalWidth, truncatedWidth, 0); 1963 float availableLogicalWidth = pixelSnappedLogicalRightOffsetForL ine(curr->lineTop(), firstLine) - snappedLogicalLeft;
1964 updateLogicalWidthForAlignment(textAlign, curr, 0, logicalLeft, totalLogicalWidth, availableLogicalWidth, 0);
1964 if (ltr) 1965 if (ltr)
1965 curr->adjustLogicalPosition(logicalLeft, 0); 1966 curr->adjustLogicalPosition(logicalLeft, 0);
1966 else 1967 else
1967 curr->adjustLogicalPosition(-(truncatedWidth - (logicalLeft + totalLogicalWidth)), 0); 1968 curr->adjustLogicalPosition(logicalLeft - (availableLogicalW idth - totalLogicalWidth), 0);
1968 } 1969 }
1969 } 1970 }
1970 firstLine = false; 1971 firstLine = false;
1971 } 1972 }
1972 } 1973 }
1973 1974
1974 bool RenderBlockFlow::positionNewFloatOnLine(FloatingObject* newFloat, FloatingO bject* lastFloatFromPreviousLine, LineInfo& lineInfo, LineWidth& width) 1975 bool RenderBlockFlow::positionNewFloatOnLine(FloatingObject* newFloat, FloatingO bject* lastFloatFromPreviousLine, LineInfo& lineInfo, LineWidth& width)
1975 { 1976 {
1976 if (!positionNewFloats()) 1977 if (!positionNewFloats())
1977 return false; 1978 return false;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
2036 float logicalLeft = logicalLeftOffsetForLine(logicalHeight(), false); 2037 float logicalLeft = logicalLeftOffsetForLine(logicalHeight(), false);
2037 float availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), fal se) - logicalLeft; 2038 float availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), fal se) - logicalLeft;
2038 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid th, availableLogicalWidth, 0); 2039 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid th, availableLogicalWidth, 0);
2039 2040
2040 if (!style()->isLeftToRightDirection()) 2041 if (!style()->isLeftToRightDirection())
2041 return logicalWidth() - logicalLeft; 2042 return logicalWidth() - logicalLeft;
2042 return logicalLeft; 2043 return logicalLeft;
2043 } 2044 }
2044 2045
2045 } 2046 }
OLDNEW
« no previous file with comments | « LayoutTests/platform/linux/fast/css/text-overflow-ellipsis-block-with-border-and-padding-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698