зеркало из https://github.com/mozilla/gecko-dev.git
Throw me a frickin' bone here.
This commit is contained in:
Родитель
fd3783d4aa
Коммит
6d36295e48
|
@ -221,10 +221,12 @@ nsTreeRowGroupFrame::FindPreviousRowContent(PRInt32& aDelta, nsIContent* aUpward
|
|||
parentContent->ChildCount(index);
|
||||
}
|
||||
|
||||
/* Let me see inside the damn nsCOMptrs
|
||||
nsIAtom* aAtom;
|
||||
parentContent->GetTag(aAtom);
|
||||
nsString result;
|
||||
aAtom->ToString(result);
|
||||
*/
|
||||
|
||||
for (PRInt32 i = index-1; i >= 0; i--) {
|
||||
nsCOMPtr<nsIContent> childContent;
|
||||
|
@ -539,7 +541,8 @@ nsTreeRowGroupFrame::GetFirstFrameForReflow(nsIPresContext& aPresContext)
|
|||
if (!mIsLazy)
|
||||
return mFrames.FirstChild();
|
||||
|
||||
if (mTopFrame)
|
||||
// If we have a frame and no content chain (e.g., unresolved/uncreated content)
|
||||
if (mTopFrame && !mContentChain)
|
||||
return mTopFrame;
|
||||
|
||||
// See if we have any frame whatsoever.
|
||||
|
@ -547,21 +550,55 @@ nsTreeRowGroupFrame::GetFirstFrameForReflow(nsIPresContext& aPresContext)
|
|||
|
||||
mBottomFrame = mTopFrame;
|
||||
|
||||
if (mTopFrame)
|
||||
nsCOMPtr<nsIContent> startContent;
|
||||
if (mTopFrame) {
|
||||
if (!mContentChain)
|
||||
return mTopFrame;
|
||||
|
||||
// We have a content chain. If the top frame is the same as our content
|
||||
// chain, we can go ahead and destroy our content chain and return the
|
||||
// top frame.
|
||||
nsCOMPtr<nsIContent> topContent;
|
||||
mTopFrame->GetContent(getter_AddRefs(topContent));
|
||||
nsCOMPtr<nsISupports> supports;
|
||||
mContentChain->GetElementAt(0, getter_AddRefs(supports));
|
||||
nsCOMPtr<nsIContent> chainContent = do_QueryInterface(supports);
|
||||
if (chainContent.get() == topContent.get()) {
|
||||
// The two content nodes are the same. Our content chain has
|
||||
// been synched up, and we can now remove our element and
|
||||
// pass the content chain inwards.
|
||||
mContentChain->RemoveElementAt(0);
|
||||
PRUint32 chainSize;
|
||||
mContentChain->Count(&chainSize);
|
||||
if (chainSize > 0) {
|
||||
((nsTreeRowGroupFrame*)mTopFrame)->SetContentChain(mContentChain);
|
||||
}
|
||||
|
||||
// The chain is dead. Long live the chain.
|
||||
NS_RELEASE(mContentChain);
|
||||
mContentChain = nsnull;
|
||||
}
|
||||
startContent = chainContent;
|
||||
}
|
||||
|
||||
// We don't have a top frame instantiated. Let's
|
||||
// try to make one.
|
||||
|
||||
// If we have a content chain, use that content node to make our frame,
|
||||
// and prepare a sub-content chain for the new child frame that we make.
|
||||
|
||||
// Otherwise just grab the first child.
|
||||
if (!startContent) {
|
||||
PRInt32 childCount;
|
||||
mContent->ChildCount(childCount);
|
||||
nsCOMPtr<nsIContent> childContent;
|
||||
if (childCount > 0) {
|
||||
mContent->ChildAt(0, *getter_AddRefs(childContent));
|
||||
mFrameConstructor->CreateTreeWidgetContent(&aPresContext, this, childContent,
|
||||
startContent = childContent;
|
||||
}
|
||||
}
|
||||
|
||||
if (startContent) {
|
||||
mFrameConstructor->CreateTreeWidgetContent(&aPresContext, this, startContent,
|
||||
&mTopFrame);
|
||||
printf("Created a frame\n");
|
||||
mBottomFrame = mTopFrame;
|
||||
|
@ -661,3 +698,10 @@ void nsTreeRowGroupFrame::OnContentAdded(nsIPresContext& aPresContext)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void nsTreeRowGroupFrame::SetContentChain(nsISupportsArray* aContentChain)
|
||||
{
|
||||
NS_IF_RELEASE(mContentChain);
|
||||
mContentChain = aContentChain;
|
||||
NS_IF_ADDREF(mContentChain);
|
||||
}
|
|
@ -87,6 +87,8 @@ protected:
|
|||
|
||||
void LocateFrame(nsIFrame* aStartFrame, nsIFrame** aResult);
|
||||
|
||||
void SetContentChain(nsISupportsArray* aContentChain);
|
||||
|
||||
void ConstructContentChain(nsIContent* aRowContent);
|
||||
void FindPreviousRowContent(PRInt32& aDelta, nsIContent* aUpwardHint,
|
||||
nsIContent* aDownwardHint, nsIContent** aResult);
|
||||
|
|
Загрузка…
Ссылка в новой задаче