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

Issue 2348433002: Make styled-label trimming less agressive, allowing whitespace (Closed)

Created:
4 years, 3 months ago by eugenebng
Modified:
4 years ago
Reviewers:
sky, Evan Stade
CC:
chromium-reviews, tfarina
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make styled-label trimming less aggressive - now when wrapped on \n, only this \n is removed, not all whitespace sequence. This allows whitespace "formatting" like line indentation with spaces. Also makes double newline behave like expected - insert an empty line between text before and after \n\n. Syled label layout loop refactored to de-duplicate code. Added tests coverage for styled label. Fixed LegalMessageLine comment - no longer have to explain that it is based on styled_label with some caveats. R=sky@chromium.org BUG= Committed: https://crrev.com/933ca2314a2ea20ceafe435bbc896500e67bd7a3 Cr-Commit-Position: refs/heads/master@{#438795}

Patch Set 1 #

Patch Set 2 : Removed a comment about leaky abstraction because it is fixed #

Patch Set 3 : Added test coverage, fixed empty line output for styled_label #

Total comments: 1

Patch Set 4 : Added styled label test on "naturally wrap at \n" case #

Patch Set 5 : Code style for correct wrap at newline #

Total comments: 7

Patch Set 6 : Code style fixes #

Patch Set 7 : Code style fixes - part 2 #

Total comments: 1

Patch Set 8 : Added test coverage for a case of long leading whitespace - there was no checking that this whitesp… #

Patch Set 9 : Refactoring: de-duplicated wrap to new line code in styled label credits to estade for code suggest… #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+76 lines, -23 lines) Patch
M components/autofill/core/browser/legal_message_line.h View 1 1 chunk +1 line, -3 lines 0 comments Download
M ui/views/controls/styled_label.cc View 1 2 3 4 5 6 7 8 3 chunks +25 lines, -20 lines 1 comment Download
M ui/views/controls/styled_label_unittest.cc View 1 2 3 4 5 6 7 3 chunks +50 lines, -0 lines 0 comments Download

Messages

Total messages: 42 (7 generated)
eugenebng
4 years, 3 months ago (2016-09-15 14:31:25 UTC) #1
eugenebng
ping sky
4 years, 3 months ago (2016-09-22 11:08:54 UTC) #2
sky
+estade as I believe he wanted the whitespace trimming logic. I tend to favor not ...
4 years, 3 months ago (2016-09-22 13:25:21 UTC) #4
eugenebng
On 2016/09/22 13:25:21, sky wrote: > +estade as I believe he wanted the whitespace trimming ...
4 years, 3 months ago (2016-09-23 12:29:50 UTC) #5
sky
On Fri, Sep 23, 2016 at 5:29 AM, <eugenebng@yandex-team.ru> wrote: > On 2016/09/22 13:25:21, sky ...
4 years, 3 months ago (2016-09-23 17:51:10 UTC) #6
eugenebng
On 2016/09/23 17:51:10, sky wrote: > On Fri, Sep 23, 2016 at 5:29 AM, <mailto:eugenebng@yandex-team.ru> ...
4 years, 2 months ago (2016-09-26 10:01:19 UTC) #7
sky
I agree your change seems good and no additional property. Please add test coverage.
4 years, 2 months ago (2016-09-26 16:37:56 UTC) #8
Evan Stade
is there a bug this is fixing or a new UI surface this is enabling? ...
4 years, 2 months ago (2016-09-26 16:50:45 UTC) #9
eugenebng
On 2016/09/26 16:50:45, Evan Stade wrote: > is there a bug this is fixing or ...
4 years, 2 months ago (2016-09-27 10:00:31 UTC) #10
sky
I'm ok with this fix, but you need to add test coverage. On Tue, Sep ...
4 years, 2 months ago (2016-09-27 13:24:37 UTC) #11
eugenebng
On 2016/09/27 13:24:37, sky wrote: > I'm ok with this fix, but you need to ...
4 years, 2 months ago (2016-09-28 11:22:41 UTC) #12
Evan Stade
On 2016/09/28 11:22:41, eugenebng wrote: > On 2016/09/27 13:24:37, sky wrote: > > I'm ok ...
4 years, 2 months ago (2016-09-28 16:22:45 UTC) #13
eugenebng
On 2016/09/28 16:22:45, Evan Stade wrote: > On 2016/09/28 11:22:41, eugenebng wrote: > > On ...
4 years, 2 months ago (2016-09-29 07:42:24 UTC) #14
eugenebng
PTAL at patch set 2. It's now not only change in styled_label, but also fixes ...
4 years ago (2016-12-01 09:29:52 UTC) #16
sky
Please add test coverage.
4 years ago (2016-12-01 16:07:16 UTC) #17
eugenebng
On 2016/12/01 16:07:16, sky wrote: > Please add test coverage. Added tests, checking that empty ...
4 years ago (2016-12-05 12:25:55 UTC) #18
sky
Evan had concerns about this in the past. Evan, this change seems reasonable to me, ...
4 years ago (2016-12-05 16:13:19 UTC) #19
Evan Stade
I see some style nits, but generally no objection https://codereview.chromium.org/2348433002/diff/40001/ui/views/controls/styled_label_unittest.cc File ui/views/controls/styled_label_unittest.cc (right): https://codereview.chromium.org/2348433002/diff/40001/ui/views/controls/styled_label_unittest.cc#newcode101 ui/views/controls/styled_label_unittest.cc:101: ...
4 years ago (2016-12-05 17:12:14 UTC) #20
eugenebng
On 2016/12/05 17:12:14, Evan Stade wrote: > I see some style nits, but generally no ...
4 years ago (2016-12-06 11:30:50 UTC) #21
Evan Stade
just nits, I'll leave it to sky for OWNERS perspective/review. https://codereview.chromium.org/2348433002/diff/80001/ui/views/controls/styled_label.cc File ui/views/controls/styled_label.cc (right): https://codereview.chromium.org/2348433002/diff/80001/ui/views/controls/styled_label.cc#newcode264 ...
4 years ago (2016-12-06 17:04:47 UTC) #22
eugenebng
On 2016/12/06 17:04:47, Evan Stade wrote: > just nits, I'll leave it to sky for ...
4 years ago (2016-12-07 16:49:24 UTC) #23
eugenebng
WDYT Evan? On 2016/12/07 16:49:24, eugenebng wrote: > On 2016/12/06 17:04:47, Evan Stade wrote: > ...
4 years ago (2016-12-09 10:39:37 UTC) #24
Evan Stade
https://codereview.chromium.org/2348433002/diff/120001/ui/views/controls/styled_label.cc File ui/views/controls/styled_label.cc (right): https://codereview.chromium.org/2348433002/diff/120001/ui/views/controls/styled_label.cc#newcode304 ui/views/controls/styled_label.cc:304: // Otherwise there is no room for anything; abort. ...
4 years ago (2016-12-09 18:41:58 UTC) #25
eugenebng
On 2016/12/09 18:41:58, Evan Stade wrote: > https://codereview.chromium.org/2348433002/diff/120001/ui/views/controls/styled_label.cc > File ui/views/controls/styled_label.cc (right): > > https://codereview.chromium.org/2348433002/diff/120001/ui/views/controls/styled_label.cc#newcode304 ...
4 years ago (2016-12-12 12:08:41 UTC) #26
Evan Stade
On 2016/12/12 12:08:41, eugenebng wrote: > On 2016/12/09 18:41:58, Evan Stade wrote: > > > ...
4 years ago (2016-12-12 16:15:33 UTC) #27
eugenebng
I agree that code style can be improved with introducing bool first_loop_iteration. But I didn't ...
4 years ago (2016-12-13 05:18:08 UTC) #28
Evan Stade
On 2016/12/13 05:18:08, eugenebng wrote: > I agree that code style can be improved with ...
4 years ago (2016-12-13 16:07:19 UTC) #29
eugenebng
On 2016/12/13 16:07:19, Evan Stade wrote: > On 2016/12/13 05:18:08, eugenebng wrote: > > I ...
4 years ago (2016-12-14 11:32:56 UTC) #30
Evan Stade
lgtm https://codereview.chromium.org/2348433002/diff/160001/ui/views/controls/styled_label.cc File ui/views/controls/styled_label.cc (right): https://codereview.chromium.org/2348433002/diff/160001/ui/views/controls/styled_label.cc#newcode309 ui/views/controls/styled_label.cc:309: // As for the first line, don't advance ...
4 years ago (2016-12-15 00:02:36 UTC) #31
Evan Stade
And thanks for sticking with this change. One last request: could you update the CL ...
4 years ago (2016-12-15 00:04:40 UTC) #32
sky
LGTM
4 years ago (2016-12-15 00:46:51 UTC) #33
eugenebng
On 2016/12/15 00:04:40, Evan Stade wrote: > And thanks for sticking with this change. One ...
4 years ago (2016-12-15 08:46:36 UTC) #35
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/2348433002/160001
4 years ago (2016-12-15 08:47:16 UTC) #37
commit-bot: I haz the power
Committed patchset #9 (id:160001)
4 years ago (2016-12-15 09:51:57 UTC) #40
commit-bot: I haz the power
4 years ago (2016-12-15 09:54:01 UTC) #42
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/933ca2314a2ea20ceafe435bbc896500e67bd7a3
Cr-Commit-Position: refs/heads/master@{#438795}

Powered by Google App Engine
This is Rietveld 408576698