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

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

Issue 2791433003: Fix Border collapsing with colpsan / rowspan cells
Patch Set: bug 2902 Created 3 years, 8 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 4c8960d476ab995648cc1d9bf9b4862848d0fd9d..e4a18ec07a1283349f9cb19178b21bbb3f214a0b 100644
--- a/third_party/WebKit/Source/core/paint/TablePainter.cpp
+++ b/third_party/WebKit/Source/core/paint/TablePainter.cpp
@@ -6,13 +6,14 @@
#include "core/layout/LayoutTable.h"
#include "core/layout/LayoutTableSection.h"
-#include "core/style/CollapsedBorderValue.h"
#include "core/paint/BoxClipper.h"
#include "core/paint/BoxPainter.h"
#include "core/paint/LayoutObjectDrawingRecorder.h"
#include "core/paint/ObjectPainter.h"
#include "core/paint/PaintInfo.h"
+#include "core/paint/TableCollapsedBorderPainter.h"
#include "core/paint/TableSectionPainter.h"
+#include "core/style/CollapsedBorderValue.h"
namespace blink {
@@ -47,20 +48,13 @@ void TablePainter::PaintObject(const PaintInfo& paint_info,
if (layout_table_.CollapseBorders() &&
ShouldPaintDescendantBlockBackgrounds(paint_phase) &&
layout_table_.Style()->Visibility() == EVisibility::kVisible) {
- // Using our cached sorted styles, we then do individual passes,
- // painting each style of border from lowest precedence to highest
- // precedence.
- LayoutTable::CollapsedBorderValues collapsed_borders =
- layout_table_.CollapsedBorders();
- size_t count = collapsed_borders.size();
- for (size_t i = 0; i < count; ++i) {
- for (LayoutTableSection* section = layout_table_.BottomSection();
- section; section = layout_table_.SectionAbove(section)) {
- LayoutPoint child_point =
- layout_table_.FlipForWritingModeForChild(section, paint_offset);
- TableSectionPainter(*section).PaintCollapsedBorders(
- paint_info_for_descendants, child_point, collapsed_borders[i]);
- }
+ TableCollapsedBorderPainter old_painter(layout_table_.BottomSection());
+ for (LayoutTableSection* section = layout_table_.BottomSection(); section;
+ section = layout_table_.SectionAbove(section, kSkipEmptySections)) {
+ LayoutPoint child_point =
+ layout_table_.FlipForWritingModeForChild(section, paint_offset);
+ TableSectionPainter(*section).PaintCollapsedBorders(
+ paint_info_for_descendants, child_point, old_painter);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698