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

Issue 2932283002: Introduce IsCaretAtEdgeOfInlineTextBox() to simplify ComputeInlineBoxPosition() (Closed)

Created:
3 years, 6 months ago by yosin_UTC9
Modified:
3 years, 6 months ago
Reviewers:
yoichio, Xiaocheng
CC:
blink-reviews, chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Introduce IsCaretAtEdgeOfInlineTextBox() to simplify ComputeInlineBoxPosition() This patch introduces |IsCaretAtEdgeOfInlineTextBox()| to simplify loop body and simplify condition expression in |ComputeInlineBoxPosition()| for improving code health. The implementation of |IsCaretAtEdgeOfInlineTextBox()| based on following reasoning: Table of exclusive-or expressions: 1 (caret_offset == caret_max_offset) ^ (affinity == Downstream) 2 (caret_offset == caret_min_offset) ^ (affinity == Upstream) Results of expression 1 and 2 are same for combinations of |caret_offset| and |affinity|. caret_offset|affinity |result ------------+----------+------- max_offset |Downstream|false max_offset |Upstream |true min_offset |Downstream|true min_offset |Upstream |false BUG=707656 TEST=n/a; no behavior changes Review-Url: https://codereview.chromium.org/2932283002 Cr-Commit-Position: refs/heads/master@{#479236} Committed: https://chromium.googlesource.com/chromium/src/+/736123357fcf3d8bf78af92fdd24efa81333117e

Patch Set 1 : 2017-06-12T15:57:21 #

Total comments: 2

Patch Set 2 : 2017-06-13T16:36:07 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -6 lines) Patch
M third_party/WebKit/Source/core/editing/VisibleUnits.cpp View 1 2 chunks +15 lines, -6 lines 0 comments Download

Messages

Total messages: 30 (23 generated)
yosin_UTC9
PTAL
3 years, 6 months ago (2017-06-12 08:19:24 UTC) #14
Xiaocheng
https://codereview.chromium.org/2932283002/diff/40001/third_party/WebKit/Source/core/editing/VisibleUnits.cpp File third_party/WebKit/Source/core/editing/VisibleUnits.cpp (right): https://codereview.chromium.org/2932283002/diff/40001/third_party/WebKit/Source/core/editing/VisibleUnits.cpp#newcode820 third_party/WebKit/Source/core/editing/VisibleUnits.cpp:820: if (caret_offset == caret_min_offset) { I think it's better ...
3 years, 6 months ago (2017-06-12 18:35:12 UTC) #17
yosin_UTC9
PTAL - Introduce a new function IsCaretAtEdgeOfInlineTextBox - Update description https://codereview.chromium.org/2932283002/diff/40001/third_party/WebKit/Source/core/editing/VisibleUnits.cpp File third_party/WebKit/Source/core/editing/VisibleUnits.cpp (right): https://codereview.chromium.org/2932283002/diff/40001/third_party/WebKit/Source/core/editing/VisibleUnits.cpp#newcode820 ...
3 years, 6 months ago (2017-06-13 07:41:07 UTC) #21
Xiaocheng
lgtm with nit: please update patch title accordingly.
3 years, 6 months ago (2017-06-13 17:20:37 UTC) #24
yosin_UTC9
On 2017/06/13 at 17:20:37, xiaochengh wrote: > lgtm with nit: please update patch title accordingly. ...
3 years, 6 months ago (2017-06-14 01:03:35 UTC) #25
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/2932283002/60001
3 years, 6 months ago (2017-06-14 01:03:53 UTC) #27
commit-bot: I haz the power
3 years, 6 months ago (2017-06-14 01:08:16 UTC) #30
Message was sent while issue was closed.
Committed patchset #2 (id:60001) as
https://chromium.googlesource.com/chromium/src/+/736123357fcf3d8bf78af92fdd24...

Powered by Google App Engine
This is Rietveld 408576698