Bug 396185 - Make nsIFrame derivatives and helper abstract classes use a different dynamic-cast system than nsISupports:
* we know all types frames may be cast to at compile time, so instead of extensible GUID IIDs, use a big enum (see nsQueryFrame::FrameIID) * eliminate all vestiges of refcounting, since frames aren't refcounted Some frames (SVG frames in particular) still implement nsISupports-derived interfaces, for example nsISVGValue. There is a FrameIID for nsISVGValue that lets you go from a frame to the XPCOM interface, but you can't query back. r+sr=roc nsITextControlFrame didn't have an IID the first time around, but this wasn't a compile error because nsITextControlFrame::kFrameIID inherited from nsIFormControlFrame::kFrameIID. I've added a static analysis pass to verify the correct behavior, since I can't figure out a way to make the compiler do it.
This commit is contained in:
@@ -105,31 +105,9 @@ nsHTMLButtonControlFrame::Init(
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsrefcnt nsHTMLButtonControlFrame::AddRef(void)
|
||||
{
|
||||
NS_WARNING("not supported");
|
||||
return 1;
|
||||
}
|
||||
|
||||
nsrefcnt nsHTMLButtonControlFrame::Release(void)
|
||||
{
|
||||
NS_WARNING("not supported");
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Frames are not refcounted, no need to AddRef
|
||||
NS_IMETHODIMP
|
||||
nsHTMLButtonControlFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_PRECONDITION(aInstancePtr, "null out param");
|
||||
|
||||
if (aIID.Equals(NS_GET_IID(nsIFormControlFrame))) {
|
||||
*aInstancePtr = static_cast<nsIFormControlFrame*>(this);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return nsHTMLContainerFrame::QueryInterface(aIID, aInstancePtr);
|
||||
}
|
||||
NS_QUERYFRAME_HEAD(nsHTMLButtonControlFrame)
|
||||
NS_QUERYFRAME_ENTRY(nsIFormControlFrame)
|
||||
NS_QUERYFRAME_TAIL_INHERITING(nsHTMLContainerFrame)
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
NS_IMETHODIMP nsHTMLButtonControlFrame::GetAccessible(nsIAccessible** aAccessible)
|
||||
|
||||
Reference in New Issue
Block a user