New issue
Advanced search Search tips

Issue 623036 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug-Regression



Sign in to add a comment

MacViews: Text input for password textfield does not work.

Project Member Reported by karandeepb@chromium.org, Jun 24 2016

Issue description

Version: 53.0.2775.0
OS: Mac

What steps will reproduce the problem?
(1) Enable MacViews.
(2) Open http auth dialog.
(3) Move focus to password field.
(4) Enter some text.

What is the expected output?
Text is entered as password in textfield.

What do you see instead?
No text is entered.

This possibly regressed in crrev.com/2033433006. Since for password textfields, input context is nil, insertText is called. Since instead of sending the input to the text input client, a KeyDownEvent is generated, no text is input.

 
Project Member

Comment 1 by bugdroid1@chromium.org, Jun 30 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/32409d8df5d505a66ed1710f102c84b90456f696

commit 32409d8df5d505a66ed1710f102c84b90456f696
Author: karandeepb <karandeepb@chromium.org>
Date: Thu Jun 30 07:14:39 2016

MacViews: Don't handle character events in textfield_unittest's MockInputMethod::DispatchKeyEvent.

MockInputMethod::DispatchKeyEvent in textfield_unittest.cc currently has a lot
of logic to handle key events. While this is appropriate for other platforms,
on Mac this is incorrect since key events don't pass through InputMethod on Mac.
This causes the test pipeline to be different from the production one on Mac. As
a result some tests may incorrectly pass on MacViews.

This CL fixes the issue by changing MockInputMethod::DispatchKeyEvent to behave
similarly to InputMethodMac::DispatchKeyEvent for character events. Composition
still needs to be mocked, since its not possible to generate test events which
trigger the appropriate NSResponder action messages for composition. This also
necessitates modifying SendKeyEvent(base::char16 ch) in textfield_unittest.cc to
dispatch all character events regularly on Mac, rather than sending them
directly to the InputMethod.

This is a precursor to crrev.com/2096363002 which adds a test
TextfieldTest.TextInputType_InsertionTest, which should have failed on MacViews,
but doesn't currently due to this issue.

BUG= 623036 

Review-Url: https://codereview.chromium.org/2095283002
Cr-Commit-Position: refs/heads/master@{#403110}

[modify] https://crrev.com/32409d8df5d505a66ed1710f102c84b90456f696/ui/events/test/cocoa_test_event_utils.mm
[modify] https://crrev.com/32409d8df5d505a66ed1710f102c84b90456f696/ui/views/controls/textfield/textfield_unittest.cc

Project Member

Comment 2 by bugdroid1@chromium.org, Jun 30 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/25492d28991f4cd464c8d8ab728e548ae735b8a2

commit 25492d28991f4cd464c8d8ab728e548ae735b8a2
Author: karandeepb <karandeepb@chromium.org>
Date: Thu Jun 30 08:06:50 2016

MacViews: Fix text input for password textfields.

crrev.com/2033433006 modified insertText handlers on BridgedContentView to
correctly handle space key events and simplify menu dispatch. However this broke
text input for password textfields.

This CL fixes the issue by introducing a new private method insertTextInternal:
on BridgedContentView, which is used by both insertText: and
insertTextReplacementRange:. Furhter, another private method
activeMenuController: is added to retreive the currently active menu controller.
A textfield test is also added which fails on MacViews for the current master.

This CL is dependent on http://crrev.com/2095283002.

BUG= 623036 
TEST=Enable Macviews. Open an http auth dialog (Go to
httpwatch.com/httpgallery/authentication/ and click on Display Image button).
Move focus to password textfield and ensure text input works correctly.

Review-Url: https://codereview.chromium.org/2096363002
Cr-Commit-Position: refs/heads/master@{#403117}

[modify] https://crrev.com/25492d28991f4cd464c8d8ab728e548ae735b8a2/ui/views/cocoa/bridged_content_view.mm
[modify] https://crrev.com/25492d28991f4cd464c8d8ab728e548ae735b8a2/ui/views/controls/textfield/textfield_unittest.cc

Status: Fixed (was: Assigned)

Comment 4 by ajha@chromium.org, Jul 7 2016

Labels: TE-Verified-53.0.2785.8 TE-Verified-M53
Verified the fix as per the test steps in C#2 on chrome version: 53.0.2785.8 on Mac OS 10.11.5.

Text entered in the password field is entered as password. Attached is the screenshot of the same.
623036.png
145 KB View Download

Sign in to add a comment