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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutDeprecatedFlexibleBox.cpp

Issue 2702043002: Use LayoutUnit for positioning ellipses (Closed)
Patch Set: bug 693905-2 Created 3 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
OLDNEW
1 /* 1 /*
2 * This file is part of the layout object implementation for KHTML. 2 * This file is part of the layout object implementation for KHTML.
3 * 3 *
4 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 4 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
5 * (C) 1999 Antti Koivisto (koivisto@kde.org) 5 * (C) 1999 Antti Koivisto (koivisto@kde.org)
6 * Copyright (C) 2003 Apple Computer, Inc. 6 * Copyright (C) 2003 Apple Computer, Inc.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1166 if (!srcBlock.style()->isLeftToRightDirection()) 1166 if (!srcBlock.style()->isLeftToRightDirection())
1167 continue; 1167 continue;
1168 1168
1169 bool leftToRight = destBlock.style()->isLeftToRightDirection(); 1169 bool leftToRight = destBlock.style()->isLeftToRightDirection();
1170 if (!leftToRight) 1170 if (!leftToRight)
1171 continue; 1171 continue;
1172 1172
1173 LayoutUnit blockRightEdge = destBlock.logicalRightOffsetForLine( 1173 LayoutUnit blockRightEdge = destBlock.logicalRightOffsetForLine(
1174 lastVisibleLine->y(), DoNotIndentText); 1174 lastVisibleLine->y(), DoNotIndentText);
1175 if (!lastVisibleLine->lineCanAccommodateEllipsis( 1175 if (!lastVisibleLine->lineCanAccommodateEllipsis(
1176 leftToRight, blockRightEdge.toInt(), 1176 leftToRight, blockRightEdge,
1177 (lastVisibleLine->x() + lastVisibleLine->logicalWidth()).toInt(), 1177 lastVisibleLine->x() + lastVisibleLine->logicalWidth(),
1178 totalWidth)) 1178 LayoutUnit(totalWidth)))
1179 continue; 1179 continue;
1180 1180
1181 // Let the truncation code kick in. 1181 // Let the truncation code kick in.
1182 // FIXME: the text alignment should be recomputed after the width changes 1182 // FIXME: the text alignment should be recomputed after the width changes
1183 // due to truncation. 1183 // due to truncation.
1184 LayoutUnit blockLeftEdge = destBlock.logicalLeftOffsetForLine( 1184 LayoutUnit blockLeftEdge = destBlock.logicalLeftOffsetForLine(
1185 lastVisibleLine->y(), DoNotIndentText); 1185 lastVisibleLine->y(), DoNotIndentText);
1186 lastVisibleLine->placeEllipsis(ellipsisStr, leftToRight, blockLeftEdge, 1186 lastVisibleLine->placeEllipsis(ellipsisStr, leftToRight, blockLeftEdge,
1187 blockRightEdge, LayoutUnit(totalWidth)); 1187 blockRightEdge, LayoutUnit(totalWidth));
1188 destBlock.setHasMarkupTruncation(true); 1188 destBlock.setHasMarkupTruncation(true);
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
1265 if (minHeight.isFixed() || minHeight.isAuto()) { 1265 if (minHeight.isFixed() || minHeight.isAuto()) {
1266 LayoutUnit minHeight(child->style()->minHeight().value()); 1266 LayoutUnit minHeight(child->style()->minHeight().value());
1267 LayoutUnit height = contentHeightForChild(child); 1267 LayoutUnit height = contentHeightForChild(child);
1268 LayoutUnit allowedShrinkage = (minHeight - height).clampPositiveToZero(); 1268 LayoutUnit allowedShrinkage = (minHeight - height).clampPositiveToZero();
1269 return allowedShrinkage; 1269 return allowedShrinkage;
1270 } 1270 }
1271 return LayoutUnit(); 1271 return LayoutUnit();
1272 } 1272 }
1273 1273
1274 } // namespace blink 1274 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698