| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 TEST_F(LayoutTableCellTest, BackgroundIsKnownToBeOpaqueWithLayerAndCollapsedBord
er) | 113 TEST_F(LayoutTableCellTest, BackgroundIsKnownToBeOpaqueWithLayerAndCollapsedBord
er) |
| 114 { | 114 { |
| 115 setBodyInnerHTML("<table style='border-collapse: collapse'>" | 115 setBodyInnerHTML("<table style='border-collapse: collapse'>" |
| 116 "<td style='will-change: transform; background-color: blue'>Cell></td>" | 116 "<td style='will-change: transform; background-color: blue'>Cell></td>" |
| 117 "</table>"); | 117 "</table>"); |
| 118 | 118 |
| 119 LayoutTableCell* cell = toLayoutTableCell(document().body()->firstChild()->f
irstChild()->firstChild()->firstChild()->layoutObject()); | 119 LayoutTableCell* cell = toLayoutTableCell(document().body()->firstChild()->f
irstChild()->firstChild()->firstChild()->layoutObject()); |
| 120 EXPECT_FALSE(cell->backgroundIsKnownToBeOpaqueInRect(LayoutRect(0, 0, 1, 1))
); | 120 EXPECT_FALSE(cell->backgroundIsKnownToBeOpaqueInRect(LayoutRect(0, 0, 1, 1))
); |
| 121 } | 121 } |
| 122 | 122 |
| 123 TEST_F(LayoutTableCellTest, RepaintContentInTableCell) |
| 124 { |
| 125 const char* bodyContent = "<table id='table' style='position: absolute; left
: 1px;'>" |
| 126 "<tr>" |
| 127 "<td id='cell'>" |
| 128 "<div style='display: inline-block; height: 20px; width: 20px'>" |
| 129 "</td>" |
| 130 "</tr>" |
| 131 "</table>"; |
| 132 setBodyInnerHTML(bodyContent); |
| 133 |
| 134 // Create an overflow recalc. |
| 135 Element* cell = document().getElementById(AtomicString("cell")); |
| 136 cell->setAttribute(HTMLNames::styleAttr, "outline: 1px solid black;"); |
| 137 // Trigger a layout on the table that doesn't require cell layout. |
| 138 Element* table = document().getElementById(AtomicString("table")); |
| 139 table->setAttribute(HTMLNames::styleAttr, "position: absolute; left: 2px;"); |
| 140 document().view()->updateAllLifecyclePhases(); |
| 141 |
| 142 // Check that overflow was calculated on the cell. |
| 143 LayoutBlock* inputBlock = toLayoutBlock(getLayoutObjectByElementId("cell")); |
| 144 LayoutRect rect = inputBlock->localOverflowRectForPaintInvalidation(); |
| 145 EXPECT_EQ(rect, LayoutRect(-1, -1, 24, 24)); |
| 146 } |
| 123 } // namespace | 147 } // namespace |
| 124 | 148 |
| 125 } // namespace blink | 149 } // namespace blink |
| OLD | NEW |