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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutTable.cpp

Issue 2670603002: Avoid pathological layout on nested percent height tables (Closed)
Patch Set: bug 687061 Created 3 years, 10 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
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 b0a6337f490370f973cdadea505b036af51ef7b8..7ce65dbd0cdcd933af34cbc617af4a3feacedb68 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTable.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
@@ -451,12 +451,13 @@ void LayoutTable::layoutSection(LayoutTableSection& section,
layouter.setChildNeedsLayout(&section);
if (!section.needsLayout())
markChildForPaginationRelayoutIfNeeded(section, layouter);
+ bool neededLayout = section.needsLayout();
mstensho (USE GERRIT) 2017/02/06 21:11:07 Might as well do: if (section.needsLayout()) {
rhogan 2017/02/06 21:21:08 section.layout() is private, should I just make it
mstensho (USE GERRIT) 2017/02/06 21:25:27 Oh. Yes. This is exactly why it's problematic to o
section.layoutIfNeeded();
- int sectionLogicalHeight = section.calcRowLogicalHeight();
- section.setLogicalHeight(LayoutUnit(sectionLogicalHeight));
+ if (neededLayout)
+ section.setLogicalHeight(LayoutUnit(section.calcRowLogicalHeight()));
if (view()->layoutState()->isPaginated())
updateFragmentationInfoForChild(section);
- setLogicalHeight(logicalHeight() + sectionLogicalHeight);
+ setLogicalHeight(logicalHeight() + section.logicalHeight());
}
LayoutUnit LayoutTable::logicalHeightFromStyle() const {

Powered by Google App Engine
This is Rietveld 408576698