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

Issue 315493004: reset VisibleSelection at the Undo command. (Closed)

Created:
6 years, 6 months ago by yoichio
Modified:
6 years, 6 months ago
CC:
blink-reviews, sof, eae+blinkwatch, blink-reviews-dom_chromium.org, dglazkov+blink, groby+blinkspell_chromium.org, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

reset VisibleSelection at the Undo command. Sice UndoManager doesn't manage DOM mutations outside of execCommand, the Undo command sometimes set broken VisibleSelection which is valid when it was recorded to the Undo steps but selection.deleteFromDocument broke that in this test case. This CL validates VisibleSelection when it is used to restore Selection at Undo. The main target VisibleSelection to be validate is that has any VisiblePosition which is not in the document already or which offset violates its nodes length because of "Unmagaed" DOM mutations. BUG=369759 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=175647

Patch Set 1 #

Total comments: 7

Patch Set 2 : Add the VisibleSelection::validateIfNeeded method #

Unified diffs Side-by-side diffs Delta from patch set Stats (+60 lines, -30 lines) Patch
A + LayoutTests/editing/undo/crash-delete-from-document.html View 1 chunk +10 lines, -7 lines 0 comments Download
A + LayoutTests/editing/undo/crash-delete-from-document-expected.txt View 1 0 chunks +-1 lines, --1 lines 0 comments Download
M Source/core/dom/Node.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/dom/Node.cpp View 1 1 chunk +22 lines, -0 lines 0 comments Download
M Source/core/dom/Range.cpp View 1 3 chunks +2 lines, -24 lines 0 comments Download
M Source/core/editing/Editor.cpp View 1 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/editing/VisibleSelection.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/editing/VisibleSelection.cpp View 1 1 chunk +22 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
yoichio
6 years, 6 months ago (2014-06-03 08:44:44 UTC) #1
yosin_UTC9
https://codereview.chromium.org/315493004/diff/1/Source/core/editing/Editor.cpp File Source/core/editing/Editor.cpp (right): https://codereview.chromium.org/315493004/diff/1/Source/core/editing/Editor.cpp#newcode738 Source/core/editing/Editor.cpp:738: newSelection = VisibleSelection(newSelection.base(), newSelection.extent(), newSelection.affinity(), newSelection.isDirectional()); Q: Why do ...
6 years, 6 months ago (2014-06-04 01:17:30 UTC) #2
yoichio
https://codereview.chromium.org/315493004/diff/1/Source/core/editing/Editor.cpp File Source/core/editing/Editor.cpp (right): https://codereview.chromium.org/315493004/diff/1/Source/core/editing/Editor.cpp#newcode738 Source/core/editing/Editor.cpp:738: newSelection = VisibleSelection(newSelection.base(), newSelection.extent(), newSelection.affinity(), newSelection.isDirectional()); On 2014/06/04 01:17:30, ...
6 years, 6 months ago (2014-06-04 02:01:46 UTC) #3
yosin_UTC9
https://codereview.chromium.org/315493004/diff/1/Source/core/editing/Editor.cpp File Source/core/editing/Editor.cpp (right): https://codereview.chromium.org/315493004/diff/1/Source/core/editing/Editor.cpp#newcode738 Source/core/editing/Editor.cpp:738: newSelection = VisibleSelection(newSelection.base(), newSelection.extent(), newSelection.affinity(), newSelection.isDirectional()); On 2014/06/04 02:01:46, ...
6 years, 6 months ago (2014-06-04 02:20:58 UTC) #4
yoichio
ping?
6 years, 6 months ago (2014-06-05 03:02:15 UTC) #5
Yuta Kitamura
https://codereview.chromium.org/315493004/diff/1/Source/core/dom/Range.cpp File Source/core/dom/Range.cpp (right): https://codereview.chromium.org/315493004/diff/1/Source/core/dom/Range.cpp#newcode551 Source/core/dom/Range.cpp:551: unsigned Range::lengthOfContentsInNode(const Node* node) I don't think this function ...
6 years, 6 months ago (2014-06-05 08:37:55 UTC) #6
yoichio
https://codereview.chromium.org/315493004/diff/1/Source/core/dom/Range.cpp File Source/core/dom/Range.cpp (right): https://codereview.chromium.org/315493004/diff/1/Source/core/dom/Range.cpp#newcode551 Source/core/dom/Range.cpp:551: unsigned Range::lengthOfContentsInNode(const Node* node) On 2014/06/05 08:37:55, Yuta Kitamura ...
6 years, 6 months ago (2014-06-06 04:49:22 UTC) #7
yosin_UTC9
Just FYI. On 2014/06/06 04:49:22, yoichio wrote: > VisibleSelection is a DISALLOW_ALLOCATION class. It means ...
6 years, 6 months ago (2014-06-06 05:02:07 UTC) #8
Yuta Kitamura
lgtm
6 years, 6 months ago (2014-06-06 08:53:14 UTC) #9
yoichio
The CQ bit was checked by yoichio@chromium.org
6 years, 6 months ago (2014-06-06 08:54:12 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/yoichio@chromium.org/315493004/20001
6 years, 6 months ago (2014-06-06 08:55:20 UTC) #11
commit-bot: I haz the power
6 years, 6 months ago (2014-06-06 08:59:29 UTC) #12
Message was sent while issue was closed.
Change committed as 175647

Powered by Google App Engine
This is Rietveld 408576698