зеркало из https://github.com/mozilla/pjs.git
Bug 495728 - "###!!! ASSERTION: destroy called on frame while scripts not blocked: '!nsContentUtils::IsSafeToRunScript()', file /Users/bzbarsky/mozilla/vanilla/mozilla/layout/generic/nsFrame.cpp, line 446." r+sr=bzbarsky
This commit is contained in:
Родитель
35fe46fc67
Коммит
c038a893da
|
@ -69,6 +69,7 @@
|
|||
#include "nsTArray.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsContentUtils.h"
|
||||
|
||||
class nsImageLoader;
|
||||
#ifdef IBMBIDI
|
||||
|
@ -1088,6 +1089,8 @@ struct nsAutoLayoutPhase {
|
|||
// Once bug 337957 is fixed this should become an NS_ASSERTION
|
||||
NS_WARN_IF_FALSE(mPresContext->mLayoutPhaseCount[eLayoutPhase_FrameC] == 0,
|
||||
"recurring into frame construction");
|
||||
NS_ASSERTION(!nsContentUtils::IsSafeToRunScript(),
|
||||
"constructing frames and scripts are not blocked");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -0,0 +1,239 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
|
||||
<window id="list-testcase" title="Testcase"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
class="reftest-wait">
|
||||
|
||||
<script>
|
||||
function scrollup() {
|
||||
var list = document.getElementById('list');
|
||||
var firstindex = list.getIndexOfItem(document.getElementById('first'));
|
||||
list.ensureIndexIsVisible(firstindex);
|
||||
setTimeout("document.documentElement.removeAttribute('class')",1);
|
||||
}
|
||||
|
||||
function scrolldown() {
|
||||
var list = document.getElementById('list');
|
||||
var lastindex = list.getIndexOfItem(document.getElementById('last'));
|
||||
list.ensureIndexIsVisible(lastindex);
|
||||
setTimeout("scrollup()",1);
|
||||
}
|
||||
|
||||
window.addEventListener("load", scrolldown, false);
|
||||
</script>
|
||||
|
||||
<listbox id="list">
|
||||
<listitem label="Item x" id="first"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x"/>
|
||||
<listitem label="Item x" id="last"/>
|
||||
</listbox>
|
||||
|
||||
</window>
|
|
@ -50,3 +50,4 @@ load 467481-1.xul
|
|||
load 470063-1.html
|
||||
load 472189.xul
|
||||
load 475133.html
|
||||
load 495728-1.xul
|
||||
|
|
|
@ -816,9 +816,15 @@ nsListBoxBodyFrame::ScrollToIndex(PRInt32 aRowIndex)
|
|||
|
||||
mCurrentIndex = newIndex;
|
||||
|
||||
nsWeakFrame weak(this);
|
||||
|
||||
// Since we're going to flush anyway, we need to not do this off an event
|
||||
DoInternalPositionChangedSync(up, delta);
|
||||
|
||||
if (!weak.IsAlive()) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// This change has to happen immediately.
|
||||
// Flush any pending reflow commands.
|
||||
// XXXbz why, exactly?
|
||||
|
@ -869,7 +875,9 @@ nsListBoxBodyFrame::DoInternalPositionChangedSync(PRBool aUp, PRInt32 aDelta)
|
|||
nsTArray< nsRefPtr<nsPositionChangedEvent> > temp;
|
||||
temp.SwapElements(mPendingPositionChangeEvents);
|
||||
for (PRUint32 i = 0; i < temp.Length(); ++i) {
|
||||
if (weak.IsAlive()) {
|
||||
temp[i]->Run();
|
||||
}
|
||||
temp[i]->Revoke();
|
||||
}
|
||||
|
||||
|
@ -886,6 +894,8 @@ nsListBoxBodyFrame::DoInternalPositionChanged(PRBool aUp, PRInt32 aDelta)
|
|||
if (aDelta == 0)
|
||||
return NS_OK;
|
||||
|
||||
nsAutoScriptBlocker scriptBlocker;
|
||||
|
||||
nsPresContext *presContext = PresContext();
|
||||
nsBoxLayoutState state(presContext);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче