OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2002 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2002 Lars Knoll (knoll@kde.org) |
3 * (C) 2002 Dirk Mueller (mueller@kde.org) | 3 * (C) 2002 Dirk Mueller (mueller@kde.org) |
4 * Copyright (C) 2003, 2006, 2008, 2010 Apple Inc. All rights reserved. | 4 * Copyright (C) 2003, 2006, 2008, 2010 Apple 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. | 9 * version 2 of the License. |
10 * | 10 * |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 if (cell->maxPreferredLogicalWidth() > columnLayout.maxLogic
alWidth) { | 78 if (cell->maxPreferredLogicalWidth() > columnLayout.maxLogic
alWidth) { |
79 columnLayout.maxLogicalWidth = cell->maxPreferredLogical
Width(); | 79 columnLayout.maxLogicalWidth = cell->maxPreferredLogical
Width(); |
80 maxContributor = cell; | 80 maxContributor = cell; |
81 } | 81 } |
82 | 82 |
83 // All browsers implement a size limit on the cell's max wid
th. | 83 // All browsers implement a size limit on the cell's max wid
th. |
84 // Our limit is based on KHTML's representation that used 16
bits widths. | 84 // Our limit is based on KHTML's representation that used 16
bits widths. |
85 // FIXME: Other browsers have a lower limit for the cell's m
ax width. | 85 // FIXME: Other browsers have a lower limit for the cell's m
ax width. |
86 const int cCellMaxWidth = 32760; | 86 const int cCellMaxWidth = 32760; |
87 Length cellLogicalWidth = cell->styleOrColLogicalWidth(); | 87 Length cellLogicalWidth = cell->styleOrColLogicalWidth(); |
| 88 // FIXME: calc() on tables should be handled consistently wi
th other lengths. See bug: https://crbug.com/382725 |
| 89 if (cellLogicalWidth.isCalculated()) |
| 90 cellLogicalWidth = Length(); // Make it Auto |
88 if (cellLogicalWidth.value() > cCellMaxWidth) | 91 if (cellLogicalWidth.value() > cCellMaxWidth) |
89 cellLogicalWidth.setValue(cCellMaxWidth); | 92 cellLogicalWidth.setValue(cCellMaxWidth); |
90 if (cellLogicalWidth.isNegative()) | 93 if (cellLogicalWidth.isNegative()) |
91 cellLogicalWidth.setValue(0); | 94 cellLogicalWidth.setValue(0); |
92 switch (cellLogicalWidth.type()) { | 95 switch (cellLogicalWidth.type()) { |
93 case Fixed: | 96 case Fixed: |
94 // ignore width=0 | 97 // ignore width=0 |
95 if (cellLogicalWidth.isPositive() && !columnLayout.logic
alWidth.isPercent()) { | 98 if (cellLogicalWidth.isPositive() && !columnLayout.logic
alWidth.isPercent()) { |
96 int logicalWidth = cell->adjustBorderBoxLogicalWidth
ForBoxSizing(cellLogicalWidth.value()); | 99 int logicalWidth = cell->adjustBorderBoxLogicalWidth
ForBoxSizing(cellLogicalWidth.value()); |
97 if (columnLayout.logicalWidth.isFixed()) { | 100 if (columnLayout.logicalWidth.isFixed()) { |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 } | 287 } |
285 | 288 |
286 for (size_t i = 0; i < m_spanCells.size(); ++i) { | 289 for (size_t i = 0; i < m_spanCells.size(); ++i) { |
287 RenderTableCell* cell = m_spanCells[i]; | 290 RenderTableCell* cell = m_spanCells[i]; |
288 if (!cell) | 291 if (!cell) |
289 break; | 292 break; |
290 | 293 |
291 unsigned span = cell->colSpan(); | 294 unsigned span = cell->colSpan(); |
292 | 295 |
293 Length cellLogicalWidth = cell->styleOrColLogicalWidth(); | 296 Length cellLogicalWidth = cell->styleOrColLogicalWidth(); |
294 if (cellLogicalWidth.isZero()) | 297 // FIXME: calc() on tables should be handled consistently with other len
gths. See bug: https://crbug.com/382725 |
295 cellLogicalWidth = Length(); // make it Auto | 298 if (cellLogicalWidth.isZero() || cellLogicalWidth.isCalculated()) |
| 299 cellLogicalWidth = Length(); // Make it Auto |
296 | 300 |
297 unsigned effCol = m_table->colToEffCol(cell->col()); | 301 unsigned effCol = m_table->colToEffCol(cell->col()); |
298 size_t lastCol = effCol; | 302 size_t lastCol = effCol; |
299 int cellMinLogicalWidth = cell->minPreferredLogicalWidth() + spacingInRo
wDirection; | 303 int cellMinLogicalWidth = cell->minPreferredLogicalWidth() + spacingInRo
wDirection; |
300 int cellMaxLogicalWidth = cell->maxPreferredLogicalWidth() + spacingInRo
wDirection; | 304 int cellMaxLogicalWidth = cell->maxPreferredLogicalWidth() + spacingInRo
wDirection; |
301 float totalPercent = 0; | 305 float totalPercent = 0; |
302 int spanMinLogicalWidth = 0; | 306 int spanMinLogicalWidth = 0; |
303 int spanMaxLogicalWidth = 0; | 307 int spanMaxLogicalWidth = 0; |
304 bool allColsArePercent = true; | 308 bool allColsArePercent = true; |
305 bool allColsAreFixed = true; | 309 bool allColsAreFixed = true; |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 | 728 |
725 int pos = 0; | 729 int pos = 0; |
726 for (size_t i = 0; i < nEffCols; ++i) { | 730 for (size_t i = 0; i < nEffCols; ++i) { |
727 m_table->setColumnPosition(i, pos); | 731 m_table->setColumnPosition(i, pos); |
728 pos += m_layoutStruct[i].computedLogicalWidth + m_table->hBorderSpacing(
); | 732 pos += m_layoutStruct[i].computedLogicalWidth + m_table->hBorderSpacing(
); |
729 } | 733 } |
730 m_table->setColumnPosition(m_table->columnPositions().size() - 1, pos); | 734 m_table->setColumnPosition(m_table->columnPositions().size() - 1, pos); |
731 } | 735 } |
732 | 736 |
733 } | 737 } |
OLD | NEW |