mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 12:55:46 +00:00
added GetLayoutObjectFor for getting a layout object as an nsISupports
while not exposing nsIFrame.
This commit is contained in:
parent
690df4f8f0
commit
83125f838e
@ -134,6 +134,15 @@ public:
|
||||
NS_IMETHOD GetPrimaryFrameFor(nsIContent* aContent,
|
||||
nsIFrame*& aPrimaryFrame) const = 0;
|
||||
|
||||
/**
|
||||
* Returns a layout object associated with the primary frame for the content object.
|
||||
*
|
||||
* @param aContent the content object for which we seek a layout object
|
||||
* @param aResult the resulting layout object as an nsISupports, if found. Refcounted.
|
||||
*/
|
||||
NS_IMETHOD GetLayoutObjectFor(nsIContent* aContent,
|
||||
nsISupports** aResult) const = 0;
|
||||
|
||||
/**
|
||||
* Get/Set the placeholder frame associated with the specified frame.
|
||||
*
|
||||
|
@ -254,6 +254,8 @@ public:
|
||||
NS_IMETHOD GetRootFrame(nsIFrame*& aFrame) const;
|
||||
NS_IMETHOD GetPageSequenceFrame(nsIPageSequenceFrame*& aPageSequenceFrame) const;
|
||||
NS_IMETHOD GetPrimaryFrameFor(nsIContent* aContent, nsIFrame*& aPrimaryFrame) const;
|
||||
NS_IMETHOD GetLayoutObjectFor(nsIContent* aContent,
|
||||
nsISupports** aResult) const;
|
||||
NS_IMETHOD GetPlaceholderFrameFor(nsIFrame* aFrame,
|
||||
nsIFrame*& aPlaceholderFrame) const;
|
||||
NS_IMETHOD SetPlaceholderFrameFor(nsIFrame* aFrame,
|
||||
@ -1423,6 +1425,26 @@ PresShell::GetPrimaryFrameFor(nsIContent* aContent, nsIFrame*& aPrimaryFrame) co
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
PresShell::GetLayoutObjectFor(nsIContent* aContent,
|
||||
nsISupports** aResult) const
|
||||
{
|
||||
nsresult result = NS_ERROR_NULL_POINTER;
|
||||
if ((nsnull!=aResult) && (nsnull!=aContent))
|
||||
{
|
||||
*aResult = nsnull;
|
||||
nsIFrame *primaryFrame=nsnull;
|
||||
result = GetPrimaryFrameFor(aContent, primaryFrame);
|
||||
if ((NS_SUCCEEDED(result)) && (nsnull!=primaryFrame))
|
||||
{
|
||||
result = primaryFrame->QueryInterface(kISupportsIID, (void**)aResult);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
PresShell::GetPlaceholderFrameFor(nsIFrame* aFrame,
|
||||
nsIFrame*& aPlaceholderFrame) const
|
||||
|
@ -134,6 +134,15 @@ public:
|
||||
NS_IMETHOD GetPrimaryFrameFor(nsIContent* aContent,
|
||||
nsIFrame*& aPrimaryFrame) const = 0;
|
||||
|
||||
/**
|
||||
* Returns a layout object associated with the primary frame for the content object.
|
||||
*
|
||||
* @param aContent the content object for which we seek a layout object
|
||||
* @param aResult the resulting layout object as an nsISupports, if found. Refcounted.
|
||||
*/
|
||||
NS_IMETHOD GetLayoutObjectFor(nsIContent* aContent,
|
||||
nsISupports** aResult) const = 0;
|
||||
|
||||
/**
|
||||
* Get/Set the placeholder frame associated with the specified frame.
|
||||
*
|
||||
|
@ -254,6 +254,8 @@ public:
|
||||
NS_IMETHOD GetRootFrame(nsIFrame*& aFrame) const;
|
||||
NS_IMETHOD GetPageSequenceFrame(nsIPageSequenceFrame*& aPageSequenceFrame) const;
|
||||
NS_IMETHOD GetPrimaryFrameFor(nsIContent* aContent, nsIFrame*& aPrimaryFrame) const;
|
||||
NS_IMETHOD GetLayoutObjectFor(nsIContent* aContent,
|
||||
nsISupports** aResult) const;
|
||||
NS_IMETHOD GetPlaceholderFrameFor(nsIFrame* aFrame,
|
||||
nsIFrame*& aPlaceholderFrame) const;
|
||||
NS_IMETHOD SetPlaceholderFrameFor(nsIFrame* aFrame,
|
||||
@ -1423,6 +1425,26 @@ PresShell::GetPrimaryFrameFor(nsIContent* aContent, nsIFrame*& aPrimaryFrame) co
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
PresShell::GetLayoutObjectFor(nsIContent* aContent,
|
||||
nsISupports** aResult) const
|
||||
{
|
||||
nsresult result = NS_ERROR_NULL_POINTER;
|
||||
if ((nsnull!=aResult) && (nsnull!=aContent))
|
||||
{
|
||||
*aResult = nsnull;
|
||||
nsIFrame *primaryFrame=nsnull;
|
||||
result = GetPrimaryFrameFor(aContent, primaryFrame);
|
||||
if ((NS_SUCCEEDED(result)) && (nsnull!=primaryFrame))
|
||||
{
|
||||
result = primaryFrame->QueryInterface(kISupportsIID, (void**)aResult);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
PresShell::GetPlaceholderFrameFor(nsIFrame* aFrame,
|
||||
nsIFrame*& aPlaceholderFrame) const
|
||||
|
Loading…
Reference in New Issue
Block a user