Changeset 108892 in webkit
- Timestamp:
- Feb 25, 2012 1:27:25 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r108890 r108892 1 2012-02-25 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 Unreviewed, rolling out r108557. 4 http://trac.webkit.org/changeset/108557 5 https://bugs.webkit.org/show_bug.cgi?id=77705 6 7 Broke svg/zoom/page/zoom-replated-intrinsic-ratio-001.htm. 8 9 * rendering/RenderTableCell.cpp: 10 * rendering/RenderTableCell.h: 11 (RenderTableCell): 12 * rendering/RenderTableSection.cpp: 13 (WebCore::RenderTableSection::calcRowLogicalHeight): 14 1 15 2012-02-25 Andreas Kling <awesomekling@apple.com> 2 16 -
trunk/Source/WebCore/rendering/RenderTableCell.cpp
r108557 r108892 92 92 } 93 93 94 LayoutUnit RenderTableCell::logicalHeightForRowSizing() const95 {96 LayoutUnit adjustedLogicalHeight = logicalHeight() - (intrinsicPaddingBefore() + intrinsicPaddingAfter());97 98 LayoutUnit styleLogicalHeight = style()->logicalHeight().calcValue(0);99 if (document()->inQuirksMode() || style()->boxSizing() == BORDER_BOX) {100 // Explicit heights use the border box in quirks mode.101 // Don't adjust height.102 } else {103 // In strict mode, box-sizing: content-box do the right104 // thing and actually add in the border and padding.105 LayoutUnit adjustedPaddingBefore = paddingBefore() - intrinsicPaddingBefore();106 LayoutUnit adjustedPaddingAfter = paddingAfter() - intrinsicPaddingAfter();107 styleLogicalHeight += adjustedPaddingBefore + adjustedPaddingAfter + borderBefore() + borderAfter();108 }109 110 return max(styleLogicalHeight, adjustedLogicalHeight);111 }112 113 94 Length RenderTableCell::styleOrColLogicalWidth() const 114 95 { -
trunk/Source/WebCore/rendering/RenderTableCell.h
r108557 r108892 86 86 Length styleOrColLogicalWidth() const; 87 87 88 LayoutUnit logicalHeightForRowSizing() const;89 90 88 virtual void computePreferredLogicalWidths(); 91 89 -
trunk/Source/WebCore/rendering/RenderTableSection.cpp
r108557 r108892 335 335 336 336 for (unsigned r = 0; r < m_grid.size(); r++) { 337 LayoutUnit baselineDescent = 0; 338 339 // Our base size is the biggest logical height from our cells' styles (excluding row spanning cells). 340 m_rowPos[r + 1] = max(m_rowPos[r] + m_grid[r].logicalHeight.calcMinValue(0), 0); 337 m_rowPos[r + 1] = 0; 338 m_grid[r].baseline = 0; 339 LayoutUnit baseline = 0; 340 int bdesc = 0; 341 int ch = m_grid[r].logicalHeight.calcMinValue(0); 342 int pos = m_rowPos[r] + ch + (m_grid[r].rowRenderer ? spacing : 0); 343 344 m_rowPos[r + 1] = max(m_rowPos[r + 1], pos); 341 345 342 346 Row& row = m_grid[r].row; … … 350 354 continue; 351 355 352 // FIXME: We are always adding the height of a rowspan to the last rows which doesn't match 353 // other browsers. See webkit.org/b/52185 for example. 354 if ((cell->row() + cell->rowSpan() - 1) != r) 356 if ((cell->row() + cell->rowSpan() - 1) > r) 355 357 continue; 356 358 357 // For row spanning cells, |r| is the last row in the span. 358 unsigned cellStartRow = cell->row(); 359 unsigned indx = max(r - cell->rowSpan() + 1, 0u); 359 360 360 361 if (cell->hasOverrideHeight()) { … … 370 371 } 371 372 372 int cellLogicalHeight = cell->logicalHeightForRowSizing(); 373 m_rowPos[r + 1] = max(m_rowPos[r + 1], m_rowPos[cellStartRow] + cellLogicalHeight); 373 int adjustedLogicalHeight = cell->logicalHeight() - (cell->intrinsicPaddingBefore() + cell->intrinsicPaddingAfter()); 374 375 ch = cell->style()->logicalHeight().calcValue(0); 376 if (document()->inQuirksMode() || cell->style()->boxSizing() == BORDER_BOX) { 377 // Explicit heights use the border box in quirks mode. 378 // Don't adjust height. 379 } else { 380 // In strict mode, box-sizing: content-box do the right 381 // thing and actually add in the border and padding. 382 int adjustedPaddingBefore = cell->paddingBefore() - cell->intrinsicPaddingBefore(); 383 int adjustedPaddingAfter = cell->paddingAfter() - cell->intrinsicPaddingAfter(); 384 ch += adjustedPaddingBefore + adjustedPaddingAfter + cell->borderBefore() + cell->borderAfter(); 385 } 386 ch = max(ch, adjustedLogicalHeight); 387 388 pos = m_rowPos[indx] + ch + (m_grid[r].rowRenderer ? spacing : 0); 389 390 m_rowPos[r + 1] = max(m_rowPos[r + 1], pos); 374 391 375 392 // find out the baseline 376 393 EVerticalAlign va = cell->style()->verticalAlign(); 377 394 if (va == BASELINE || va == TEXT_BOTTOM || va == TEXT_TOP || va == SUPER || va == SUB) { 378 int b aselinePosition= cell->cellBaselinePosition();379 if (b aselinePosition> cell->borderBefore() + cell->paddingBefore()) {380 m_grid[r].baseline = max(m_grid[r].baseline, baselinePosition- cell->intrinsicPaddingBefore());381 b aselineDescent = max(baselineDescent, m_rowPos[cellStartRow] + cellLogicalHeight - (baselinePosition- cell->intrinsicPaddingBefore()));395 int b = cell->cellBaselinePosition(); 396 if (b > cell->borderBefore() + cell->paddingBefore()) { 397 baseline = max<LayoutUnit>(baseline, b - cell->intrinsicPaddingBefore()); 398 bdesc = max(bdesc, m_rowPos[indx] + ch - (b - cell->intrinsicPaddingBefore())); 382 399 } 383 400 } … … 385 402 386 403 // do we have baseline aligned elements? 387 if ( m_grid[r].baseline)404 if (baseline) { 388 405 // increase rowheight if baseline requires 389 m_rowPos[r + 1] = max(m_rowPos[r + 1], m_grid[r].baseline + baselineDescent);390 391 // Add the border-spacing to our final position.392 m_rowPos[r + 1] += m_grid[r].rowRenderer ? spacing : 0; 406 m_rowPos[r + 1] = max(m_rowPos[r + 1], baseline + bdesc + (m_grid[r].rowRenderer ? spacing : 0)); 407 m_grid[r].baseline = baseline; 408 } 409 393 410 m_rowPos[r + 1] = max(m_rowPos[r + 1], m_rowPos[r]); 394 411 }
Note: See TracChangeset
for help on using the changeset viewer.