mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:18:48 +00:00
applied bug1362924.diff
This commit is contained in:
+24
-16
@@ -1822,6 +1822,24 @@ PresShell::EndObservingDocument()
|
||||
char* nsPresShell_ReflowStackPointerTop;
|
||||
#endif
|
||||
|
||||
class XBLConstructorRunner : public nsRunnable
|
||||
{
|
||||
public:
|
||||
explicit XBLConstructorRunner(nsIDocument* aDocument)
|
||||
: mDocument(aDocument)
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHOD Run() override
|
||||
{
|
||||
mDocument->BindingManager()->ProcessAttachedQueue();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsIDocument> mDocument;
|
||||
};
|
||||
|
||||
nsresult
|
||||
PresShell::Initialize(nscoord aWidth, nscoord aHeight)
|
||||
{
|
||||
@@ -1919,24 +1937,14 @@ PresShell::Initialize(nscoord aWidth, nscoord aHeight)
|
||||
mFrameConstructor->EndUpdate();
|
||||
}
|
||||
|
||||
// nsAutoScriptBlocker going out of scope may have killed us too
|
||||
// nsAutoCauseReflowNotifier (which sets up a script blocker) going out of
|
||||
// scope may have killed us too
|
||||
NS_ENSURE_STATE(!mHaveShutDown);
|
||||
|
||||
// Run the XBL binding constructors for any new frames we've constructed
|
||||
mDocument->BindingManager()->ProcessAttachedQueue();
|
||||
|
||||
// Constructors may have killed us too
|
||||
NS_ENSURE_STATE(!mHaveShutDown);
|
||||
|
||||
// Now flush out pending restyles before we actually reflow, in
|
||||
// case XBL constructors changed styles somewhere.
|
||||
{
|
||||
nsAutoScriptBlocker scriptBlocker;
|
||||
mPresContext->RestyleManager()->ProcessPendingRestyles();
|
||||
}
|
||||
|
||||
// And that might have run _more_ XBL constructors
|
||||
NS_ENSURE_STATE(!mHaveShutDown);
|
||||
// Run the XBL binding constructors for any new frames we've constructed.
|
||||
// (Do this in a script runner, since our caller might have a script
|
||||
// blocker on the stack.)
|
||||
nsContentUtils::AddScriptRunner(new XBLConstructorRunner(mDocument));
|
||||
}
|
||||
|
||||
NS_ASSERTION(rootFrame, "How did that happen?");
|
||||
|
||||
Reference in New Issue
Block a user