Fixes for 83027, 83892, and 80512. r/sr=blake,alecf,pink, sr=hewitt,blake, a=asa

This commit is contained in:
hyatt%netscape.com 2001-06-04 23:23:35 +00:00
Родитель 39d76ec4be
Коммит d5e373a2c8
7 изменённых файлов: 52 добавлений и 24 удалений

Просмотреть файл

@ -1408,27 +1408,29 @@ nsXBLPrototypeBinding::NotifyBoundElements()
nsCOMPtr<nsIDocument> doc; nsCOMPtr<nsIDocument> doc;
content->GetDocument(*getter_AddRefs(doc)); content->GetDocument(*getter_AddRefs(doc));
// Flush first if (doc) {
doc->FlushPendingNotifications(); // Flush first
doc->FlushPendingNotifications();
// Notify // Notify
nsCOMPtr<nsIContent> parent; nsCOMPtr<nsIContent> parent;
content->GetParent(*getter_AddRefs(parent)); content->GetParent(*getter_AddRefs(parent));
PRInt32 index = 0; PRInt32 index = 0;
if (parent) if (parent)
parent->IndexOf(content, index); parent->IndexOf(content, index);
nsCOMPtr<nsIPresShell> shell = getter_AddRefs(doc->GetShellAt(0)); nsCOMPtr<nsIPresShell> shell = getter_AddRefs(doc->GetShellAt(0));
if (shell) { if (shell) {
nsIFrame* childFrame; nsIFrame* childFrame;
shell->GetPrimaryFrameFor(content, &childFrame); shell->GetPrimaryFrameFor(content, &childFrame);
nsCOMPtr<nsIDocumentObserver> obs(do_QueryInterface(shell)); nsCOMPtr<nsIDocumentObserver> obs(do_QueryInterface(shell));
if (!childFrame) if (!childFrame)
obs->ContentInserted(doc, parent, content, index); obs->ContentInserted(doc, parent, content, index);
} }
// Flush again // Flush again
doc->FlushPendingNotifications(); doc->FlushPendingNotifications();
}
} }
} }

Просмотреть файл

@ -8495,6 +8495,16 @@ nsCSSFrameConstructor::ContentInserted(nsIPresContext* aPresContext,
nsIFrame* parentFrame = GetFrameFor(shell, aPresContext, aContainer); nsIFrame* parentFrame = GetFrameFor(shell, aPresContext, aContainer);
if (parentFrame) { if (parentFrame) {
// See if we have an XBL insertion point. If so, then see if the
// frame for it has been built yet. If it hasn't been built yet,
// then we just bail.
nsCOMPtr<nsIFrameManager> frameManager;
shell->GetFrameManager(getter_AddRefs(frameManager));
nsIFrame* insertionPoint = nsnull;
frameManager->GetInsertionPoint(shell, parentFrame, aChild, &insertionPoint);
if (!insertionPoint)
return NS_OK; // Don't build the frames.
// Find the frame that precedes the insertion point. // Find the frame that precedes the insertion point.
nsIFrame* prevSibling = (aIndexInContainer == -1) ? nsIFrame* prevSibling = (aIndexInContainer == -1) ?
FindPreviousAnonymousSibling(shell, aContainer, aChild) : FindPreviousAnonymousSibling(shell, aContainer, aChild) :

Просмотреть файл

@ -4456,7 +4456,8 @@ PresShell::UnsuppressAndInvalidate()
mDocument->GetScriptGlobalObject(getter_AddRefs(globalObject)); mDocument->GetScriptGlobalObject(getter_AddRefs(globalObject));
nsCOMPtr<nsPIDOMWindow> ourWindow = do_QueryInterface(globalObject); nsCOMPtr<nsPIDOMWindow> ourWindow = do_QueryInterface(globalObject);
nsCOMPtr<nsIFocusController> focusController; nsCOMPtr<nsIFocusController> focusController;
ourWindow->GetRootFocusController(getter_AddRefs(focusController)); if (ourWindow)
ourWindow->GetRootFocusController(getter_AddRefs(focusController));
if (focusController) if (focusController)
// Suppress focus. The act of tearing down the old content viewer // Suppress focus. The act of tearing down the old content viewer
// causes us to blur incorrectly. // causes us to blur incorrectly.
@ -4489,7 +4490,8 @@ PresShell::UnsuppressAndInvalidate()
((nsFrame*)rootFrame)->Invalidate(mPresContext, rect, PR_FALSE); ((nsFrame*)rootFrame)->Invalidate(mPresContext, rect, PR_FALSE);
} }
CheckForFocus(ourWindow, focusController, mDocument); if (ourWindow)
CheckForFocus(ourWindow, focusController, mDocument);
if (focusController) // Unsuppress now that we've shown the new window and focused it. if (focusController) // Unsuppress now that we've shown the new window and focused it.
focusController->SetSuppressFocus(PR_FALSE, "PresShell suppression on Web page loads"); focusController->SetSuppressFocus(PR_FALSE, "PresShell suppression on Web page loads");

Просмотреть файл

@ -4456,7 +4456,8 @@ PresShell::UnsuppressAndInvalidate()
mDocument->GetScriptGlobalObject(getter_AddRefs(globalObject)); mDocument->GetScriptGlobalObject(getter_AddRefs(globalObject));
nsCOMPtr<nsPIDOMWindow> ourWindow = do_QueryInterface(globalObject); nsCOMPtr<nsPIDOMWindow> ourWindow = do_QueryInterface(globalObject);
nsCOMPtr<nsIFocusController> focusController; nsCOMPtr<nsIFocusController> focusController;
ourWindow->GetRootFocusController(getter_AddRefs(focusController)); if (ourWindow)
ourWindow->GetRootFocusController(getter_AddRefs(focusController));
if (focusController) if (focusController)
// Suppress focus. The act of tearing down the old content viewer // Suppress focus. The act of tearing down the old content viewer
// causes us to blur incorrectly. // causes us to blur incorrectly.
@ -4489,7 +4490,8 @@ PresShell::UnsuppressAndInvalidate()
((nsFrame*)rootFrame)->Invalidate(mPresContext, rect, PR_FALSE); ((nsFrame*)rootFrame)->Invalidate(mPresContext, rect, PR_FALSE);
} }
CheckForFocus(ourWindow, focusController, mDocument); if (ourWindow)
CheckForFocus(ourWindow, focusController, mDocument);
if (focusController) // Unsuppress now that we've shown the new window and focused it. if (focusController) // Unsuppress now that we've shown the new window and focused it.
focusController->SetSuppressFocus(PR_FALSE, "PresShell suppression on Web page loads"); focusController->SetSuppressFocus(PR_FALSE, "PresShell suppression on Web page loads");

Просмотреть файл

@ -8495,6 +8495,16 @@ nsCSSFrameConstructor::ContentInserted(nsIPresContext* aPresContext,
nsIFrame* parentFrame = GetFrameFor(shell, aPresContext, aContainer); nsIFrame* parentFrame = GetFrameFor(shell, aPresContext, aContainer);
if (parentFrame) { if (parentFrame) {
// See if we have an XBL insertion point. If so, then see if the
// frame for it has been built yet. If it hasn't been built yet,
// then we just bail.
nsCOMPtr<nsIFrameManager> frameManager;
shell->GetFrameManager(getter_AddRefs(frameManager));
nsIFrame* insertionPoint = nsnull;
frameManager->GetInsertionPoint(shell, parentFrame, aChild, &insertionPoint);
if (!insertionPoint)
return NS_OK; // Don't build the frames.
// Find the frame that precedes the insertion point. // Find the frame that precedes the insertion point.
nsIFrame* prevSibling = (aIndexInContainer == -1) ? nsIFrame* prevSibling = (aIndexInContainer == -1) ?
FindPreviousAnonymousSibling(shell, aContainer, aChild) : FindPreviousAnonymousSibling(shell, aContainer, aChild) :

Просмотреть файл

@ -219,7 +219,8 @@ static void GetInsertionPoint(nsIPresShell* aShell, nsIFrame* aFrame, nsIFrame*
nsCOMPtr<nsIFrameManager> frameManager; nsCOMPtr<nsIFrameManager> frameManager;
aShell->GetFrameManager(getter_AddRefs(frameManager)); aShell->GetFrameManager(getter_AddRefs(frameManager));
nsCOMPtr<nsIContent> child; nsCOMPtr<nsIContent> child;
aChild->GetContent(getter_AddRefs(child)); if (aChild)
aChild->GetContent(getter_AddRefs(child));
frameManager->GetInsertionPoint(aShell, aFrame, child, aResult); frameManager->GetInsertionPoint(aShell, aFrame, child, aResult);
} }

Просмотреть файл

@ -903,7 +903,8 @@ static void GetInsertionPoint(nsIPresShell* aShell, nsIFrame* aFrame, nsIFrame*
nsCOMPtr<nsIFrameManager> frameManager; nsCOMPtr<nsIFrameManager> frameManager;
aShell->GetFrameManager(getter_AddRefs(frameManager)); aShell->GetFrameManager(getter_AddRefs(frameManager));
nsCOMPtr<nsIContent> child; nsCOMPtr<nsIContent> child;
aChild->GetContent(getter_AddRefs(child)); if (aChild)
aChild->GetContent(getter_AddRefs(child));
frameManager->GetInsertionPoint(aShell, aFrame, child, aResult); frameManager->GetInsertionPoint(aShell, aFrame, child, aResult);
} }