| OLD | NEW |
| 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 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1104 | 1104 |
| 1105 int remainingExtraLogicalHeight = extraLogicalHeight; | 1105 int remainingExtraLogicalHeight = extraLogicalHeight; |
| 1106 distributeExtraLogicalHeightToPercentRows(remainingExtraLogicalHeight, | 1106 distributeExtraLogicalHeightToPercentRows(remainingExtraLogicalHeight, |
| 1107 totalPercent); | 1107 totalPercent); |
| 1108 distributeExtraLogicalHeightToAutoRows(remainingExtraLogicalHeight, | 1108 distributeExtraLogicalHeightToAutoRows(remainingExtraLogicalHeight, |
| 1109 autoRowsCount); | 1109 autoRowsCount); |
| 1110 distributeRemainingExtraLogicalHeight(remainingExtraLogicalHeight); | 1110 distributeRemainingExtraLogicalHeight(remainingExtraLogicalHeight); |
| 1111 return extraLogicalHeight - remainingExtraLogicalHeight; | 1111 return extraLogicalHeight - remainingExtraLogicalHeight; |
| 1112 } | 1112 } |
| 1113 | 1113 |
| 1114 static bool shouldFlexCellChild(LayoutObject* cellDescendant) { | 1114 static bool shouldFlexCellChild(const LayoutTableCell& cell, |
| 1115 return cellDescendant->isAtomicInlineLevel() || | 1115 LayoutObject* cellDescendant) { |
| 1116 (cellDescendant->isBox() && | 1116 if (!cell.style()->logicalHeight().isSpecified()) |
| 1117 toLayoutBox(cellDescendant)->style()->overflowY() != | 1117 return false; |
| 1118 OverflowVisible && | 1118 if (cellDescendant->style()->overflowY() == OverflowVisible || |
| 1119 toLayoutBox(cellDescendant)->style()->overflowY() != OverflowHidden); | 1119 cellDescendant->style()->overflowY() == OverflowHidden) |
| 1120 return true; |
| 1121 return cellDescendant->isBox() && |
| 1122 toLayoutBox(cellDescendant)->shouldBeConsideredAsReplaced(); |
| 1120 } | 1123 } |
| 1121 | 1124 |
| 1122 void LayoutTableSection::layoutRows() { | 1125 void LayoutTableSection::layoutRows() { |
| 1123 #if ENABLE(ASSERT) | 1126 #if ENABLE(ASSERT) |
| 1124 SetLayoutNeededForbiddenScope layoutForbiddenScope(*this); | 1127 SetLayoutNeededForbiddenScope layoutForbiddenScope(*this); |
| 1125 #endif | 1128 #endif |
| 1126 | 1129 |
| 1127 ASSERT(!needsLayout()); | 1130 ASSERT(!needsLayout()); |
| 1128 | 1131 |
| 1129 LayoutAnalyzer::Scope analyzer(*this); | 1132 LayoutAnalyzer::Scope analyzer(*this); |
| (...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1895 // can't hope to match the behavior perfectly, but we'll continue to refine it | 1898 // can't hope to match the behavior perfectly, but we'll continue to refine it |
| 1896 // as we discover new bugs. :) | 1899 // as we discover new bugs. :) |
| 1897 bool cellChildrenFlex = false; | 1900 bool cellChildrenFlex = false; |
| 1898 bool flexAllChildren = cell.style()->logicalHeight().isSpecified() || | 1901 bool flexAllChildren = cell.style()->logicalHeight().isSpecified() || |
| 1899 (!table()->style()->logicalHeight().isAuto() && | 1902 (!table()->style()->logicalHeight().isAuto() && |
| 1900 rowHeight != cell.logicalHeight()); | 1903 rowHeight != cell.logicalHeight()); |
| 1901 | 1904 |
| 1902 for (LayoutObject* child = cell.firstChild(); child; | 1905 for (LayoutObject* child = cell.firstChild(); child; |
| 1903 child = child->nextSibling()) { | 1906 child = child->nextSibling()) { |
| 1904 if (!child->isText() && child->style()->logicalHeight().isPercentOrCalc() && | 1907 if (!child->isText() && child->style()->logicalHeight().isPercentOrCalc() && |
| 1905 (flexAllChildren || shouldFlexCellChild(child)) && | 1908 (flexAllChildren || shouldFlexCellChild(cell, child)) && |
| 1906 (!child->isTable() || toLayoutTable(child)->hasSections())) { | 1909 (!child->isTable() || toLayoutTable(child)->hasSections())) { |
| 1907 cellChildrenFlex = true; | 1910 cellChildrenFlex = true; |
| 1908 break; | 1911 break; |
| 1909 } | 1912 } |
| 1910 } | 1913 } |
| 1911 | 1914 |
| 1912 if (!cellChildrenFlex) { | 1915 if (!cellChildrenFlex) { |
| 1913 if (TrackedLayoutBoxListHashSet* percentHeightDescendants = | 1916 if (TrackedLayoutBoxListHashSet* percentHeightDescendants = |
| 1914 cell.percentHeightDescendants()) { | 1917 cell.percentHeightDescendants()) { |
| 1915 for (auto* descendant : *percentHeightDescendants) { | 1918 for (auto* descendant : *percentHeightDescendants) { |
| 1916 if (flexAllChildren || shouldFlexCellChild(descendant)) { | 1919 if (flexAllChildren || shouldFlexCellChild(cell, descendant)) { |
| 1917 cellChildrenFlex = true; | 1920 cellChildrenFlex = true; |
| 1918 break; | 1921 break; |
| 1919 } | 1922 } |
| 1920 } | 1923 } |
| 1921 } | 1924 } |
| 1922 } | 1925 } |
| 1923 | 1926 |
| 1924 if (!cellChildrenFlex) | 1927 if (!cellChildrenFlex) |
| 1925 return; | 1928 return; |
| 1926 | 1929 |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2077 // the header in all columns. | 2080 // the header in all columns. |
| 2078 // Note that this is in flow thread coordinates, not visual coordinates. The | 2081 // Note that this is in flow thread coordinates, not visual coordinates. The |
| 2079 // enclosing LayoutFlowThread will convert to visual coordinates. | 2082 // enclosing LayoutFlowThread will convert to visual coordinates. |
| 2080 if (table()->header() == this && isRepeatingHeaderGroup()) | 2083 if (table()->header() == this && isRepeatingHeaderGroup()) |
| 2081 rect.setHeight(table()->logicalHeight()); | 2084 rect.setHeight(table()->logicalHeight()); |
| 2082 return LayoutTableBoxComponent::mapToVisualRectInAncestorSpace(ancestor, rect, | 2085 return LayoutTableBoxComponent::mapToVisualRectInAncestorSpace(ancestor, rect, |
| 2083 flags); | 2086 flags); |
| 2084 } | 2087 } |
| 2085 | 2088 |
| 2086 } // namespace blink | 2089 } // namespace blink |
| OLD | NEW |