Index: third_party/WebKit/Source/core/layout/LayoutTable.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutTable.cpp b/third_party/WebKit/Source/core/layout/LayoutTable.cpp |
index 6febb8197d75b049dc4d25fa852f59efa1fa805f..2ea24920d5472b03134079d6df36f86c064f7b1c 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutTable.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutTable.cpp |
@@ -535,10 +535,15 @@ void LayoutTable::layout() |
distributeExtraLogicalHeight(floorToInt(computedLogicalHeight - totalSectionLogicalHeight)); |
- for (LayoutTableSection* section = topSection(); section; section = sectionBelow(section)) |
+ LayoutTableSection* topSection = this->topSection(); |
+ LayoutUnit logicalOffset = topSection ? topSection->logicalTop() : LayoutUnit(); |
+ for (LayoutTableSection* section = topSection; section; section = sectionBelow(section)) { |
+ section->setLogicalTop(logicalOffset); |
section->layoutRows(); |
+ logicalOffset += section->logicalHeight(); |
+ } |
- if (!topSection() && computedLogicalHeight > totalSectionLogicalHeight && !document().inQuirksMode()) { |
+ if (!topSection && computedLogicalHeight > totalSectionLogicalHeight && !document().inQuirksMode()) { |
// Completely empty tables (with no sections or anything) should at least honor specified height |
// in strict mode. |
setLogicalHeight(logicalHeight() + computedLogicalHeight); |
@@ -549,7 +554,7 @@ void LayoutTable::layout() |
sectionLogicalLeft += style()->isLeftToRightDirection() ? paddingStart() : paddingEnd(); |
// position the table sections |
- LayoutTableSection* section = topSection(); |
+ LayoutTableSection* section = topSection; |
while (section) { |
if (!sectionMoved && section->logicalTop() != logicalHeight()) |
sectionMoved = true; |