Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/paint/CollapsedBorderPainter.h" | 5 #include "core/paint/CollapsedBorderPainter.h" |
| 6 | 6 |
| 7 #include "core/paint/BlockPainter.h" | 7 #include "core/paint/BlockPainter.h" |
| 8 #include "core/paint/ObjectPainter.h" | 8 #include "core/paint/ObjectPainter.h" |
| 9 #include "core/paint/PaintInfo.h" | 9 #include "core/paint/PaintInfo.h" |
| 10 | 10 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 79 cell_preceding->RowSpan() >= cell_.RowSpan()) { | 79 cell_preceding->RowSpan() >= cell_.RowSpan()) { |
| 80 start_.value = nullptr; | 80 start_.value = nullptr; |
| 81 // Otherwise we'll still paint the shared border twice which may cause | 81 // Otherwise we'll still paint the shared border twice which may cause |
| 82 // incorrect border conflict resolution for row/col spanning cells. | 82 // incorrect border conflict resolution for row/col spanning cells. |
| 83 // TODO(crbug.com/2902 etc.): Paint collapsed borders by grid cells. | 83 // TODO(crbug.com/2902 etc.): Paint collapsed borders by grid cells. |
| 84 } | 84 } |
| 85 } | 85 } |
| 86 | 86 |
| 87 // Skip painting the before border if it will be painted by the above cell | 87 // Skip painting the before border if it will be painted by the above cell |
| 88 // as its after border. If we break page before the row with non-zero strut | 88 // as its after border. If we break page before the row with non-zero strut |
| 89 // (which means a gap between this row and the row above), we need to paint | 89 // (which means a gap between this row and the row above), or if we are |
| 90 // the before border separately. | 90 // painting the top row of a footer that repeats on each page we need to paint |
| 91 // the before border separately. This will double-paint the top border of the | |
|
mstensho (USE GERRIT)
2017/07/17 10:38:08
That double-painting doesn't seem like a good thin
rhogan
2017/07/24 18:56:07
Will do. wangxianzhu would be ideal but he's off f
mstensho (USE GERRIT)
2017/07/25 08:59:32
OK. A TODO, then.
| |
| 92 // footer on the last page. | |
| 91 if (before_.value && !cell_.Row()->PaginationStrut()) { | 93 if (before_.value && !cell_.Row()->PaginationStrut()) { |
| 92 const auto* cell_above = table_.CellAbove(cell_); | 94 const auto* cell_above = table_.CellAbove(cell_); |
| 95 bool cell_is_top_of_repeating_footer = | |
|
mstensho (USE GERRIT)
2017/07/17 10:38:08
Sounds like a rare case, and a lot of other condit
rhogan
2017/07/24 18:56:07
Done.
| |
| 96 cell_.Section()->IsRepeatingFooterGroup() && | |
| 97 (!cell_above || cell_above->Section() != cell_.Section()); | |
| 93 if (cell_.StartsAtSameColumn(cell_above) && | 98 if (cell_.StartsAtSameColumn(cell_above) && |
| 94 cell_above->ColSpan() >= cell_.ColSpan() && | 99 cell_above->ColSpan() >= cell_.ColSpan() && |
| 95 cell_above->Row()->HasSameDirectionAs(&table_)) { | 100 cell_above->Row()->HasSameDirectionAs(&table_) && |
| 101 !cell_is_top_of_repeating_footer) { | |
| 96 before_.value = nullptr; | 102 before_.value = nullptr; |
| 97 // Otherwise we'll still paint the shared border twice which may cause | 103 // Otherwise we'll still paint the shared border twice which may cause |
| 98 // incorrect border conflict resolution for row/col spanning cells. | 104 // incorrect border conflict resolution for row/col spanning cells. |
| 99 // TODO(crbug.com/2902 etc.): Paint collapsed borders by grid cells. | 105 // TODO(crbug.com/2902 etc.): Paint collapsed borders by grid cells. |
| 100 } | 106 } |
| 101 } | 107 } |
| 102 } | 108 } |
| 103 | 109 |
| 104 static const CollapsedBorderValues* GetCollapsedBorderValues( | 110 static const CollapsedBorderValues* GetCollapsedBorderValues( |
| 105 const LayoutTableCell* cell) { | 111 const LayoutTableCell* cell) { |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 371 if (end_.value) { | 377 if (end_.value) { |
| 372 ObjectPainter::DrawLineForBoxSide( | 378 ObjectPainter::DrawLineForBoxSide( |
| 373 context, rect.MaxX() - end_.inner_width, rect.Y() - end_.begin_outset, | 379 context, rect.MaxX() - end_.inner_width, rect.Y() - end_.begin_outset, |
| 374 rect.MaxX() + end_.outer_width, rect.MaxY() + end_.end_outset, kBSRight, | 380 rect.MaxX() + end_.outer_width, rect.MaxY() + end_.end_outset, kBSRight, |
| 375 end_.value->GetColor(), CollapsedBorderStyle(end_.value->Style()), 0, 0, | 381 end_.value->GetColor(), CollapsedBorderStyle(end_.value->Style()), 0, 0, |
| 376 true); | 382 true); |
| 377 } | 383 } |
| 378 } | 384 } |
| 379 | 385 |
| 380 } // namespace blink | 386 } // namespace blink |
| OLD | NEW |