Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Issue 2373403002: views: update textfield cursor state after programmatic text changes (Closed)

Created:
4 years, 2 months ago by Elly Fong-Jones
Modified:
4 years, 2 months ago
Reviewers:
dmazzoni, Peter Kasting
CC:
chromium-reviews, tfarina, James Su, shuchen+watch_chromium.org, yusukes+watch_chromium.org, nona+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

views: update textfield cursor state after programmatic text changes Subclasses of Textfield (specifically OmniboxView) use these methods to implement their own paste semantics and so on. They should not be responsible for remembering to call UpdateAfterChange() after doing so, so call it in mutator methods here. BUG=651016

Patch Set 1 #

Total comments: 4

Patch Set 2 : remove spurious update calls #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -7 lines) Patch
M ui/views/controls/textfield/textfield.cc View 1 1 chunk +3 lines, -7 lines 0 comments Download

Messages

Total messages: 15 (5 generated)
Elly Fong-Jones
pkasting: ptal? :)
4 years, 2 months ago (2016-09-28 14:48:31 UTC) #3
Peter Kasting
https://codereview.chromium.org/2373403002/diff/1/ui/views/controls/textfield/textfield.cc File ui/views/controls/textfield/textfield.cc (right): https://codereview.chromium.org/2373403002/diff/1/ui/views/controls/textfield/textfield.cc#newcode310 ui/views/controls/textfield/textfield.cc:310: UpdateAfterChange(true, true); UpdateAfterChange() calls OnCaretBoundsChanged(), SchedulePaint(), and NotifyAccessibilityEvent(), so ...
4 years, 2 months ago (2016-09-28 18:56:47 UTC) #4
Elly Fong-Jones
pkasting: ptal? :) https://codereview.chromium.org/2373403002/diff/1/ui/views/controls/textfield/textfield.cc File ui/views/controls/textfield/textfield.cc (right): https://codereview.chromium.org/2373403002/diff/1/ui/views/controls/textfield/textfield.cc#newcode310 ui/views/controls/textfield/textfield.cc:310: UpdateAfterChange(true, true); On 2016/09/28 18:56:47, Peter ...
4 years, 2 months ago (2016-10-03 17:37:30 UTC) #5
Peter Kasting
On 2016/10/03 17:37:30, Elly Fong-Jones wrote: > pkasting: ptal? :) Will try to get to ...
4 years, 2 months ago (2016-10-04 07:56:48 UTC) #6
Peter Kasting
LGTM, but I'm definitely concerned about the accessibility effect. I suggest asking dmazzoni (added as ...
4 years, 2 months ago (2016-10-05 00:34:33 UTC) #8
dmazzoni
lgtm This seems like a good change, it's definitely better to consolidate the logic in ...
4 years, 2 months ago (2016-10-05 17:52:21 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2373403002/20001
4 years, 2 months ago (2016-10-05 17:53:37 UTC) #11
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/310591) mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, ...
4 years, 2 months ago (2016-10-05 18:26:30 UTC) #13
Elly Fong-Jones
On 2016/10/05 18:26:30, commit-bot: I haz the power wrote: > Try jobs failed on following ...
4 years, 2 months ago (2016-10-06 13:27:46 UTC) #14
Peter Kasting
4 years, 2 months ago (2016-10-10 21:23:02 UTC) #15
Message was sent while issue was closed.
On 2016/10/06 13:27:46, Elly Fong-Jones wrote:
> On 2016/10/05 18:26:30, commit-bot: I haz the power wrote:
> > Try jobs failed on following builders:
> >   linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED,
> >
>
http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
> >   mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED,
> >
>
http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
> 
> There are two failures happening here:
> 
> 1) A couple of the tests assert that the model does *not* get callbacks when
the
> programmatic setters are used. That's disturbing.
> 2) A lot of the bookmark editor tests explode because their controller assumes
> it's only called via user input, meaning the UI is already visible.
> 
> So, I think this CL is fundamentally a mistake and will probably subtly break
> other stuff / introduce a lot of crashes.

The test results suggest your second clause is probably true.

I don't know whether that means the first clause is true.  That is, I would
prefer that we aim for whatever we think the right long-term implementation is,
not aim for whatever we think will be least likely to disrupt existing
expectations of the code.

I do not have a strong opinion of what that right long-term implementation
actually is.  I am reluctant to believe that the omnibox is a special snowflake
and other clients should not get this behavior, but I am not sufficiently
certain of that to say that you are wrong to go the alternate route.

However, please be certain that it's the right thing to do, and keep in mind the
general biases I mention above.  Let's not get to a point someday where a
non-omnibox consumer of textfields has wonky behavior that they wouldn't have
had if we had just Done It Right in textfields to begin with.

Powered by Google App Engine
This is Rietveld 408576698