|
|
Chromium Code Reviews|
Created:
4 years, 2 months ago by Xiaocheng Modified:
4 years, 2 months ago Reviewers:
yosin_UTC9 CC:
blink-reviews, chromium-reviews Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionEnsure valid VisiblePositions in InsertListCommand::doApply
This patch ensures that the VisiblePositions created in
InsertListCommand::doApply are always valid when used.
This patch is a prepartion of pruning createVisibleSelectionDeprecated
from EditCommand::setEndingSelection.
BUG=648949
Committed: https://crrev.com/af07c6533b27d117b9f57595253e6d3dde192734
Cr-Commit-Position: refs/heads/master@{#424727}
Patch Set 1 #
Total comments: 3
Patch Set 2 : Use new functions of PWA #
Depends on Patchset: Dependent Patchsets: Messages
Total messages: 20 (11 generated)
The CQ bit was checked by xiaochengh@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
xiaochengh@chromium.org changed reviewers: + yosin@chromium.org
PTAL.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2412493004/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp (right): https://codereview.chromium.org/2412493004/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp:228: if (endOfSelection.isNull() || endOfSelection.position().isOrphan() || It it better to introduce: PositionWithAffinity::isOrphan() and |isConnected()|? Actually, it is better to use |!Position::isConnected()| instead of |p.isNull() || p.isOrphan()|. bool isConnected() const { return m_anchorNode && m_anchorNode->isConnected(); } bool isOrphan() const { return m_anchorNode && !m_anchorNode->isConnected(); } WDYT?
https://codereview.chromium.org/2412493004/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp (right): https://codereview.chromium.org/2412493004/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp:228: if (endOfSelection.isNull() || endOfSelection.position().isOrphan() || On 2016/10/12 at 06:27:43, Yosi_UTC9 wrote: > It it better to introduce: PositionWithAffinity::isOrphan() and |isConnected()|? > Actually, it is better to use |!Position::isConnected()| instead of |p.isNull() || p.isOrphan()|. > > bool isConnected() const { return m_anchorNode && m_anchorNode->isConnected(); } > bool isOrphan() const { return m_anchorNode && !m_anchorNode->isConnected(); } > > WDYT? Reasonable. Will do.
https://codereview.chromium.org/2412493004/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp (right): https://codereview.chromium.org/2412493004/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp:228: if (endOfSelection.isNull() || endOfSelection.position().isOrphan() || On 2016/10/12 at 06:31:06, Xiaocheng wrote: > On 2016/10/12 at 06:27:43, Yosi_UTC9 wrote: > > It it better to introduce: PositionWithAffinity::isOrphan() and |isConnected()|? > > Actually, it is better to use |!Position::isConnected()| instead of |p.isNull() || p.isOrphan()|. > > > > bool isConnected() const { return m_anchorNode && m_anchorNode->isConnected(); } > > bool isOrphan() const { return m_anchorNode && !m_anchorNode->isConnected(); } > > > > WDYT? > > Reasonable. Will do. In this patch, it is OK to write |endOfSelection.position().isConnected()|. It is up to you, introduce PWA::isConnected() and isOrphan(), then use here. As usual, introducing PWA::isConnected() should be in another patch. ;-)
The CQ bit was checked by xiaochengh@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Updated with new functions introduced to PWA (https://codereview.chromium.org/2406163004). PTAL.
lgtm
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by xiaochengh@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Committed patchset #2 (id:20001)
Message was sent while issue was closed.
Description was changed from ========== Ensure valid VisiblePositions in InsertListCommand::doApply This patch ensures that the VisiblePositions created in InsertListCommand::doApply are always valid when used. This patch is a prepartion of pruning createVisibleSelectionDeprecated from EditCommand::setEndingSelection. BUG=648949 ========== to ========== Ensure valid VisiblePositions in InsertListCommand::doApply This patch ensures that the VisiblePositions created in InsertListCommand::doApply are always valid when used. This patch is a prepartion of pruning createVisibleSelectionDeprecated from EditCommand::setEndingSelection. BUG=648949 Committed: https://crrev.com/af07c6533b27d117b9f57595253e6d3dde192734 Cr-Commit-Position: refs/heads/master@{#424727} ==========
Message was sent while issue was closed.
Patchset 2 (id:??) landed as https://crrev.com/af07c6533b27d117b9f57595253e6d3dde192734 Cr-Commit-Position: refs/heads/master@{#424727} |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
