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

Side by Side Diff: Source/core/layout/LayoutTableCol.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/LayoutTableCol.h ('k') | Source/core/layout/LayoutTableRow.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, 2009 Apple Inc. All rights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
8 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 8 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
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 18 matching lines...) Expand all
29 #include "core/HTMLNames.h" 29 #include "core/HTMLNames.h"
30 #include "core/html/HTMLTableColElement.h" 30 #include "core/html/HTMLTableColElement.h"
31 #include "core/layout/LayoutTable.h" 31 #include "core/layout/LayoutTable.h"
32 #include "core/layout/LayoutTableCell.h" 32 #include "core/layout/LayoutTableCell.h"
33 33
34 namespace blink { 34 namespace blink {
35 35
36 using namespace HTMLNames; 36 using namespace HTMLNames;
37 37
38 LayoutTableCol::LayoutTableCol(Element* element) 38 LayoutTableCol::LayoutTableCol(Element* element)
39 : RenderBox(element) 39 : LayoutBox(element)
40 , m_span(1) 40 , m_span(1)
41 { 41 {
42 // init LayoutObject attributes 42 // init LayoutObject attributes
43 setInline(true); // our object is not Inline 43 setInline(true); // our object is not Inline
44 updateFromElement(); 44 updateFromElement();
45 } 45 }
46 46
47 void LayoutTableCol::styleDidChange(StyleDifference diff, const LayoutStyle* old Style) 47 void LayoutTableCol::styleDidChange(StyleDifference diff, const LayoutStyle* old Style)
48 { 48 {
49 RenderBox::styleDidChange(diff, oldStyle); 49 LayoutBox::styleDidChange(diff, oldStyle);
50 50
51 // If border was changed, notify table. 51 // If border was changed, notify table.
52 if (parent()) { 52 if (parent()) {
53 LayoutTable* table = this->table(); 53 LayoutTable* table = this->table();
54 if (table && !table->selfNeedsLayout() && !table->normalChildNeedsLayout () && oldStyle && oldStyle->border() != style()->border()) { 54 if (table && !table->selfNeedsLayout() && !table->normalChildNeedsLayout () && oldStyle && oldStyle->border() != style()->border()) {
55 table->invalidateCollapsedBorders(); 55 table->invalidateCollapsedBorders();
56 } else if (oldStyle && oldStyle->logicalWidth() != style()->logicalWidth ()) { 56 } else if (oldStyle && oldStyle->logicalWidth() != style()->logicalWidth ()) {
57 // FIXME : setPreferredLogicalWidthsDirty is done for all cells as o f now. 57 // FIXME : setPreferredLogicalWidthsDirty is done for all cells as o f now.
58 // Need to find a better way so that only the cells which are change d by 58 // Need to find a better way so that only the cells which are change d by
59 // the col width should have preferred logical widths recomputed. 59 // the col width should have preferred logical widths recomputed.
(...skipping 19 matching lines...) Expand all
79 m_span = tc.span(); 79 m_span = tc.span();
80 } else { 80 } else {
81 m_span = !(style() && style()->display() == TABLE_COLUMN_GROUP); 81 m_span = !(style() && style()->display() == TABLE_COLUMN_GROUP);
82 } 82 }
83 if (m_span != oldSpan && style() && parent()) 83 if (m_span != oldSpan && style() && parent())
84 setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(); 84 setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation();
85 } 85 }
86 86
87 void LayoutTableCol::insertedIntoTree() 87 void LayoutTableCol::insertedIntoTree()
88 { 88 {
89 RenderBox::insertedIntoTree(); 89 LayoutBox::insertedIntoTree();
90 table()->addColumn(this); 90 table()->addColumn(this);
91 } 91 }
92 92
93 void LayoutTableCol::willBeRemovedFromTree() 93 void LayoutTableCol::willBeRemovedFromTree()
94 { 94 {
95 RenderBox::willBeRemovedFromTree(); 95 LayoutBox::willBeRemovedFromTree();
96 table()->removeColumn(this); 96 table()->removeColumn(this);
97 } 97 }
98 98
99 bool LayoutTableCol::isChildAllowed(LayoutObject* child, const LayoutStyle& styl e) const 99 bool LayoutTableCol::isChildAllowed(LayoutObject* child, const LayoutStyle& styl e) const
100 { 100 {
101 // We cannot use isTableColumn here as style() may return 0. 101 // We cannot use isTableColumn here as style() may return 0.
102 return child->isLayoutTableCol() && style.display() == TABLE_COLUMN; 102 return child->isLayoutTableCol() && style.display() == TABLE_COLUMN;
103 } 103 }
104 104
105 bool LayoutTableCol::canHaveChildren() const 105 bool LayoutTableCol::canHaveChildren() const
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 return style()->borderStart(); 189 return style()->borderStart();
190 } 190 }
191 191
192 const BorderValue& LayoutTableCol::borderAdjoiningCellAfter(const LayoutTableCel l* cell) const 192 const BorderValue& LayoutTableCol::borderAdjoiningCellAfter(const LayoutTableCel l* cell) const
193 { 193 {
194 ASSERT_UNUSED(cell, table()->colElement(cell->col() - 1) == this); 194 ASSERT_UNUSED(cell, table()->colElement(cell->col() - 1) == this);
195 return style()->borderEnd(); 195 return style()->borderEnd();
196 } 196 }
197 197
198 } 198 }
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutTableCol.h ('k') | Source/core/layout/LayoutTableRow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698