DescriptionReland of "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 CL is a relanding of https://codereview.chromium.org/2110543008 with
the following change:
A new function |UndoStack::clear| is introduced and called in |Editor::clear|.
In this way the leak reported by crbug.com/625736 is not reintroduced.
BUG=349272, 549334
TEST=editing/undo/undo-iframe-location-change.html
Committed: https://crrev.com/512508f0d652a006407ce66aafcd339b296a5276
Cr-Commit-Position: refs/heads/master@{#403871}
Patch Set 1 #
Total comments: 2
Patch Set 2 : Hide UndoStack::clear in Editor::clear #Messages
Total messages: 16 (5 generated)
|