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

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

Issue 12316027: Revert 130774 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1410/
Patch Set: Created 7 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/fast/table/css-table-max-width-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) 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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 availableContentLogicalWidth = shrinkLogicalWidthToAvoidFloats(margi nStart, marginEnd, cb, 0, 0); 266 availableContentLogicalWidth = shrinkLogicalWidthToAvoidFloats(margi nStart, marginEnd, cb, 0, 0);
267 } 267 }
268 268
269 // Ensure we aren't bigger than our available width. 269 // Ensure we aren't bigger than our available width.
270 setLogicalWidth(min<int>(availableContentLogicalWidth, maxPreferredLogic alWidth())); 270 setLogicalWidth(min<int>(availableContentLogicalWidth, maxPreferredLogic alWidth()));
271 } 271 }
272 272
273 // Ensure we aren't smaller than our min preferred width. 273 // Ensure we aren't smaller than our min preferred width.
274 setLogicalWidth(max<int>(logicalWidth(), minPreferredLogicalWidth())); 274 setLogicalWidth(max<int>(logicalWidth(), minPreferredLogicalWidth()));
275 275
276
277 // Ensure we aren't bigger than our max-width style.
278 Length styleMaxLogicalWidth = style()->logicalMaxWidth();
279 if (styleMaxLogicalWidth.isSpecified() && !styleMaxLogicalWidth.isNegative() ) {
280 LayoutUnit computedMaxLogicalWidth = convertStyleLogicalWidthToComputedW idth(styleMaxLogicalWidth, availableLogicalWidth);
281 setLogicalWidth(min<int>(logicalWidth(), computedMaxLogicalWidth));
282 }
283
284 // Ensure we aren't smaller than our min-width style. 276 // Ensure we aren't smaller than our min-width style.
285 Length styleMinLogicalWidth = style()->logicalMinWidth(); 277 Length styleMinLogicalWidth = style()->logicalMinWidth();
286 if (styleMinLogicalWidth.isSpecified() && !styleMinLogicalWidth.isNegative() ) { 278 if (styleMinLogicalWidth.isSpecified() && styleMinLogicalWidth.isPositive())
287 LayoutUnit computedMinLogicalWidth = convertStyleLogicalWidthToComputedW idth(styleMinLogicalWidth, availableLogicalWidth); 279 setLogicalWidth(max<int>(logicalWidth(), convertStyleLogicalWidthToCompu tedWidth(styleMinLogicalWidth, availableLogicalWidth)));
288 setLogicalWidth(max<int>(logicalWidth(), computedMinLogicalWidth));
289 }
290 280
291 // Finally, with our true width determined, compute our margins for real. 281 // Finally, with our true width determined, compute our margins for real.
292 setMarginStart(0); 282 setMarginStart(0);
293 setMarginEnd(0); 283 setMarginEnd(0);
294 if (!hasPerpendicularContainingBlock) { 284 if (!hasPerpendicularContainingBlock) {
295 LayoutUnit containerLogicalWidthForAutoMargins = availableLogicalWidth; 285 LayoutUnit containerLogicalWidthForAutoMargins = availableLogicalWidth;
296 if (avoidsFloats() && cb->containsFloats()) 286 if (avoidsFloats() && cb->containsFloats())
297 containerLogicalWidthForAutoMargins = containingBlockAvailableLineWi dthInRegion(0, 0); // FIXME: Work with regions someday. 287 containerLogicalWidthForAutoMargins = containingBlockAvailableLineWi dthInRegion(0, 0); // FIXME: Work with regions someday.
298 ComputedMarginValues marginValues; 288 ComputedMarginValues marginValues;
299 bool hasInvertedDirection = cb->style()->isLeftToRightDirection() == st yle()->isLeftToRightDirection(); 289 bool hasInvertedDirection = cb->style()->isLeftToRightDirection() == st yle()->isLeftToRightDirection();
(...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after
1395 const BorderValue& RenderTable::tableEndBorderAdjoiningCell(const RenderTableCel l* cell) const 1385 const BorderValue& RenderTable::tableEndBorderAdjoiningCell(const RenderTableCel l* cell) const
1396 { 1386 {
1397 ASSERT(cell->isFirstOrLastCellInRow()); 1387 ASSERT(cell->isFirstOrLastCellInRow());
1398 if (hasSameDirectionAs(cell->row())) 1388 if (hasSameDirectionAs(cell->row()))
1399 return style()->borderEnd(); 1389 return style()->borderEnd();
1400 1390
1401 return style()->borderStart(); 1391 return style()->borderStart();
1402 } 1392 }
1403 1393
1404 } 1394 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/table/css-table-max-width-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698