Commit 1e069b0a authored by Dominic Mazzoni's avatar Dominic Mazzoni Committed by Commit Bot

Toggling caret browsing should invalidate style.

When caret browsing is enabled it should cause the cursor to start
blinking if it wasn't already. To do this, it's sufficient to just
invalidate style. This results in calling
FrameCaret::UpdateStyleAndLayoutIfNeeded() which starts the caret
timer if needed.

Bug: 1116658
Change-Id: I55a249878a1646a358a584e6ffccd501bfdd8189
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2357963
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Auto-Submit: Dominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#798961}
parent 2c7740b9
...@@ -104,6 +104,7 @@ TEST_F(FrameCaretTest, ShouldBlinkCaretWhileCaretBrowsing) { ...@@ -104,6 +104,7 @@ TEST_F(FrameCaretTest, ShouldBlinkCaretWhileCaretBrowsing) {
Selection().SetCaretVisible(true); Selection().SetCaretVisible(true);
EXPECT_FALSE(ShouldBlinkCaret(caret)); EXPECT_FALSE(ShouldBlinkCaret(caret));
GetDocument().GetFrame()->GetSettings()->SetCaretBrowsingEnabled(true); GetDocument().GetFrame()->GetSettings()->SetCaretBrowsingEnabled(true);
UpdateAllLifecyclePhasesForTest();
EXPECT_TRUE(ShouldBlinkCaret(caret)); EXPECT_TRUE(ShouldBlinkCaret(caret));
} }
......
...@@ -454,6 +454,7 @@ ...@@ -454,6 +454,7 @@
{ {
name: "caretBrowsingEnabled", name: "caretBrowsingEnabled",
initial: false, initial: false,
invalidate: "Style",
}, },
// Font scale factor for accessibility, applied as part of text autosizing. // Font scale factor for accessibility, applied as part of text autosizing.
......
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