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

Unified Diff: third_party/WebKit/Source/core/paint/TablePainter.cpp

Issue 1781463002: Fix table background painting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sample code for improved collapsed border painting Created 3 years, 11 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/paint/TablePainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/TablePainter.cpp b/third_party/WebKit/Source/core/paint/TablePainter.cpp
index 0e1ea132e9dc1facd49a7aaa19d08bcd1fdf3c12..8708ba5358ac3826ec684abbffd9a79d1a319efe 100644
--- a/third_party/WebKit/Source/core/paint/TablePainter.cpp
+++ b/third_party/WebKit/Source/core/paint/TablePainter.cpp
@@ -13,6 +13,7 @@
#include "core/paint/ObjectPainter.h"
#include "core/paint/PaintInfo.h"
#include "core/paint/ScopeRecorder.h"
+#include "core/paint/TableCollapsedBorderPainter.h"
#include "core/paint/TableSectionPainter.h"
namespace blink {
@@ -43,14 +44,24 @@ void TablePainter::paintObject(const PaintInfo& paintInfo, const LayoutPoint& pa
}
if (m_layoutTable.collapseBorders() && shouldPaintDescendantBlockBackgrounds(paintPhase) && m_layoutTable.style()->visibility() == VISIBLE) {
+ if (RuntimeEnabledFeatures::newTableCollapsedBordersEnabled()) {
+ // New collapsed border painter
+ TableCollapsedBorderPainter oldPainter(m_layoutTable.bottomSection());
+ for (LayoutTableSection* section = m_layoutTable.bottomSection(); section; section = m_layoutTable.sectionAbove(section, SkipEmptySections)) {
+ LayoutPoint childPoint = m_layoutTable.flipForWritingModeForChild(section, paintOffset);
+ TableSectionPainter(*section).paintCollapsedBorders2(paintInfoForDescendants, childPoint, oldPainter);
+ }
+
+ } else {
// Using our cached sorted styles, we then do individual passes,
// painting each style of border from lowest precedence to highest precedence.
- LayoutTable::CollapsedBorderValues collapsedBorders = m_layoutTable.collapsedBorders();
- size_t count = collapsedBorders.size();
- for (size_t i = 0; i < count; ++i) {
- for (LayoutTableSection* section = m_layoutTable.bottomSection(); section; section = m_layoutTable.sectionAbove(section)) {
- LayoutPoint childPoint = m_layoutTable.flipForWritingModeForChild(section, paintOffset);
- TableSectionPainter(*section).paintCollapsedBorders(paintInfoForDescendants, childPoint, collapsedBorders[i]);
+ LayoutTable::CollapsedBorderValues collapsedBorders = m_layoutTable.collapsedBorders();
+ size_t count = collapsedBorders.size();
+ for (size_t i = 0; i < count; ++i) {
+ for (LayoutTableSection* section = m_layoutTable.bottomSection(); section; section = m_layoutTable.sectionAbove(section)) {
+ LayoutPoint childPoint = m_layoutTable.flipForWritingModeForChild(section, paintOffset);
+ TableSectionPainter(*section).paintCollapsedBorders(paintInfoForDescendants, childPoint, collapsedBorders[i]);
+ }
}
}
}

Powered by Google App Engine
This is Rietveld 408576698