| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/PaintControllerPaintTest.h" | 5 #include "core/paint/PaintControllerPaintTest.h" |
| 6 #include "core/paint/PaintLayerPainter.h" | 6 #include "core/paint/PaintLayerPainter.h" |
| 7 | 7 |
| 8 namespace blink { | 8 namespace blink { |
| 9 | 9 |
| 10 using TableCellPainterTest = PaintControllerPaintTest; | 10 using TableCellPainterTest = PaintControllerPaintTest; |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 } | 163 } |
| 164 | 164 |
| 165 TEST_F(TableCellPainterTest, CollapsedBorderAndOverflow) { | 165 TEST_F(TableCellPainterTest, CollapsedBorderAndOverflow) { |
| 166 setBodyInnerHTML( | 166 setBodyInnerHTML( |
| 167 "<style>" | 167 "<style>" |
| 168 " body { margin: 0 }" | 168 " body { margin: 0 }" |
| 169 " td { width: 100px; height: 100px; border: 100px solid blue; outline: " | 169 " td { width: 100px; height: 100px; border: 100px solid blue; outline: " |
| 170 "100px solid yellow; background: green; }" | 170 "100px solid yellow; background: green; }" |
| 171 " table { margin: 100px; border-collapse: collapse; }" | 171 " table { margin: 100px; border-collapse: collapse; }" |
| 172 "</style>" | 172 "</style>" |
| 173 "<table>" | 173 "<table id='table'>" |
| 174 " <tr><td id='cell'></td></tr>" | 174 " <tr><td id='cell'></td></tr>" |
| 175 "</table>"); | 175 "</table>"); |
| 176 | 176 |
| 177 LayoutView& layoutView = *document().layoutView(); | 177 LayoutView& layoutView = *document().layoutView(); |
| 178 LayoutObject& table = *getLayoutObjectByElementId("table"); |
| 178 LayoutObject& cell = *getLayoutObjectByElementId("cell"); | 179 LayoutObject& cell = *getLayoutObjectByElementId("cell"); |
| 179 | 180 |
| 180 rootPaintController().invalidateAll(); | 181 rootPaintController().invalidateAll(); |
| 181 document().view()->updateAllLifecyclePhasesExceptPaint(); | 182 document().view()->updateAllLifecyclePhasesExceptPaint(); |
| 182 // Intersects the overflowing part of cell but not border box. | 183 // Intersects the overflowing part of cell but not border box. |
| 183 IntRect interestRect(0, 0, 100, 100); | 184 IntRect interestRect(0, 0, 100, 100); |
| 184 paint(&interestRect); | 185 paint(&interestRect); |
| 185 | 186 |
| 186 // We should paint all display items of cell. | 187 // We should paint all display items of cell. |
| 187 EXPECT_DISPLAY_LIST( | 188 EXPECT_DISPLAY_LIST( |
| 188 rootPaintController().getDisplayItemList(), 4, | 189 rootPaintController().getDisplayItemList(), 4, |
| 189 TestDisplayItem(layoutView, DisplayItem::kDocumentBackground), | 190 TestDisplayItem(layoutView, DisplayItem::kDocumentBackground), |
| 190 TestDisplayItem(cell, DisplayItem::kBoxDecorationBackground), | 191 TestDisplayItem(cell, DisplayItem::kBoxDecorationBackground), |
| 191 TestDisplayItem(cell, DisplayItem::kTableCollapsedBorderLast), | 192 TestDisplayItem(table, DisplayItem::kTableCollapsedBorders), |
| 192 TestDisplayItem(cell, DisplayItem::paintPhaseToDrawingType( | 193 TestDisplayItem(cell, DisplayItem::paintPhaseToDrawingType( |
| 193 PaintPhaseSelfOutlineOnly))); | 194 PaintPhaseSelfOutlineOnly))); |
| 194 } | 195 } |
| 195 | 196 |
| 196 } // namespace blink | 197 } // namespace blink |
| OLD | NEW |