зеркало из https://github.com/mozilla/pjs.git
Bug 615015 - "ASSERTION: bad action nesting!"; r,a=roc
--HG-- extra : rebase_source : 3e972a7f5dad81b5cba1b8ee93c16798fdc809c2
This commit is contained in:
Родитель
d46f1e8477
Коммит
a340167558
|
@ -117,16 +117,21 @@ NS_IMETHODIMP SplitElementTxn::DoTransaction(void)
|
|||
|
||||
// insert the new node
|
||||
result = mEditor->SplitNodeImpl(mExistingRightNode, mOffset, mNewLeftNode, mParent);
|
||||
if (NS_SUCCEEDED(result) && mNewLeftNode)
|
||||
{
|
||||
nsCOMPtr<nsISelection>selection;
|
||||
mEditor->GetSelection(getter_AddRefs(selection));
|
||||
NS_ENSURE_SUCCESS(result, result);
|
||||
NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
|
||||
result = selection->Collapse(mNewLeftNode, mOffset);
|
||||
}
|
||||
else {
|
||||
result = NS_ERROR_NOT_IMPLEMENTED;
|
||||
if (mNewLeftNode) {
|
||||
PRBool bAdjustSelection;
|
||||
mEditor->ShouldTxnSetSelection(&bAdjustSelection);
|
||||
if (bAdjustSelection)
|
||||
{
|
||||
nsCOMPtr<nsISelection> selection;
|
||||
result = mEditor->GetSelection(getter_AddRefs(selection));
|
||||
NS_ENSURE_SUCCESS(result, result);
|
||||
NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
|
||||
result = selection->Collapse(mNewLeftNode, mOffset);
|
||||
}
|
||||
else
|
||||
{
|
||||
// do nothing - dom range gravity will adjust selection
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script>
|
||||
|
||||
function boom()
|
||||
{
|
||||
document.getElementById("j").focus();
|
||||
try {
|
||||
document.execCommand("insertunorderedlist", false, null);
|
||||
} catch(e) { }
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body onload="boom();"><span><span contenteditable id="j"></span>T</span></body>
|
||||
</html>
|
|
@ -19,4 +19,5 @@ load 535632-1.xhtml
|
|||
load 574558-1.xhtml
|
||||
load 582138-1.xhtml
|
||||
load 612565-1.html
|
||||
load 615015-1.html
|
||||
load 615450-1.html
|
||||
|
|
|
@ -6055,10 +6055,15 @@ nsHTMLEditRules::GetListActionNodes(nsCOMArray<nsIDOMNode> &outArrayOfNodes,
|
|||
// selection spans multiple lists but with no common list parent.
|
||||
if (outArrayOfNodes.Count()) return NS_OK;
|
||||
}
|
||||
|
||||
// contruct a list of nodes to act on.
|
||||
res = GetNodesFromSelection(selection, kMakeList, outArrayOfNodes, aDontTouchContent);
|
||||
NS_ENSURE_SUCCESS(res, res);
|
||||
|
||||
{
|
||||
// We don't like other people messing with our selection!
|
||||
nsAutoTxnsConserveSelection dontSpazMySelection(mHTMLEditor);
|
||||
|
||||
// contruct a list of nodes to act on.
|
||||
res = GetNodesFromSelection(selection, kMakeList, outArrayOfNodes, aDontTouchContent);
|
||||
NS_ENSURE_SUCCESS(res, res);
|
||||
}
|
||||
|
||||
// pre process our list of nodes...
|
||||
PRInt32 listCount = outArrayOfNodes.Count();
|
||||
|
|
Загрузка…
Ссылка в новой задаче