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

Issue 2931673004: Make InlineBoxPosition constructor not to accept null-InlineBox (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

Make InlineBoxPosition constructor not to accept null-InlineBox and an negative offset This patch makes |InlineBoxPosition| not to accept null |InlineBox| and an negative offset to avoid wrong usage of |InlineBoxPosition|. Before this patch, |InlineBoxPosition.offset_in_box| holds an offset of specified position event if |.layout_object| is null. After this patch, |.offset_in_box| is zero if |.layout_object| is null. Other than explicit test case and |LocalCaretRectOfPositionTemplate()|, we don't use |offset_in_box| member when |InlineBox| is null. We've not seen wrong usage so far and code reading doesn't find wrong usages. Once we find wrong call sites, we'll fix them. BUG=707656 TEST=run_webkit_unit_tests --gtest_filter=VisibleUnitsTest.ComputeInlineBoxPositionMixedEditable Review-Url: https://codereview.chromium.org/2931673004 Cr-Commit-Position: refs/heads/master@{#479264} Committed: https://chromium.googlesource.com/chromium/src/+/4a043e477b4857645c2f73583ea147b318fb40a4

Patch Set 1 : 2017-06-12T14:51:57 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+16 lines, -9 lines) Patch
M third_party/WebKit/Source/core/editing/VisibleUnits.h View 1 chunk +4 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/editing/VisibleUnits.cpp View 3 chunks +11 lines, -5 lines 3 comments Download
M third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp View 1 chunk +1 line, -3 lines 0 comments Download

Messages

Total messages: 21 (15 generated)
yosin_UTC9
PTAL
3 years, 6 months ago (2017-06-12 08:19:04 UTC) #12
Xiaocheng
https://codereview.chromium.org/2931673004/diff/20001/third_party/WebKit/Source/core/editing/VisibleUnits.cpp File third_party/WebKit/Source/core/editing/VisibleUnits.cpp (right): https://codereview.chromium.org/2931673004/diff/20001/third_party/WebKit/Source/core/editing/VisibleUnits.cpp#newcode1033 third_party/WebKit/Source/core/editing/VisibleUnits.cpp:1033: nullptr, position.GetPosition().ComputeEditingOffset())); Could you clarify this change? We should ...
3 years, 6 months ago (2017-06-12 18:53:41 UTC) #13
yosin_UTC9
PTAL Reply question and update description. https://codereview.chromium.org/2931673004/diff/20001/third_party/WebKit/Source/core/editing/VisibleUnits.cpp File third_party/WebKit/Source/core/editing/VisibleUnits.cpp (right): https://codereview.chromium.org/2931673004/diff/20001/third_party/WebKit/Source/core/editing/VisibleUnits.cpp#newcode1033 third_party/WebKit/Source/core/editing/VisibleUnits.cpp:1033: nullptr, position.GetPosition().ComputeEditingOffset())); On ...
3 years, 6 months ago (2017-06-13 06:55:00 UTC) #15
Xiaocheng
lgtm https://codereview.chromium.org/2931673004/diff/20001/third_party/WebKit/Source/core/editing/VisibleUnits.cpp File third_party/WebKit/Source/core/editing/VisibleUnits.cpp (right): https://codereview.chromium.org/2931673004/diff/20001/third_party/WebKit/Source/core/editing/VisibleUnits.cpp#newcode1033 third_party/WebKit/Source/core/editing/VisibleUnits.cpp:1033: nullptr, position.GetPosition().ComputeEditingOffset())); On 2017/06/13 at 06:55:00, yosin_UTC9 wrote: ...
3 years, 6 months ago (2017-06-13 17:25:03 UTC) #16
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/2931673004/20001
3 years, 6 months ago (2017-06-14 01:04:28 UTC) #18
commit-bot: I haz the power
3 years, 6 months ago (2017-06-14 02:50:24 UTC) #21
Message was sent while issue was closed.
Committed patchset #1 (id:20001) as
https://chromium.googlesource.com/chromium/src/+/4a043e477b4857645c2f73583ea1...

Powered by Google App Engine
This is Rietveld 408576698