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, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. | 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. |
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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 177 |
178 void TableLayoutAlgorithmFixed::computeIntrinsicLogicalWidths(LayoutUnit& minWid
th, LayoutUnit& maxWidth) | 178 void TableLayoutAlgorithmFixed::computeIntrinsicLogicalWidths(LayoutUnit& minWid
th, LayoutUnit& maxWidth) |
179 { | 179 { |
180 minWidth = maxWidth = LayoutUnit(calcWidthArray()); | 180 minWidth = maxWidth = LayoutUnit(calcWidthArray()); |
181 } | 181 } |
182 | 182 |
183 void TableLayoutAlgorithmFixed::applyPreferredLogicalWidthQuirks(LayoutUnit& min
Width, LayoutUnit& maxWidth) const | 183 void TableLayoutAlgorithmFixed::applyPreferredLogicalWidthQuirks(LayoutUnit& min
Width, LayoutUnit& maxWidth) const |
184 { | 184 { |
185 Length tableLogicalWidth = m_table->style()->logicalWidth(); | 185 Length tableLogicalWidth = m_table->style()->logicalWidth(); |
186 if (tableLogicalWidth.isFixed() && tableLogicalWidth.isPositive()) { | 186 if (tableLogicalWidth.isFixed() && tableLogicalWidth.isPositive()) { |
187 minWidth = maxWidth = max(minWidth, LayoutUnit(tableLogicalWidth.value()
- m_table->bordersPaddingAndSpacingInRowDirection())).floor(); | 187 minWidth = maxWidth = LayoutUnit(max(minWidth, LayoutUnit(tableLogicalWi
dth.value() - m_table->bordersPaddingAndSpacingInRowDirection())).floor()); |
188 } | 188 } |
189 | 189 |
190 /* | 190 /* |
191 <table style="width:100%; background-color:red"><tr><td> | 191 <table style="width:100%; background-color:red"><tr><td> |
192 <table style="background-color:blue"><tr><td> | 192 <table style="background-color:blue"><tr><td> |
193 <table style="width:100%; background-color:green; table-layout:f
ixed"><tr><td> | 193 <table style="width:100%; background-color:green; table-layout:f
ixed"><tr><td> |
194 Content | 194 Content |
195 </td></tr></table> | 195 </td></tr></table> |
196 </td></tr></table> | 196 </td></tr></table> |
197 </td></tr></table> | 197 </td></tr></table> |
198 */ | 198 */ |
199 // In this example, the two inner tables should be as large as the outer tab
le. | 199 // In this example, the two inner tables should be as large as the outer tab
le. |
200 // We can achieve this effect by making the maxwidth of fixed tables with pe
rcentage | 200 // We can achieve this effect by making the maxwidth of fixed tables with pe
rcentage |
201 // widths be infinite. | 201 // widths be infinite. |
202 if (m_table->style()->logicalWidth().hasPercent() && maxWidth < tableMaxWidt
h) | 202 if (m_table->style()->logicalWidth().hasPercent() && maxWidth < tableMaxWidt
h) |
203 maxWidth = tableMaxWidth; | 203 maxWidth = LayoutUnit(tableMaxWidth); |
204 } | 204 } |
205 | 205 |
206 void TableLayoutAlgorithmFixed::layout() | 206 void TableLayoutAlgorithmFixed::layout() |
207 { | 207 { |
208 int tableLogicalWidth = m_table->logicalWidth() - m_table->bordersPaddingAnd
SpacingInRowDirection(); | 208 int tableLogicalWidth = m_table->logicalWidth() - m_table->bordersPaddingAnd
SpacingInRowDirection(); |
209 unsigned nEffCols = m_table->numEffCols(); | 209 unsigned nEffCols = m_table->numEffCols(); |
210 | 210 |
211 // FIXME: It is possible to be called without having properly updated our in
ternal representation. | 211 // FIXME: It is possible to be called without having properly updated our in
ternal representation. |
212 // This means that our preferred logical widths were not recomputed as expec
ted. | 212 // This means that our preferred logical widths were not recomputed as expec
ted. |
213 if (nEffCols != m_width.size()) { | 213 if (nEffCols != m_width.size()) { |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 LayoutTableRow* row = section->rowLayoutObjectAt(i); | 331 LayoutTableRow* row = section->rowLayoutObjectAt(i); |
332 if (!row) | 332 if (!row) |
333 continue; | 333 continue; |
334 for (LayoutTableCell* cell = row->firstCell(); cell; cell = cell->ne
xtCell()) | 334 for (LayoutTableCell* cell = row->firstCell(); cell; cell = cell->ne
xtCell()) |
335 cell->setPreferredLogicalWidthsDirty(); | 335 cell->setPreferredLogicalWidthsDirty(); |
336 } | 336 } |
337 } | 337 } |
338 } | 338 } |
339 | 339 |
340 } // namespace blink | 340 } // namespace blink |
OLD | NEW |