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

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

Issue 9117049: 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 105786)
+++ Source/WebCore/rendering/RenderTable.cpp (working copy)
@@ -265,11 +265,20 @@
}
}
-void RenderTable::adjustLogicalHeightForCaption(RenderBlock* caption)
+void RenderTable::layoutCaption(RenderTableCaption* 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);
@@ -330,10 +339,6 @@
}
}
- // 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).
@@ -345,7 +350,7 @@
for (unsigned i = 0; i < m_captions.size(); i++) {
if (m_captions[i]->style()->captionSide() == CAPBOTTOM)
continue;
- adjustLogicalHeightForCaption(m_captions[i]);
+ layoutCaption(m_captions[i]);
}
if (logicalHeight() != oldTableLogicalTop) {
sectionMoved = true;
@@ -405,7 +410,7 @@
for (unsigned i = 0; i < m_captions.size(); i++) {
if (m_captions[i]->style()->captionSide() != CAPBOTTOM)
continue;
- adjustLogicalHeightForCaption(m_captions[i]);
+ layoutCaption(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