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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutTableCellTest.cpp

Issue 1946413002: Avoid overflow recalc on tables if sections need rebuild (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated Created 4 years, 7 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTable.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutTableCellTest.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableCellTest.cpp b/third_party/WebKit/Source/core/layout/LayoutTableCellTest.cpp
index c323f9f0a4374ac1fe738dd08356a64f4626eb49..5183d90ba09489cc37807d2460783ed586b4fb02 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTableCellTest.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTableCellTest.cpp
@@ -120,6 +120,30 @@ TEST_F(LayoutTableCellTest, BackgroundIsKnownToBeOpaqueWithLayerAndCollapsedBord
EXPECT_FALSE(cell->backgroundIsKnownToBeOpaqueInRect(LayoutRect(0, 0, 1, 1)));
}
+TEST_F(LayoutTableCellTest, RepaintContentInTableCell)
+{
+ const char* bodyContent = "<table id='table' style='position: absolute; left: 1px;'>"
+ "<tr>"
+ "<td id='cell'>"
+ "<div style='display: inline-block; height: 20px; width: 20px'>"
+ "</td>"
+ "</tr>"
+ "</table>";
+ setBodyInnerHTML(bodyContent);
+
+ // Create an overflow recalc.
+ Element* cell = document().getElementById(AtomicString("cell"));
+ cell->setAttribute(HTMLNames::styleAttr, "outline: 1px solid black;");
+ // Trigger a layout on the table that doesn't require cell layout.
+ Element* table = document().getElementById(AtomicString("table"));
+ table->setAttribute(HTMLNames::styleAttr, "position: absolute; left: 2px;");
+ document().view()->updateAllLifecyclePhases();
+
+ // Check that overflow was calculated on the cell.
+ LayoutBlock* inputBlock = toLayoutBlock(getLayoutObjectByElementId("cell"));
+ LayoutRect rect = inputBlock->localOverflowRectForPaintInvalidation();
+ EXPECT_EQ(rect, LayoutRect(-1, -1, 24, 24));
+}
} // namespace
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTable.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698