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

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

Issue 899163003: Move rendering/RenderObject to layout/LayoutObject. (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/LayoutTableRow.h ('k') | Source/core/layout/LayoutTableSection.h » ('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, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 25 matching lines...) Expand all
36 #include "core/rendering/style/StyleInheritedData.h" 36 #include "core/rendering/style/StyleInheritedData.h"
37 37
38 namespace blink { 38 namespace blink {
39 39
40 using namespace HTMLNames; 40 using namespace HTMLNames;
41 41
42 LayoutTableRow::LayoutTableRow(Element* element) 42 LayoutTableRow::LayoutTableRow(Element* element)
43 : RenderBox(element) 43 : RenderBox(element)
44 , m_rowIndex(unsetRowIndex) 44 , m_rowIndex(unsetRowIndex)
45 { 45 {
46 // init RenderObject attributes 46 // init LayoutObject attributes
47 setInline(false); // our object is not Inline 47 setInline(false); // our object is not Inline
48 } 48 }
49 49
50 void LayoutTableRow::willBeRemovedFromTree() 50 void LayoutTableRow::willBeRemovedFromTree()
51 { 51 {
52 RenderBox::willBeRemovedFromTree(); 52 RenderBox::willBeRemovedFromTree();
53 53
54 section()->setNeedsCellRecalc(); 54 section()->setNeedsCellRecalc();
55 } 55 }
56 56
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 return style()->borderStart(); 98 return style()->borderStart();
99 } 99 }
100 100
101 const BorderValue& LayoutTableRow::borderAdjoiningEndCell(const LayoutTableCell* cell) const 101 const BorderValue& LayoutTableRow::borderAdjoiningEndCell(const LayoutTableCell* cell) const
102 { 102 {
103 ASSERT_UNUSED(cell, cell->isFirstOrLastCellInRow()); 103 ASSERT_UNUSED(cell, cell->isFirstOrLastCellInRow());
104 // FIXME: https://webkit.org/b/79272 - Add support for mixed directionality at the cell level. 104 // FIXME: https://webkit.org/b/79272 - Add support for mixed directionality at the cell level.
105 return style()->borderEnd(); 105 return style()->borderEnd();
106 } 106 }
107 107
108 void LayoutTableRow::addChild(RenderObject* child, RenderObject* beforeChild) 108 void LayoutTableRow::addChild(LayoutObject* child, LayoutObject* beforeChild)
109 { 109 {
110 if (!child->isTableCell()) { 110 if (!child->isTableCell()) {
111 RenderObject* last = beforeChild; 111 LayoutObject* last = beforeChild;
112 if (!last) 112 if (!last)
113 last = lastCell(); 113 last = lastCell();
114 if (last && last->isAnonymous() && last->isTableCell() && !last->isBefor eOrAfterContent()) { 114 if (last && last->isAnonymous() && last->isTableCell() && !last->isBefor eOrAfterContent()) {
115 LayoutTableCell* lastCell = toLayoutTableCell(last); 115 LayoutTableCell* lastCell = toLayoutTableCell(last);
116 if (beforeChild == lastCell) 116 if (beforeChild == lastCell)
117 beforeChild = lastCell->firstChild(); 117 beforeChild = lastCell->firstChild();
118 lastCell->addChild(child, beforeChild); 118 lastCell->addChild(child, beforeChild);
119 return; 119 return;
120 } 120 }
121 121
122 if (beforeChild && !beforeChild->isAnonymous() && beforeChild->parent() == this) { 122 if (beforeChild && !beforeChild->isAnonymous() && beforeChild->parent() == this) {
123 RenderObject* cell = beforeChild->previousSibling(); 123 LayoutObject* cell = beforeChild->previousSibling();
124 if (cell && cell->isTableCell() && cell->isAnonymous()) { 124 if (cell && cell->isTableCell() && cell->isAnonymous()) {
125 cell->addChild(child); 125 cell->addChild(child);
126 return; 126 return;
127 } 127 }
128 } 128 }
129 129
130 // If beforeChild is inside an anonymous cell, insert into the cell. 130 // If beforeChild is inside an anonymous cell, insert into the cell.
131 if (last && !last->isTableCell() && last->parent() && last->parent()->is Anonymous() && !last->parent()->isBeforeOrAfterContent()) { 131 if (last && !last->isTableCell() && last->parent() && last->parent()->is Anonymous() && !last->parent()->isBeforeOrAfterContent()) {
132 last->parent()->addChild(child, beforeChild); 132 last->parent()->addChild(child, beforeChild);
133 return; 133 return;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 setShouldDoFullPaintInvalidation(); 224 setShouldDoFullPaintInvalidation();
225 } 225 }
226 226
227 LayoutTableRow* LayoutTableRow::createAnonymous(Document* document) 227 LayoutTableRow* LayoutTableRow::createAnonymous(Document* document)
228 { 228 {
229 LayoutTableRow* renderer = new LayoutTableRow(0); 229 LayoutTableRow* renderer = new LayoutTableRow(0);
230 renderer->setDocumentForAnonymous(document); 230 renderer->setDocumentForAnonymous(document);
231 return renderer; 231 return renderer;
232 } 232 }
233 233
234 LayoutTableRow* LayoutTableRow::createAnonymousWithParentRenderer(const RenderOb ject* parent) 234 LayoutTableRow* LayoutTableRow::createAnonymousWithParentRenderer(const LayoutOb ject* parent)
235 { 235 {
236 LayoutTableRow* newRow = LayoutTableRow::createAnonymous(&parent->document() ); 236 LayoutTableRow* newRow = LayoutTableRow::createAnonymous(&parent->document() );
237 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay( parent->style(), TABLE_ROW); 237 RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay( parent->style(), TABLE_ROW);
238 newRow->setStyle(newStyle.release()); 238 newRow->setStyle(newStyle.release());
239 return newRow; 239 return newRow;
240 } 240 }
241 241
242 void LayoutTableRow::addOverflowFromCell(const LayoutTableCell* cell) 242 void LayoutTableRow::addOverflowFromCell(const LayoutTableCell* cell)
243 { 243 {
244 // Non-row-spanning-cells don't create overflow (they are fully contained wi thin this row). 244 // Non-row-spanning-cells don't create overflow (they are fully contained wi thin this row).
245 if (cell->rowSpan() == 1) 245 if (cell->rowSpan() == 1)
246 return; 246 return;
247 247
248 // Cells only generates visual overflow. 248 // Cells only generates visual overflow.
249 LayoutRect cellVisualOverflowRect = cell->visualOverflowRectForPropagation(s tyle()); 249 LayoutRect cellVisualOverflowRect = cell->visualOverflowRectForPropagation(s tyle());
250 250
251 // The cell and the row share the section's coordinate system. However 251 // The cell and the row share the section's coordinate system. However
252 // the visual overflow should be determined in the coordinate system of 252 // the visual overflow should be determined in the coordinate system of
253 // the row, that's why we shift it below. 253 // the row, that's why we shift it below.
254 LayoutUnit cellOffsetLogicalTopDifference = cell->location().y() - location( ).y(); 254 LayoutUnit cellOffsetLogicalTopDifference = cell->location().y() - location( ).y();
255 cellVisualOverflowRect.move(0, cellOffsetLogicalTopDifference); 255 cellVisualOverflowRect.move(0, cellOffsetLogicalTopDifference);
256 256
257 addVisualOverflow(cellVisualOverflowRect); 257 addVisualOverflow(cellVisualOverflowRect);
258 } 258 }
259 259
260 } // namespace blink 260 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutTableRow.h ('k') | Source/core/layout/LayoutTableSection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698