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

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

Issue 287193013: Revert of Strip anonymous blocks when change in style removes need for them (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderBox.cpp ('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) 1997 Martin Jones (mjones@kde.org) 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 * (C) 1997 Torben Weis (weis@kde.org) 3 * (C) 1997 Torben Weis (weis@kde.org)
4 * (C) 1998 Waldo Bastian (bastian@kde.org) 4 * (C) 1998 Waldo Bastian (bastian@kde.org)
5 * (C) 1999 Lars Knoll (knoll@kde.org) 5 * (C) 1999 Lars Knoll (knoll@kde.org)
6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 * (C) 1999 Antti Koivisto (koivisto@kde.org)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r ights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r ights reserved.
8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 setLogicalWidth(max<int>(logicalWidth(), minPreferredLogicalWidth())); 295 setLogicalWidth(max<int>(logicalWidth(), minPreferredLogicalWidth()));
296 296
297 // Ensure we aren't smaller than our min-width style. 297 // Ensure we aren't smaller than our min-width style.
298 Length styleMinLogicalWidth = style()->logicalMinWidth(); 298 Length styleMinLogicalWidth = style()->logicalMinWidth();
299 if ((styleMinLogicalWidth.isSpecified() && !styleMinLogicalWidth.isNegative( )) || styleMinLogicalWidth.isIntrinsic()) { 299 if ((styleMinLogicalWidth.isSpecified() && !styleMinLogicalWidth.isNegative( )) || styleMinLogicalWidth.isIntrinsic()) {
300 LayoutUnit computedMinLogicalWidth = convertStyleLogicalWidthToComputedW idth(styleMinLogicalWidth, availableLogicalWidth); 300 LayoutUnit computedMinLogicalWidth = convertStyleLogicalWidthToComputedW idth(styleMinLogicalWidth, availableLogicalWidth);
301 setLogicalWidth(max<int>(logicalWidth(), computedMinLogicalWidth)); 301 setLogicalWidth(max<int>(logicalWidth(), computedMinLogicalWidth));
302 } 302 }
303 303
304 // Finally, with our true width determined, compute our margins for real. 304 // Finally, with our true width determined, compute our margins for real.
305 ComputedMarginValues marginValues; 305 setMarginStart(0);
306 computeMarginsForDirection(InlineDirection, cb, availableLogicalWidth, logic alWidth(), marginValues.m_start, marginValues.m_end, style()->marginStart(), sty le()->marginEnd()); 306 setMarginEnd(0);
307 setMarginStart(marginValues.m_start); 307 if (!hasPerpendicularContainingBlock) {
308 setMarginEnd(marginValues.m_end); 308 ComputedMarginValues marginValues;
309 bool hasInvertedDirection = cb->style()->isLeftToRightDirection() == st yle()->isLeftToRightDirection();
310 computeInlineDirectionMargins(cb, availableLogicalWidth, logicalWidth(),
311 hasInvertedDirection ? marginValues.m_start : marginValues.m_end,
312 hasInvertedDirection ? marginValues.m_end : marginValues.m_start);
313 setMarginStart(marginValues.m_start);
314 setMarginEnd(marginValues.m_end);
315 } else {
316 setMarginStart(minimumValueForLength(style()->marginStart(), availableLo gicalWidth));
317 setMarginEnd(minimumValueForLength(style()->marginEnd(), availableLogica lWidth));
318 }
309 319
310 // We should NEVER shrink the table below the min-content logical width, or else the table can't accomodate 320 // We should NEVER shrink the table below the min-content logical width, or else the table can't accomodate
311 // its own content which doesn't match CSS nor what authors expect. 321 // its own content which doesn't match CSS nor what authors expect.
312 // FIXME: When we convert to sub-pixel layout for tables we can remove the i nt conversion 322 // FIXME: When we convert to sub-pixel layout for tables we can remove the i nt conversion
313 // https://code.google.com/p/chromium/issues/detail?id=241198 323 // https://code.google.com/p/chromium/issues/detail?id=241198
314 ASSERT(logicalWidth().toInt() >= minPreferredLogicalWidth().toInt()); 324 ASSERT(logicalWidth().toInt() >= minPreferredLogicalWidth().toInt());
315 } 325 }
316 326
317 // This method takes a RenderStyle's logical width, min-width, or max-width leng th and computes its actual value. 327 // This method takes a RenderStyle's logical width, min-width, or max-width leng th and computes its actual value.
318 LayoutUnit RenderTable::convertStyleLogicalWidthToComputedWidth(const Length& st yleLogicalWidth, LayoutUnit availableWidth) 328 LayoutUnit RenderTable::convertStyleLogicalWidthToComputedWidth(const Length& st yleLogicalWidth, LayoutUnit availableWidth)
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1447 const BorderValue& RenderTable::tableEndBorderAdjoiningCell(const RenderTableCel l* cell) const 1457 const BorderValue& RenderTable::tableEndBorderAdjoiningCell(const RenderTableCel l* cell) const
1448 { 1458 {
1449 ASSERT(cell->isFirstOrLastCellInRow()); 1459 ASSERT(cell->isFirstOrLastCellInRow());
1450 if (hasSameDirectionAs(cell->row())) 1460 if (hasSameDirectionAs(cell->row()))
1451 return style()->borderEnd(); 1461 return style()->borderEnd();
1452 1462
1453 return style()->borderStart(); 1463 return style()->borderStart();
1454 } 1464 }
1455 1465
1456 } 1466 }
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBox.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698