Bug 340542 - SVG Consolidate functionality to get primary frame. r=tor,r+sr=bzbarsky

This commit is contained in:
longsonr@gmail.com
2006-06-12 16:14:31 +00:00
parent 65b0bc85e6
commit 90f1fa84a7
17 changed files with 95 additions and 192 deletions

View File

@@ -2408,6 +2408,46 @@ nsGenericElement::DispatchClickEvent(nsPresContext* aPresContext,
return DispatchEvent(aPresContext, &event, aTarget, aFullDispatch, aStatus);
}
nsIFrame*
nsGenericElement::GetPrimaryFrame()
{
nsIDocument* doc = GetCurrentDoc();
if (!doc) {
return nsnull;
}
return GetPrimaryFrameFor(this, doc);
}
nsIFrame*
nsGenericElement::GetPrimaryFrame(mozFlushType aType)
{
nsIDocument* doc = GetCurrentDoc();
if (!doc) {
return nsnull;
}
// Cause a flush, so we get up-to-date frame
// information
doc->FlushPendingNotifications(aType);
return GetPrimaryFrameFor(this, doc);
}
/* static */
nsIFrame*
nsGenericElement::GetPrimaryFrameFor(nsIContent* aContent,
nsIDocument* aDocument)
{
// Get presentation shell 0
nsIPresShell *presShell = aDocument->GetShellAt(0);
if (!presShell) {
return nsnull;
}
return presShell->GetPrimaryFrameFor(aContent);
}
//----------------------------------------------------------------------
// Generic DOMNode implementations