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

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

Issue 2535173006: Percent height border-box content should get correct height in percent height cells (Closed)
Patch Set: bug 669867 Created 4 years 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/LayoutTableSection.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
index ac59da6ee6c12085703967fb88a6d60497b72088..98f629c264f96c201c30ae801244048301df33f5 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
@@ -1111,12 +1111,19 @@ int LayoutTableSection::distributeExtraLogicalHeightToRows(
return extraLogicalHeight - remainingExtraLogicalHeight;
}
-static bool shouldFlexCellChild(LayoutObject* cellDescendant) {
- return cellDescendant->isAtomicInlineLevel() ||
- (cellDescendant->isBox() &&
- toLayoutBox(cellDescendant)->style()->overflowY() !=
- OverflowVisible &&
- toLayoutBox(cellDescendant)->style()->overflowY() != OverflowHidden);
+static bool shouldFlexCellChild(const LayoutTableCell& cell,
+ LayoutObject* cellDescendant) {
+ if (!cell.style()->logicalHeight().isSpecified())
+ return false;
+ if (cellDescendant->isAtomicInlineLevel())
+ return true;
+ if (cellDescendant->style()->overflowY() == OverflowVisible ||
+ cellDescendant->style()->overflowY() == OverflowHidden)
+ return true;
+ Node* node = cellDescendant->node();
+ return node && node->isElementNode() &&
+ (toElement(node)->isFormControlElement() ||
+ isHTMLImageElement(toElement(node)));
}
void LayoutTableSection::layoutRows() {
@@ -1902,7 +1909,7 @@ void LayoutTableSection::relayoutCellIfFlexed(LayoutTableCell& cell,
for (LayoutObject* child = cell.firstChild(); child;
child = child->nextSibling()) {
if (!child->isText() && child->style()->logicalHeight().isPercentOrCalc() &&
- (flexAllChildren || shouldFlexCellChild(child)) &&
+ (flexAllChildren || shouldFlexCellChild(cell, child)) &&
(!child->isTable() || toLayoutTable(child)->hasSections())) {
cellChildrenFlex = true;
break;
@@ -1913,7 +1920,7 @@ void LayoutTableSection::relayoutCellIfFlexed(LayoutTableCell& cell,
if (TrackedLayoutBoxListHashSet* percentHeightDescendants =
cell.percentHeightDescendants()) {
for (auto* descendant : *percentHeightDescendants) {
- if (flexAllChildren || shouldFlexCellChild(descendant)) {
+ if (flexAllChildren || shouldFlexCellChild(cell, descendant)) {
cellChildrenFlex = true;
break;
}

Powered by Google App Engine
This is Rietveld 408576698