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

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

Issue 2358663003: [css-tables] Set needsLayout on cells when table border width changes (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « third_party/WebKit/LayoutTests/paint/invalidation/table/cached-change-table-border-width-expected.txt ('k') | no next file » | 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 * 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 // explicit width is specified on the table. Auto width implies auto ta ble layout. 94 // explicit width is specified on the table. Auto width implies auto ta ble layout.
95 if (style()->isFixedTableLayout()) 95 if (style()->isFixedTableLayout())
96 m_tableLayout = wrapUnique(new TableLayoutAlgorithmFixed(this)); 96 m_tableLayout = wrapUnique(new TableLayoutAlgorithmFixed(this));
97 else 97 else
98 m_tableLayout = wrapUnique(new TableLayoutAlgorithmAuto(this)); 98 m_tableLayout = wrapUnique(new TableLayoutAlgorithmAuto(this));
99 } 99 }
100 100
101 // If border was changed, invalidate collapsed borders cache. 101 // If border was changed, invalidate collapsed borders cache.
102 if (!needsLayout() && oldStyle && oldStyle->border() != style()->border()) 102 if (!needsLayout() && oldStyle && oldStyle->border() != style()->border())
103 invalidateCollapsedBorders(); 103 invalidateCollapsedBorders();
104 if (LayoutTableBoxComponent::doCellsHaveDirtyWidth(*this, *this, diff, *oldS tyle)) {
mstensho (USE GERRIT) 2016/09/21 07:02:45 The code here is almost identical to what we alrea
dgrogan 2016/09/21 18:35:11 Good catch, refactored.
105 for (LayoutObject* child = children()->firstChild(); child; child = chil d->nextSibling()) {
106 if (!child->isTableSection())
107 continue;
108 LayoutTableSection* section = toLayoutTableSection(child);
109 section->markAllCellsWidthsDirtyAndOrNeedsLayout(LayoutTableSection: :MarkDirtyAndNeedsLayout);
110 }
111 }
104 } 112 }
105 113
106 static inline void resetSectionPointerIfNotBefore(LayoutTableSection*& ptr, Layo utObject* before) 114 static inline void resetSectionPointerIfNotBefore(LayoutTableSection*& ptr, Layo utObject* before)
107 { 115 {
108 if (!before || !ptr) 116 if (!before || !ptr)
109 return; 117 return;
110 LayoutObject* o = before->previousSibling(); 118 LayoutObject* o = before->previousSibling();
111 while (o && o != ptr) 119 while (o && o != ptr)
112 o = o->previousSibling(); 120 o = o->previousSibling();
113 if (!o) 121 if (!o)
(...skipping 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after
1476 1484
1477 LayoutUnit LayoutTable::paddingRight() const 1485 LayoutUnit LayoutTable::paddingRight() const
1478 { 1486 {
1479 if (collapseBorders()) 1487 if (collapseBorders())
1480 return LayoutUnit(); 1488 return LayoutUnit();
1481 1489
1482 return LayoutBlock::paddingRight(); 1490 return LayoutBlock::paddingRight();
1483 } 1491 }
1484 1492
1485 } // namespace blink 1493 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/paint/invalidation/table/cached-change-table-border-width-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698