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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutTableCell.cpp

Issue 2160363003: [css-tables] Mark sibling cells dirty when cell border width changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/table/change-cell-border-width-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutTableCell.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp b/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp
index 1aba9144cdca77bb57d4fc4460bf34f920a5cf4c..3469d4abc189a54d4964cd1e3a3e42f8a862488f 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTableCell.cpp
@@ -387,10 +387,25 @@ void LayoutTableCell::styleDidChange(StyleDifference diff, const ComputedStyle*
clearIntrinsicPadding();
// If border was changed, notify table.
- if (parent()) {
- LayoutTable* table = this->table();
- if (table && !table->selfNeedsLayout() && !table->normalChildNeedsLayout()&& oldStyle && oldStyle->border() != style()->border())
- table->invalidateCollapsedBorders();
+ if (!parent())
+ return;
+ LayoutTable* table = this->table();
+ if (!table)
+ return;
+ if (!table->selfNeedsLayout() && !table->normalChildNeedsLayout()&& oldStyle && oldStyle->border() != style()->border())
+ table->invalidateCollapsedBorders();
+
+ if (LayoutTableBoxComponent::doCellsHaveDirtyWidth(*this, *table, diff, *oldStyle)) {
+ if (previousCell()) {
+ // TODO(dgrogan) Add a layout test showing that setChildNeedsLayout is needed instead of setNeedsLayout.
+ previousCell()->setChildNeedsLayout();
+ previousCell()->setPreferredLogicalWidthsDirty(MarkOnlyThis);
+ }
+ if (nextCell()) {
+ // TODO(dgrogan) Add a layout test showing that setChildNeedsLayout is needed instead of setNeedsLayout.
+ nextCell()->setChildNeedsLayout();
+ nextCell()->setPreferredLogicalWidthsDirty(MarkOnlyThis);
+ }
}
}
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/table/change-cell-border-width-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698