Textfield dragging up and down should select through the ends of the text |
||||||||||||
Issue descriptionWhat steps will reproduce the problem? (1) Type some text into a Views textfield on the Mac (2) Click halfway along the line of text and drag down What is the expected output? The text selection should extend from where you clicked within the text to the end of the text. What do you see instead? The text selection only extends from where you clicked within the text to where you may have slightly dragged to the right when dragging down. On the Mac, following the steps selects all text in the line to the end. Likewise clicking in the middle of the text and dragging up should select all text from the click-point to the beginning of the line of text.
,
Apr 7 2016
,
Apr 14 2016
,
Apr 14 2016
bulk-tagging Phase1 for M52
,
Apr 18 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/ef378f2dcd244781ba68cc2a4f709e6f3d100569 commit ef378f2dcd244781ba68cc2a4f709e6f3d100569 Author: ellyjones <ellyjones@chromium.org> Date: Mon Apr 18 19:45:38 2016 views: support vertical-drag-to-end on textfields On Mac, dragging above the top of a textfield drags to the beginning of the textfield's contents, and dragging below the bottom drags to the end of the textfield's contents. This change implements that behavior, controlled by PlatformStyle::kTextfieldDragVerticallyDragsToEnd, which is true only on Mac. BUG= 600166 Review URL: https://codereview.chromium.org/1865063004 Cr-Commit-Position: refs/heads/master@{#387988} [modify] https://crrev.com/ef378f2dcd244781ba68cc2a4f709e6f3d100569/ui/views/controls/textfield/textfield.cc [modify] https://crrev.com/ef378f2dcd244781ba68cc2a4f709e6f3d100569/ui/views/controls/textfield/textfield_unittest.cc [modify] https://crrev.com/ef378f2dcd244781ba68cc2a4f709e6f3d100569/ui/views/style/platform_style.cc [modify] https://crrev.com/ef378f2dcd244781ba68cc2a4f709e6f3d100569/ui/views/style/platform_style.h [modify] https://crrev.com/ef378f2dcd244781ba68cc2a4f709e6f3d100569/ui/views/style/platform_style_mac.mm
,
Apr 19 2016
,
Apr 19 2016
Great!
,
Apr 20 2016
,
Oct 10 2016
Reopening this. I don't think the behavior implemented and described in the bug report is entirely as per Cocoa. Whether the text extends to the left or to the right when the mouse goes above or below the textfield is dependent on the start point of the selection. In a Cocoa textfield, consider text - abcd. Start selection from left of c and move cursor upwards and slightly to the right while dragging => cd is selected Start selection from left of c and move cursor upwards and slightly to the left while dragging => ab is selected Current views behavior => ab is selected in both cases. Will look at this as part of issue 630365 .
,
Dec 12 2016
,
Jan 4 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/4e4ca175171eb6c46603799904a624e6797773e4 commit 4e4ca175171eb6c46603799904a624e6797773e4 Author: karandeepb <karandeepb@chromium.org> Date: Wed Jan 04 02:12:24 2017 RenderTextHarfBuzz: Add support for multi line text selection. This CL- - Adds support for multi-line text selection to RenderTextHarfBuzz. To do this RenderTextHarfBuzz::FindCursorPosition and RenderTextHarfBuzz::GetSubstringBounds are reimplemented. - RenderTextHarfBuzz::FindCursorPosition now returns valid grapheme boundaries hence fixing issue 673986 . - RenderTextHarfBuzz::GetSubstringBounds did already support multiline but the implementation was flawed. It relied on the text space bounds intersection computed from LineSegment's x_range paramater and from TextRunHarfBuzz. However these were not in sync if some newline segments were popped or if some text was truncated. - Enables multi-line text selection for views::Labels. - Corrects the behavior for RTL when mouse is dragged above/below the text bounds on MacViews. - Adds lots of tests. BUG= 650120 , 630365 , 600166 , 673986 TEST= Open views_examples_with_content_exe. Select Labels from the dropdown. Enter a large string in the "Content" textfield. Enable the Multiline and Text Selection checkboxes. Ensure text selection works correctly on the Label. Review-Url: https://codereview.chromium.org/2541313002 Cr-Commit-Position: refs/heads/master@{#441290} [modify] https://crrev.com/4e4ca175171eb6c46603799904a624e6797773e4/ui/gfx/render_text.cc [modify] https://crrev.com/4e4ca175171eb6c46603799904a624e6797773e4/ui/gfx/render_text.h [modify] https://crrev.com/4e4ca175171eb6c46603799904a624e6797773e4/ui/gfx/render_text_harfbuzz.cc [modify] https://crrev.com/4e4ca175171eb6c46603799904a624e6797773e4/ui/gfx/render_text_harfbuzz.h [modify] https://crrev.com/4e4ca175171eb6c46603799904a624e6797773e4/ui/gfx/render_text_unittest.cc [modify] https://crrev.com/4e4ca175171eb6c46603799904a624e6797773e4/ui/views/controls/label.cc [modify] https://crrev.com/4e4ca175171eb6c46603799904a624e6797773e4/ui/views/controls/label.h [modify] https://crrev.com/4e4ca175171eb6c46603799904a624e6797773e4/ui/views/controls/label_unittest.cc [modify] https://crrev.com/4e4ca175171eb6c46603799904a624e6797773e4/ui/views/controls/textfield/textfield_unittest.cc [modify] https://crrev.com/4e4ca175171eb6c46603799904a624e6797773e4/ui/views/examples/label_example.cc [modify] https://crrev.com/4e4ca175171eb6c46603799904a624e6797773e4/ui/views/examples/label_example.h [modify] https://crrev.com/4e4ca175171eb6c46603799904a624e6797773e4/ui/views/selection_controller.cc [modify] https://crrev.com/4e4ca175171eb6c46603799904a624e6797773e4/ui/views/style/platform_style.cc [modify] https://crrev.com/4e4ca175171eb6c46603799904a624e6797773e4/ui/views/style/platform_style.h [modify] https://crrev.com/4e4ca175171eb6c46603799904a624e6797773e4/ui/views/style/platform_style_mac.mm
,
Jan 27 2017
Status: Patch in c#11 should fix the RTL behavior related to dragging up and down on a textfield. However the behavior in c#9 is still not implemented. However this should not be a P2 and should not block issue 603386 IMO.
,
Jan 27 2017
I'm going to leave it as a blocker for Phase3. I prefer not to let this bit of non-conformance to expected behavior slip through.
,
Feb 13 2017
ellyjones@ - this is the textfield bug I was talking about.
,
Feb 14 2017
Yah we should fix this :). The decision to select-to-end should be based on Y-coord, but "which end" to pick should be based on X-coord. (Currently they are both using Y-coord). It should be a straightforward fix.
,
Mar 27 2017
,
May 25 2017
I felt inspired to fix this today, hope you don't mind :) https://codereview.chromium.org/2903193003/ Interesting to note that the current MacViews behavior is consistent with single-line textfields in webcontents on Mac, but inconsistent with Cocoa single line textfields. That CL makes MacViews match Cocoa. Maybe we want to pursue something for textfields in webcontents.. or maybe that will break the web. Anyway, Safari matches Chrome in this regard - maybe it's some web standard.
,
May 28 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/4a1a83be8f109eb727dd9e8724cce49801279faf commit 4a1a83be8f109eb727dd9e8724cce49801279faf Author: tapted <tapted@chromium.org> Date: Sun May 28 11:08:58 2017 MacViews: Tweak kDragToEndIfOutsideVerticalBounds for single line fields. Currently the direction to extend is based off the y-position. Dragging above extends to the logical start and dragging below extends to the logical end. This matches <textarea> and single-line <input> fields in webcontents, but does not match single line Cocoa text fields such as the current Chrome Mac omnibox. Instead, compare x positions of the selection start and the mouse cursor. For single line RenderText, extend to the end that is in the visual direction towards the mouse cursor. BUG= 600166 Review-Url: https://codereview.chromium.org/2903193003 Cr-Commit-Position: refs/heads/master@{#475260} [modify] https://crrev.com/4a1a83be8f109eb727dd9e8724cce49801279faf/ui/gfx/render_text_harfbuzz.cc [modify] https://crrev.com/4a1a83be8f109eb727dd9e8724cce49801279faf/ui/views/controls/label_unittest.cc [modify] https://crrev.com/4a1a83be8f109eb727dd9e8724cce49801279faf/ui/views/controls/textfield/textfield_unittest.cc
,
May 29 2017
|
||||||||||||
►
Sign in to add a comment |
||||||||||||
Comment 1 by ellyjo...@chromium.org
, Apr 4 2016Owner: ellyjo...@chromium.org
Status: Assigned (was: Available)