Backed out changeset 645cb4fbf390 (bug 842132) for build bustage.

This commit is contained in:
Ryan VanderMeulen 2013-02-18 11:12:16 -05:00
parent 7da38b2a1a
commit 10bb153b4f
4 changed files with 5 additions and 32 deletions

View File

@ -4566,7 +4566,8 @@ nsEditor::CreateTxnForDeleteSelection(EDirection aAction,
// allocate the out-param transaction
nsRefPtr<EditAggregateTxn> aggTxn = new EditAggregateTxn();
for (uint32_t rangeIdx = 0; rangeIdx < selection->GetRangeCount(); ++rangeIdx) {
uint32_t rangeCount = selection->GetRangeCount();
for (uint32_t rangeIdx = 0; rangeIdx < rangeCount; ++rangeIdx) {
nsRefPtr<nsRange> range = selection->GetRangeAt(rangeIdx);
NS_ENSURE_STATE(range);

View File

@ -1,27 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script>
function boom()
{
var e = document.body;
var sel = window.getSelection();
window.getSelection().removeAllRanges();
var r0 = document.createRange();
r0.setStart(e, 0);
r0.setEnd(e, 1);
window.getSelection().addRange(r0);
var r1 = document.createRange();
r1.setStart(e, 1);
r1.setEnd(e, 1);
window.getSelection().addRange(r1);
window.getSelection().deleteFromDocument();
}
</script>
</head>
<body onload="boom();" contenteditable="true">x</body>
</html>

View File

@ -428,4 +428,3 @@ test-pref(layout.css.flexbox.enabled,true) load 798235-1.html
test-pref(layout.css.flexbox.enabled,true) load 799207-1.html
asserts(12) test-pref(layout.css.flexbox.enabled,true) load 799207-2.html
test-pref(layout.css.flexbox.enabled,true) load 804089-1.xhtml
load 842132-1.html

View File

@ -2930,9 +2930,9 @@ nsFrameSelection::DeleteFromDocument()
return NS_OK;
}
nsRefPtr<mozilla::Selection> selection = mDomSelections[index];
for (uint32_t rangeIdx = 0; rangeIdx < selection->GetRangeCount(); ++rangeIdx) {
nsRefPtr<nsRange> range = selection->GetRangeAt(rangeIdx);
uint32_t rangeCount = mDomSelections[index]->GetRangeCount();
for (uint32_t rangeIdx = 0; rangeIdx < rangeCount; ++rangeIdx) {
nsRefPtr<nsRange> range = mDomSelections[index]->GetRangeAt(rangeIdx);
res = range->DeleteContents();
if (NS_FAILED(res))
return res;