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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1997 Martin Jones (mjones@kde.org) 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 * (C) 1997 Torben Weis (weis@kde.org) 3 * (C) 1997 Torben Weis (weis@kde.org)
4 * (C) 1998 Waldo Bastian (bastian@kde.org) 4 * (C) 1998 Waldo Bastian (bastian@kde.org)
5 * (C) 1999 Lars Knoll (knoll@kde.org) 5 * (C) 1999 Lars Knoll (knoll@kde.org)
6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 * (C) 1999 Antti Koivisto (koivisto@kde.org)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2013 Apple Inc. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2013 Apple Inc.
8 * All rights reserved. 8 * All rights reserved.
9 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 9 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
10 * 10 *
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
1103 1103
1104 int remainingExtraLogicalHeight = extraLogicalHeight; 1104 int remainingExtraLogicalHeight = extraLogicalHeight;
1105 distributeExtraLogicalHeightToPercentRows(remainingExtraLogicalHeight, 1105 distributeExtraLogicalHeightToPercentRows(remainingExtraLogicalHeight,
1106 totalPercent); 1106 totalPercent);
1107 distributeExtraLogicalHeightToAutoRows(remainingExtraLogicalHeight, 1107 distributeExtraLogicalHeightToAutoRows(remainingExtraLogicalHeight,
1108 autoRowsCount); 1108 autoRowsCount);
1109 distributeRemainingExtraLogicalHeight(remainingExtraLogicalHeight); 1109 distributeRemainingExtraLogicalHeight(remainingExtraLogicalHeight);
1110 return extraLogicalHeight - remainingExtraLogicalHeight; 1110 return extraLogicalHeight - remainingExtraLogicalHeight;
1111 } 1111 }
1112 1112
1113 static bool shouldFlexCellChild(LayoutObject* cellDescendant) { 1113 static bool shouldFlexCellChild(const LayoutTableCell& cell,
1114 return cellDescendant->isAtomicInlineLevel() || 1114 LayoutObject* cellDescendant) {
1115 (cellDescendant->isBox() && 1115 if (!cell.style()->logicalHeight().isSpecified())
1116 toLayoutBox(cellDescendant)->style()->overflowY() != 1116 return false;
1117 EOverflow::Visible && 1117 if (cellDescendant->style()->overflowY() == EOverflow::Visible ||
1118 toLayoutBox(cellDescendant)->style()->overflowY() != 1118 cellDescendant->style()->overflowY() == EOverflow::Hidden)
1119 EOverflow::Hidden); 1119 return true;
1120 return cellDescendant->isBox() &&
1121 toLayoutBox(cellDescendant)->shouldBeConsideredAsReplaced();
1120 } 1122 }
1121 1123
1122 void LayoutTableSection::layoutRows() { 1124 void LayoutTableSection::layoutRows() {
1123 #if DCHECK_IS_ON() 1125 #if DCHECK_IS_ON()
1124 SetLayoutNeededForbiddenScope layoutForbiddenScope(*this); 1126 SetLayoutNeededForbiddenScope layoutForbiddenScope(*this);
1125 #endif 1127 #endif
1126 1128
1127 ASSERT(!needsLayout()); 1129 ASSERT(!needsLayout());
1128 1130
1129 LayoutAnalyzer::Scope analyzer(*this); 1131 LayoutAnalyzer::Scope analyzer(*this);
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
1895 // can't hope to match the behavior perfectly, but we'll continue to refine it 1897 // can't hope to match the behavior perfectly, but we'll continue to refine it
1896 // as we discover new bugs. :) 1898 // as we discover new bugs. :)
1897 bool cellChildrenFlex = false; 1899 bool cellChildrenFlex = false;
1898 bool flexAllChildren = cell.style()->logicalHeight().isSpecified() || 1900 bool flexAllChildren = cell.style()->logicalHeight().isSpecified() ||
1899 (!table()->style()->logicalHeight().isAuto() && 1901 (!table()->style()->logicalHeight().isAuto() &&
1900 rowHeight != cell.logicalHeight()); 1902 rowHeight != cell.logicalHeight());
1901 1903
1902 for (LayoutObject* child = cell.firstChild(); child; 1904 for (LayoutObject* child = cell.firstChild(); child;
1903 child = child->nextSibling()) { 1905 child = child->nextSibling()) {
1904 if (!child->isText() && child->style()->logicalHeight().isPercentOrCalc() && 1906 if (!child->isText() && child->style()->logicalHeight().isPercentOrCalc() &&
1905 (flexAllChildren || shouldFlexCellChild(child)) && 1907 (flexAllChildren || shouldFlexCellChild(cell, child)) &&
1906 (!child->isTable() || toLayoutTable(child)->hasSections())) { 1908 (!child->isTable() || toLayoutTable(child)->hasSections())) {
1907 cellChildrenFlex = true; 1909 cellChildrenFlex = true;
1908 break; 1910 break;
1909 } 1911 }
1910 } 1912 }
1911 1913
1912 if (!cellChildrenFlex) { 1914 if (!cellChildrenFlex) {
1913 if (TrackedLayoutBoxListHashSet* percentHeightDescendants = 1915 if (TrackedLayoutBoxListHashSet* percentHeightDescendants =
1914 cell.percentHeightDescendants()) { 1916 cell.percentHeightDescendants()) {
1915 for (auto* descendant : *percentHeightDescendants) { 1917 for (auto* descendant : *percentHeightDescendants) {
1916 if (flexAllChildren || shouldFlexCellChild(descendant)) { 1918 if (flexAllChildren || shouldFlexCellChild(cell, descendant)) {
1917 cellChildrenFlex = true; 1919 cellChildrenFlex = true;
1918 break; 1920 break;
1919 } 1921 }
1920 } 1922 }
1921 } 1923 }
1922 } 1924 }
1923 1925
1924 if (!cellChildrenFlex) 1926 if (!cellChildrenFlex)
1925 return; 1927 return;
1926 1928
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
2082 // the header in all columns. 2084 // the header in all columns.
2083 // Note that this is in flow thread coordinates, not visual coordinates. The 2085 // Note that this is in flow thread coordinates, not visual coordinates. The
2084 // enclosing LayoutFlowThread will convert to visual coordinates. 2086 // enclosing LayoutFlowThread will convert to visual coordinates.
2085 if (table()->header() == this && isRepeatingHeaderGroup()) 2087 if (table()->header() == this && isRepeatingHeaderGroup())
2086 rect.setHeight(table()->logicalHeight()); 2088 rect.setHeight(table()->logicalHeight());
2087 return LayoutTableBoxComponent::mapToVisualRectInAncestorSpace(ancestor, rect, 2089 return LayoutTableBoxComponent::mapToVisualRectInAncestorSpace(ancestor, rect,
2088 flags); 2090 flags);
2089 } 2091 }
2090 2092
2091 } // namespace blink 2093 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698