зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset e3b15fe52734 (bug 1265800) for failing added wpt /XMLHttpRequest/event-error.html. r=backout
This commit is contained in:
Родитель
9df7aba907
Коммит
6568eeec5b
|
@ -2294,11 +2294,24 @@ HTMLEditRules::WillDeleteSelection(Selection* aSelection,
|
||||||
NS_ENSURE_STATE(mHTMLEditor);
|
NS_ENSURE_STATE(mHTMLEditor);
|
||||||
if (leftBlockParent == rightBlockParent &&
|
if (leftBlockParent == rightBlockParent &&
|
||||||
mHTMLEditor->NodesSameType(GetAsDOMNode(leftParent),
|
mHTMLEditor->NodesSameType(GetAsDOMNode(leftParent),
|
||||||
GetAsDOMNode(rightParent)) &&
|
GetAsDOMNode(rightParent))) {
|
||||||
// XXX What's special about these three types of block?
|
if (leftParent->IsHTMLElement(nsGkAtoms::p)) {
|
||||||
(leftParent->IsHTMLElement(nsGkAtoms::p) ||
|
// First delete the selection
|
||||||
HTMLEditUtils::IsListItem(leftParent) ||
|
NS_ENSURE_STATE(mHTMLEditor);
|
||||||
HTMLEditUtils::IsHeader(*leftParent))) {
|
res = mHTMLEditor->DeleteSelectionImpl(aAction, aStripWrappers);
|
||||||
|
NS_ENSURE_SUCCESS(res, res);
|
||||||
|
// Then join paragraphs, insert break
|
||||||
|
NS_ENSURE_STATE(mHTMLEditor);
|
||||||
|
EditorDOMPoint pt =
|
||||||
|
mHTMLEditor->JoinNodeDeep(*leftParent, *rightParent);
|
||||||
|
NS_ENSURE_STATE(pt.node);
|
||||||
|
// Fix up selection
|
||||||
|
res = aSelection->Collapse(pt.node, pt.offset);
|
||||||
|
NS_ENSURE_SUCCESS(res, res);
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
if (HTMLEditUtils::IsListItem(leftParent) ||
|
||||||
|
HTMLEditUtils::IsHeader(*leftParent)) {
|
||||||
// First delete the selection
|
// First delete the selection
|
||||||
NS_ENSURE_STATE(mHTMLEditor);
|
NS_ENSURE_STATE(mHTMLEditor);
|
||||||
res = mHTMLEditor->DeleteSelectionImpl(aAction, aStripWrappers);
|
res = mHTMLEditor->DeleteSelectionImpl(aAction, aStripWrappers);
|
||||||
|
@ -2313,6 +2326,7 @@ HTMLEditRules::WillDeleteSelection(Selection* aSelection,
|
||||||
NS_ENSURE_SUCCESS(res, res);
|
NS_ENSURE_SUCCESS(res, res);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Else blocks not same type, or not siblings. Delete everything
|
// Else blocks not same type, or not siblings. Delete everything
|
||||||
// except table elements.
|
// except table elements.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче