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

Side by Side Diff: sky/engine/core/rendering/RenderBlockLineLayout.cpp

Issue 741893002: Remove canCollapseAnonymousBlockChild. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 * 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 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after
1202 if (isFullLayout) { 1202 if (isFullLayout) {
1203 // Ensure the old line boxes will be erased. 1203 // Ensure the old line boxes will be erased.
1204 if (firstLineBox()) 1204 if (firstLineBox())
1205 setShouldDoFullPaintInvalidation(true); 1205 setShouldDoFullPaintInvalidation(true);
1206 lineBoxes()->deleteLineBoxes(); 1206 lineBoxes()->deleteLineBoxes();
1207 } 1207 }
1208 1208
1209 // Text truncation kicks in in two cases: 1209 // Text truncation kicks in in two cases:
1210 // 1) If your overflow isn't visible and your text-overflow-mode isn't c lip. 1210 // 1) If your overflow isn't visible and your text-overflow-mode isn't c lip.
1211 // 2) If you're an anonymous block with a block parent that satisfies #1 that was created 1211 // 2) If you're an anonymous block with a block parent that satisfies #1 that was created
1212 // to accomodate a block that has inline and block children. This exc ludes parents where 1212 // to accomodate a block that has inline and block children.
1213 // canCollapseAnonymousBlockChild is false, notabley flex items.
1214 // FIXME: CSS3 says that descendants that are clipped must also know how to truncate. This is insanely 1213 // FIXME: CSS3 says that descendants that are clipped must also know how to truncate. This is insanely
1215 // difficult to figure out in general (especially in the middle of doing lay out), so we only handle the 1214 // difficult to figure out in general (especially in the middle of doing lay out), so we only handle the
1216 // simple case of an anonymous block truncating when it's parent is clipped. 1215 // simple case of an anonymous block truncating when it's parent is clipped.
1217 bool hasTextOverflow = (style()->textOverflow() && hasOverflowClip()) 1216 bool hasTextOverflow = (style()->textOverflow() && hasOverflowClip())
1218 || (isAnonymousBlock() && parent() && parent()->isRenderBlock() && toRen derBlock(parent())->canCollapseAnonymousBlockChild() 1217 || (isAnonymousBlock() && parent() && parent()->style()->textOverflow() && parent()->hasOverflowClip());
esprehn 2014/11/20 19:06:54 You lost the check for parent()->isRenderBlock(),
ojan 2014/11/20 19:25:53 That was just to make the toRenderBlock(parent())
ojan 2014/11/21 05:37:14 See https://codereview.chromium.org/751483002#msg2
1219 && parent()->style()->textOverflow() && parent()->hasOverflowClip()) ;
1220 1218
1221 // Walk all the lines and delete our ellipsis line boxes if they exist. 1219 // Walk all the lines and delete our ellipsis line boxes if they exist.
1222 if (hasTextOverflow) 1220 if (hasTextOverflow)
1223 deleteEllipsisLineBoxes(); 1221 deleteEllipsisLineBoxes();
1224 1222
1225 if (firstChild()) { 1223 if (firstChild()) {
1226 // In full layout mode, clear the line boxes of children upfront. Otherw ise, 1224 // In full layout mode, clear the line boxes of children upfront. Otherw ise,
1227 // siblings can run into stale root lineboxes during layout. Then layout 1225 // siblings can run into stale root lineboxes during layout. Then layout
1228 // the replaced elements later. In partial layout mode, line boxes are n ot 1226 // the replaced elements later. In partial layout mode, line boxes are n ot
1229 // deleted and only dirtied. In that case, we can layout the replaced 1227 // deleted and only dirtied. In that case, we can layout the replaced
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
1588 float logicalLeft = logicalLeftOffsetForLine(logicalHeight(), false).toFloat (); 1586 float logicalLeft = logicalLeftOffsetForLine(logicalHeight(), false).toFloat ();
1589 float availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), fal se) - logicalLeft; 1587 float availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), fal se) - logicalLeft;
1590 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid th, availableLogicalWidth, 0); 1588 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid th, availableLogicalWidth, 0);
1591 1589
1592 if (!style()->isLeftToRightDirection()) 1590 if (!style()->isLeftToRightDirection())
1593 return logicalWidth() - logicalLeft; 1591 return logicalWidth() - logicalLeft;
1594 return logicalLeft; 1592 return logicalLeft;
1595 } 1593 }
1596 1594
1597 } 1595 }
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderBlock.cpp ('k') | sky/engine/core/rendering/RenderFlexibleBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698