Commit e96bb06c authored by Siye Liu's avatar Siye Liu Committed by Commit Bot

Use solid underline for interim selection during composition.

We introduced interim composition character highlight for Windows in
crrev.com/780377. However, we need to revert to previous UI (solid
underline) due to strong user request.

Bug: 1124602
Change-Id: Ia4ac41f9719fabb4fcdf6171f94d242472009689
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2394195Reviewed-by: default avatarYoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Siye Liu <siliu@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#804834}
parent 45239adf
...@@ -51,7 +51,6 @@ ...@@ -51,7 +51,6 @@
#include "third_party/blink/renderer/core/events/composition_event.h" #include "third_party/blink/renderer/core/events/composition_event.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/visual_viewport.h"
#include "third_party/blink/renderer/core/geometry/dom_rect.h" #include "third_party/blink/renderer/core/geometry/dom_rect.h"
#include "third_party/blink/renderer/core/html/forms/html_input_element.h" #include "third_party/blink/renderer/core/html/forms/html_input_element.h"
#include "third_party/blink/renderer/core/html/forms/html_text_area_element.h" #include "third_party/blink/renderer/core/html/forms/html_text_area_element.h"
...@@ -724,18 +723,14 @@ void InputMethodController::AddImeTextSpans( ...@@ -724,18 +723,14 @@ void InputMethodController::AddImeTextSpans(
switch (ime_text_span.GetType()) { switch (ime_text_span.GetType()) {
case ImeTextSpan::Type::kComposition: { case ImeTextSpan::Type::kComposition: {
Color background_color = ImeTextSpanUnderlineStyle underline_style =
GetDocument().GetPage() && ime_text_span.InterimCharSelection() ime_text_span.InterimCharSelection()
? LayoutTheme::GetTheme().ActiveSelectionBackgroundColor( ? ImeTextSpanUnderlineStyle::kSolid
GetDocument() : ime_text_span.UnderlineStyle();
.GetPage()
->GetVisualViewport()
.UsedColorScheme())
: ime_text_span.BackgroundColor();
GetDocument().Markers().AddCompositionMarker( GetDocument().Markers().AddCompositionMarker(
ephemeral_line_range, ime_text_span.UnderlineColor(), ephemeral_line_range, ime_text_span.UnderlineColor(),
ime_text_span.Thickness(), ime_text_span.UnderlineStyle(), ime_text_span.Thickness(), underline_style,
ime_text_span.TextColor(), background_color); ime_text_span.TextColor(), ime_text_span.BackgroundColor());
break; break;
} }
case ImeTextSpan::Type::kAutocorrect: case ImeTextSpan::Type::kAutocorrect:
......
...@@ -1463,10 +1463,8 @@ TEST_F(InputMethodControllerTest, ...@@ -1463,10 +1463,8 @@ TEST_F(InputMethodControllerTest,
auto* styleable_marker = auto* styleable_marker =
DynamicTo<StyleableMarker>(GetDocument().Markers().Markers()[0].Get()); DynamicTo<StyleableMarker>(GetDocument().Markers().Markers()[0].Get());
Color background_color = EXPECT_EQ(ImeTextSpanUnderlineStyle::kSolid,
LayoutTheme::GetTheme().ActiveSelectionBackgroundColor( styleable_marker->UnderlineStyle());
GetFrame().GetPage()->GetVisualViewport().UsedColorScheme());
EXPECT_EQ(background_color, styleable_marker->BackgroundColor());
} }
TEST_F(InputMethodControllerTest, CommitPlainTextWithIme_Text_SpanInsert) { TEST_F(InputMethodControllerTest, CommitPlainTextWithIme_Text_SpanInsert) {
......
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