mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 12:35:58 +00:00
bug 179621: Inspector should use Editor's TransactionManager model: Phase One amendment patch
patch by Alex Vincent <ajvincent@gmail.com> r=timeless sr=roc
This commit is contained in:
parent
e0e44d1781
commit
0375dee12c
@ -147,31 +147,23 @@ function nodeTypeToText (nodeType)
|
||||
return nodeType;
|
||||
}
|
||||
|
||||
// Functions for converting Inspector-style command constructors to nsITransaction constructors
|
||||
function ConvertCommandToTxn(constructor) {
|
||||
constructor.prototype.doTransaction = constructor.prototype.doCommand;
|
||||
constructor.prototype.undoTransaction = constructor.prototype.undoCommand;
|
||||
constructor.prototype.redoTransaction = constructor.prototype.doCommand;
|
||||
constructor.prototype.merge = ConvertCommandToTxn.txnMerge;
|
||||
constructor.prototype.QueryInterface = ConvertCommandToTxn.txnQueryInterface;
|
||||
// ::::::: nsITransaction helper functions :::::::
|
||||
|
||||
if (arguments.length > 1) {
|
||||
constructor.prototype.txnType = arguments[1];
|
||||
} else {
|
||||
constructor.prototype.txnType = "standard";
|
||||
}
|
||||
if (arguments.length > 2) {
|
||||
constructor.prototype.isTransient = arguments[2];
|
||||
} else {
|
||||
constructor.prototype.isTransient = false;
|
||||
}
|
||||
}
|
||||
ConvertCommandToTxn.txnQueryInterface = function(theUID, theResult) {
|
||||
if (theUID == Components.interfaces.nsITransaction || theUID == Components.interfaces.nsISupports) {
|
||||
function txnQueryInterface(theUID, theResult)
|
||||
{
|
||||
const nsITransaction = Components.interfaces.nsITransaction;
|
||||
const nsISupports = Components.interfaces.nsISupports;
|
||||
if (theUID == nsITransaction || theUID == nsISupports) {
|
||||
return this;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
ConvertCommandToTxn.txnMerge = function() {
|
||||
|
||||
function txnMerge()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
function txnRedoTransaction() {
|
||||
this.doTransaction();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user