Skip to content
Permalink
Browse files
Unreviewed, rolling out r108557.
http://trac.webkit.org/changeset/108557
https://bugs.webkit.org/show_bug.cgi?id=77705

Broke svg/zoom/page/zoom-replated-intrinsic-ratio-001.htm.

* rendering/RenderTableCell.cpp:
* rendering/RenderTableCell.h:
(RenderTableCell):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::calcRowLogicalHeight):

Canonical link: https://commits.webkit.org/96665@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@108892 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Nikolas Zimmermann committed Feb 25, 2012
1 parent 503c3cb commit 910b99d14ce9aee10322399c4787fd127f8c1c41
Showing 4 changed files with 49 additions and 39 deletions.
@@ -1,3 +1,17 @@
2012-02-25 Nikolas Zimmermann <nzimmermann@rim.com>

Unreviewed, rolling out r108557.
http://trac.webkit.org/changeset/108557
https://bugs.webkit.org/show_bug.cgi?id=77705

Broke svg/zoom/page/zoom-replated-intrinsic-ratio-001.htm.

* rendering/RenderTableCell.cpp:
* rendering/RenderTableCell.h:
(RenderTableCell):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::calcRowLogicalHeight):

2012-02-25 Andreas Kling <awesomekling@apple.com>

HTMLParamElement: Clean up name/value attribute handling.
@@ -91,25 +91,6 @@ void RenderTableCell::colSpanOrRowSpanChanged()
section()->setNeedsCellRecalc();
}

LayoutUnit RenderTableCell::logicalHeightForRowSizing() const
{
LayoutUnit adjustedLogicalHeight = logicalHeight() - (intrinsicPaddingBefore() + intrinsicPaddingAfter());

LayoutUnit styleLogicalHeight = style()->logicalHeight().calcValue(0);
if (document()->inQuirksMode() || style()->boxSizing() == BORDER_BOX) {
// Explicit heights use the border box in quirks mode.
// Don't adjust height.
} else {
// In strict mode, box-sizing: content-box do the right
// thing and actually add in the border and padding.
LayoutUnit adjustedPaddingBefore = paddingBefore() - intrinsicPaddingBefore();
LayoutUnit adjustedPaddingAfter = paddingAfter() - intrinsicPaddingAfter();
styleLogicalHeight += adjustedPaddingBefore + adjustedPaddingAfter + borderBefore() + borderAfter();
}

return max(styleLogicalHeight, adjustedLogicalHeight);
}

Length RenderTableCell::styleOrColLogicalWidth() const
{
Length w = style()->logicalWidth();
@@ -85,8 +85,6 @@ class RenderTableCell : public RenderBlock {

Length styleOrColLogicalWidth() const;

LayoutUnit logicalHeightForRowSizing() const;

virtual void computePreferredLogicalWidths();

void updateLogicalWidth(LayoutUnit);
@@ -334,10 +334,14 @@ int RenderTableSection::calcRowLogicalHeight()
m_rowPos[0] = spacing;

for (unsigned r = 0; r < m_grid.size(); r++) {
LayoutUnit baselineDescent = 0;
m_rowPos[r + 1] = 0;
m_grid[r].baseline = 0;
LayoutUnit baseline = 0;
int bdesc = 0;
int ch = m_grid[r].logicalHeight.calcMinValue(0);
int pos = m_rowPos[r] + ch + (m_grid[r].rowRenderer ? spacing : 0);

// Our base size is the biggest logical height from our cells' styles (excluding row spanning cells).
m_rowPos[r + 1] = max(m_rowPos[r] + m_grid[r].logicalHeight.calcMinValue(0), 0);
m_rowPos[r + 1] = max(m_rowPos[r + 1], pos);

Row& row = m_grid[r].row;
unsigned totalCols = row.size();
@@ -349,13 +353,10 @@ int RenderTableSection::calcRowLogicalHeight()
if (!cell || current.inColSpan)
continue;

// FIXME: We are always adding the height of a rowspan to the last rows which doesn't match
// other browsers. See webkit.org/b/52185 for example.
if ((cell->row() + cell->rowSpan() - 1) != r)
if ((cell->row() + cell->rowSpan() - 1) > r)
continue;

// For row spanning cells, |r| is the last row in the span.
unsigned cellStartRow = cell->row();
unsigned indx = max(r - cell->rowSpan() + 1, 0u);

if (cell->hasOverrideHeight()) {
if (!statePusher.didPush()) {
@@ -369,27 +370,43 @@ int RenderTableSection::calcRowLogicalHeight()
cell->layoutIfNeeded();
}

int cellLogicalHeight = cell->logicalHeightForRowSizing();
m_rowPos[r + 1] = max(m_rowPos[r + 1], m_rowPos[cellStartRow] + cellLogicalHeight);
int adjustedLogicalHeight = cell->logicalHeight() - (cell->intrinsicPaddingBefore() + cell->intrinsicPaddingAfter());

ch = cell->style()->logicalHeight().calcValue(0);
if (document()->inQuirksMode() || cell->style()->boxSizing() == BORDER_BOX) {
// Explicit heights use the border box in quirks mode.
// Don't adjust height.
} else {
// In strict mode, box-sizing: content-box do the right
// thing and actually add in the border and padding.
int adjustedPaddingBefore = cell->paddingBefore() - cell->intrinsicPaddingBefore();
int adjustedPaddingAfter = cell->paddingAfter() - cell->intrinsicPaddingAfter();
ch += adjustedPaddingBefore + adjustedPaddingAfter + cell->borderBefore() + cell->borderAfter();
}
ch = max(ch, adjustedLogicalHeight);

pos = m_rowPos[indx] + ch + (m_grid[r].rowRenderer ? spacing : 0);

m_rowPos[r + 1] = max(m_rowPos[r + 1], pos);

// find out the baseline
EVerticalAlign va = cell->style()->verticalAlign();
if (va == BASELINE || va == TEXT_BOTTOM || va == TEXT_TOP || va == SUPER || va == SUB) {
int baselinePosition = cell->cellBaselinePosition();
if (baselinePosition > cell->borderBefore() + cell->paddingBefore()) {
m_grid[r].baseline = max(m_grid[r].baseline, baselinePosition - cell->intrinsicPaddingBefore());
baselineDescent = max(baselineDescent, m_rowPos[cellStartRow] + cellLogicalHeight - (baselinePosition - cell->intrinsicPaddingBefore()));
int b = cell->cellBaselinePosition();
if (b > cell->borderBefore() + cell->paddingBefore()) {
baseline = max<LayoutUnit>(baseline, b - cell->intrinsicPaddingBefore());
bdesc = max(bdesc, m_rowPos[indx] + ch - (b - cell->intrinsicPaddingBefore()));
}
}
}

// do we have baseline aligned elements?
if (m_grid[r].baseline)
if (baseline) {
// increase rowheight if baseline requires
m_rowPos[r + 1] = max(m_rowPos[r + 1], m_grid[r].baseline + baselineDescent);
m_rowPos[r + 1] = max(m_rowPos[r + 1], baseline + bdesc + (m_grid[r].rowRenderer ? spacing : 0));
m_grid[r].baseline = baseline;
}

// Add the border-spacing to our final position.
m_rowPos[r + 1] += m_grid[r].rowRenderer ? spacing : 0;
m_rowPos[r + 1] = max(m_rowPos[r + 1], m_rowPos[r]);
}

0 comments on commit 910b99d

Please sign in to comment.