Index: Source/WebCore/rendering/RenderTable.cpp |
=================================================================== |
--- Source/WebCore/rendering/RenderTable.cpp (revision 105806) |
+++ Source/WebCore/rendering/RenderTable.cpp (working copy) |
@@ -265,20 +265,11 @@ |
} |
} |
-void RenderTable::layoutCaption(RenderTableCaption* caption) |
+void RenderTable::adjustLogicalHeightForCaption(RenderBlock* caption) |
{ |
IntRect captionRect(caption->x(), caption->y(), caption->width(), caption->height()); |
- if (caption->needsLayout()) { |
- // The margins may not be available but ensure the caption is at least located beneath any previous sibling caption |
- // so that it does not mistakenly think any floats in the previous caption intrude into it. |
- caption->setLogicalLocation(IntPoint(caption->marginStart(), caption->marginBefore() + logicalHeight())); |
- // If RenderTableCaption ever gets a layout() function, use it here. |
- caption->layoutIfNeeded(); |
- } |
- // Apply the margins to the location now that they are definitely available from layout |
caption->setLogicalLocation(IntPoint(caption->marginStart(), caption->marginBefore() + logicalHeight())); |
- |
if (!selfNeedsLayout() && caption->checkForRepaintDuringLayout()) |
caption->repaintDuringLayoutIfMoved(captionRect); |
@@ -339,6 +330,10 @@ |
} |
} |
+ // Only lay out one caption, since it's the only one we're going to end up painting. |
+ for (unsigned i = 0; i < m_captions.size(); i++) |
+ m_captions[i]->layoutIfNeeded(); |
+ |
// If any table section moved vertically, we will just repaint everything from that |
// section down (it is quite unlikely that any of the following sections |
// did not shift). |
@@ -350,7 +345,7 @@ |
for (unsigned i = 0; i < m_captions.size(); i++) { |
if (m_captions[i]->style()->captionSide() == CAPBOTTOM) |
continue; |
- layoutCaption(m_captions[i]); |
+ adjustLogicalHeightForCaption(m_captions[i]); |
} |
if (logicalHeight() != oldTableLogicalTop) { |
sectionMoved = true; |
@@ -410,7 +405,7 @@ |
for (unsigned i = 0; i < m_captions.size(); i++) { |
if (m_captions[i]->style()->captionSide() != CAPBOTTOM) |
continue; |
- layoutCaption(m_captions[i]); |
+ adjustLogicalHeightForCaption(m_captions[i]); |
} |
if (isPositioned()) |