Commit 82142c1f authored by Philip Rogers's avatar Philip Rogers Committed by Commit Bot

Add tests for legacy tables with touch-action

This patch adds a test that legacy tables paint touch-action hit test
regions.

Change-Id: I08105e6a874fe63fc0c4033dcf0a2f7ccd52cd17
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2464743
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: default avatarXianzhu Wang <wangxianzhu@chromium.org>
Auto-Submit: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#815962}
parent d4756d6f
......@@ -241,4 +241,42 @@ TEST_P(TablePainterTest, DontPaintEmptyDecorationBackground) {
IsSameId(table_2_descendant, DisplayItem::kTableCollapsedBorders)));
}
TEST_P(TablePainterTest, TouchActionOnTable) {
SetBodyInnerHTML(R"HTML(
<style>
body { margin: 0; }
table {
width: 100px;
height: 100px;
touch-action: none;
}
</style>
<table></table>
)HTML");
const auto& paint_chunk = RootPaintController().PaintChunks().back();
EXPECT_EQ(paint_chunk.hit_test_data->touch_action_rects[0].rect,
IntRect(0, 0, 100, 100));
}
TEST_P(TablePainterTest, TouchActionOnTableCell) {
SetBodyInnerHTML(R"HTML(
<style>
body { margin: 0; }
table {
border-collapse: collapse;
}
td {
width: 100px;
height: 100px;
touch-action: none;
padding: 0;
}
</style>
<table><tr><td></td></tr></table>
)HTML");
const auto& paint_chunk = RootPaintController().PaintChunks().back();
EXPECT_EQ(paint_chunk.hit_test_data->touch_action_rects[0].rect,
IntRect(0, 0, 100, 100));
}
} // namespace blink
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment