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

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

Issue 2013693002: [css-tables] Set table and cell widths dirty when section border changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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, 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 if (section() && oldStyle && style()->logicalHeight() != oldStyle->logicalHe ight()) 71 if (section() && oldStyle && style()->logicalHeight() != oldStyle->logicalHe ight())
72 section()->rowLogicalHeightChanged(this); 72 section()->rowLogicalHeightChanged(this);
73 73
74 // If border was changed, notify table. 74 // If border was changed, notify table.
75 if (parent()) { 75 if (parent()) {
76 LayoutTable* table = this->table(); 76 LayoutTable* table = this->table();
77 if (table && !table->selfNeedsLayout() && !table->normalChildNeedsLayout () && oldStyle && oldStyle->border() != style()->border()) 77 if (table && !table->selfNeedsLayout() && !table->normalChildNeedsLayout () && oldStyle && oldStyle->border() != style()->border())
78 table->invalidateCollapsedBorders(); 78 table->invalidateCollapsedBorders();
79 79
80 // TODO(dgrogan): Do we need to setPreferredLogicalWidthsDirty even when !diff.needsFullLayout()?
mstensho (USE GERRIT) 2016/05/25 12:18:28 No? :) See my other comment.
80 if (table && oldStyle && diff.needsFullLayout() && needsLayout() && tabl e->collapseBorders() && borderWidthChanged(oldStyle, style())) { 81 if (table && oldStyle && diff.needsFullLayout() && needsLayout() && tabl e->collapseBorders() && borderWidthChanged(oldStyle, style())) {
81 // If the border width changes on a row, we need to make sure the ce lls in the row know to lay out again. 82 // If the border width changes on a row, we need to make sure the ce lls in the row know to lay out again.
82 // This only happens when borders are collapsed, since they end up a ffecting the border sides of the cell 83 // This only happens when borders are collapsed, since they end up a ffecting the border sides of the cell
83 // itself. 84 // itself.
84 table->setPreferredLogicalWidthsDirty(MarkOnlyThis); 85 table->setPreferredLogicalWidthsDirty(MarkOnlyThis);
85 for (LayoutBox* childBox = firstChildBox(); childBox; childBox = chi ldBox->nextSiblingBox()) { 86 for (LayoutBox* childBox = firstChildBox(); childBox; childBox = chi ldBox->nextSiblingBox()) {
86 if (!childBox->isTableCell()) 87 if (!childBox->isTableCell())
87 continue; 88 continue;
88 childBox->setChildNeedsLayout(); 89 childBox->setChildNeedsLayout();
89 childBox->setPreferredLogicalWidthsDirty(MarkOnlyThis); 90 childBox->setPreferredLogicalWidthsDirty(MarkOnlyThis);
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 // The cell and the row share the section's coordinate system. However 255 // The cell and the row share the section's coordinate system. However
255 // the visual overflow should be determined in the coordinate system of 256 // the visual overflow should be determined in the coordinate system of
256 // the row, that's why we shift it below. 257 // the row, that's why we shift it below.
257 LayoutUnit cellOffsetLogicalTopDifference = cell->location().y() - location( ).y(); 258 LayoutUnit cellOffsetLogicalTopDifference = cell->location().y() - location( ).y();
258 cellVisualOverflowRect.move(LayoutUnit(), cellOffsetLogicalTopDifference); 259 cellVisualOverflowRect.move(LayoutUnit(), cellOffsetLogicalTopDifference);
259 260
260 addContentsVisualOverflow(cellVisualOverflowRect); 261 addContentsVisualOverflow(cellVisualOverflowRect);
261 } 262 }
262 263
263 } // namespace blink 264 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698