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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
80 if (cell->maxPreferredLogicalWidth() > columnLayout.maxLogic alWidth) { | 80 if (cell->maxPreferredLogicalWidth() > columnLayout.maxLogic alWidth) { |
81 columnLayout.maxLogicalWidth = cell->maxPreferredLogical Width(); | 81 columnLayout.maxLogicalWidth = cell->maxPreferredLogical Width(); |
82 maxContributor = cell; | 82 maxContributor = cell; |
83 } | 83 } |
84 | 84 |
85 // All browsers implement a size limit on the cell's max wid th. | 85 // All browsers implement a size limit on the cell's max wid th. |
86 // Our limit is based on KHTML's representation that used 16 bits widths. | 86 // Our limit is based on KHTML's representation that used 16 bits widths. |
87 // FIXME: Other browsers have a lower limit for the cell's m ax width. | 87 // FIXME: Other browsers have a lower limit for the cell's m ax width. |
88 const int cCellMaxWidth = 32760; | 88 const int cCellMaxWidth = 32760; |
89 Length cellLogicalWidth = cell->styleOrColLogicalWidth(); | 89 Length cellLogicalWidth = cell->styleOrColLogicalWidth(); |
90 // FIXME: calc() on tables should be handled consistently wi th other lengths. See bug: https://crbug.com/382725 | |
91 if (cellLogicalWidth.isCalculated()) | |
92 cellLogicalWidth = Length(); // make it Auto | |
Julien - ping for review
2014/06/23 17:09:24
For consistency, we should capitalize Make.
| |
90 if (cellLogicalWidth.value() > cCellMaxWidth) | 93 if (cellLogicalWidth.value() > cCellMaxWidth) |
91 cellLogicalWidth.setValue(cCellMaxWidth); | 94 cellLogicalWidth.setValue(cCellMaxWidth); |
92 if (cellLogicalWidth.isNegative()) | 95 if (cellLogicalWidth.isNegative()) |
93 cellLogicalWidth.setValue(0); | 96 cellLogicalWidth.setValue(0); |
94 switch (cellLogicalWidth.type()) { | 97 switch (cellLogicalWidth.type()) { |
95 case Fixed: | 98 case Fixed: |
96 // ignore width=0 | 99 // ignore width=0 |
97 if (cellLogicalWidth.isPositive() && !columnLayout.logic alWidth.isPercent()) { | 100 if (cellLogicalWidth.isPositive() && !columnLayout.logic alWidth.isPercent()) { |
98 int logicalWidth = cell->adjustBorderBoxLogicalWidth ForBoxSizing(cellLogicalWidth.value()); | 101 int logicalWidth = cell->adjustBorderBoxLogicalWidth ForBoxSizing(cellLogicalWidth.value()); |
99 if (columnLayout.logicalWidth.isFixed()) { | 102 if (columnLayout.logicalWidth.isFixed()) { |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
286 } | 289 } |
287 | 290 |
288 for (size_t i = 0; i < m_spanCells.size(); ++i) { | 291 for (size_t i = 0; i < m_spanCells.size(); ++i) { |
289 RenderTableCell* cell = m_spanCells[i]; | 292 RenderTableCell* cell = m_spanCells[i]; |
290 if (!cell) | 293 if (!cell) |
291 break; | 294 break; |
292 | 295 |
293 unsigned span = cell->colSpan(); | 296 unsigned span = cell->colSpan(); |
294 | 297 |
295 Length cellLogicalWidth = cell->styleOrColLogicalWidth(); | 298 Length cellLogicalWidth = cell->styleOrColLogicalWidth(); |
296 if (cellLogicalWidth.isZero()) | 299 // FIXME: calc() on tables should be handled consistently with other len gths. See bug: https://crbug.com/382725 |
300 if (cellLogicalWidth.isZero() || cellLogicalWidth.isCalculated()) | |
297 cellLogicalWidth = Length(); // make it Auto | 301 cellLogicalWidth = Length(); // make it Auto |
Julien - ping for review
2014/06/23 17:09:23
Ditto.
| |
298 | 302 |
299 unsigned effCol = m_table->colToEffCol(cell->col()); | 303 unsigned effCol = m_table->colToEffCol(cell->col()); |
300 size_t lastCol = effCol; | 304 size_t lastCol = effCol; |
301 int cellMinLogicalWidth = cell->minPreferredLogicalWidth() + spacingInRo wDirection; | 305 int cellMinLogicalWidth = cell->minPreferredLogicalWidth() + spacingInRo wDirection; |
302 int cellMaxLogicalWidth = cell->maxPreferredLogicalWidth() + spacingInRo wDirection; | 306 int cellMaxLogicalWidth = cell->maxPreferredLogicalWidth() + spacingInRo wDirection; |
303 float totalPercent = 0; | 307 float totalPercent = 0; |
304 int spanMinLogicalWidth = 0; | 308 int spanMinLogicalWidth = 0; |
305 int spanMaxLogicalWidth = 0; | 309 int spanMaxLogicalWidth = 0; |
306 bool allColsArePercent = true; | 310 bool allColsArePercent = true; |
307 bool allColsAreFixed = true; | 311 bool allColsAreFixed = true; |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
726 | 730 |
727 int pos = 0; | 731 int pos = 0; |
728 for (size_t i = 0; i < nEffCols; ++i) { | 732 for (size_t i = 0; i < nEffCols; ++i) { |
729 m_table->setColumnPosition(i, pos); | 733 m_table->setColumnPosition(i, pos); |
730 pos += m_layoutStruct[i].computedLogicalWidth + m_table->hBorderSpacing( ); | 734 pos += m_layoutStruct[i].computedLogicalWidth + m_table->hBorderSpacing( ); |
731 } | 735 } |
732 m_table->setColumnPosition(m_table->columnPositions().size() - 1, pos); | 736 m_table->setColumnPosition(m_table->columnPositions().size() - 1, pos); |
733 } | 737 } |
734 | 738 |
735 } | 739 } |
OLD | NEW |