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

Side by Side Diff: Source/core/layout/LayoutTableSection.cpp

Issue 926193003: Move rendering/RenderBox to layout/LayoutBox. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/LayoutTableSection.h ('k') | Source/core/layout/LayoutTextControl.cpp » ('j') | 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. All r ights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2013 Apple Inc. All r ights reserved.
8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 || (cRowLogicalHeight.isFixed() && cRowLogicalHeight.value() < l ogicalHeight.value())) 71 || (cRowLogicalHeight.isFixed() && cRowLogicalHeight.value() < l ogicalHeight.value()))
72 row.logicalHeight = logicalHeight; 72 row.logicalHeight = logicalHeight;
73 break; 73 break;
74 default: 74 default:
75 break; 75 break;
76 } 76 }
77 } 77 }
78 } 78 }
79 79
80 LayoutTableSection::LayoutTableSection(Element* element) 80 LayoutTableSection::LayoutTableSection(Element* element)
81 : RenderBox(element) 81 : LayoutBox(element)
82 , m_cCol(0) 82 , m_cCol(0)
83 , m_cRow(0) 83 , m_cRow(0)
84 , m_outerBorderStart(0) 84 , m_outerBorderStart(0)
85 , m_outerBorderEnd(0) 85 , m_outerBorderEnd(0)
86 , m_outerBorderBefore(0) 86 , m_outerBorderBefore(0)
87 , m_outerBorderAfter(0) 87 , m_outerBorderAfter(0)
88 , m_needsCellRecalc(false) 88 , m_needsCellRecalc(false)
89 , m_forceSlowPaintPathWithOverflowingCell(false) 89 , m_forceSlowPaintPathWithOverflowingCell(false)
90 , m_hasMultipleCellLevels(false) 90 , m_hasMultipleCellLevels(false)
91 { 91 {
92 // init LayoutObject attributes 92 // init LayoutObject attributes
93 setInline(false); // our object is not Inline 93 setInline(false); // our object is not Inline
94 } 94 }
95 95
96 LayoutTableSection::~LayoutTableSection() 96 LayoutTableSection::~LayoutTableSection()
97 { 97 {
98 } 98 }
99 99
100 void LayoutTableSection::styleDidChange(StyleDifference diff, const LayoutStyle* oldStyle) 100 void LayoutTableSection::styleDidChange(StyleDifference diff, const LayoutStyle* oldStyle)
101 { 101 {
102 RenderBox::styleDidChange(diff, oldStyle); 102 LayoutBox::styleDidChange(diff, oldStyle);
103 propagateStyleToAnonymousChildren(); 103 propagateStyleToAnonymousChildren();
104 104
105 // If border was changed, notify table. 105 // If border was changed, notify table.
106 LayoutTable* table = this->table(); 106 LayoutTable* table = this->table();
107 if (table && !table->selfNeedsLayout() && !table->normalChildNeedsLayout() & & oldStyle && oldStyle->border() != style()->border()) 107 if (table && !table->selfNeedsLayout() && !table->normalChildNeedsLayout() & & oldStyle && oldStyle->border() != style()->border())
108 table->invalidateCollapsedBorders(); 108 table->invalidateCollapsedBorders();
109 } 109 }
110 110
111 void LayoutTableSection::willBeRemovedFromTree() 111 void LayoutTableSection::willBeRemovedFromTree()
112 { 112 {
113 RenderBox::willBeRemovedFromTree(); 113 LayoutBox::willBeRemovedFromTree();
114 114
115 // Preventively invalidate our cells as we may be re-inserted into 115 // Preventively invalidate our cells as we may be re-inserted into
116 // a new table which would require us to rebuild our structure. 116 // a new table which would require us to rebuild our structure.
117 setNeedsCellRecalc(); 117 setNeedsCellRecalc();
118 } 118 }
119 119
120 void LayoutTableSection::addChild(LayoutObject* child, LayoutObject* beforeChild ) 120 void LayoutTableSection::addChild(LayoutObject* child, LayoutObject* beforeChild )
121 { 121 {
122 if (!child->isTableRow()) { 122 if (!child->isTableRow()) {
123 LayoutObject* last = beforeChild; 123 LayoutObject* last = beforeChild;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 m_grid[insertionRow].rowRenderer = row; 167 m_grid[insertionRow].rowRenderer = row;
168 row->setRowIndex(insertionRow); 168 row->setRowIndex(insertionRow);
169 169
170 if (!beforeChild) 170 if (!beforeChild)
171 setRowLogicalHeightToRowStyleLogicalHeight(m_grid[insertionRow]); 171 setRowLogicalHeightToRowStyleLogicalHeight(m_grid[insertionRow]);
172 172
173 if (beforeChild && beforeChild->parent() != this) 173 if (beforeChild && beforeChild->parent() != this)
174 beforeChild = splitAnonymousBoxesAroundChild(beforeChild); 174 beforeChild = splitAnonymousBoxesAroundChild(beforeChild);
175 175
176 ASSERT(!beforeChild || beforeChild->isTableRow()); 176 ASSERT(!beforeChild || beforeChild->isTableRow());
177 RenderBox::addChild(child, beforeChild); 177 LayoutBox::addChild(child, beforeChild);
178 } 178 }
179 179
180 void LayoutTableSection::ensureRows(unsigned numRows) 180 void LayoutTableSection::ensureRows(unsigned numRows)
181 { 181 {
182 if (numRows <= m_grid.size()) 182 if (numRows <= m_grid.size())
183 return; 183 return;
184 184
185 unsigned oldSize = m_grid.size(); 185 unsigned oldSize = m_grid.size();
186 m_grid.grow(numRows); 186 m_grid.grow(numRows);
187 187
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
910 910
911 int remainingExtraLogicalHeight = extraLogicalHeight; 911 int remainingExtraLogicalHeight = extraLogicalHeight;
912 distributeExtraLogicalHeightToPercentRows(remainingExtraLogicalHeight, total Percent); 912 distributeExtraLogicalHeightToPercentRows(remainingExtraLogicalHeight, total Percent);
913 distributeExtraLogicalHeightToAutoRows(remainingExtraLogicalHeight, autoRows Count); 913 distributeExtraLogicalHeightToAutoRows(remainingExtraLogicalHeight, autoRows Count);
914 distributeRemainingExtraLogicalHeight(remainingExtraLogicalHeight); 914 distributeRemainingExtraLogicalHeight(remainingExtraLogicalHeight);
915 return extraLogicalHeight - remainingExtraLogicalHeight; 915 return extraLogicalHeight - remainingExtraLogicalHeight;
916 } 916 }
917 917
918 static bool shouldFlexCellChild(LayoutObject* cellDescendant) 918 static bool shouldFlexCellChild(LayoutObject* cellDescendant)
919 { 919 {
920 return cellDescendant->isReplaced() || (cellDescendant->isBox() && toRenderB ox(cellDescendant)->scrollsOverflow()); 920 return cellDescendant->isReplaced() || (cellDescendant->isBox() && toLayoutB ox(cellDescendant)->scrollsOverflow());
921 } 921 }
922 922
923 void LayoutTableSection::layoutRows() 923 void LayoutTableSection::layoutRows()
924 { 924 {
925 #if ENABLE(ASSERT) 925 #if ENABLE(ASSERT)
926 SetLayoutNeededForbiddenScope layoutForbiddenScope(*this); 926 SetLayoutNeededForbiddenScope layoutForbiddenScope(*this);
927 #endif 927 #endif
928 928
929 ASSERT(!needsLayout()); 929 ASSERT(!needsLayout());
930 930
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
1604 // FIXME: The table's direction should determine our row's direction, not th e section's (see bug 96691). 1604 // FIXME: The table's direction should determine our row's direction, not th e section's (see bug 96691).
1605 if (!style()->isLeftToRightDirection()) 1605 if (!style()->isLeftToRightDirection())
1606 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing); 1606 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing);
1607 else 1607 else
1608 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing); 1608 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing);
1609 1609
1610 cell->setLogicalLocation(cellLocation); 1610 cell->setLogicalLocation(cellLocation);
1611 } 1611 }
1612 1612
1613 } // namespace blink 1613 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutTableSection.h ('k') | Source/core/layout/LayoutTextControl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698