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

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

Issue 2816313002: Treat cells with percent height as auto if their container depends on content height (Closed)
Patch Set: bug 687551 Created 3 years, 8 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 | « third_party/WebKit/LayoutTests/platform/win/tables/mozilla_expected_failures/bugs/bug32205-4-expected.png ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
index 95efd6a7998bde5fe64d5ea338105f0a3f094c00..5460ea7f1ccb05add751a9fcae0024ef0e095036 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
@@ -1114,9 +1114,18 @@ int LayoutTableSection::DistributeExtraLogicalHeightToRows(
return extra_logical_height - remaining_extra_logical_height;
}
+bool CellHasExplicitlySpecifiedHeight(const LayoutTableCell& cell) {
+ if (cell.Style()->LogicalHeight().IsFixed())
+ return true;
+ LayoutBlock* cb = cell.ContainingBlock();
+ if (cb->AvailableLogicalHeightForPercentageComputation() == -1)
+ return false;
+ return true;
+}
+
static bool ShouldFlexCellChild(const LayoutTableCell& cell,
LayoutObject* cell_descendant) {
- if (!cell.Style()->LogicalHeight().IsSpecified())
+ if (!CellHasExplicitlySpecifiedHeight(cell))
return false;
if (cell_descendant->Style()->OverflowY() == EOverflow::kVisible ||
cell_descendant->Style()->OverflowY() == EOverflow::kHidden)
@@ -1961,7 +1970,7 @@ void LayoutTableSection::RelayoutCellIfFlexed(LayoutTableCell& cell,
// can't hope to match the behavior perfectly, but we'll continue to refine it
// as we discover new bugs. :)
bool cell_children_flex = false;
- bool flex_all_children = cell.Style()->LogicalHeight().IsSpecified() ||
+ bool flex_all_children = CellHasExplicitlySpecifiedHeight(cell) ||
(!Table()->Style()->LogicalHeight().IsAuto() &&
row_height != cell.LogicalHeight());
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/win/tables/mozilla_expected_failures/bugs/bug32205-4-expected.png ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698