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

Unified 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: 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutTable.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTable.cpp b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
index 3c82b36e11aeea371d7277de86e9acffc1d438bf..8013404db7793809ee60d9a121a65153f701ec67 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTable.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
@@ -101,6 +101,8 @@ void LayoutTable::styleDidChange(StyleDifference diff, const ComputedStyle* oldS
// If border was changed, invalidate collapsed borders cache.
if (!needsLayout() && oldStyle && oldStyle->border() != style()->border())
invalidateCollapsedBorders();
+ if (LayoutTableBoxComponent::doCellsHaveDirtyWidth(*this, *this, diff, *oldStyle))
+ markAllCellsWidthsDirtyAndOrNeedsLayout(MarkDirtyAndNeedsLayout);
}
static inline void resetSectionPointerIfNotBefore(LayoutTableSection*& ptr, LayoutObject* before)
@@ -702,6 +704,16 @@ void LayoutTable::subtractCaptionRect(LayoutRect& rect) const
}
}
+void LayoutTable::markAllCellsWidthsDirtyAndOrNeedsLayout(WhatToMarkAllCells whatToMark)
+{
+ for (LayoutObject* child = children()->firstChild(); child; child = child->nextSibling()) {
+ if (!child->isTableSection())
+ continue;
+ LayoutTableSection* section = toLayoutTableSection(child);
+ section->markAllCellsWidthsDirtyAndOrNeedsLayout(whatToMark);
+ }
+}
+
void LayoutTable::paintBoxDecorationBackground(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) const
{
TablePainter(*this).paintBoxDecorationBackground(paintInfo, paintOffset);
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTable.h ('k') | third_party/WebKit/Source/core/layout/LayoutTableCol.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698