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

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

Issue 185723005: Use correct container width as base for percentage margins. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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 * 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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 setMarginStart(0); 305 setMarginStart(0);
306 setMarginEnd(0); 306 setMarginEnd(0);
307 if (!hasPerpendicularContainingBlock) { 307 if (!hasPerpendicularContainingBlock) {
308 LayoutUnit containerLogicalWidthForAutoMargins = availableLogicalWidth; 308 LayoutUnit containerLogicalWidthForAutoMargins = availableLogicalWidth;
309 if (avoidsFloats() && cb->containsFloats()) 309 if (avoidsFloats() && cb->containsFloats())
310 containerLogicalWidthForAutoMargins = containingBlockAvailableLineWi dth(); 310 containerLogicalWidthForAutoMargins = containingBlockAvailableLineWi dth();
311 ComputedMarginValues marginValues; 311 ComputedMarginValues marginValues;
312 bool hasInvertedDirection = cb->style()->isLeftToRightDirection() == st yle()->isLeftToRightDirection(); 312 bool hasInvertedDirection = cb->style()->isLeftToRightDirection() == st yle()->isLeftToRightDirection();
313 computeInlineDirectionMargins(cb, containerLogicalWidthForAutoMargins, l ogicalWidth(), 313 computeInlineDirectionMargins(cb, availableLogicalWidth, containerLogica lWidthForAutoMargins, logicalWidth(),
314 hasInvertedDirection ? marginValues.m_start : marginValues.m_end, 314 hasInvertedDirection ? marginValues.m_start : marginValues.m_end,
315 hasInvertedDirection ? marginValues.m_end : marginValues.m_start); 315 hasInvertedDirection ? marginValues.m_end : marginValues.m_start);
316 setMarginStart(marginValues.m_start); 316 setMarginStart(marginValues.m_start);
317 setMarginEnd(marginValues.m_end); 317 setMarginEnd(marginValues.m_end);
318 } else { 318 } else {
319 setMarginStart(minimumValueForLength(style()->marginStart(), availableLo gicalWidth)); 319 setMarginStart(minimumValueForLength(style()->marginStart(), availableLo gicalWidth));
320 setMarginEnd(minimumValueForLength(style()->marginEnd(), availableLogica lWidth)); 320 setMarginEnd(minimumValueForLength(style()->marginEnd(), availableLogica lWidth));
321 } 321 }
322 322
323 // We should NEVER shrink the table below the min-content logical width, or else the table can't accomodate 323 // We should NEVER shrink the table below the min-content logical width, or else the table can't accomodate
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1458 const BorderValue& RenderTable::tableEndBorderAdjoiningCell(const RenderTableCel l* cell) const 1458 const BorderValue& RenderTable::tableEndBorderAdjoiningCell(const RenderTableCel l* cell) const
1459 { 1459 {
1460 ASSERT(cell->isFirstOrLastCellInRow()); 1460 ASSERT(cell->isFirstOrLastCellInRow());
1461 if (hasSameDirectionAs(cell->row())) 1461 if (hasSameDirectionAs(cell->row()))
1462 return style()->borderEnd(); 1462 return style()->borderEnd();
1463 1463
1464 return style()->borderStart(); 1464 return style()->borderStart();
1465 } 1465 }
1466 1466
1467 } 1467 }
OLDNEW
« Source/core/rendering/RenderBox.cpp ('K') | « Source/core/rendering/RenderBox.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698