Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Unified Diff: Source/WebCore/rendering/RenderTable.cpp

Issue 9271029: Revert 105788 - Merge 105768 - Incorrect positioning of floating pseudo-elements in table captions (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/rendering/RenderTable.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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())
« no previous file with comments | « Source/WebCore/rendering/RenderTable.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698