Backed out changeset e3b15fe52734 (bug 1265800) for failing added wpt /XMLHttpRequest/event-error.html. r=backout

This commit is contained in:
Sebastian Hengst 2016-08-21 23:48:54 +02:00
Родитель 9df7aba907
Коммит 6568eeec5b
1 изменённых файлов: 19 добавлений и 5 удалений

Просмотреть файл

@ -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.