mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 776323 part 1 - Fix crash due to silly logic error in nsSelectionState::SaveSelection; r=ehsan
This commit is contained in:
parent
f35c6c9667
commit
a80cb9b3a2
18
editor/libeditor/base/crashtests/776323.html
Normal file
18
editor/libeditor/base/crashtests/776323.html
Normal file
@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<html contenteditable="true">
|
||||
<head>
|
||||
<script>
|
||||
|
||||
function boom()
|
||||
{
|
||||
document.execCommand("inserthtml", false, "b");
|
||||
var myrange = document.createRange();
|
||||
myrange.selectNodeContents(document.getElementsByTagName("img")[0]);
|
||||
window.getSelection().addRange(myrange);
|
||||
document.execCommand("strikethrough", false, null);
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body onload="boom();"><img></body>
|
||||
</html>
|
@ -17,3 +17,4 @@ load 766845.xhtml
|
||||
load 768765.html
|
||||
needs-focus load 771749.html
|
||||
load 772282.html
|
||||
load 776323.html
|
||||
|
@ -57,9 +57,7 @@ nsSelectionState::SaveSelection(nsISelection *aSel)
|
||||
// if we need more items in the array, new them
|
||||
if (arrayCount<rangeCount)
|
||||
{
|
||||
PRInt32 count = rangeCount-arrayCount;
|
||||
for (i=0; i<count; i++)
|
||||
{
|
||||
for (i = arrayCount; i < rangeCount; i++) {
|
||||
mArray.AppendElement();
|
||||
mArray[i] = new nsRangeStore();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user