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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutTableCol.cpp

Issue 2358663003: [css-tables] Set needsLayout on cells when table border width changes (Closed)
Patch Set: refactor some code into LayoutTable::markAllCellsWidthsDirty... Created 4 years, 3 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
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 // TODO(dgrogan): Is the "else" necessary for correctness or just a brittle optimization? The optimization would be: 59 // TODO(dgrogan): Is the "else" necessary for correctness or just a brittle optimization? The optimization would be:
60 // if the first branch is taken then the next one can't be, so don't even ch eck its condition. 60 // if the first branch is taken then the next one can't be, so don't even ch eck its condition.
61 if (!table->selfNeedsLayout() && !table->normalChildNeedsLayout() && oldStyl e->border() != style()->border()) { 61 if (!table->selfNeedsLayout() && !table->normalChildNeedsLayout() && oldStyl e->border() != style()->border()) {
62 table->invalidateCollapsedBorders(); 62 table->invalidateCollapsedBorders();
63 } else if ((oldStyle->logicalWidth() != style()->logicalWidth()) || LayoutTa bleBoxComponent::doCellsHaveDirtyWidth(*this, *table, diff, *oldStyle)) { 63 } else if ((oldStyle->logicalWidth() != style()->logicalWidth()) || LayoutTa bleBoxComponent::doCellsHaveDirtyWidth(*this, *table, diff, *oldStyle)) {
64 // TODO(dgrogan): Optimization opportunities: 64 // TODO(dgrogan): Optimization opportunities:
65 // (1) Only mark cells which are affected by this col, not every cell in the table. 65 // (1) Only mark cells which are affected by this col, not every cell in the table.
66 // (2) If only the col width changes and its border width doesn't, do th e cells need to be marked as 66 // (2) If only the col width changes and its border width doesn't, do th e cells need to be marked as
67 // needing layout or just given dirty widths? 67 // needing layout or just given dirty widths?
68 for (LayoutObject* child = table->children()->firstChild(); child; child = child->nextSibling()) { 68 table->markAllCellsWidthsDirtyAndOrNeedsLayout(LayoutTable::MarkDirtyAnd NeedsLayout);
69 if (!child->isTableSection())
70 continue;
71 LayoutTableSection* section = toLayoutTableSection(child);
72 section->markAllCellsWidthsDirtyAndOrNeedsLayout(LayoutTableSection: :MarkDirtyAndNeedsLayout);
73 }
74 } 69 }
75 } 70 }
76 71
77 void LayoutTableCol::updateFromElement() 72 void LayoutTableCol::updateFromElement()
78 { 73 {
79 unsigned oldSpan = m_span; 74 unsigned oldSpan = m_span;
80 Node* n = node(); 75 Node* n = node();
81 if (isHTMLTableColElement(n)) { 76 if (isHTMLTableColElement(n)) {
82 HTMLTableColElement& tc = toHTMLTableColElement(*n); 77 HTMLTableColElement& tc = toHTMLTableColElement(*n);
83 m_span = tc.span(); 78 m_span = tc.span();
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 return style()->borderStart(); 186 return style()->borderStart();
192 } 187 }
193 188
194 const BorderValue& LayoutTableCol::borderAdjoiningCellAfter(const LayoutTableCel l* cell) const 189 const BorderValue& LayoutTableCol::borderAdjoiningCellAfter(const LayoutTableCel l* cell) const
195 { 190 {
196 ASSERT_UNUSED(cell, table()->colElementAtAbsoluteColumn(cell->absoluteColumn Index() - 1).innermostColOrColGroup() == this); 191 ASSERT_UNUSED(cell, table()->colElementAtAbsoluteColumn(cell->absoluteColumn Index() - 1).innermostColOrColGroup() == this);
197 return style()->borderEnd(); 192 return style()->borderEnd();
198 } 193 }
199 194
200 } // namespace blink 195 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTable.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutTableSection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698