OLD | NEW |
---|---|
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, 2013 Apple Inc. All rights reserved. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
293 // Ensure we aren't smaller than our min-width style. | 293 // Ensure we aren't smaller than our min-width style. |
294 Length styleMinLogicalWidth = style()->logicalMinWidth(); | 294 Length styleMinLogicalWidth = style()->logicalMinWidth(); |
295 if ((styleMinLogicalWidth.isSpecified() && !styleMinLogicalWidth.isNegative( )) || styleMinLogicalWidth.isIntrinsic()) { | 295 if ((styleMinLogicalWidth.isSpecified() && !styleMinLogicalWidth.isNegative( )) || styleMinLogicalWidth.isIntrinsic()) { |
296 LayoutUnit computedMinLogicalWidth = convertStyleLogicalWidthToComputedW idth(styleMinLogicalWidth, availableLogicalWidth); | 296 LayoutUnit computedMinLogicalWidth = convertStyleLogicalWidthToComputedW idth(styleMinLogicalWidth, availableLogicalWidth); |
297 setLogicalWidth(std::max<int>(logicalWidth(), computedMinLogicalWidth)); | 297 setLogicalWidth(std::max<int>(logicalWidth(), computedMinLogicalWidth)); |
298 } | 298 } |
299 | 299 |
300 // Finally, with our true width determined, compute our margins for real. | 300 // Finally, with our true width determined, compute our margins for real. |
301 ComputedMarginValues marginValues; | 301 ComputedMarginValues marginValues; |
302 computeMarginsForDirection(InlineDirection, cb, availableLogicalWidth, logic alWidth(), marginValues.m_start, marginValues.m_end, style()->marginStart(), sty le()->marginEnd()); | 302 computeMarginsForDirection(InlineDirection, cb, availableLogicalWidth, logic alWidth(), marginValues.m_start, marginValues.m_end, style()->marginStart(), sty le()->marginEnd()); |
303 setMarginStart(marginValues.m_start); | 303 |
304 setMarginEnd(marginValues.m_end); | 304 bool hasInvertedDirection = cb->style()->isLeftToRightDirection() == style() ->isLeftToRightDirection(); |
mstensho (USE GERRIT)
2014/12/04 09:47:57
This is a generic problem that doesn't only apply
Kyungtae Kim
2014/12/04 11:15:21
You're right. Both the code for RenderBox and Rend
| |
305 setMarginStart(hasInvertedDirection ? marginValues.m_start : marginValues.m_ end); | |
306 setMarginEnd(hasInvertedDirection ? marginValues.m_end : marginValues.m_star t); | |
305 | 307 |
306 // We should NEVER shrink the table below the min-content logical width, or else the table can't accomodate | 308 // We should NEVER shrink the table below the min-content logical width, or else the table can't accomodate |
307 // its own content which doesn't match CSS nor what authors expect. | 309 // its own content which doesn't match CSS nor what authors expect. |
308 // FIXME: When we convert to sub-pixel layout for tables we can remove the i nt conversion | 310 // FIXME: When we convert to sub-pixel layout for tables we can remove the i nt conversion |
309 // https://code.google.com/p/chromium/issues/detail?id=241198 | 311 // https://code.google.com/p/chromium/issues/detail?id=241198 |
310 ASSERT(logicalWidth().toInt() >= minPreferredLogicalWidth().toInt()); | 312 ASSERT(logicalWidth().toInt() >= minPreferredLogicalWidth().toInt()); |
311 } | 313 } |
312 | 314 |
313 // This method takes a RenderStyle's logical width, min-width, or max-width leng th and computes its actual value. | 315 // This method takes a RenderStyle's logical width, min-width, or max-width leng th and computes its actual value. |
314 LayoutUnit RenderTable::convertStyleLogicalWidthToComputedWidth(const Length& st yleLogicalWidth, LayoutUnit availableWidth) | 316 LayoutUnit RenderTable::convertStyleLogicalWidthToComputedWidth(const Length& st yleLogicalWidth, LayoutUnit availableWidth) |
(...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1337 const BorderValue& RenderTable::tableEndBorderAdjoiningCell(const RenderTableCel l* cell) const | 1339 const BorderValue& RenderTable::tableEndBorderAdjoiningCell(const RenderTableCel l* cell) const |
1338 { | 1340 { |
1339 ASSERT(cell->isFirstOrLastCellInRow()); | 1341 ASSERT(cell->isFirstOrLastCellInRow()); |
1340 if (hasSameDirectionAs(cell->row())) | 1342 if (hasSameDirectionAs(cell->row())) |
1341 return style()->borderEnd(); | 1343 return style()->borderEnd(); |
1342 | 1344 |
1343 return style()->borderStart(); | 1345 return style()->borderStart(); |
1344 } | 1346 } |
1345 | 1347 |
1346 } | 1348 } |
OLD | NEW |