WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
12461
Need API to clear WebView's undo actions from undo manager
https://bugs.webkit.org/show_bug.cgi?id=12461
Summary
Need API to clear WebView's undo actions from undo manager
Jim Correia
Reported
2007-01-29 11:01:13 PST
Please provide a public API on WebView which let's me clear all undo actions associated with the web view. Consider this usage model: A view controller (not NSViewController based since this code targets 10.4) inserts a web view into a window. The web view shares the undo manager with other views in the window (via -windowWillReturnUndoManager:) and is not being used in bindings mode. After some user edits, a) the data is committed back to the model object and b) the view is removed from the window. After (a) it is desirable to remove the web view's undo actions from the undo manager. After (b) it is required that I remove the actions. If I don't, you'll crash later on when choosing undo. You can reproduce this in the attached sample: Build/Run. Type in the web view. Click "Remove Web View". Choose "Undo" from the edit menu. Note: it appears that loading a new string/request into the web view clears the undo actions today. But The action gets cleared when the load is complete (on a runloop callback) and by that time it is too late, since I've already removed the view from the window, and therefore it can no longer locate its undo manager.
Attachments
Test case described in bug body.
(26.29 KB, application/zip)
2007-01-29 11:02 PST
,
Jim Correia
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Jim Correia
Comment 1
2007-01-29 11:02:13 PST
Created
attachment 12746
[details]
Test case described in bug body.
David Kilzer (:ddkilzer)
Comment 2
2007-01-29 12:09:57 PST
This is a dumb question, but can't you just create a new undo manager to "clear" the undo history? How is this bug related to
Bug 12462
?
Jim Correia
Comment 3
2007-01-29 12:24:41 PST
(In reply to
comment #2
)
> This is a dumb question, but can't you just create a new undo manager to > "clear" the undo history? > > How is this bug related to
Bug 12462
?
The bug isn't related to 12462 as they solve different problems. (I answered in more detail there.) I can't just create a new undo manager to clear the history because the undo manager is associated with the window, and other views and model objects may have registered actions with the undo manager which need to persist. This is not unlike NSTextView when used as a field editor or in bindings mode. (Though it does this through an SPI, which presents a similar problem, but that one is logged in radar.)
David Kilzer (:ddkilzer)
Comment 4
2007-01-29 12:38:46 PST
(In reply to
comment #3
)
> This is not unlike NSTextView when used as a field editor or in bindings mode. > (Though it does this through an SPI, which presents a similar problem, but that > one is logged in radar.)
Please note the Radar bug number here (in the form <
rdar://problem/NNNNNNN
>) in case an Apple engineer wants to review it in conjunction with this bug.
Jim Correia
Comment 5
2007-01-29 13:00:17 PST
(In reply to
comment #4
)
> Please note the Radar bug number here (in the form <
rdar://problem/NNNNNNN
>) in > case an Apple engineer wants to review it in conjunction with this bug.
rdar://problem/4961133
It is a similar API request for NSTextView
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug