зеркало из https://github.com/mozilla/gecko-dev.git
Bug 771639 - Handle null current node in nsRange.cpp's ValidateCurrentNode; r=smaug
This commit is contained in:
Родитель
e942dd1c94
Коммит
f4113550e3
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<script>
|
||||
var root = document.documentElement;
|
||||
while(root.firstChild) { root.removeChild(root.firstChild); }
|
||||
var div = document.createElement("div");
|
||||
root.appendChild(div);
|
||||
|
||||
document.addEventListener("DOMNodeRemoved", function() {
|
||||
root.appendChild(document.createTextNode("some mutation"));
|
||||
}, false);
|
||||
|
||||
var range = document.createRange();
|
||||
range.setStart(root, 0);
|
||||
range.setEnd(root, root.childNodes.length);
|
||||
range.deleteContents();
|
||||
</script>
|
|
@ -109,6 +109,7 @@ load 713417-2.html
|
|||
load 715056.html
|
||||
load 741163-1.html
|
||||
load 766426.html
|
||||
load 771639.html
|
||||
asserts(0-1) load 752226-1.html
|
||||
asserts(0-1) load 752226-2.html
|
||||
HTTP(..) load xhr_abortinprogress.html
|
||||
|
|
|
@ -1453,6 +1453,11 @@ ValidateCurrentNode(nsRange* aRange, RangeSubtreeIterator& aIter)
|
|||
{
|
||||
bool before, after;
|
||||
nsCOMPtr<nsIDOMNode> domNode = aIter.GetCurrentNode();
|
||||
if (!domNode) {
|
||||
// We don't have to worry that the node was removed if it doesn't exist,
|
||||
// e.g., the iterator is done.
|
||||
return true;
|
||||
}
|
||||
nsCOMPtr<nsINode> node = do_QueryInterface(domNode);
|
||||
MOZ_ASSERT(node);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче