| 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 id='table'>" | 173 "<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"); | |
| 179 LayoutObject& cell = *getLayoutObjectByElementId("cell"); | 178 LayoutObject& cell = *getLayoutObjectByElementId("cell"); |
| 180 | 179 |
| 181 rootPaintController().invalidateAll(); | 180 rootPaintController().invalidateAll(); |
| 182 document().view()->updateAllLifecyclePhasesExceptPaint(); | 181 document().view()->updateAllLifecyclePhasesExceptPaint(); |
| 183 // Intersects the overflowing part of cell but not border box. | 182 // Intersects the overflowing part of cell but not border box. |
| 184 IntRect interestRect(0, 0, 100, 100); | 183 IntRect interestRect(0, 0, 100, 100); |
| 185 paint(&interestRect); | 184 paint(&interestRect); |
| 186 | 185 |
| 187 // We should paint all display items of cell. | 186 // We should paint all display items of cell. |
| 188 EXPECT_DISPLAY_LIST( | 187 EXPECT_DISPLAY_LIST( |
| 189 rootPaintController().getDisplayItemList(), 4, | 188 rootPaintController().getDisplayItemList(), 4, |
| 190 TestDisplayItem(layoutView, DisplayItem::kDocumentBackground), | 189 TestDisplayItem(layoutView, DisplayItem::kDocumentBackground), |
| 191 TestDisplayItem(cell, DisplayItem::kBoxDecorationBackground), | 190 TestDisplayItem(cell, DisplayItem::kBoxDecorationBackground), |
| 192 TestDisplayItem(table, DisplayItem::kTableCollapsedBorders), | 191 TestDisplayItem(cell, DisplayItem::kTableCollapsedBorderLast), |
| 193 TestDisplayItem(cell, DisplayItem::paintPhaseToDrawingType( | 192 TestDisplayItem(cell, DisplayItem::paintPhaseToDrawingType( |
| 194 PaintPhaseSelfOutlineOnly))); | 193 PaintPhaseSelfOutlineOnly))); |
| 195 } | 194 } |
| 196 | 195 |
| 197 } // namespace blink | 196 } // namespace blink |
| OLD | NEW |