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

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

Issue 869323003: Oilpan: move RenderObjects off heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: review-induced improvements 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/paint/TableSectionPainter.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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 if (cRowLogicalHeight.type() < Percent 70 if (cRowLogicalHeight.type() < Percent
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 void LayoutTableSection::CellStruct::trace(Visitor* visitor)
81 {
82 #if ENABLE(OILPAN)
83 visitor->trace(cells);
84 #endif
85 }
86
87 void LayoutTableSection::RowStruct::trace(Visitor* visitor)
88 {
89 visitor->trace(row);
90 visitor->trace(rowRenderer);
91 }
92
93 LayoutTableSection::LayoutTableSection(Element* element) 80 LayoutTableSection::LayoutTableSection(Element* element)
94 : RenderBox(element) 81 : RenderBox(element)
95 , m_cCol(0) 82 , m_cCol(0)
96 , m_cRow(0) 83 , m_cRow(0)
97 , m_outerBorderStart(0) 84 , m_outerBorderStart(0)
98 , m_outerBorderEnd(0) 85 , m_outerBorderEnd(0)
99 , m_outerBorderBefore(0) 86 , m_outerBorderBefore(0)
100 , m_outerBorderAfter(0) 87 , m_outerBorderAfter(0)
101 , m_needsCellRecalc(false) 88 , m_needsCellRecalc(false)
102 , m_forceSlowPaintPathWithOverflowingCell(false) 89 , m_forceSlowPaintPathWithOverflowingCell(false)
103 , m_hasMultipleCellLevels(false) 90 , m_hasMultipleCellLevels(false)
104 { 91 {
105 // init RenderObject attributes 92 // init RenderObject attributes
106 setInline(false); // our object is not Inline 93 setInline(false); // our object is not Inline
107 } 94 }
108 95
109 LayoutTableSection::~LayoutTableSection() 96 LayoutTableSection::~LayoutTableSection()
110 { 97 {
111 } 98 }
112 99
113 void LayoutTableSection::trace(Visitor* visitor)
114 {
115 #if ENABLE(OILPAN)
116 visitor->trace(m_children);
117 visitor->trace(m_grid);
118 visitor->trace(m_overflowingCells);
119 visitor->trace(m_cellsCollapsedBorders);
120 #endif
121 RenderBox::trace(visitor);
122 }
123
124 void LayoutTableSection::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) 100 void LayoutTableSection::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
125 { 101 {
126 RenderBox::styleDidChange(diff, oldStyle); 102 RenderBox::styleDidChange(diff, oldStyle);
127 propagateStyleToAnonymousChildren(); 103 propagateStyleToAnonymousChildren();
128 104
129 // If border was changed, notify table. 105 // If border was changed, notify table.
130 LayoutTable* table = this->table(); 106 LayoutTable* table = this->table();
131 if (table && !table->selfNeedsLayout() && !table->normalChildNeedsLayout() & & oldStyle && oldStyle->border() != style()->border()) 107 if (table && !table->selfNeedsLayout() && !table->normalChildNeedsLayout() & & oldStyle && oldStyle->border() != style()->border())
132 table->invalidateCollapsedBorders(); 108 table->invalidateCollapsedBorders();
133 } 109 }
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after
1077 // descendants. An exception is if we need a layout. In this cas e, we know we're going to 1053 // descendants. An exception is if we need a layout. In this cas e, we know we're going to
1078 // issue paint invalidations ourselves (and the child) anyway. 1054 // issue paint invalidations ourselves (and the child) anyway.
1079 if (!table()->selfNeedsLayout()) 1055 if (!table()->selfNeedsLayout())
1080 cell->setMayNeedPaintInvalidation(); 1056 cell->setMayNeedPaintInvalidation();
1081 } 1057 }
1082 } 1058 }
1083 if (rowHeightIncreaseForPagination) { 1059 if (rowHeightIncreaseForPagination) {
1084 for (unsigned rowIndex = r + 1; rowIndex <= totalRows; rowIndex++) 1060 for (unsigned rowIndex = r + 1; rowIndex <= totalRows; rowIndex++)
1085 m_rowPos[rowIndex] += rowHeightIncreaseForPagination; 1061 m_rowPos[rowIndex] += rowHeightIncreaseForPagination;
1086 for (unsigned c = 0; c < nEffCols; ++c) { 1062 for (unsigned c = 0; c < nEffCols; ++c) {
1087 WillBeHeapVector<RawPtrWillBeMember<LayoutTableCell>, 1>& cells = cellAt(r, c).cells; 1063 Vector<LayoutTableCell*, 1>& cells = cellAt(r, c).cells;
1088 for (size_t i = 0; i < cells.size(); ++i) { 1064 for (size_t i = 0; i < cells.size(); ++i) {
1089 LayoutUnit oldLogicalHeight = cells[i]->logicalHeight(); 1065 LayoutUnit oldLogicalHeight = cells[i]->logicalHeight();
1090 cells[i]->setLogicalHeight(oldLogicalHeight + rowHeightIncre aseForPagination); 1066 cells[i]->setLogicalHeight(oldLogicalHeight + rowHeightIncre aseForPagination);
1091 cells[i]->computeOverflow(oldLogicalHeight, false); 1067 cells[i]->computeOverflow(oldLogicalHeight, false);
1092 } 1068 }
1093 } 1069 }
1094 } 1070 }
1095 } 1071 }
1096 1072
1097 ASSERT(!needsLayout()); 1073 ASSERT(!needsLayout());
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
1599 1575
1600 void LayoutTableSection::setCachedCollapsedBorder(const LayoutTableCell* cell, C ollapsedBorderSide side, CollapsedBorderValue border) 1576 void LayoutTableSection::setCachedCollapsedBorder(const LayoutTableCell* cell, C ollapsedBorderSide side, CollapsedBorderValue border)
1601 { 1577 {
1602 ASSERT(table()->collapseBorders()); 1578 ASSERT(table()->collapseBorders());
1603 m_cellsCollapsedBorders.set(std::make_pair(cell, side), border); 1579 m_cellsCollapsedBorders.set(std::make_pair(cell, side), border);
1604 } 1580 }
1605 1581
1606 CollapsedBorderValue& LayoutTableSection::cachedCollapsedBorder(const LayoutTabl eCell* cell, CollapsedBorderSide side) 1582 CollapsedBorderValue& LayoutTableSection::cachedCollapsedBorder(const LayoutTabl eCell* cell, CollapsedBorderSide side)
1607 { 1583 {
1608 ASSERT(table()->collapseBorders()); 1584 ASSERT(table()->collapseBorders());
1609 WillBeHeapHashMap<pair<RawPtrWillBeMember<const LayoutTableCell>, int>, Coll apsedBorderValue>::iterator it = m_cellsCollapsedBorders.find(std::make_pair(cel l, side)); 1585 HashMap<pair<const LayoutTableCell*, int>, CollapsedBorderValue>::iterator i t = m_cellsCollapsedBorders.find(std::make_pair(cell, side));
1610 ASSERT_WITH_SECURITY_IMPLICATION(it != m_cellsCollapsedBorders.end()); 1586 ASSERT_WITH_SECURITY_IMPLICATION(it != m_cellsCollapsedBorders.end());
1611 return it->value; 1587 return it->value;
1612 } 1588 }
1613 1589
1614 LayoutTableSection* LayoutTableSection::createAnonymousWithParentRenderer(const RenderObject* parent) 1590 LayoutTableSection* LayoutTableSection::createAnonymousWithParentRenderer(const RenderObject* parent)
1615 { 1591 {
1616 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay( parent->style(), TABLE_ROW_GROUP); 1592 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay( parent->style(), TABLE_ROW_GROUP);
1617 LayoutTableSection* newSection = new LayoutTableSection(0); 1593 LayoutTableSection* newSection = new LayoutTableSection(0);
1618 newSection->setDocumentForAnonymous(&parent->document()); 1594 newSection->setDocumentForAnonymous(&parent->document());
1619 newSection->setStyle(newStyle.release()); 1595 newSection->setStyle(newStyle.release());
1620 return newSection; 1596 return newSection;
1621 } 1597 }
1622 1598
1623 void LayoutTableSection::setLogicalPositionForCell(LayoutTableCell* cell, unsign ed effectiveColumn) const 1599 void LayoutTableSection::setLogicalPositionForCell(LayoutTableCell* cell, unsign ed effectiveColumn) const
1624 { 1600 {
1625 LayoutPoint cellLocation(0, m_rowPos[cell->rowIndex()]); 1601 LayoutPoint cellLocation(0, m_rowPos[cell->rowIndex()]);
1626 int horizontalBorderSpacing = table()->hBorderSpacing(); 1602 int horizontalBorderSpacing = table()->hBorderSpacing();
1627 1603
1628 // 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).
1629 if (!style()->isLeftToRightDirection()) 1605 if (!style()->isLeftToRightDirection())
1630 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);
1631 else 1607 else
1632 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing); 1608 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing);
1633 1609
1634 cell->setLogicalLocation(cellLocation); 1610 cell->setLogicalLocation(cellLocation);
1635 } 1611 }
1636 1612
1637 } // namespace blink 1613 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutTableSection.h ('k') | Source/core/paint/TableSectionPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698