mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 771639 - Handle null current node in nsRange.cpp's ValidateCurrentNode; r=smaug
This commit is contained in:
parent
7462df8b36
commit
9f8028c3c1
16
content/base/crashtests/771639.html
Normal file
16
content/base/crashtests/771639.html
Normal file
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user