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

Issue 2110543008: Move UndoStack from Page to Editor (Closed)

Created:
4 years, 5 months ago by Xiaocheng
Modified:
4 years, 5 months ago
Reviewers:
tkent, yosin_UTC9
CC:
blink-reviews, chromium-reviews, gavinp+loader_chromium.org, Nate Chapin, loading-reviews_chromium.org, tyoshino+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Move UndoStack from Page to Editor Blink currently maintains per-page undo stacks, leading to: - Security risks. A frame can directly manipulate content of another frame by running document.execCommand('undo'), allowing Javascript to bypass frame and even origin boundaries. - Inconsistent behaviors. Without OOPIF, all changes in a page can be undone by repeatedly invoking keyboard undo (CTRL+Z); With OOPIF, only those changes in the focused frame and its same-origin frames can be undone. Redos have analogous defects. This patch changes UndoStack from per-page to per-frame, so that undos and redos are consistently resolved by the frame where script is run or which gets focused. This patch also removes |UndoStack::didUnloadFrame()| since its only purpose is to filter out the undo steps for a particular frame, which no longer makes sense after undo stacks are made per-frame. BUG=349272, 549334 TEST=editing/undo/undo-iframe-location-change.html Committed: https://crrev.com/6447f384cf6d95f70475798e3fd45b689316ce50 Cr-Commit-Position: refs/heads/master@{#403653}

Patch Set 1 #

Patch Set 2 : Fix layout test #

Total comments: 8

Patch Set 3 : Address comments and rewrite test #

Total comments: 4

Patch Set 4 : Use |const Member| and add notes to UndoStack class #

Unified diffs Side-by-side diffs Delta from patch set Stats (+34 lines, -103 lines) Patch
M third_party/WebKit/LayoutTests/editing/undo/undo-iframe-location-change.html View 1 2 2 chunks +22 lines, -43 lines 0 comments Download
D third_party/WebKit/LayoutTests/editing/undo/undo-iframe-location-change-expected.txt View 1 2 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/editing/Editor.h View 1 2 3 2 chunks +1 line, -2 lines 0 comments Download
M third_party/WebKit/Source/core/editing/Editor.cpp View 1 2 7 chunks +9 lines, -23 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/UndoStack.h View 1 2 3 3 chunks +2 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/UndoStack.cpp View 1 2 2 chunks +0 lines, -20 lines 0 comments Download
M third_party/WebKit/Source/core/loader/FrameLoader.cpp View 1 2 2 chunks +0 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/page/Page.h View 3 chunks +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/page/Page.cpp View 3 chunks +0 lines, -3 lines 0 comments Download

Messages

Total messages: 21 (9 generated)
Xiaocheng
PTAL. Thanks. I also have some questions about the usage of the undo stack after ...
4 years, 5 months ago (2016-07-01 08:49:36 UTC) #3
yosin_UTC9
https://codereview.chromium.org/2110543008/diff/20001/third_party/WebKit/LayoutTests/editing/undo/undo-iframe-location-change.html File third_party/WebKit/LayoutTests/editing/undo/undo-iframe-location-change.html (right): https://codereview.chromium.org/2110543008/diff/20001/third_party/WebKit/LayoutTests/editing/undo/undo-iframe-location-change.html#newcode12 third_party/WebKit/LayoutTests/editing/undo/undo-iframe-location-change.html:12: function part1() { Optional: Could you convert this test ...
4 years, 5 months ago (2016-07-01 09:21:22 UTC) #5
Xiaocheng
PTAL at Patch 3. |UndoStack::didUnloadFrame()| is completely removed since it doesn't do any useful work ...
4 years, 5 months ago (2016-07-04 06:29:23 UTC) #9
yosin_UTC9
lgtm w/ small nit Thanks for converting test! Good job! (^_^)b https://codereview.chromium.org/2110543008/diff/40001/third_party/WebKit/Source/core/editing/Editor.h File third_party/WebKit/Source/core/editing/Editor.h (right): ...
4 years, 5 months ago (2016-07-04 07:27:41 UTC) #10
tkent
lgtm https://codereview.chromium.org/2110543008/diff/40001/third_party/WebKit/Source/core/editing/commands/UndoStack.h File third_party/WebKit/Source/core/editing/commands/UndoStack.h (right): https://codereview.chromium.org/2110543008/diff/40001/third_party/WebKit/Source/core/editing/commands/UndoStack.h#newcode43 third_party/WebKit/Source/core/editing/commands/UndoStack.h:43: class UndoStack final : public GarbageCollected<UndoStack> { Please ...
4 years, 5 months ago (2016-07-04 07:44:36 UTC) #11
Xiaocheng
Thanks for the review! I'm going ahead to commit since all comments are addressed. https://codereview.chromium.org/2110543008/diff/40001/third_party/WebKit/Source/core/editing/Editor.h ...
4 years, 5 months ago (2016-07-04 08:03:37 UTC) #13
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/2110543008/60001
4 years, 5 months ago (2016-07-04 08:03:47 UTC) #15
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 5 months ago (2016-07-04 09:16:58 UTC) #16
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-07-04 09:17:04 UTC) #17
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/6447f384cf6d95f70475798e3fd45b689316ce50 Cr-Commit-Position: refs/heads/master@{#403653}
4 years, 5 months ago (2016-07-04 09:18:25 UTC) #19
Kunihiko Sakamoto
A revert of this CL (patchset #4 id:60001) has been created in https://codereview.chromium.org/2127463002/ by ksakamoto@chromium.org. ...
4 years, 5 months ago (2016-07-05 05:01:01 UTC) #20
tkent
4 years, 5 months ago (2016-07-05 08:17:55 UTC) #21

Powered by Google App Engine
This is Rietveld 408576698