Fire XBL constructors asynchronously after binding attachment, unless we're in

the middle of an update. In that case, fire them at the end of the update.
Bugs 267833, 373756, 394676, 394014.  r+sr=sicking, a=dveditz


git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@236965 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2007-10-01 02:46:15 +00:00
parent 7b0c9ab404
commit c82427eb24
10 changed files with 195 additions and 30 deletions

View File

@@ -8901,9 +8901,6 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer,
}
}
// We built some new frames. Initialize any newly-constructed bindings.
mDocument->BindingManager()->ProcessAttachedQueue();
// process the current pseudo frame state
if (!state.mPseudoFrames.IsEmpty()) {
ProcessPseudoFrames(state, frameItems);
@@ -9334,8 +9331,6 @@ nsCSSFrameConstructor::ContentInserted(nsIContent* aContainer,
#endif
}
mDocument->BindingManager()->ProcessAttachedQueue();
// otherwise this is not a child of the root element, and we
// won't let it have a frame.
return NS_OK;
@@ -9577,10 +9572,6 @@ nsCSSFrameConstructor::ContentInserted(nsIContent* aContainer,
}
}
// Now that we've created frames, run the attach queue.
//XXXwaterson should we do this after we've processed pseudos, too?
mDocument->BindingManager()->ProcessAttachedQueue();
// process the current pseudo frame state
if (!state.mPseudoFrames.IsEmpty())
ProcessPseudoFrames(state, frameItems);
@@ -13216,8 +13207,6 @@ nsCSSFrameConstructor::CreateListBoxContent(nsPresContext* aPresContext,
*aNewFrame = newFrame;
if (NS_SUCCEEDED(rv) && (nsnull != newFrame)) {
mDocument->BindingManager()->ProcessAttachedQueue();
// Notify the parent frame
if (aIsAppend)
rv = ((nsListBoxBodyFrame*)aParentFrame)->ListBoxAppendFrames(newFrame);
@@ -14234,11 +14223,11 @@ nsCSSFrameConstructor::ProcessPendingRestyles()
currentRestyle->mChangeHint);
}
delete [] restylesToProcess;
EndUpdate();
viewManager->EndUpdateViewBatch(NS_VMREFRESH_NO_SYNC);
delete [] restylesToProcess;
}
void
@@ -14283,7 +14272,7 @@ nsCSSFrameConstructor::PostRestyleEvent(nsIContent* aContent,
void nsCSSFrameConstructor::RestyleEvent::HandleEvent() {
nsCSSFrameConstructor* constructor =
NS_STATIC_CAST(nsCSSFrameConstructor*, owner);
nsIViewManager* viewManager =
nsCOMPtr<nsIViewManager> viewManager =
constructor->mDocument->GetShellAt(0)->GetPresContext()->GetViewManager();
NS_ASSERTION(viewManager, "Must have view manager for update");
@@ -14299,6 +14288,7 @@ void nsCSSFrameConstructor::RestyleEvent::HandleEvent() {
constructor->mRestyleEventQueue = nsnull;
constructor->ProcessPendingRestyles();
constructor->mDocument->BindingManager()->ProcessAttachedQueue();
viewManager->EndUpdateViewBatch(NS_VMREFRESH_NO_SYNC);
}