MacViews: Behavior of some moveAndSelect commands is incorrect when selection direction changes. |
||||||
Issue descriptionVersion: 52.0.2742.0 OS: Mac What steps will reproduce the problem? (1) Enable MacViews. (2) Go To Bookmark bubble. (3) In the name textfield, type abcdefg. (4) Select cde from left to right. Now Press Command + Shift + Left. Actual behavior- "ab" is selected. Expected behavior - "abcde" is selected. Also, with cde selected from left to right, press Alt + Shift + Left. Actual behavior- "ab" is selected Expected behavior - "ab|cdefg" i.e the existing selection reduces to a caret. Commands with incorrect behavior for the case where selection direction is changed- -moveWordForwardAndModifySelection -moveWordBackwardAndModifySelection -moveToBeginningOfLineAndModifySelection -moveToEndOfLineAndModifySelection -moveToBeginningOfParagraphAndModifySelection -moveToEndOfParagraphAndModifySelection -moveToEndOfDocumentAndModifySelection -moveToBeginningOfDocumentAndModifySelection -moveParagraphForwardAndModifySelection -moveParagraphBackwardAndModifySelection -moveWordRightAndModifySelection -moveWordLeftAndModifySelection -moveToLeftEndOfLineAndModifySelection -moveToRightEndOfLineAndModifySelection
,
Jul 9 2016
Moving this nonessential bug to the next milestone. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jul 27 2016
Also, if you drag select cde from right to left and press Shift+Right Arrow: Actual behavior- "de" is selected. Expected behavior - "cdef" is selected. Similarly, if you drag select cde from left to right and press Shift+Left Arrow: Actual behavior- "bcde" is selected. Expected behavior - "cd" is selected.
,
Jul 28 2016
Yeah it seems Cocoa disregards the selection direction when a selection is made using the mouse.
,
Aug 18 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/84ab6fac6177ca421e01391de629bcfa36fda381 commit 84ab6fac6177ca421e01391de629bcfa36fda381 Author: karandeepb <karandeepb@chromium.org> Date: Thu Aug 18 00:22:07 2016 MacViews: Fix behavior of move and select commands when selection direction changes. Currently the following commands do not behave similarly to Cocoa textfields when the selection direction changes- -moveWordForwardAndModifySelection -moveWordBackwardAndModifySelection -moveToBeginningOfLineAndModifySelection -moveToEndOfLineAndModifySelection -moveToBeginningOfParagraphAndModifySelection -moveToEndOfParagraphAndModifySelection -moveToEndOfDocumentAndModifySelection -moveToBeginningOfDocumentAndModifySelection -moveParagraphForwardAndModifySelection -moveParagraphBackwardAndModifySelection -moveWordRightAndModifySelection -moveWordLeftAndModifySelection -moveToLeftEndOfLineAndModifySelection -moveToRightEndOfLineAndModifySelection This CL adds a new enum gfx::SelectionBehavior which specifies whether a selection is to be made and how. RenderText::MoveCursor() is modified to take this enum as a parameter. Also, two new text edit commands are added to the ui::TextEditCommand enum- -MOVE_PARAGRAPH_BACKWARD_AND_MODIFY_SELECTION -MOVE_PARAGRAPH_FORWARD_AND_MODIFY_SELECTION Textfield::IsTextEditCommandEnabled is modified to enable the following commands on Mac- -MOVE_DOWN: -MOVE_DOWN_AND_MODIFY_SELECTION: -MOVE_PAGE_DOWN: -MOVE_PAGE_DOWN_AND_MODIFY_SELECTION: -MOVE_PAGE_UP: -MOVE_PAGE_UP_AND_MODIFY_SELECTION: -MOVE_UP: -MOVE_UP_AND_MODIFY_SELECTION: Further, Textfield::ExecuteEditCommand is modified to set the correct SelectionBehavior value for the different text editing commands. Also, lots of tests are added. This CL should have no behavior change for non-Mac platforms. BUG= 613438 , 586985 Review-Url: https://codereview.chromium.org/2228833002 Cr-Commit-Position: refs/heads/master@{#412702} [modify] https://crrev.com/84ab6fac6177ca421e01391de629bcfa36fda381/ui/base/ime/linux/text_edit_command_auralinux.cc [modify] https://crrev.com/84ab6fac6177ca421e01391de629bcfa36fda381/ui/base/ime/text_edit_commands.h [modify] https://crrev.com/84ab6fac6177ca421e01391de629bcfa36fda381/ui/gfx/render_text.cc [modify] https://crrev.com/84ab6fac6177ca421e01391de629bcfa36fda381/ui/gfx/render_text.h [modify] https://crrev.com/84ab6fac6177ca421e01391de629bcfa36fda381/ui/gfx/render_text_unittest.cc [modify] https://crrev.com/84ab6fac6177ca421e01391de629bcfa36fda381/ui/gfx/text_constants.h [modify] https://crrev.com/84ab6fac6177ca421e01391de629bcfa36fda381/ui/views/cocoa/bridged_content_view.mm [modify] https://crrev.com/84ab6fac6177ca421e01391de629bcfa36fda381/ui/views/cocoa/bridged_native_widget_unittest.mm [modify] https://crrev.com/84ab6fac6177ca421e01391de629bcfa36fda381/ui/views/controls/textfield/textfield.cc [modify] https://crrev.com/84ab6fac6177ca421e01391de629bcfa36fda381/ui/views/controls/textfield/textfield_model.cc [modify] https://crrev.com/84ab6fac6177ca421e01391de629bcfa36fda381/ui/views/controls/textfield/textfield_model.h [modify] https://crrev.com/84ab6fac6177ca421e01391de629bcfa36fda381/ui/views/controls/textfield/textfield_model_unittest.cc [modify] https://crrev.com/84ab6fac6177ca421e01391de629bcfa36fda381/ui/views/controls/textfield/textfield_test_api.h [modify] https://crrev.com/84ab6fac6177ca421e01391de629bcfa36fda381/ui/views/controls/textfield/textfield_unittest.cc
,
Aug 18 2016
Marking this as fixed. @shrike: Regarding comment 3, I don't think it's worth fixing. It's just that Cocoa disregards the initial selection direction we get from mouse dragging, while Views takes it into account. Hence with Cocoa, the mouse selection is always expanded on using the keyboard initially. Personally, I think the Views behavior is more intuitive. Please reopen the bug if you think this is not the case. Also, you probably mixed up the Actual and Expected behaviors for the second case.
,
Aug 19 2016
karandeepb@- Could you please let us know which flag do we need to enable to test this issue from Chrome TE end. While navigating to chrome://flags we could see 5 macviews flags.
,
Aug 19 2016
You need to enable chrome://flags/#mac-views-native-dialogs to enable MacViews for the bookmark bubble.
,
Aug 19 2016
Verified this issue on Mac OS 10.11.6 using chrome latest Dev M54-54.0.2832.2 by following steps mentioned in the original comment. Observed text 'ab' gets selected as expected. Hence adding TE-Verified label. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by tapted@chromium.org
, May 31 2016