Fix for dogfood bug#43169. r=pink
This commit is contained in:
@@ -8093,6 +8093,7 @@ nsCSSFrameConstructor::ContentAppended(nsIPresContext* aPresContext,
|
|||||||
innerGroup->MarkDirtyChildren(state);
|
innerGroup->MarkDirtyChildren(state);
|
||||||
}
|
}
|
||||||
treeRowGroup->ClearRowGroupInfo();
|
treeRowGroup->ClearRowGroupInfo();
|
||||||
|
shell->FlushPendingNotifications();
|
||||||
#else
|
#else
|
||||||
// See if there's a previous sibling.
|
// See if there's a previous sibling.
|
||||||
nsIFrame* prevSibling = FindPreviousSibling(shell,
|
nsIFrame* prevSibling = FindPreviousSibling(shell,
|
||||||
@@ -8377,6 +8378,10 @@ nsCSSFrameConstructor::ContentInserted(nsIPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
nsCOMPtr<nsIPresShell> shell;
|
||||||
|
aPresContext->GetShell(getter_AddRefs(shell));
|
||||||
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
#ifdef INCLUDE_XUL
|
#ifdef INCLUDE_XUL
|
||||||
if (aContainer) {
|
if (aContainer) {
|
||||||
nsCOMPtr<nsIAtom> tag;
|
nsCOMPtr<nsIAtom> tag;
|
||||||
@@ -8403,29 +8408,22 @@ nsCSSFrameConstructor::ContentInserted(nsIPresContext* aPresContext,
|
|||||||
nsIFrame* outerFrame = GetFrameFor(shell, aPresContext, child);
|
nsIFrame* outerFrame = GetFrameFor(shell, aPresContext, child);
|
||||||
|
|
||||||
// Convert to a tree row group frame.
|
// Convert to a tree row group frame.
|
||||||
#ifdef XULTREE
|
|
||||||
nsXULTreeOuterGroupFrame* treeRowGroup = (nsXULTreeOuterGroupFrame*)outerFrame;
|
nsXULTreeOuterGroupFrame* treeRowGroup = (nsXULTreeOuterGroupFrame*)outerFrame;
|
||||||
#else
|
|
||||||
nsTreeRowGroupFrame* treeRowGroup = (nsTreeRowGroupFrame*)outerFrame;
|
|
||||||
#endif
|
|
||||||
if (treeRowGroup) {
|
if (treeRowGroup) {
|
||||||
|
|
||||||
// Get the primary frame for the parent of the child that's being added.
|
// Get the primary frame for the parent of the child that's being added.
|
||||||
nsIFrame* innerFrame = GetFrameFor(shell, aPresContext, aContainer);
|
nsIFrame* innerFrame = GetFrameFor(shell, aPresContext, aContainer);
|
||||||
|
|
||||||
|
|
||||||
#ifdef XULTREE
|
|
||||||
nsXULTreeGroupFrame* innerGroup = (nsXULTreeGroupFrame*) innerFrame;
|
nsXULTreeGroupFrame* innerGroup = (nsXULTreeGroupFrame*) innerFrame;
|
||||||
treeRowGroup->ClearRowGroupInfo();
|
treeRowGroup->ClearRowGroupInfo();
|
||||||
nsIFrame* prevSibling = nsnull;
|
nsBoxLayoutState state(aPresContext);
|
||||||
#else
|
treeRowGroup->MarkDirtyChildren(state);
|
||||||
nsTreeRowGroupFrame* innerGroup = (nsTreeRowGroupFrame*) innerFrame;
|
|
||||||
|
|
||||||
// See if there's a previous sibling.
|
// See if there's a previous sibling.
|
||||||
nsIFrame* prevSibling = FindPreviousSibling(shell,
|
nsIFrame* prevSibling = FindPreviousSibling(shell,
|
||||||
aContainer,
|
aContainer,
|
||||||
aIndexInContainer);
|
aIndexInContainer);
|
||||||
#endif
|
|
||||||
if (prevSibling || innerFrame) {
|
if (prevSibling || innerFrame) {
|
||||||
// We're onscreen, but because of the fact that we can be called to
|
// We're onscreen, but because of the fact that we can be called to
|
||||||
// "kill" a displayed frame (e.g., when you close a tree node), we
|
// "kill" a displayed frame (e.g., when you close a tree node), we
|
||||||
@@ -8453,27 +8451,18 @@ nsCSSFrameConstructor::ContentInserted(nsIPresContext* aPresContext,
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Good call. Make sure a full reflow happens.
|
if (innerGroup) {
|
||||||
nsIFrame* nextSibling = FindNextSibling(shell, aContainer, aIndexInContainer);
|
//nsBoxLayoutState state(aPresContext);
|
||||||
#ifdef XULTREE
|
//innerGroup->MarkDirtyChildren(state);
|
||||||
if (nextSibling) {
|
|
||||||
#else
|
// Good call. Make sure a full reflow happens.
|
||||||
if(!nextSibling)
|
nsIFrame* nextSibling = FindNextSibling(shell, aContainer, aIndexInContainer);
|
||||||
treeRowGroup->OnContentAdded(aPresContext);
|
if (nextSibling)
|
||||||
else {
|
|
||||||
#endif
|
|
||||||
if(innerGroup)
|
|
||||||
innerGroup->OnContentInserted(aPresContext, nextSibling, aIndexInContainer);
|
innerGroup->OnContentInserted(aPresContext, nextSibling, aIndexInContainer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifndef XULTREE
|
|
||||||
else {
|
|
||||||
// We're going to be offscreen.
|
|
||||||
treeRowGroup->ClearRowGroupInfo();
|
|
||||||
treeRowGroup->ReflowScrollbar(aPresContext);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
shell->FlushPendingNotifications();
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8481,10 +8470,6 @@ nsCSSFrameConstructor::ContentInserted(nsIPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
#endif // INCLUDE_XUL
|
#endif // INCLUDE_XUL
|
||||||
|
|
||||||
nsCOMPtr<nsIPresShell> shell;
|
|
||||||
aPresContext->GetShell(getter_AddRefs(shell));
|
|
||||||
nsresult rv = NS_OK;
|
|
||||||
|
|
||||||
// If we have a null parent, then this must be the document element
|
// If we have a null parent, then this must be the document element
|
||||||
// being inserted
|
// being inserted
|
||||||
if (nsnull == aContainer) {
|
if (nsnull == aContainer) {
|
||||||
@@ -9124,6 +9109,7 @@ nsCSSFrameConstructor::ContentRemoved(nsIPresContext* aPresContext,
|
|||||||
nsBoxLayoutState state(aPresContext);
|
nsBoxLayoutState state(aPresContext);
|
||||||
treeRowGroup->MarkDirtyChildren(state);
|
treeRowGroup->MarkDirtyChildren(state);
|
||||||
treeRowGroup->ClearRowGroupInfo();
|
treeRowGroup->ClearRowGroupInfo();
|
||||||
|
shell->FlushPendingNotifications();
|
||||||
}
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -8093,6 +8093,7 @@ nsCSSFrameConstructor::ContentAppended(nsIPresContext* aPresContext,
|
|||||||
innerGroup->MarkDirtyChildren(state);
|
innerGroup->MarkDirtyChildren(state);
|
||||||
}
|
}
|
||||||
treeRowGroup->ClearRowGroupInfo();
|
treeRowGroup->ClearRowGroupInfo();
|
||||||
|
shell->FlushPendingNotifications();
|
||||||
#else
|
#else
|
||||||
// See if there's a previous sibling.
|
// See if there's a previous sibling.
|
||||||
nsIFrame* prevSibling = FindPreviousSibling(shell,
|
nsIFrame* prevSibling = FindPreviousSibling(shell,
|
||||||
@@ -8377,6 +8378,10 @@ nsCSSFrameConstructor::ContentInserted(nsIPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
nsCOMPtr<nsIPresShell> shell;
|
||||||
|
aPresContext->GetShell(getter_AddRefs(shell));
|
||||||
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
#ifdef INCLUDE_XUL
|
#ifdef INCLUDE_XUL
|
||||||
if (aContainer) {
|
if (aContainer) {
|
||||||
nsCOMPtr<nsIAtom> tag;
|
nsCOMPtr<nsIAtom> tag;
|
||||||
@@ -8403,29 +8408,22 @@ nsCSSFrameConstructor::ContentInserted(nsIPresContext* aPresContext,
|
|||||||
nsIFrame* outerFrame = GetFrameFor(shell, aPresContext, child);
|
nsIFrame* outerFrame = GetFrameFor(shell, aPresContext, child);
|
||||||
|
|
||||||
// Convert to a tree row group frame.
|
// Convert to a tree row group frame.
|
||||||
#ifdef XULTREE
|
|
||||||
nsXULTreeOuterGroupFrame* treeRowGroup = (nsXULTreeOuterGroupFrame*)outerFrame;
|
nsXULTreeOuterGroupFrame* treeRowGroup = (nsXULTreeOuterGroupFrame*)outerFrame;
|
||||||
#else
|
|
||||||
nsTreeRowGroupFrame* treeRowGroup = (nsTreeRowGroupFrame*)outerFrame;
|
|
||||||
#endif
|
|
||||||
if (treeRowGroup) {
|
if (treeRowGroup) {
|
||||||
|
|
||||||
// Get the primary frame for the parent of the child that's being added.
|
// Get the primary frame for the parent of the child that's being added.
|
||||||
nsIFrame* innerFrame = GetFrameFor(shell, aPresContext, aContainer);
|
nsIFrame* innerFrame = GetFrameFor(shell, aPresContext, aContainer);
|
||||||
|
|
||||||
|
|
||||||
#ifdef XULTREE
|
|
||||||
nsXULTreeGroupFrame* innerGroup = (nsXULTreeGroupFrame*) innerFrame;
|
nsXULTreeGroupFrame* innerGroup = (nsXULTreeGroupFrame*) innerFrame;
|
||||||
treeRowGroup->ClearRowGroupInfo();
|
treeRowGroup->ClearRowGroupInfo();
|
||||||
nsIFrame* prevSibling = nsnull;
|
nsBoxLayoutState state(aPresContext);
|
||||||
#else
|
treeRowGroup->MarkDirtyChildren(state);
|
||||||
nsTreeRowGroupFrame* innerGroup = (nsTreeRowGroupFrame*) innerFrame;
|
|
||||||
|
|
||||||
// See if there's a previous sibling.
|
// See if there's a previous sibling.
|
||||||
nsIFrame* prevSibling = FindPreviousSibling(shell,
|
nsIFrame* prevSibling = FindPreviousSibling(shell,
|
||||||
aContainer,
|
aContainer,
|
||||||
aIndexInContainer);
|
aIndexInContainer);
|
||||||
#endif
|
|
||||||
if (prevSibling || innerFrame) {
|
if (prevSibling || innerFrame) {
|
||||||
// We're onscreen, but because of the fact that we can be called to
|
// We're onscreen, but because of the fact that we can be called to
|
||||||
// "kill" a displayed frame (e.g., when you close a tree node), we
|
// "kill" a displayed frame (e.g., when you close a tree node), we
|
||||||
@@ -8453,27 +8451,18 @@ nsCSSFrameConstructor::ContentInserted(nsIPresContext* aPresContext,
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Good call. Make sure a full reflow happens.
|
if (innerGroup) {
|
||||||
nsIFrame* nextSibling = FindNextSibling(shell, aContainer, aIndexInContainer);
|
//nsBoxLayoutState state(aPresContext);
|
||||||
#ifdef XULTREE
|
//innerGroup->MarkDirtyChildren(state);
|
||||||
if (nextSibling) {
|
|
||||||
#else
|
// Good call. Make sure a full reflow happens.
|
||||||
if(!nextSibling)
|
nsIFrame* nextSibling = FindNextSibling(shell, aContainer, aIndexInContainer);
|
||||||
treeRowGroup->OnContentAdded(aPresContext);
|
if (nextSibling)
|
||||||
else {
|
|
||||||
#endif
|
|
||||||
if(innerGroup)
|
|
||||||
innerGroup->OnContentInserted(aPresContext, nextSibling, aIndexInContainer);
|
innerGroup->OnContentInserted(aPresContext, nextSibling, aIndexInContainer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifndef XULTREE
|
|
||||||
else {
|
|
||||||
// We're going to be offscreen.
|
|
||||||
treeRowGroup->ClearRowGroupInfo();
|
|
||||||
treeRowGroup->ReflowScrollbar(aPresContext);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
shell->FlushPendingNotifications();
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8481,10 +8470,6 @@ nsCSSFrameConstructor::ContentInserted(nsIPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
#endif // INCLUDE_XUL
|
#endif // INCLUDE_XUL
|
||||||
|
|
||||||
nsCOMPtr<nsIPresShell> shell;
|
|
||||||
aPresContext->GetShell(getter_AddRefs(shell));
|
|
||||||
nsresult rv = NS_OK;
|
|
||||||
|
|
||||||
// If we have a null parent, then this must be the document element
|
// If we have a null parent, then this must be the document element
|
||||||
// being inserted
|
// being inserted
|
||||||
if (nsnull == aContainer) {
|
if (nsnull == aContainer) {
|
||||||
@@ -9124,6 +9109,7 @@ nsCSSFrameConstructor::ContentRemoved(nsIPresContext* aPresContext,
|
|||||||
nsBoxLayoutState state(aPresContext);
|
nsBoxLayoutState state(aPresContext);
|
||||||
treeRowGroup->MarkDirtyChildren(state);
|
treeRowGroup->MarkDirtyChildren(state);
|
||||||
treeRowGroup->ClearRowGroupInfo();
|
treeRowGroup->ClearRowGroupInfo();
|
||||||
|
shell->FlushPendingNotifications();
|
||||||
}
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -430,6 +430,9 @@ void nsXULTreeGroupFrame::OnContentRemoved(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
}
|
}
|
||||||
MarkDirtyChildren(state);
|
MarkDirtyChildren(state);
|
||||||
|
nsCOMPtr<nsIPresShell> shell;
|
||||||
|
aPresContext->GetShell(getter_AddRefs(shell));
|
||||||
|
shell->FlushPendingNotifications();
|
||||||
}
|
}
|
||||||
|
|
||||||
PRBool nsXULTreeGroupFrame::ContinueReflow(nscoord height)
|
PRBool nsXULTreeGroupFrame::ContinueReflow(nscoord height)
|
||||||
|
|||||||
Reference in New Issue
Block a user