mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-01 13:57:32 +00:00
Bug 486848. Don't clobber |result| until we're done using it. r+sr=roc
This commit is contained in:
parent
b815eff029
commit
c5b13dc8d7
12
layout/reftests/bugs/486848-1-ref.xul
Normal file
12
layout/reftests/bugs/486848-1-ref.xul
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<listbox id="listbox">
|
||||
<listitem id="a">a</listitem>
|
||||
<listitem>b</listitem>
|
||||
<listitem id="c">c</listitem>
|
||||
</listbox>
|
||||
|
||||
</window>
|
25
layout/reftests/bugs/486848-1.xul
Normal file
25
layout/reftests/bugs/486848-1.xul
Normal file
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="boom();">
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function boom()
|
||||
{
|
||||
var c = document.getElementById("c");
|
||||
var n = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "listitem");
|
||||
n.textContent = "b";
|
||||
c.parentNode.insertBefore(n, c);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<listbox id="listbox">
|
||||
<listitem id="a">a</listitem>
|
||||
<listitem id="c">c</listitem>
|
||||
</listbox>
|
||||
|
||||
</window>
|
@ -1132,3 +1132,4 @@ fails == 461512-1.html 461512-1-ref.html # Bug 461512
|
||||
== 486052-2e.html 486052-2-ref.html
|
||||
== 486052-2f.html 486052-2-ref.html
|
||||
== 486052-2g.html 486052-2-ref.html
|
||||
== 486848-1.xul 486848-1-ref.xul
|
||||
|
@ -1209,9 +1209,10 @@ nsListBoxBodyFrame::GetNextItemBox(nsIBox* aBox, PRInt32 aOffset,
|
||||
nsIContent *nextContent = parentContent->GetChildAt(i + aOffset + 1);
|
||||
|
||||
nsPresContext* presContext = PresContext();
|
||||
result = presContext->GetPresShell()->GetPrimaryFrameFor(nextContent);
|
||||
nsIFrame* existingFrame =
|
||||
presContext->GetPresShell()->GetPrimaryFrameFor(nextContent);
|
||||
|
||||
if (!result) {
|
||||
if (!existingFrame) {
|
||||
// Either append the new frame, or insert it after the current frame
|
||||
PRBool isAppend = result != mLinkupFrame && mRowsToPrepend <= 0;
|
||||
nsIFrame* prevFrame = isAppend ? nsnull : aBox;
|
||||
@ -1225,6 +1226,8 @@ nsListBoxBodyFrame::GetNextItemBox(nsIBox* aBox, PRInt32 aOffset,
|
||||
*aCreated = PR_TRUE;
|
||||
} else
|
||||
return GetNextItemBox(aBox, ++aOffset, aCreated);
|
||||
} else {
|
||||
result = existingFrame;
|
||||
}
|
||||
|
||||
mLinkupFrame = nsnull;
|
||||
|
Loading…
x
Reference in New Issue
Block a user