| Index: third_party/WebKit/Source/core/editing/CaretDisplayItemClientTest.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/CaretDisplayItemClientTest.cpp b/third_party/WebKit/Source/core/editing/CaretDisplayItemClientTest.cpp
|
| index 4c2344e9b3971bc9f0198a21c51591ff3a89e34c..2887d04581855b2ae531047a50b8939c0b20d322 100644
|
| --- a/third_party/WebKit/Source/core/editing/CaretDisplayItemClientTest.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/CaretDisplayItemClientTest.cpp
|
| @@ -341,4 +341,39 @@ TEST_F(CaretDisplayItemClientTest, CaretHideMoveAndShow) {
|
| document().view()->setTracksPaintInvalidations(false);
|
| }
|
|
|
| +TEST_F(CaretDisplayItemClientTest, CompositingChange) {
|
| + enableCompositing();
|
| + setBodyInnerHTML(
|
| + "<style>"
|
| + " body { margin: 0 }"
|
| + " #container { position: absolute; top: 55px; left: 66px; }"
|
| + "</style>"
|
| + "<div id='container'>"
|
| + " <div id='editor' contenteditable style='padding: 50px'>ABCDE</div>"
|
| + "</div>");
|
| +
|
| + document().page()->focusController().setActive(true);
|
| + document().page()->focusController().setFocused(true);
|
| + auto* container = document().getElementById("container");
|
| + auto* editor = document().getElementById("editor");
|
| + auto* editorBlock = toLayoutBlock(editor->layoutObject());
|
| + selection().setSelection(
|
| + SelectionInDOMTree::Builder().collapse(Position(editor, 0)).build());
|
| + updateAllLifecyclePhases();
|
| +
|
| + EXPECT_TRUE(editorBlock->shouldPaintCursorCaret());
|
| + EXPECT_EQ(editorBlock, caretLayoutBlock());
|
| + EXPECT_EQ(LayoutRect(116, 105, 1, 1), caretDisplayItemClient().visualRect());
|
| +
|
| + // Composite container.
|
| + container->setAttribute(HTMLNames::styleAttr, "will-change: transform");
|
| + updateAllLifecyclePhases();
|
| + EXPECT_EQ(LayoutRect(50, 50, 1, 1), caretDisplayItemClient().visualRect());
|
| +
|
| + // Uncomposite container.
|
| + container->setAttribute(HTMLNames::styleAttr, "");
|
| + updateAllLifecyclePhases();
|
| + EXPECT_EQ(LayoutRect(116, 105, 1, 1), caretDisplayItemClient().visualRect());
|
| +}
|
| +
|
| } // namespace blink
|
|
|