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

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

Issue 2153283002: [css-tables] Clean up code that detects significant border changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove /*static*/ 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
Index: third_party/WebKit/Source/core/layout/LayoutTableBoxComponent.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableBoxComponent.cpp b/third_party/WebKit/Source/core/layout/LayoutTableBoxComponent.cpp
index b0ca3aaea220adc1d37963604f08dfeed2533c95..8c815b1a8ebdd6516ec19d907e4d3d93e017751b 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableBoxComponent.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTableBoxComponent.cpp
@@ -4,6 +4,7 @@
#include "core/layout/LayoutTableBoxComponent.h"
+#include "core/layout/LayoutTable.h"
#include "core/style/ComputedStyle.h"
namespace blink {
@@ -25,4 +26,13 @@ void LayoutTableBoxComponent::imageChanged(WrappedImagePtr, const IntRect*)
m_backgroundChangedSinceLastPaintInvalidation = true;
}
+bool LayoutTableBoxComponent::doCellsHaveDirtyWidth(const LayoutObject& tablePart, const LayoutTable& table, const StyleDifference& diff, const ComputedStyle& oldStyle)
+{
+ // ComputedStyle::diffNeedsFullLayoutAndPaintInvalidation sets needsFullLayout when border sizes
+ // change: checking diff.needsFullLayout() is an optimization, not required for correctness.
+ // TODO(dgrogan): Remove tablePart.needsLayout()? Perhaps it was an old optimization but now it
+ // seems that diff.needsFullLayout() implies tablePart.needsLayout().
+ return diff.needsFullLayout() && tablePart.needsLayout() && table.collapseBorders() && !oldStyle.border().sizeEquals(tablePart.style()->border());
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698