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.

--HG--
extra : rebase_source : 4894a2ca0278e2ab92f27459db77165f8348cf41
This commit is contained in:
Benjamin Smedberg 2009-01-12 14:20:59 -05:00
Родитель 3c0e89dac0
Коммит c0b8dd79be
202 изменённых файлов: 1156 добавлений и 2106 удалений

Просмотреть файл

@ -52,29 +52,29 @@ interface nsIAccessibilityService : nsIAccessibleRetrieval
nsIAccessible createOuterDocAccessible(in nsIDOMNode aNode); nsIAccessible createOuterDocAccessible(in nsIDOMNode aNode);
nsIAccessible createRootAccessible(in nsIPresShell aShell, in nsIDocument aDocument); nsIAccessible createRootAccessible(in nsIPresShell aShell, in nsIDocument aDocument);
nsIAccessible createHTML4ButtonAccessible(in nsISupports aFrame); nsIAccessible createHTML4ButtonAccessible(in nsIFrame aFrame);
nsIAccessible createHyperTextAccessible(in nsISupports aFrame); nsIAccessible createHyperTextAccessible(in nsIFrame aFrame);
nsIAccessible createHTMLBRAccessible(in nsISupports aFrame); nsIAccessible createHTMLBRAccessible(in nsIFrame aFrame);
nsIAccessible createHTMLButtonAccessible(in nsISupports aFrame); nsIAccessible createHTMLButtonAccessible(in nsIFrame aFrame);
nsIAccessible createHTMLAccessibleByMarkup(in nsIFrame aFrame, in nsIWeakReference aWeakShell, in nsIDOMNode aDOMNode); nsIAccessible createHTMLAccessibleByMarkup(in nsIFrame aFrame, in nsIWeakReference aWeakShell, in nsIDOMNode aDOMNode);
nsIAccessible createHTMLLIAccessible(in nsISupports aFrame, in nsISupports aBulletFrame, in AString aBulletText); nsIAccessible createHTMLLIAccessible(in nsIFrame aFrame, in nsIFrame aBulletFrame, in AString aBulletText);
nsIAccessible createHTMLCheckboxAccessible(in nsISupports aFrame); nsIAccessible createHTMLCheckboxAccessible(in nsIFrame aFrame);
nsIAccessible createHTMLComboboxAccessible(in nsIDOMNode aNode, in nsIWeakReference aPresShell); nsIAccessible createHTMLComboboxAccessible(in nsIDOMNode aNode, in nsIWeakReference aPresShell);
nsIAccessible createHTMLGenericAccessible(in nsISupports aFrame); nsIAccessible createHTMLGenericAccessible(in nsIFrame aFrame);
nsIAccessible createHTMLGroupboxAccessible(in nsISupports aFrame); nsIAccessible createHTMLGroupboxAccessible(in nsIFrame aFrame);
nsIAccessible createHTMLHRAccessible(in nsISupports aFrame); nsIAccessible createHTMLHRAccessible(in nsIFrame aFrame);
nsIAccessible createHTMLImageAccessible(in nsISupports aFrame); nsIAccessible createHTMLImageAccessible(in nsIFrame aFrame);
nsIAccessible createHTMLLabelAccessible(in nsISupports aFrame); nsIAccessible createHTMLLabelAccessible(in nsIFrame aFrame);
nsIAccessible createHTMLListboxAccessible(in nsIDOMNode aNode, in nsIWeakReference aPresShell); nsIAccessible createHTMLListboxAccessible(in nsIDOMNode aNode, in nsIWeakReference aPresShell);
nsIAccessible createHTMLObjectFrameAccessible(in nsObjectFrame aFrame); nsIAccessible createHTMLObjectFrameAccessible(in nsObjectFrame aFrame);
nsIAccessible createHTMLRadioButtonAccessible(in nsISupports aFrame); nsIAccessible createHTMLRadioButtonAccessible(in nsIFrame aFrame);
nsIAccessible createHTMLSelectOptionAccessible(in nsIDOMNode aNode, in nsIAccessible aAccParent, in nsIWeakReference aPresShell); nsIAccessible createHTMLSelectOptionAccessible(in nsIDOMNode aNode, in nsIAccessible aAccParent, in nsIWeakReference aPresShell);
nsIAccessible createHTMLTableAccessible(in nsISupports aFrame); nsIAccessible createHTMLTableAccessible(in nsIFrame aFrame);
nsIAccessible createHTMLTableCellAccessible(in nsISupports aFrame); nsIAccessible createHTMLTableCellAccessible(in nsIFrame aFrame);
nsIAccessible createHTMLTableHeadAccessible(in nsIDOMNode aDOMNode); nsIAccessible createHTMLTableHeadAccessible(in nsIDOMNode aDOMNode);
nsIAccessible createHTMLTextAccessible(in nsISupports aFrame); nsIAccessible createHTMLTextAccessible(in nsIFrame aFrame);
nsIAccessible createHTMLTextFieldAccessible(in nsISupports aFrame); nsIAccessible createHTMLTextFieldAccessible(in nsIFrame aFrame);
nsIAccessible createHTMLCaptionAccessible(in nsISupports aFrame); nsIAccessible createHTMLCaptionAccessible(in nsIFrame aFrame);
nsIAccessible getAccessible(in nsIDOMNode aNode, in nsIPresShell aPresShell, nsIAccessible getAccessible(in nsIDOMNode aNode, in nsIPresShell aPresShell,
in nsIWeakReference aWeakShell, in nsIWeakReference aWeakShell,

Просмотреть файл

@ -332,11 +332,10 @@ NS_IMETHODIMP nsAccessibilityService::OnSecurityChange(nsIWebProgress *aWebProgr
nsresult nsresult
nsAccessibilityService::GetInfo(nsISupports* aFrame, nsIFrame** aRealFrame, nsIWeakReference** aShell, nsIDOMNode** aNode) nsAccessibilityService::GetInfo(nsIFrame* aFrame, nsIWeakReference** aShell, nsIDOMNode** aNode)
{ {
NS_ASSERTION(aFrame,"Error -- 1st argument (aFrame) is null!!"); NS_ASSERTION(aFrame,"Error -- 1st argument (aFrame) is null!!");
*aRealFrame = static_cast<nsIFrame*>(aFrame); nsCOMPtr<nsIContent> content = aFrame->GetContent();
nsCOMPtr<nsIContent> content = (*aRealFrame)->GetContent();
nsCOMPtr<nsIDOMNode> node(do_QueryInterface(content)); nsCOMPtr<nsIDOMNode> node(do_QueryInterface(content));
if (!content || !node) if (!content || !node)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
@ -474,12 +473,11 @@ nsAccessibilityService::CreateRootAccessible(nsIPresShell *aShell,
* HTML widget creation * HTML widget creation
*/ */
NS_IMETHODIMP NS_IMETHODIMP
nsAccessibilityService::CreateHTML4ButtonAccessible(nsISupports *aFrame, nsIAccessible **_retval) nsAccessibilityService::CreateHTML4ButtonAccessible(nsIFrame *aFrame, nsIAccessible **_retval)
{ {
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node; nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell; nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node)); nsresult rv = GetInfo(aFrame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv)) if (NS_FAILED(rv))
return rv; return rv;
@ -492,12 +490,11 @@ nsAccessibilityService::CreateHTML4ButtonAccessible(nsISupports *aFrame, nsIAcce
} }
NS_IMETHODIMP NS_IMETHODIMP
nsAccessibilityService::CreateHTMLButtonAccessible(nsISupports *aFrame, nsIAccessible **_retval) nsAccessibilityService::CreateHTMLButtonAccessible(nsIFrame *aFrame, nsIAccessible **_retval)
{ {
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node; nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell; nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node)); nsresult rv = GetInfo(aFrame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv)) if (NS_FAILED(rv))
return rv; return rv;
@ -565,15 +562,14 @@ nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame *aFrame,
} }
NS_IMETHODIMP NS_IMETHODIMP
nsAccessibilityService::CreateHTMLLIAccessible(nsISupports *aFrame, nsAccessibilityService::CreateHTMLLIAccessible(nsIFrame *aFrame,
nsISupports *aBulletFrame, nsIFrame *aBulletFrame,
const nsAString& aBulletText, const nsAString& aBulletText,
nsIAccessible **_retval) nsIAccessible **_retval)
{ {
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node; nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell; nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node)); nsresult rv = GetInfo(aFrame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv)) if (NS_FAILED(rv))
return rv; return rv;
@ -586,12 +582,11 @@ nsAccessibilityService::CreateHTMLLIAccessible(nsISupports *aFrame,
} }
NS_IMETHODIMP NS_IMETHODIMP
nsAccessibilityService::CreateHyperTextAccessible(nsISupports *aFrame, nsIAccessible **aAccessible) nsAccessibilityService::CreateHyperTextAccessible(nsIFrame *aFrame, nsIAccessible **aAccessible)
{ {
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node; nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell; nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node)); nsresult rv = GetInfo(aFrame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv)) if (NS_FAILED(rv))
return rv; return rv;
@ -606,12 +601,11 @@ nsAccessibilityService::CreateHyperTextAccessible(nsISupports *aFrame, nsIAccess
} }
NS_IMETHODIMP NS_IMETHODIMP
nsAccessibilityService::CreateHTMLCheckboxAccessible(nsISupports *aFrame, nsIAccessible **_retval) nsAccessibilityService::CreateHTMLCheckboxAccessible(nsIFrame *aFrame, nsIAccessible **_retval)
{ {
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node; nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell; nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node)); nsresult rv = GetInfo(aFrame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv)) if (NS_FAILED(rv))
return rv; return rv;
@ -635,12 +629,11 @@ nsAccessibilityService::CreateHTMLComboboxAccessible(nsIDOMNode* aDOMNode, nsIWe
} }
NS_IMETHODIMP NS_IMETHODIMP
nsAccessibilityService::CreateHTMLImageAccessible(nsISupports *aFrame, nsIAccessible **_retval) nsAccessibilityService::CreateHTMLImageAccessible(nsIFrame *aFrame, nsIAccessible **_retval)
{ {
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node; nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell; nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node)); nsresult rv = GetInfo(aFrame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv)) if (NS_FAILED(rv))
return rv; return rv;
@ -658,18 +651,17 @@ nsAccessibilityService::CreateHTMLImageAccessible(nsISupports *aFrame, nsIAccess
} }
NS_IMETHODIMP NS_IMETHODIMP
nsAccessibilityService::CreateHTMLGenericAccessible(nsISupports *aFrame, nsIAccessible **aAccessible) nsAccessibilityService::CreateHTMLGenericAccessible(nsIFrame *aFrame, nsIAccessible **aAccessible)
{ {
return CreateHyperTextAccessible(aFrame, aAccessible); return CreateHyperTextAccessible(aFrame, aAccessible);
} }
NS_IMETHODIMP NS_IMETHODIMP
nsAccessibilityService::CreateHTMLGroupboxAccessible(nsISupports *aFrame, nsIAccessible **_retval) nsAccessibilityService::CreateHTMLGroupboxAccessible(nsIFrame *aFrame, nsIAccessible **_retval)
{ {
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node; nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell; nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node)); nsresult rv = GetInfo(aFrame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv)) if (NS_FAILED(rv))
return rv; return rv;
@ -707,11 +699,10 @@ nsAccessibilityService::CreateHTMLObjectFrameAccessible(nsObjectFrame *aFrame,
{ {
nsCOMPtr<nsIDOMNode> node; nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell; nsCOMPtr<nsIWeakReference> weakShell;
nsIFrame *frame; GetInfo(aFrame, getter_AddRefs(weakShell), getter_AddRefs(node));
GetInfo(static_cast<nsIFrame*>(aFrame), &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
*aAccessible = nsnull; *aAccessible = nsnull;
if (!frame || frame->GetRect().IsEmpty()) { if (aFrame->GetRect().IsEmpty()) {
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
// 1) for object elements containing either HTML or TXT documents // 1) for object elements containing either HTML or TXT documents
@ -743,7 +734,7 @@ nsAccessibilityService::CreateHTMLObjectFrameAccessible(nsObjectFrame *aFrame,
// 3) for images and imagemaps, or anything else with a child frame // 3) for images and imagemaps, or anything else with a child frame
// we have the object frame, get the image frame // we have the object frame, get the image frame
frame = aFrame->GetFirstChild(nsnull); nsIFrame *frame = aFrame->GetFirstChild(nsnull);
if (frame) if (frame)
return frame->GetAccessible(aAccessible); return frame->GetAccessible(aAccessible);
@ -751,12 +742,11 @@ nsAccessibilityService::CreateHTMLObjectFrameAccessible(nsObjectFrame *aFrame,
} }
NS_IMETHODIMP NS_IMETHODIMP
nsAccessibilityService::CreateHTMLRadioButtonAccessible(nsISupports *aFrame, nsIAccessible **_retval) nsAccessibilityService::CreateHTMLRadioButtonAccessible(nsIFrame *aFrame, nsIAccessible **_retval)
{ {
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node; nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell; nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node)); nsresult rv = GetInfo(aFrame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv)) if (NS_FAILED(rv))
return rv; return rv;
@ -783,12 +773,11 @@ nsAccessibilityService::CreateHTMLSelectOptionAccessible(nsIDOMNode* aDOMNode,
} }
NS_IMETHODIMP NS_IMETHODIMP
nsAccessibilityService::CreateHTMLTableAccessible(nsISupports *aFrame, nsIAccessible **_retval) nsAccessibilityService::CreateHTMLTableAccessible(nsIFrame *aFrame, nsIAccessible **_retval)
{ {
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node; nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell; nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node)); nsresult rv = GetInfo(aFrame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv)) if (NS_FAILED(rv))
return rv; return rv;
@ -828,12 +817,11 @@ nsAccessibilityService::CreateHTMLTableHeadAccessible(nsIDOMNode *aDOMNode, nsIA
} }
NS_IMETHODIMP NS_IMETHODIMP
nsAccessibilityService::CreateHTMLTableCellAccessible(nsISupports *aFrame, nsIAccessible **_retval) nsAccessibilityService::CreateHTMLTableCellAccessible(nsIFrame *aFrame, nsIAccessible **_retval)
{ {
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node; nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell; nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node)); nsresult rv = GetInfo(aFrame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv)) if (NS_FAILED(rv))
return rv; return rv;
@ -846,14 +834,13 @@ nsAccessibilityService::CreateHTMLTableCellAccessible(nsISupports *aFrame, nsIAc
} }
NS_IMETHODIMP NS_IMETHODIMP
nsAccessibilityService::CreateHTMLTextAccessible(nsISupports *aFrame, nsIAccessible **_retval) nsAccessibilityService::CreateHTMLTextAccessible(nsIFrame *aFrame, nsIAccessible **_retval)
{ {
*_retval = nsnull; *_retval = nsnull;
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node; nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell; nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node)); nsresult rv = GetInfo(aFrame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv)) if (NS_FAILED(rv))
return rv; return rv;
@ -867,12 +854,11 @@ nsAccessibilityService::CreateHTMLTextAccessible(nsISupports *aFrame, nsIAccessi
} }
NS_IMETHODIMP NS_IMETHODIMP
nsAccessibilityService::CreateHTMLTextFieldAccessible(nsISupports *aFrame, nsIAccessible **_retval) nsAccessibilityService::CreateHTMLTextFieldAccessible(nsIFrame *aFrame, nsIAccessible **_retval)
{ {
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node; nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell; nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node)); nsresult rv = GetInfo(aFrame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv)) if (NS_FAILED(rv))
return rv; return rv;
@ -885,12 +871,11 @@ nsAccessibilityService::CreateHTMLTextFieldAccessible(nsISupports *aFrame, nsIAc
} }
NS_IMETHODIMP NS_IMETHODIMP
nsAccessibilityService::CreateHTMLLabelAccessible(nsISupports *aFrame, nsIAccessible **_retval) nsAccessibilityService::CreateHTMLLabelAccessible(nsIFrame *aFrame, nsIAccessible **_retval)
{ {
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node; nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell; nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node)); nsresult rv = GetInfo(aFrame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv)) if (NS_FAILED(rv))
return rv; return rv;
@ -903,12 +888,11 @@ nsAccessibilityService::CreateHTMLLabelAccessible(nsISupports *aFrame, nsIAccess
} }
NS_IMETHODIMP NS_IMETHODIMP
nsAccessibilityService::CreateHTMLHRAccessible(nsISupports *aFrame, nsIAccessible **_retval) nsAccessibilityService::CreateHTMLHRAccessible(nsIFrame *aFrame, nsIAccessible **_retval)
{ {
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node; nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell; nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node)); nsresult rv = GetInfo(aFrame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv)) if (NS_FAILED(rv))
return rv; return rv;
@ -921,12 +905,11 @@ nsAccessibilityService::CreateHTMLHRAccessible(nsISupports *aFrame, nsIAccessibl
} }
NS_IMETHODIMP NS_IMETHODIMP
nsAccessibilityService::CreateHTMLBRAccessible(nsISupports *aFrame, nsIAccessible **_retval) nsAccessibilityService::CreateHTMLBRAccessible(nsIFrame *aFrame, nsIAccessible **_retval)
{ {
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node; nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell; nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node)); nsresult rv = GetInfo(aFrame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv)) if (NS_FAILED(rv))
return rv; return rv;
@ -939,12 +922,11 @@ nsAccessibilityService::CreateHTMLBRAccessible(nsISupports *aFrame, nsIAccessibl
} }
NS_IMETHODIMP NS_IMETHODIMP
nsAccessibilityService::CreateHTMLCaptionAccessible(nsISupports *aFrame, nsIAccessible **_retval) nsAccessibilityService::CreateHTMLCaptionAccessible(nsIFrame *aFrame, nsIAccessible **_retval)
{ {
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node; nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell; nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node)); nsresult rv = GetInfo(aFrame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv)) if (NS_FAILED(rv))
return rv; return rv;
@ -1410,8 +1392,7 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode,
// image frame is the image content. // image frame is the image content.
// Check if frame is an image frame, and content is <area> // Check if frame is an image frame, and content is <area>
nsIImageFrame *imageFrame; nsIImageFrame *imageFrame = do_QueryFrame(frame);
CallQueryInterface(frame, &imageFrame);
nsCOMPtr<nsIDOMHTMLAreaElement> areaElmt = do_QueryInterface(content); nsCOMPtr<nsIDOMHTMLAreaElement> areaElmt = do_QueryInterface(content);
if (imageFrame && areaElmt) { if (imageFrame && areaElmt) {
nsCOMPtr<nsIAccessible> imageAcc; nsCOMPtr<nsIAccessible> imageAcc;

Просмотреть файл

@ -89,12 +89,11 @@ private:
* Return presentation shell, DOM node for the given frame. * Return presentation shell, DOM node for the given frame.
* *
* @param aFrame - the given frame * @param aFrame - the given frame
* @param aRealFrame [out] - the given frame casted to nsIFrame
* @param aShell [out] - presentation shell for DOM node associated with the * @param aShell [out] - presentation shell for DOM node associated with the
* given frame * given frame
* @param aContent [out] - DOM node associated with the given frame * @param aContent [out] - DOM node associated with the given frame
*/ */
nsresult GetInfo(nsISupports *aFrame, nsIFrame **aRealFrame, nsresult GetInfo(nsIFrame *aFrame,
nsIWeakReference **aShell, nsIWeakReference **aShell,
nsIDOMNode **aContent); nsIDOMNode **aContent);

Просмотреть файл

@ -2785,8 +2785,7 @@ NS_IMETHODIMP nsAccessible::GetAccessibleRelated(PRUint32 aRelationType, nsIAcce
if (frame) { if (frame) {
nsIView *view = frame->GetViewExternal(); nsIView *view = frame->GetViewExternal();
if (view) { if (view) {
nsIScrollableFrame *scrollFrame = nsnull; nsIScrollableFrame *scrollFrame = do_QueryFrame(frame);
CallQueryInterface(frame, &scrollFrame);
if (scrollFrame || view->GetWidget()) { if (scrollFrame || view->GetWidget()) {
return GetParent(aRelated); return GetParent(aRelated);
} }

Просмотреть файл

@ -331,8 +331,7 @@ nsCoreUtils::ScrollFrameToPoint(nsIFrame *aScrollableFrame,
nsIFrame *aFrame, nsIFrame *aFrame,
const nsIntPoint& aPoint) const nsIntPoint& aPoint)
{ {
nsIScrollableFrame *scrollableFrame = nsnull; nsIScrollableFrame *scrollableFrame = do_QueryFrame(aScrollableFrame);
CallQueryInterface(aScrollableFrame, &scrollableFrame);
if (!scrollableFrame) if (!scrollableFrame)
return; return;

Просмотреть файл

@ -841,8 +841,7 @@ nsresult nsRootAccessible::HandleEventWithTarget(nsIDOMEvent* aEvent,
nsIFrame* menuFrame = menuAccessNode->GetFrame(); nsIFrame* menuFrame = menuAccessNode->GetFrame();
NS_ENSURE_TRUE(menuFrame, NS_ERROR_FAILURE); NS_ENSURE_TRUE(menuFrame, NS_ERROR_FAILURE);
nsIMenuFrame* imenuFrame; nsIMenuFrame* imenuFrame = do_QueryFrame(menuFrame);
CallQueryInterface(menuFrame, &imenuFrame);
if (imenuFrame) if (imenuFrame)
fireFocus = PR_TRUE; fireFocus = PR_TRUE;
// QI failed for nsIMenuFrame means it's not on menu bar // QI failed for nsIMenuFrame means it's not on menu bar

Просмотреть файл

@ -120,6 +120,8 @@ NS_IMETHODIMP
nsHTMLAreaAccessible::GetBounds(PRInt32 *x, PRInt32 *y, nsHTMLAreaAccessible::GetBounds(PRInt32 *x, PRInt32 *y,
PRInt32 *width, PRInt32 *height) PRInt32 *width, PRInt32 *height)
{ {
nsresult rv;
// Essentially this uses GetRect on mAreas of nsImageMap from nsImageFrame // Essentially this uses GetRect on mAreas of nsImageMap from nsImageFrame
*x = *y = *width = *height = 0; *x = *y = *width = *height = 0;
@ -132,9 +134,7 @@ nsHTMLAreaAccessible::GetBounds(PRInt32 *x, PRInt32 *y,
nsIFrame *frame = GetFrame(); nsIFrame *frame = GetFrame();
NS_ENSURE_TRUE(frame, NS_ERROR_FAILURE); NS_ENSURE_TRUE(frame, NS_ERROR_FAILURE);
nsIImageFrame *imageFrame; nsIImageFrame *imageFrame = do_QueryFrame(frame);
nsresult rv = frame->QueryInterface(NS_GET_IID(nsIImageFrame), (void**)&imageFrame);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIImageMap> map; nsCOMPtr<nsIImageMap> map;
imageFrame->GetImageMap(presContext, getter_AddRefs(map)); imageFrame->GetImageMap(presContext, getter_AddRefs(map));

Просмотреть файл

@ -292,8 +292,7 @@ nsHTMLButtonAccessible::GetNameInternal(nsAString& aName)
// Use the button's (default) label if nothing else works // Use the button's (default) label if nothing else works
nsIFrame* frame = GetFrame(); nsIFrame* frame = GetFrame();
if (frame) { if (frame) {
nsIFormControlFrame* fcFrame = nsnull; nsIFormControlFrame* fcFrame = do_QueryFrame(frame);
CallQueryInterface(frame, &fcFrame);
if (fcFrame) if (fcFrame)
fcFrame->GetFormProperty(nsAccessibilityAtoms::defaultLabel, name); fcFrame->GetFormProperty(nsAccessibilityAtoms::defaultLabel, name);
} }

Просмотреть файл

@ -743,14 +743,12 @@ NS_IMETHODIMP nsHTMLSelectOptionAccessible::DoAction(PRUint8 index)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
nsIFrame *selectFrame = presShell->GetPrimaryFrameFor(selectContent); nsIFrame *selectFrame = presShell->GetPrimaryFrameFor(selectContent);
nsIComboboxControlFrame *comboBoxFrame = nsnull; nsIComboboxControlFrame *comboBoxFrame = do_QueryFrame(selectFrame);
CallQueryInterface(selectFrame, &comboBoxFrame);
if (comboBoxFrame) { if (comboBoxFrame) {
nsIFrame *listFrame = comboBoxFrame->GetDropDown(); nsIFrame *listFrame = comboBoxFrame->GetDropDown();
if (comboBoxFrame->IsDroppedDown() && listFrame) { if (comboBoxFrame->IsDroppedDown() && listFrame) {
// use this list control frame to roll up the list // use this list control frame to roll up the list
nsIListControlFrame *listControlFrame = nsnull; nsIListControlFrame *listControlFrame = do_QueryFrame(listFrame);
listFrame->QueryInterface(NS_GET_IID(nsIListControlFrame), (void**)&listControlFrame);
if (listControlFrame) { if (listControlFrame) {
PRInt32 newIndex = 0; PRInt32 newIndex = 0;
option->GetIndex(&newIndex); option->GetIndex(&newIndex);
@ -797,8 +795,7 @@ nsresult nsHTMLSelectOptionAccessible::GetFocusedOptionNode(nsIDOMNode *aListNod
nsresult rv = selectElement->GetOptions(getter_AddRefs(options)); nsresult rv = selectElement->GetOptions(getter_AddRefs(options));
if (NS_SUCCEEDED(rv)) { if (NS_SUCCEEDED(rv)) {
nsIListControlFrame *listFrame = nsnull; nsIListControlFrame *listFrame = do_QueryFrame(frame);
frame->QueryInterface(NS_GET_IID(nsIListControlFrame), (void**)&listFrame);
if (listFrame) { if (listFrame) {
// Get what's focused in listbox by asking frame for "selected item". // Get what's focused in listbox by asking frame for "selected item".
// Can't use dom interface for this, because it will always return the first selected item // Can't use dom interface for this, because it will always return the first selected item
@ -1016,8 +1013,7 @@ void nsHTMLComboboxAccessible::CacheChildren()
if (!frame) { if (!frame) {
return; return;
} }
nsIComboboxControlFrame *comboFrame = nsnull; nsIComboboxControlFrame *comboFrame = do_QueryFrame(frame);
frame->QueryInterface(NS_GET_IID(nsIComboboxControlFrame), (void**)&comboFrame);
if (!comboFrame) { if (!comboFrame) {
return; return;
} }
@ -1076,11 +1072,7 @@ nsHTMLComboboxAccessible::GetStateInternal(PRUint32 *aState,
NS_ENSURE_A11Y_SUCCESS(rv, rv); NS_ENSURE_A11Y_SUCCESS(rv, rv);
nsIFrame *frame = GetBoundsFrame(); nsIFrame *frame = GetBoundsFrame();
nsIComboboxControlFrame *comboFrame = nsnull; nsIComboboxControlFrame *comboFrame = do_QueryFrame(frame);
if (frame) {
frame->QueryInterface(NS_GET_IID(nsIComboboxControlFrame), (void**)&comboFrame);
}
if (comboFrame && comboFrame->IsDroppedDown()) { if (comboFrame && comboFrame->IsDroppedDown()) {
*aState |= nsIAccessibleStates::STATE_EXPANDED; *aState |= nsIAccessibleStates::STATE_EXPANDED;
} }
@ -1160,8 +1152,7 @@ NS_IMETHODIMP nsHTMLComboboxAccessible::DoAction(PRUint8 aIndex)
if (!frame) { if (!frame) {
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
nsIComboboxControlFrame *comboFrame = nsnull; nsIComboboxControlFrame *comboFrame = do_QueryFrame(frame);
frame->QueryInterface(NS_GET_IID(nsIComboboxControlFrame), (void**)&comboFrame);
if (!comboFrame) { if (!comboFrame) {
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
@ -1186,8 +1177,7 @@ NS_IMETHODIMP nsHTMLComboboxAccessible::GetActionName(PRUint8 aIndex, nsAString&
if (!frame) { if (!frame) {
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
nsIComboboxControlFrame *comboFrame = nsnull; nsIComboboxControlFrame *comboFrame = do_QueryFrame(frame);
frame->QueryInterface(NS_GET_IID(nsIComboboxControlFrame), (void**)&comboFrame);
if (!comboFrame) { if (!comboFrame) {
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
@ -1428,8 +1418,7 @@ nsHTMLComboboxListAccessible::GetFrame()
nsIFrame* frame = nsHTMLSelectListAccessible::GetFrame(); nsIFrame* frame = nsHTMLSelectListAccessible::GetFrame();
if (frame) { if (frame) {
nsIComboboxControlFrame* comboBox; nsIComboboxControlFrame* comboBox = do_QueryFrame(frame);
CallQueryInterface(frame, &comboBox);
if (comboBox) { if (comboBox) {
return comboBox->GetDropDown(); return comboBox->GetDropDown();
} }
@ -1454,10 +1443,7 @@ nsHTMLComboboxListAccessible::GetStateInternal(PRUint32 *aState,
NS_ENSURE_A11Y_SUCCESS(rv, rv); NS_ENSURE_A11Y_SUCCESS(rv, rv);
nsIFrame *boundsFrame = GetBoundsFrame(); nsIFrame *boundsFrame = GetBoundsFrame();
nsIComboboxControlFrame* comboFrame = nsnull; nsIComboboxControlFrame* comboFrame = do_QueryFrame(boundsFrame);
if (boundsFrame)
boundsFrame->QueryInterface(NS_GET_IID(nsIComboboxControlFrame), (void**)&comboFrame);
if (comboFrame && comboFrame->IsDroppedDown()) if (comboFrame && comboFrame->IsDroppedDown())
*aState |= nsIAccessibleStates::STATE_FLOATING; *aState |= nsIAccessibleStates::STATE_FLOATING;
else else

Просмотреть файл

@ -95,8 +95,7 @@ nsHTMLTableCellAccessible::GetAttributesInternal(nsIPersistentProperties *aAttri
NS_ASSERTION(frame, "The frame cannot be obtaied for HTML table cell."); NS_ASSERTION(frame, "The frame cannot be obtaied for HTML table cell.");
NS_ENSURE_STATE(frame); NS_ENSURE_STATE(frame);
nsITableCellLayout *cellLayout = nsnull; nsITableCellLayout *cellLayout = do_QueryFrame(frame);
CallQueryInterface(frame, &cellLayout);
NS_ENSURE_STATE(cellLayout); NS_ENSURE_STATE(cellLayout);
PRInt32 rowIdx = -1, cellIdx = -1; PRInt32 rowIdx = -1, cellIdx = -1;
@ -928,7 +927,11 @@ nsHTMLTableAccessible::GetTableLayout(nsITableLayout **aTableLayout)
NS_ENSURE_TRUE(shell, NS_ERROR_FAILURE); NS_ENSURE_TRUE(shell, NS_ERROR_FAILURE);
nsIFrame *frame = shell->GetPrimaryFrameFor(tableContent); nsIFrame *frame = shell->GetPrimaryFrameFor(tableContent);
return frame ? CallQueryInterface(frame, aTableLayout) : NS_ERROR_FAILURE; if (!frame)
return NS_ERROR_FAILURE;
*aTableLayout = do_QueryFrame(frame);
return (*aTableLayout) ? NS_OK : NS_NOINTERFACE;
} }
nsresult nsresult

Просмотреть файл

@ -2044,8 +2044,7 @@ nsHyperTextAccessible::ScrollSubstringToPoint(PRInt32 aStartIndex,
PRBool initialScrolled = PR_FALSE; PRBool initialScrolled = PR_FALSE;
nsIFrame *parentFrame = frame; nsIFrame *parentFrame = frame;
while ((parentFrame = parentFrame->GetParent())) { while ((parentFrame = parentFrame->GetParent())) {
nsIScrollableFrame *scrollableFrame = nsnull; nsIScrollableFrame *scrollableFrame = do_QueryFrame(parentFrame);
CallQueryInterface(parentFrame, &scrollableFrame);
if (scrollableFrame) { if (scrollableFrame) {
if (!initialScrolled) { if (!initialScrolled) {
// Scroll substring to the given point. Turn the point into percents // Scroll substring to the given point. Turn the point into percents

Просмотреть файл

@ -216,8 +216,7 @@ __try {
else { else {
// If a frame is a scrollable frame, then it has one window for the client area, // If a frame is a scrollable frame, then it has one window for the client area,
// not an extra parent window for just the scrollbars // not an extra parent window for just the scrollbars
nsIScrollableFrame *scrollFrame = nsnull; nsIScrollableFrame *scrollFrame = do_QueryFrame(frame);
CallQueryInterface(frame, &scrollFrame);
if (scrollFrame) { if (scrollFrame) {
hwnd = (HWND)scrollFrame->GetScrolledFrame()->GetWindow()->GetNativeData(NS_NATIVE_WINDOW); hwnd = (HWND)scrollFrame->GetScrolledFrame()->GetWindow()->GetNativeData(NS_NATIVE_WINDOW);
NS_ASSERTION(hwnd, "No window handle for window"); NS_ASSERTION(hwnd, "No window handle for window");

Просмотреть файл

@ -635,8 +635,7 @@ nsFrameLoader::SwapWithOtherLoader(nsFrameLoader* aOther,
return NS_ERROR_NOT_IMPLEMENTED; return NS_ERROR_NOT_IMPLEMENTED;
} }
nsIFrameFrame* ourFrameFrame = nsnull; nsIFrameFrame* ourFrameFrame = do_QueryFrame(ourFrame);
CallQueryInterface(ourFrame, &ourFrameFrame);
if (!ourFrameFrame) { if (!ourFrameFrame) {
mInSwap = aOther->mInSwap = PR_FALSE; mInSwap = aOther->mInSwap = PR_FALSE;
FirePageShowEvent(ourTreeItem, ourChromeEventHandler, PR_TRUE); FirePageShowEvent(ourTreeItem, ourChromeEventHandler, PR_TRUE);

Просмотреть файл

@ -1117,12 +1117,9 @@ nsNSElementTearoff::GetScrollInfo(nsIScrollableView **aScrollableView,
} }
// Get the scrollable frame // Get the scrollable frame
nsIScrollableFrame *scrollFrame = nsnull; nsIScrollableFrame *scrollFrame = do_QueryFrame(frame);
CallQueryInterface(frame, &scrollFrame);
if (!scrollFrame) { if (!scrollFrame) {
nsIScrollableViewProvider *scrollProvider = nsnull; nsIScrollableViewProvider *scrollProvider = do_QueryFrame(frame);
CallQueryInterface(frame, &scrollProvider);
// menu frames implement nsIScrollableViewProvider but we don't want // menu frames implement nsIScrollableViewProvider but we don't want
// to use it here. // to use it here.
if (scrollProvider && frame->GetType() != nsGkAtoms::menuFrame) { if (scrollProvider && frame->GetType() != nsGkAtoms::menuFrame) {
@ -1151,7 +1148,7 @@ nsNSElementTearoff::GetScrollInfo(nsIScrollableView **aScrollableView,
break; break;
} }
CallQueryInterface(frame, &scrollFrame); scrollFrame = do_QueryFrame(frame);
} while (!scrollFrame); } while (!scrollFrame);
} }

Просмотреть файл

@ -561,8 +561,7 @@ nsObjectLoadingContent::OnStartRequest(nsIRequest *aRequest,
} }
{ {
nsIFrame *nsiframe; nsIFrame *nsiframe = do_QueryFrame(frame);
CallQueryInterface(frame, &nsiframe);
nsWeakFrame weakFrame(nsiframe); nsWeakFrame weakFrame(nsiframe);
@ -751,8 +750,7 @@ nsObjectLoadingContent::EnsureInstantiation(nsIPluginInstance** aInstance)
} }
} }
nsIFrame *nsiframe; nsIFrame *nsiframe = do_QueryFrame(frame);
CallQueryInterface(frame, &nsiframe);
nsWeakFrame weakFrame(nsiframe); nsWeakFrame weakFrame(nsiframe);
// We may have a plugin instance already; if so, do nothing // We may have a plugin instance already; if so, do nothing
@ -805,8 +803,7 @@ nsObjectLoadingContent::HasNewFrame(nsIObjectFrame* aFrame)
} }
} }
nsIFrame* frame = nsnull; nsIFrame* frame = do_QueryFrame(aFrame);
CallQueryInterface(aFrame, &frame);
nsCOMPtr<nsIRunnable> event = nsCOMPtr<nsIRunnable> event =
new nsAsyncInstantiateEvent(this, frame, mContentType, mURI); new nsAsyncInstantiateEvent(this, frame, mContentType, mURI);
if (!event) { if (!event) {
@ -1652,8 +1649,7 @@ nsObjectLoadingContent::GetExistingFrame(FlushType aFlushType)
aFlushType = eDontFlush; aFlushType = eDontFlush;
} while (1); } while (1);
nsIObjectFrame* objFrame; nsIObjectFrame* objFrame = do_QueryFrame(frame);
CallQueryInterface(frame, &objFrame);
return objFrame; return objFrame;
} }
@ -1695,8 +1691,7 @@ nsObjectLoadingContent::TryInstantiate(const nsACString& aMIMEType,
// frame does have a plugin instance already, be sure to // frame does have a plugin instance already, be sure to
// re-instantiate the plugin as its source or whatnot might have // re-instantiate the plugin as its source or whatnot might have
// chanced since it was instantiated. // chanced since it was instantiated.
nsIFrame* iframe; nsIFrame* iframe = do_QueryFrame(frame);
CallQueryInterface(frame, &iframe);
if (iframe->GetStateBits() & NS_FRAME_FIRST_REFLOW) { if (iframe->GetStateBits() & NS_FRAME_FIRST_REFLOW) {
LOG(("OBJLC [%p]: Frame hasn't been reflown yet\n", this)); LOG(("OBJLC [%p]: Frame hasn't been reflown yet\n", this));
return NS_OK; // Not a failure to have no frame return NS_OK; // Not a failure to have no frame

Просмотреть файл

@ -2379,8 +2379,7 @@ nsEventStateManager::DoDefaultDragStart(nsPresContext* aPresContext,
if (presShell) { if (presShell) {
nsIFrame* frame = presShell->GetPrimaryFrameFor(content); nsIFrame* frame = presShell->GetPrimaryFrameFor(content);
if (frame) { if (frame) {
nsTreeBodyFrame* treeBody; nsTreeBodyFrame* treeBody = do_QueryFrame(frame);
CallQueryInterface(frame, &treeBody);
treeBody->GetSelectionRegion(getter_AddRefs(region)); treeBody->GetSelectionRegion(getter_AddRefs(region));
} }
} }
@ -2535,8 +2534,7 @@ static nsIScrollableView*
GetScrollableViewForFrame(nsPresContext* aPresContext, nsIFrame* aFrame) GetScrollableViewForFrame(nsPresContext* aPresContext, nsIFrame* aFrame)
{ {
for (; aFrame; aFrame = GetParentFrameToScroll(aPresContext, aFrame)) { for (; aFrame; aFrame = GetParentFrameToScroll(aPresContext, aFrame)) {
nsIScrollableViewProvider* svp; nsIScrollableViewProvider* svp = do_QueryFrame(aFrame);
CallQueryInterface(aFrame, &svp);
if (svp) { if (svp) {
nsIScrollableView* scrollView = svp->GetScrollableView(); nsIScrollableView* scrollView = svp->GetScrollableView();
if (scrollView) if (scrollView)
@ -2612,8 +2610,7 @@ nsEventStateManager::DoScrollText(nsPresContext* aPresContext,
// operation, even if the mouse hasn't moved. // operation, even if the mouse hasn't moved.
nsIFrame* lastScrollFrame = nsMouseWheelTransaction::GetTargetFrame(); nsIFrame* lastScrollFrame = nsMouseWheelTransaction::GetTargetFrame();
if (lastScrollFrame) { if (lastScrollFrame) {
nsIScrollableViewProvider* svp; nsIScrollableViewProvider* svp = do_QueryFrame(lastScrollFrame);
CallQueryInterface(lastScrollFrame, &svp);
if (svp) { if (svp) {
scrollView = svp->GetScrollableView(); scrollView = svp->GetScrollableView();
nsMouseWheelTransaction::UpdateTransaction(); nsMouseWheelTransaction::UpdateTransaction();
@ -2628,8 +2625,7 @@ nsEventStateManager::DoScrollText(nsPresContext* aPresContext,
scrollFrame = GetParentFrameToScroll(aPresContext, scrollFrame)) { scrollFrame = GetParentFrameToScroll(aPresContext, scrollFrame)) {
// Check whether the frame wants to provide us with a scrollable view. // Check whether the frame wants to provide us with a scrollable view.
scrollView = nsnull; scrollView = nsnull;
nsIScrollableViewProvider* svp; nsIScrollableViewProvider* svp = do_QueryFrame(scrollFrame);
CallQueryInterface(scrollFrame, &svp);
if (svp) { if (svp) {
scrollView = svp->GetScrollableView(); scrollView = svp->GetScrollableView();
} }
@ -2658,8 +2654,7 @@ nsEventStateManager::DoScrollText(nsPresContext* aPresContext,
} }
// Comboboxes need special care. // Comboboxes need special care.
nsIComboboxControlFrame* comboBox = nsnull; nsIComboboxControlFrame* comboBox = do_QueryFrame(scrollFrame);
CallQueryInterface(scrollFrame, &comboBox);
if (comboBox) { if (comboBox) {
if (comboBox->IsDroppedDown()) { if (comboBox->IsDroppedDown()) {
// Don't propagate to parent when drop down menu is active. // Don't propagate to parent when drop down menu is active.
@ -3593,8 +3588,7 @@ nsEventStateManager::NotifyMouseOut(nsGUIEvent* aEvent, nsIContent* aMovingInto)
if (mLastMouseOverFrame) { if (mLastMouseOverFrame) {
// if the frame is associated with a subdocument, // if the frame is associated with a subdocument,
// tell the subdocument that we're moving out of it // tell the subdocument that we're moving out of it
nsIFrameFrame* subdocFrame; nsIFrameFrame* subdocFrame = do_QueryFrame(mLastMouseOverFrame.GetFrame());
CallQueryInterface(mLastMouseOverFrame.GetFrame(), &subdocFrame);
if (subdocFrame) { if (subdocFrame) {
nsCOMPtr<nsIDocShell> docshell; nsCOMPtr<nsIDocShell> docshell;
subdocFrame->GetDocShell(getter_AddRefs(docshell)); subdocFrame->GetDocShell(getter_AddRefs(docshell));
@ -5215,9 +5209,7 @@ nsEventStateManager::SendFocusBlur(nsPresContext* aPresContext,
currentFocusFrame = presShell->GetPrimaryFrameFor(mCurrentFocus); currentFocusFrame = presShell->GetPrimaryFrameFor(mCurrentFocus);
if (!currentFocusFrame) if (!currentFocusFrame)
currentFocusFrame = mCurrentTarget; currentFocusFrame = mCurrentTarget;
nsIObjectFrame* objFrame = nsnull; nsIObjectFrame* objFrame = do_QueryFrame(currentFocusFrame);
if (currentFocusFrame)
CallQueryInterface(currentFocusFrame, &objFrame);
if (objFrame) { if (objFrame) {
nsIView* view = currentFocusFrame->GetViewExternal(); nsIView* view = currentFocusFrame->GetViewExternal();
NS_ASSERTION(view, "Object frames must have views"); NS_ASSERTION(view, "Object frames must have views");

Просмотреть файл

@ -1326,8 +1326,7 @@ nsGenericHTMLElement::GetFormControlFrameFor(nsIContent* aContent,
} }
nsIFrame* frame = GetPrimaryFrameFor(aContent, aDocument); nsIFrame* frame = GetPrimaryFrameFor(aContent, aDocument);
if (frame) { if (frame) {
nsIFormControlFrame* form_frame = nsnull; nsIFormControlFrame* form_frame = do_QueryFrame(frame);
CallQueryInterface(frame, &form_frame);
if (form_frame) { if (form_frame) {
return form_frame; return form_frame;
} }
@ -1337,7 +1336,7 @@ nsGenericHTMLElement::GetFormControlFrameFor(nsIContent* aContent,
for (frame = frame->GetFirstChild(nsnull); for (frame = frame->GetFirstChild(nsnull);
frame; frame;
frame = frame->GetNextSibling()) { frame = frame->GetNextSibling()) {
CallQueryInterface(frame, &form_frame); form_frame = do_QueryFrame(frame);
if (form_frame) { if (form_frame) {
return form_frame; return form_frame;
} }
@ -3552,8 +3551,7 @@ nsGenericHTMLElement::GetEditorInternal(nsIEditor** aEditor)
nsIFormControlFrame *fcFrame = GetFormControlFrame(PR_FALSE); nsIFormControlFrame *fcFrame = GetFormControlFrame(PR_FALSE);
if (fcFrame) { if (fcFrame) {
nsITextControlFrame *textFrame = nsnull; nsITextControlFrame *textFrame = do_QueryFrame(fcFrame);
CallQueryInterface(fcFrame, &textFrame);
if (textFrame) { if (textFrame) {
return textFrame->GetEditor(aEditor); return textFrame->GetEditor(aEditor);
} }

Просмотреть файл

@ -306,9 +306,7 @@ nsHTMLButtonElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
nsIFormControlFrame* formControlFrame = GetFormControlFrame(PR_FALSE); nsIFormControlFrame* formControlFrame = GetFormControlFrame(PR_FALSE);
if (formControlFrame) { if (formControlFrame) {
nsIFrame* formFrame = nsnull; nsIFrame* formFrame = do_QueryFrame(formControlFrame);
CallQueryInterface(formControlFrame, &formFrame);
if (formFrame) { if (formFrame) {
const nsStyleUserInterface* uiStyle = formFrame->GetStyleUserInterface(); const nsStyleUserInterface* uiStyle = formFrame->GetStyleUserInterface();

Просмотреть файл

@ -787,9 +787,7 @@ nsHTMLInputElement::GetValue(nsAString& aValue)
PRBool frameOwnsValue = PR_FALSE; PRBool frameOwnsValue = PR_FALSE;
if (formControlFrame) { if (formControlFrame) {
nsITextControlFrame* textControlFrame = nsnull; nsITextControlFrame* textControlFrame = do_QueryFrame(formControlFrame);
CallQueryInterface(formControlFrame, &textControlFrame);
if (textControlFrame) { if (textControlFrame) {
textControlFrame->OwnsValue(&frameOwnsValue); textControlFrame->OwnsValue(&frameOwnsValue);
} else { } else {
@ -993,7 +991,7 @@ nsHTMLInputElement::SetValueInternal(const nsAString& aValue,
formControlFrame = GetFormControlFrame(PR_FALSE); formControlFrame = GetFormControlFrame(PR_FALSE);
if (formControlFrame) { if (formControlFrame) {
CallQueryInterface(formControlFrame, &textControlFrame); textControlFrame = do_QueryFrame(formControlFrame);
} }
} }
@ -1266,14 +1264,12 @@ nsHTMLInputElement::SetCheckedInternal(PRBool aChecked, PRBool aNotify)
nsPresContext *presContext = GetPresContext(); nsPresContext *presContext = GetPresContext();
if (mType == NS_FORM_INPUT_CHECKBOX) { if (mType == NS_FORM_INPUT_CHECKBOX) {
nsICheckboxControlFrame* checkboxFrame = nsnull; nsICheckboxControlFrame* checkboxFrame = do_QueryFrame(frame);
CallQueryInterface(frame, &checkboxFrame);
if (checkboxFrame) { if (checkboxFrame) {
checkboxFrame->OnChecked(presContext, aChecked); checkboxFrame->OnChecked(presContext, aChecked);
} }
} else if (mType == NS_FORM_INPUT_RADIO) { } else if (mType == NS_FORM_INPUT_RADIO) {
nsIRadioControlFrame* radioFrame = nsnull; nsIRadioControlFrame* radioFrame = do_QueryFrame(frame);
CallQueryInterface(frame, &radioFrame);
if (radioFrame) { if (radioFrame) {
radioFrame->OnChecked(presContext, aChecked); radioFrame->OnChecked(presContext, aChecked);
} }
@ -1600,8 +1596,7 @@ nsHTMLInputElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
if (aVisitor.mEvent->message == NS_BLUR_CONTENT) { if (aVisitor.mEvent->message == NS_BLUR_CONTENT) {
nsIFrame* primaryFrame = GetPrimaryFrame(); nsIFrame* primaryFrame = GetPrimaryFrame();
if (primaryFrame) { if (primaryFrame) {
nsITextControlFrame* textFrame = nsnull; nsITextControlFrame* textFrame = do_QueryFrame(primaryFrame);
CallQueryInterface(primaryFrame, &textFrame);
if (textFrame) { if (textFrame) {
textFrame->CheckFireOnChange(); textFrame->CheckFireOnChange();
} }
@ -1839,8 +1834,7 @@ nsHTMLInputElement::PostHandleEvent(nsEventChainPostVisitor& aVisitor)
if (!isButton) { if (!isButton) {
nsIFrame* primaryFrame = GetPrimaryFrame(); nsIFrame* primaryFrame = GetPrimaryFrame();
if (primaryFrame) { if (primaryFrame) {
nsITextControlFrame* textFrame = nsnull; nsITextControlFrame* textFrame = do_QueryFrame(primaryFrame);
CallQueryInterface(primaryFrame, &textFrame);
// Fire onChange (if necessary) // Fire onChange (if necessary)
if (textFrame) { if (textFrame) {
@ -2212,9 +2206,7 @@ nsHTMLInputElement::SetSelectionRange(PRInt32 aSelectionStart,
nsIFormControlFrame* formControlFrame = GetFormControlFrame(PR_TRUE); nsIFormControlFrame* formControlFrame = GetFormControlFrame(PR_TRUE);
if (formControlFrame) { if (formControlFrame) {
nsITextControlFrame* textControlFrame = nsnull; nsITextControlFrame* textControlFrame = do_QueryFrame(formControlFrame);
CallQueryInterface(formControlFrame, &textControlFrame);
if (textControlFrame) if (textControlFrame)
rv = textControlFrame->SetSelectionRange(aSelectionStart, aSelectionEnd); rv = textControlFrame->SetSelectionRange(aSelectionStart, aSelectionEnd);
} }
@ -2238,9 +2230,7 @@ nsHTMLInputElement::SetSelectionStart(PRInt32 aSelectionStart)
nsIFormControlFrame* formControlFrame = GetFormControlFrame(PR_TRUE); nsIFormControlFrame* formControlFrame = GetFormControlFrame(PR_TRUE);
if (formControlFrame) { if (formControlFrame) {
nsITextControlFrame* textControlFrame = nsnull; nsITextControlFrame* textControlFrame = do_QueryFrame(formControlFrame);
CallQueryInterface(formControlFrame, &textControlFrame);
if (textControlFrame) if (textControlFrame)
rv = textControlFrame->SetSelectionStart(aSelectionStart); rv = textControlFrame->SetSelectionStart(aSelectionStart);
} }
@ -2265,9 +2255,7 @@ nsHTMLInputElement::SetSelectionEnd(PRInt32 aSelectionEnd)
nsIFormControlFrame* formControlFrame = GetFormControlFrame(PR_TRUE); nsIFormControlFrame* formControlFrame = GetFormControlFrame(PR_TRUE);
if (formControlFrame) { if (formControlFrame) {
nsITextControlFrame* textControlFrame = nsnull; nsITextControlFrame* textControlFrame = do_QueryFrame(formControlFrame);
CallQueryInterface(formControlFrame, &textControlFrame);
if (textControlFrame) if (textControlFrame)
rv = textControlFrame->SetSelectionEnd(aSelectionEnd); rv = textControlFrame->SetSelectionEnd(aSelectionEnd);
} }
@ -2304,9 +2292,7 @@ nsHTMLInputElement::GetSelectionRange(PRInt32* aSelectionStart,
nsIFormControlFrame* formControlFrame = GetFormControlFrame(PR_TRUE); nsIFormControlFrame* formControlFrame = GetFormControlFrame(PR_TRUE);
if (formControlFrame) { if (formControlFrame) {
nsITextControlFrame* textControlFrame = nsnull; nsITextControlFrame* textControlFrame = do_QueryFrame(formControlFrame);
CallQueryInterface(formControlFrame, &textControlFrame);
if (textControlFrame) if (textControlFrame)
rv = textControlFrame->GetSelectionRange(aSelectionStart, aSelectionEnd); rv = textControlFrame->GetSelectionRange(aSelectionStart, aSelectionEnd);
} }
@ -2321,9 +2307,7 @@ nsHTMLInputElement::GetPhonetic(nsAString& aPhonetic)
nsIFormControlFrame* formControlFrame = GetFormControlFrame(PR_TRUE); nsIFormControlFrame* formControlFrame = GetFormControlFrame(PR_TRUE);
if (formControlFrame) { if (formControlFrame) {
nsITextControlFrame* textControlFrame = nsnull; nsITextControlFrame* textControlFrame = do_QueryFrame(formControlFrame);
CallQueryInterface(formControlFrame, &textControlFrame);
if (textControlFrame) if (textControlFrame)
textControlFrame->GetPhonetic(aPhonetic); textControlFrame->GetPhonetic(aPhonetic);
} }

Просмотреть файл

@ -323,11 +323,7 @@ nsHTMLObjectElement::SubmitNamesValues(nsIFormSubmission *aFormSubmission,
nsIFrame* frame = GetPrimaryFrame(); nsIFrame* frame = GetPrimaryFrame();
nsIObjectFrame *objFrame = nsnull; nsIObjectFrame *objFrame = do_QueryFrame(frame);
if (frame) {
CallQueryInterface(frame, &objFrame);
}
if (!objFrame) { if (!objFrame) {
// No frame, nothing to submit. // No frame, nothing to submit.

Просмотреть файл

@ -601,7 +601,7 @@ nsHTMLSelectElement::GetSelectFrame()
nsISelectControlFrame *select_frame = nsnull; nsISelectControlFrame *select_frame = nsnull;
if (form_control_frame) { if (form_control_frame) {
CallQueryInterface(form_control_frame, &select_frame); select_frame = do_QueryFrame(form_control_frame);
} }
return select_frame; return select_frame;
@ -1440,9 +1440,7 @@ nsHTMLSelectElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
nsIFrame* formFrame = nsnull; nsIFrame* formFrame = nsnull;
if (formControlFrame && if (formControlFrame &&
NS_SUCCEEDED(CallQueryInterface(formControlFrame, &formFrame)) && (formFrame = do_QueryFrame(formControlFrame))) {
formFrame)
{
const nsStyleUserInterface* uiStyle = formFrame->GetStyleUserInterface(); const nsStyleUserInterface* uiStyle = formFrame->GetStyleUserInterface();
if (uiStyle->mUserInput == NS_STYLE_USER_INPUT_NONE || if (uiStyle->mUserInput == NS_STYLE_USER_INPUT_NONE ||
@ -1702,14 +1700,12 @@ void nsHTMLSelectElement::DispatchContentReset() {
// Only dispatch content reset notification if this is a list control // Only dispatch content reset notification if this is a list control
// frame or combo box control frame. // frame or combo box control frame.
if (IsCombobox()) { if (IsCombobox()) {
nsIComboboxControlFrame* comboFrame = nsnull; nsIComboboxControlFrame* comboFrame = do_QueryFrame(formControlFrame);
CallQueryInterface(formControlFrame, &comboFrame);
if (comboFrame) { if (comboFrame) {
comboFrame->OnContentReset(); comboFrame->OnContentReset();
} }
} else { } else {
nsIListControlFrame* listFrame = nsnull; nsIListControlFrame* listFrame = do_QueryFrame(formControlFrame);
CallQueryInterface(formControlFrame, &listFrame);
if (listFrame) { if (listFrame) {
listFrame->OnContentReset(); listFrame->OnContentReset();
} }

Просмотреть файл

@ -410,7 +410,7 @@ nsHTMLTextAreaElement::GetValueInternal(nsAString& aValue, PRBool aIgnoreWrap)
nsIFrame* primaryFrame = GetPrimaryFrame(); nsIFrame* primaryFrame = GetPrimaryFrame();
nsITextControlFrame* textControlFrame = nsnull; nsITextControlFrame* textControlFrame = nsnull;
if (primaryFrame) { if (primaryFrame) {
CallQueryInterface(primaryFrame, &textControlFrame); textControlFrame = do_QueryFrame(primaryFrame);
} }
// If the frame exists and owns the value, get it from the frame. Otherwise // If the frame exists and owns the value, get it from the frame. Otherwise
@ -453,7 +453,7 @@ nsHTMLTextAreaElement::SetValueInternal(const nsAString& aValue,
formControlFrame = GetFormControlFrame(PR_FALSE); formControlFrame = GetFormControlFrame(PR_FALSE);
if (formControlFrame) { if (formControlFrame) {
CallQueryInterface(formControlFrame, &textControlFrame); textControlFrame = do_QueryFrame(formControlFrame);
} }
} }
@ -593,8 +593,7 @@ nsHTMLTextAreaElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
nsIFrame* formFrame = nsnull; nsIFrame* formFrame = nsnull;
if (formControlFrame && if (formControlFrame &&
NS_SUCCEEDED(CallQueryInterface(formControlFrame, &formFrame)) && (formFrame = do_QueryFrame(formControlFrame))) {
formFrame) {
const nsStyleUserInterface* uiStyle = formFrame->GetStyleUserInterface(); const nsStyleUserInterface* uiStyle = formFrame->GetStyleUserInterface();
if (uiStyle->mUserInput == NS_STYLE_USER_INPUT_NONE || if (uiStyle->mUserInput == NS_STYLE_USER_INPUT_NONE ||
@ -628,8 +627,7 @@ nsHTMLTextAreaElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
if (aVisitor.mEvent->message == NS_BLUR_CONTENT) { if (aVisitor.mEvent->message == NS_BLUR_CONTENT) {
nsIFrame* primaryFrame = GetPrimaryFrame(); nsIFrame* primaryFrame = GetPrimaryFrame();
if (primaryFrame) { if (primaryFrame) {
nsITextControlFrame* textFrame = nsnull; nsITextControlFrame* textFrame = do_QueryFrame(primaryFrame);
CallQueryInterface(primaryFrame, &textFrame);
if (textFrame) { if (textFrame) {
textFrame->CheckFireOnChange(); textFrame->CheckFireOnChange();
} }
@ -730,9 +728,7 @@ nsHTMLTextAreaElement::SetSelectionStart(PRInt32 aSelectionStart)
nsIFormControlFrame* formControlFrame = GetFormControlFrame(PR_TRUE); nsIFormControlFrame* formControlFrame = GetFormControlFrame(PR_TRUE);
if (formControlFrame){ if (formControlFrame){
nsITextControlFrame* textControlFrame = nsnull; nsITextControlFrame* textControlFrame = do_QueryFrame(formControlFrame);
CallQueryInterface(formControlFrame, &textControlFrame);
if (textControlFrame) if (textControlFrame)
rv = textControlFrame->SetSelectionStart(aSelectionStart); rv = textControlFrame->SetSelectionStart(aSelectionStart);
} }
@ -756,9 +752,7 @@ nsHTMLTextAreaElement::SetSelectionEnd(PRInt32 aSelectionEnd)
nsIFormControlFrame* formControlFrame = GetFormControlFrame(PR_TRUE); nsIFormControlFrame* formControlFrame = GetFormControlFrame(PR_TRUE);
if (formControlFrame) { if (formControlFrame) {
nsITextControlFrame* textControlFrame = nsnull; nsITextControlFrame* textControlFrame = do_QueryFrame(formControlFrame);
CallQueryInterface(formControlFrame, &textControlFrame);
if (textControlFrame) if (textControlFrame)
rv = textControlFrame->SetSelectionEnd(aSelectionEnd); rv = textControlFrame->SetSelectionEnd(aSelectionEnd);
} }
@ -774,9 +768,7 @@ nsHTMLTextAreaElement::GetSelectionRange(PRInt32* aSelectionStart,
nsIFormControlFrame* formControlFrame = GetFormControlFrame(PR_TRUE); nsIFormControlFrame* formControlFrame = GetFormControlFrame(PR_TRUE);
if (formControlFrame) { if (formControlFrame) {
nsITextControlFrame* textControlFrame = nsnull; nsITextControlFrame* textControlFrame = do_QueryFrame(formControlFrame);
CallQueryInterface(formControlFrame, &textControlFrame);
if (textControlFrame) if (textControlFrame)
rv = textControlFrame->GetSelectionRange(aSelectionStart, aSelectionEnd); rv = textControlFrame->GetSelectionRange(aSelectionStart, aSelectionEnd);
} }
@ -791,9 +783,7 @@ nsHTMLTextAreaElement::SetSelectionRange(PRInt32 aSelectionStart, PRInt32 aSelec
nsIFormControlFrame* formControlFrame = GetFormControlFrame(PR_TRUE); nsIFormControlFrame* formControlFrame = GetFormControlFrame(PR_TRUE);
if (formControlFrame) { if (formControlFrame) {
nsITextControlFrame* textControlFrame = nsnull; nsITextControlFrame* textControlFrame = do_QueryFrame(formControlFrame);
CallQueryInterface(formControlFrame, &textControlFrame);
if (textControlFrame) if (textControlFrame)
rv = textControlFrame->SetSelectionRange(aSelectionStart, aSelectionEnd); rv = textControlFrame->SetSelectionRange(aSelectionStart, aSelectionEnd);
} }

Просмотреть файл

@ -144,8 +144,7 @@ nsPluginStreamListener::SetupPlugin()
return NS_OK; return NS_OK;
} }
nsIObjectFrame* objFrame; nsIObjectFrame* objFrame = do_QueryFrame(frame);
CallQueryInterface(frame, &objFrame);
if (!objFrame) { if (!objFrame) {
mPluginDoc->AllowNormalInstantiation(); mPluginDoc->AllowNormalInstantiation();
return NS_ERROR_UNEXPECTED; return NS_ERROR_UNEXPECTED;
@ -342,9 +341,7 @@ nsPluginDocument::Print()
nsIFrame* frame = shell->GetPrimaryFrameFor(mPluginContent); nsIFrame* frame = shell->GetPrimaryFrameFor(mPluginContent);
NS_ENSURE_TRUE(frame, NS_ERROR_FAILURE); NS_ENSURE_TRUE(frame, NS_ERROR_FAILURE);
nsIObjectFrame* objectFrame = nsnull; nsIObjectFrame* objectFrame = do_QueryFrame(frame);
CallQueryInterface(frame, &objectFrame);
if (objectFrame) { if (objectFrame) {
nsCOMPtr<nsIPluginInstance> pi; nsCOMPtr<nsIPluginInstance> pi;
objectFrame->GetPluginInstance(*getter_AddRefs(pi)); objectFrame->GetPluginInstance(*getter_AddRefs(pi));

Просмотреть файл

@ -39,21 +39,18 @@
#ifndef __NS_ISVGTEXTCONTENTMETRICS_H__ #ifndef __NS_ISVGTEXTCONTENTMETRICS_H__
#define __NS_ISVGTEXTCONTENTMETRICS_H__ #define __NS_ISVGTEXTCONTENTMETRICS_H__
#include "nsISupports.h" #include "nsQueryFrame.h"
class nsIDOMSVGRect; class nsIDOMSVGRect;
class nsIDOMSVGPoint; class nsIDOMSVGPoint;
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
// nsISVGTextContentMetrics // nsISVGTextContentMetrics
// {CBF0A774-4171-4112-BD9A-F49BEFC0CE18} class nsISVGTextContentMetrics
#define NS_ISVGTEXTCONTENTMETRICS_IID \
{ 0xcbf0a774, 0x4171, 0x4112, { 0xbd, 0x9a, 0xf4, 0x9b, 0xef, 0xc0, 0xce, 0x18 } }
class nsISVGTextContentMetrics : public nsISupports
{ {
public: public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISVGTEXTCONTENTMETRICS_IID) NS_DECLARE_FRAME_ACCESSOR(nsISVGTextContentMetrics)
NS_IMETHOD GetNumberOfChars(PRInt32 *_retval)=0; NS_IMETHOD GetNumberOfChars(PRInt32 *_retval)=0;
NS_IMETHOD GetComputedTextLength(float *_retval)=0; NS_IMETHOD GetComputedTextLength(float *_retval)=0;
@ -65,7 +62,4 @@ public:
NS_IMETHOD GetCharNumAtPosition(nsIDOMSVGPoint *point, PRInt32 *_retval)=0; NS_IMETHOD GetCharNumAtPosition(nsIDOMSVGPoint *point, PRInt32 *_retval)=0;
}; };
NS_DEFINE_STATIC_IID_ACCESSOR(nsISVGTextContentMetrics,
NS_ISVGTEXTCONTENTMETRICS_IID)
#endif // __NS_ISVGTEXTCONTENTMETRICS_H__ #endif // __NS_ISVGTEXTCONTENTMETRICS_H__

Просмотреть файл

@ -41,6 +41,7 @@
#define __NS_ISVGVALUE_H__ #define __NS_ISVGVALUE_H__
#include "nsISupports.h" #include "nsISupports.h"
#include "nsQueryFrame.h"
#include "nsString.h" #include "nsString.h"
class nsISVGValueObserver; class nsISVGValueObserver;
@ -72,6 +73,7 @@ public:
}; };
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISVGVALUE_IID) NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISVGVALUE_IID)
NS_DECLARE_FRAME_ACCESSOR(nsISVGValue)
NS_IMETHOD SetValueString(const nsAString& aValue)=0; NS_IMETHOD SetValueString(const nsAString& aValue)=0;
NS_IMETHOD GetValueString(nsAString& aValue)=0; NS_IMETHOD GetValueString(nsAString& aValue)=0;

Просмотреть файл

@ -94,8 +94,7 @@ NS_IMETHODIMP nsSVGGraphicElement::GetBBox(nsIDOMSVGRect **_retval)
if (!frame || (frame->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) if (!frame || (frame->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD))
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
nsISVGChildFrame* svgframe; nsISVGChildFrame* svgframe = do_QueryFrame(frame);
CallQueryInterface(frame, &svgframe);
NS_ASSERTION(svgframe, "wrong frame type"); NS_ASSERTION(svgframe, "wrong frame type");
if (svgframe) { if (svgframe) {
svgframe->SetMatrixPropagation(PR_FALSE); svgframe->SetMatrixPropagation(PR_FALSE);

Просмотреть файл

@ -276,8 +276,7 @@ nsSVGPatternElement::PushUpdate()
nsIFrame *frame = GetPrimaryFrame(); nsIFrame *frame = GetPrimaryFrame();
if (frame) { if (frame) {
nsISVGValue *value = nsnull; nsISVGValue *value = do_QueryFrame(frame);
CallQueryInterface(frame, &value);
if (value) { if (value) {
value->BeginBatchUpdate(); value->BeginBatchUpdate();
value->EndBatchUpdate(); value->EndBatchUpdate();

Просмотреть файл

@ -365,8 +365,7 @@ nsSVGSVGElement::SuspendRedraw(PRUint32 max_wait_milliseconds, PRUint32 *_retval
NS_ASSERTION(frame, "suspending redraw w/o frame"); NS_ASSERTION(frame, "suspending redraw w/o frame");
#endif #endif
if (frame) { if (frame) {
nsISVGSVGFrame* svgframe; nsISVGSVGFrame* svgframe = do_QueryFrame(frame);
CallQueryInterface(frame, &svgframe);
NS_ASSERTION(svgframe, "wrong frame type"); NS_ASSERTION(svgframe, "wrong frame type");
if (svgframe) { if (svgframe) {
svgframe->SuspendRedraw(); svgframe->SuspendRedraw();
@ -404,8 +403,7 @@ nsSVGSVGElement::UnsuspendRedrawAll()
NS_ASSERTION(frame, "unsuspending redraw w/o frame"); NS_ASSERTION(frame, "unsuspending redraw w/o frame");
#endif #endif
if (frame) { if (frame) {
nsISVGSVGFrame* svgframe; nsISVGSVGFrame* svgframe = do_QueryFrame(frame);
CallQueryInterface(frame, &svgframe);
NS_ASSERTION(svgframe, "wrong frame type"); NS_ASSERTION(svgframe, "wrong frame type");
if (svgframe) { if (svgframe) {
svgframe->UnsuspendRedraw(); svgframe->UnsuspendRedraw();
@ -658,8 +656,7 @@ nsSVGSVGElement::GetBBox(nsIDOMSVGRect **_retval)
if (!frame || (frame->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) if (!frame || (frame->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD))
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
nsISVGChildFrame* svgframe; nsISVGChildFrame* svgframe = do_QueryFrame(frame);
CallQueryInterface(frame, &svgframe);
if (svgframe) { if (svgframe) {
svgframe->SetMatrixPropagation(PR_FALSE); svgframe->SetMatrixPropagation(PR_FALSE);
svgframe->NotifySVGChanged(nsISVGChildFrame::SUPPRESS_INVALIDATION | svgframe->NotifySVGChanged(nsISVGChildFrame::SUPPRESS_INVALIDATION |
@ -1297,8 +1294,7 @@ nsSVGSVGElement::InvalidateTransformNotifyFrame()
nsIFrame* frame = presShell->GetPrimaryFrameFor(this); nsIFrame* frame = presShell->GetPrimaryFrameFor(this);
if (frame) { if (frame) {
nsISVGSVGFrame* svgframe; nsISVGSVGFrame* svgframe = do_QueryFrame(frame);
CallQueryInterface(frame, &svgframe);
if (svgframe) { if (svgframe) {
svgframe->NotifyViewportChange(); svgframe->NotifyViewportChange();
} }

Просмотреть файл

@ -97,9 +97,7 @@ nsSVGSwitchElement::MaybeInvalidate()
nsIFrame *frame = GetPrimaryFrame(); nsIFrame *frame = GetPrimaryFrame();
if (frame) { if (frame) {
nsISVGChildFrame* svgFrame = nsnull; nsISVGChildFrame* svgFrame = do_QueryFrame(frame);
CallQueryInterface(frame, &svgFrame);
if (svgFrame) { if (svgFrame) {
nsSVGUtils::UpdateGraphic(svgFrame); nsSVGUtils::UpdateGraphic(svgFrame);
} }

Просмотреть файл

@ -82,7 +82,7 @@ protected:
// nsSVGElement overrides // nsSVGElement overrides
virtual PRBool IsEventName(nsIAtom* aName); virtual PRBool IsEventName(nsIAtom* aName);
already_AddRefed<nsISVGTextContentMetrics> GetTextContentMetrics(); nsISVGTextContentMetrics* GetTextContentMetrics();
// nsIDOMSVGTextPositioning properties: // nsIDOMSVGTextPositioning properties:
nsCOMPtr<nsIDOMSVGAnimatedLengthList> mX; nsCOMPtr<nsIDOMSVGAnimatedLengthList> mX;
@ -253,7 +253,7 @@ NS_IMETHODIMP nsSVGTSpanElement::GetLengthAdjust(nsIDOMSVGAnimatedEnumeration *
/* long getNumberOfChars (); */ /* long getNumberOfChars (); */
NS_IMETHODIMP nsSVGTSpanElement::GetNumberOfChars(PRInt32 *_retval) NS_IMETHODIMP nsSVGTSpanElement::GetNumberOfChars(PRInt32 *_retval)
{ {
nsCOMPtr<nsISVGTextContentMetrics> metrics = GetTextContentMetrics(); nsISVGTextContentMetrics *metrics = GetTextContentMetrics();
if (metrics) if (metrics)
return metrics->GetNumberOfChars(_retval); return metrics->GetNumberOfChars(_retval);
@ -265,7 +265,7 @@ NS_IMETHODIMP nsSVGTSpanElement::GetNumberOfChars(PRInt32 *_retval)
/* float getComputedTextLength (); */ /* float getComputedTextLength (); */
NS_IMETHODIMP nsSVGTSpanElement::GetComputedTextLength(float *_retval) NS_IMETHODIMP nsSVGTSpanElement::GetComputedTextLength(float *_retval)
{ {
nsCOMPtr<nsISVGTextContentMetrics> metrics = GetTextContentMetrics(); nsISVGTextContentMetrics *metrics = GetTextContentMetrics();
if (metrics) if (metrics)
return metrics->GetComputedTextLength(_retval); return metrics->GetComputedTextLength(_retval);
@ -277,7 +277,7 @@ NS_IMETHODIMP nsSVGTSpanElement::GetComputedTextLength(float *_retval)
/* float getSubStringLength (in unsigned long charnum, in unsigned long nchars); */ /* float getSubStringLength (in unsigned long charnum, in unsigned long nchars); */
NS_IMETHODIMP nsSVGTSpanElement::GetSubStringLength(PRUint32 charnum, PRUint32 nchars, float *_retval) NS_IMETHODIMP nsSVGTSpanElement::GetSubStringLength(PRUint32 charnum, PRUint32 nchars, float *_retval)
{ {
nsCOMPtr<nsISVGTextContentMetrics> metrics = GetTextContentMetrics(); nsISVGTextContentMetrics *metrics = GetTextContentMetrics();
if (metrics) if (metrics)
return metrics->GetSubStringLength(charnum, nchars, _retval); return metrics->GetSubStringLength(charnum, nchars, _retval);
@ -290,7 +290,7 @@ NS_IMETHODIMP nsSVGTSpanElement::GetSubStringLength(PRUint32 charnum, PRUint32 n
NS_IMETHODIMP nsSVGTSpanElement::GetStartPositionOfChar(PRUint32 charnum, nsIDOMSVGPoint **_retval) NS_IMETHODIMP nsSVGTSpanElement::GetStartPositionOfChar(PRUint32 charnum, nsIDOMSVGPoint **_retval)
{ {
*_retval = nsnull; *_retval = nsnull;
nsCOMPtr<nsISVGTextContentMetrics> metrics = GetTextContentMetrics(); nsISVGTextContentMetrics *metrics = GetTextContentMetrics();
if (!metrics) return NS_ERROR_FAILURE; if (!metrics) return NS_ERROR_FAILURE;
@ -301,7 +301,7 @@ NS_IMETHODIMP nsSVGTSpanElement::GetStartPositionOfChar(PRUint32 charnum, nsIDOM
NS_IMETHODIMP nsSVGTSpanElement::GetEndPositionOfChar(PRUint32 charnum, nsIDOMSVGPoint **_retval) NS_IMETHODIMP nsSVGTSpanElement::GetEndPositionOfChar(PRUint32 charnum, nsIDOMSVGPoint **_retval)
{ {
*_retval = nsnull; *_retval = nsnull;
nsCOMPtr<nsISVGTextContentMetrics> metrics = GetTextContentMetrics(); nsISVGTextContentMetrics *metrics = GetTextContentMetrics();
if (!metrics) return NS_ERROR_FAILURE; if (!metrics) return NS_ERROR_FAILURE;
@ -312,7 +312,7 @@ NS_IMETHODIMP nsSVGTSpanElement::GetEndPositionOfChar(PRUint32 charnum, nsIDOMSV
NS_IMETHODIMP nsSVGTSpanElement::GetExtentOfChar(PRUint32 charnum, nsIDOMSVGRect **_retval) NS_IMETHODIMP nsSVGTSpanElement::GetExtentOfChar(PRUint32 charnum, nsIDOMSVGRect **_retval)
{ {
*_retval = nsnull; *_retval = nsnull;
nsCOMPtr<nsISVGTextContentMetrics> metrics = GetTextContentMetrics(); nsISVGTextContentMetrics *metrics = GetTextContentMetrics();
if (!metrics) return NS_ERROR_FAILURE; if (!metrics) return NS_ERROR_FAILURE;
@ -324,7 +324,7 @@ NS_IMETHODIMP nsSVGTSpanElement::GetRotationOfChar(PRUint32 charnum, float *_ret
{ {
*_retval = 0.0; *_retval = 0.0;
nsCOMPtr<nsISVGTextContentMetrics> metrics = GetTextContentMetrics(); nsISVGTextContentMetrics *metrics = GetTextContentMetrics();
if (!metrics) return NS_ERROR_FAILURE; if (!metrics) return NS_ERROR_FAILURE;
@ -339,7 +339,7 @@ NS_IMETHODIMP nsSVGTSpanElement::GetCharNumAtPosition(nsIDOMSVGPoint *point,
if (!point) if (!point)
return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR; return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR;
nsCOMPtr<nsISVGTextContentMetrics> metrics = GetTextContentMetrics(); nsISVGTextContentMetrics *metrics = GetTextContentMetrics();
if (metrics) if (metrics)
return metrics->GetCharNumAtPosition(point, _retval); return metrics->GetCharNumAtPosition(point, _retval);
@ -385,7 +385,7 @@ nsSVGTSpanElement::IsEventName(nsIAtom* aName)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// implementation helpers: // implementation helpers:
already_AddRefed<nsISVGTextContentMetrics> nsISVGTextContentMetrics*
nsSVGTSpanElement::GetTextContentMetrics() nsSVGTSpanElement::GetTextContentMetrics()
{ {
nsIFrame* frame = GetPrimaryFrame(Flush_Layout); nsIFrame* frame = GetPrimaryFrame(Flush_Layout);
@ -394,7 +394,6 @@ nsSVGTSpanElement::GetTextContentMetrics()
return nsnull; return nsnull;
} }
nsISVGTextContentMetrics* metrics; nsISVGTextContentMetrics* metrics = do_QueryFrame(frame);
CallQueryInterface(frame, &metrics);
return metrics; return metrics;
} }

Просмотреть файл

@ -80,7 +80,7 @@ public:
protected: protected:
already_AddRefed<nsISVGTextContentMetrics> GetTextContentMetrics(); nsISVGTextContentMetrics* GetTextContentMetrics();
// nsIDOMSVGTextPositioning properties: // nsIDOMSVGTextPositioning properties:
nsCOMPtr<nsIDOMSVGAnimatedLengthList> mX; nsCOMPtr<nsIDOMSVGAnimatedLengthList> mX;
@ -250,7 +250,7 @@ NS_IMETHODIMP nsSVGTextElement::GetLengthAdjust(nsIDOMSVGAnimatedEnumeration * *
/* long getNumberOfChars (); */ /* long getNumberOfChars (); */
NS_IMETHODIMP nsSVGTextElement::GetNumberOfChars(PRInt32 *_retval) NS_IMETHODIMP nsSVGTextElement::GetNumberOfChars(PRInt32 *_retval)
{ {
nsCOMPtr<nsISVGTextContentMetrics> metrics = GetTextContentMetrics(); nsISVGTextContentMetrics *metrics = GetTextContentMetrics();
if (metrics) if (metrics)
return metrics->GetNumberOfChars(_retval); return metrics->GetNumberOfChars(_retval);
@ -262,7 +262,7 @@ NS_IMETHODIMP nsSVGTextElement::GetNumberOfChars(PRInt32 *_retval)
/* float getComputedTextLength (); */ /* float getComputedTextLength (); */
NS_IMETHODIMP nsSVGTextElement::GetComputedTextLength(float *_retval) NS_IMETHODIMP nsSVGTextElement::GetComputedTextLength(float *_retval)
{ {
nsCOMPtr<nsISVGTextContentMetrics> metrics = GetTextContentMetrics(); nsISVGTextContentMetrics *metrics = GetTextContentMetrics();
if (metrics) if (metrics)
return metrics->GetComputedTextLength(_retval); return metrics->GetComputedTextLength(_retval);
@ -274,7 +274,7 @@ NS_IMETHODIMP nsSVGTextElement::GetComputedTextLength(float *_retval)
/* float getSubStringLength (in unsigned long charnum, in unsigned long nchars); */ /* float getSubStringLength (in unsigned long charnum, in unsigned long nchars); */
NS_IMETHODIMP nsSVGTextElement::GetSubStringLength(PRUint32 charnum, PRUint32 nchars, float *_retval) NS_IMETHODIMP nsSVGTextElement::GetSubStringLength(PRUint32 charnum, PRUint32 nchars, float *_retval)
{ {
nsCOMPtr<nsISVGTextContentMetrics> metrics = GetTextContentMetrics(); nsISVGTextContentMetrics *metrics = GetTextContentMetrics();
if (metrics) if (metrics)
return metrics->GetSubStringLength(charnum, nchars, _retval); return metrics->GetSubStringLength(charnum, nchars, _retval);
@ -287,7 +287,7 @@ NS_IMETHODIMP nsSVGTextElement::GetSubStringLength(PRUint32 charnum, PRUint32 nc
NS_IMETHODIMP nsSVGTextElement::GetStartPositionOfChar(PRUint32 charnum, nsIDOMSVGPoint **_retval) NS_IMETHODIMP nsSVGTextElement::GetStartPositionOfChar(PRUint32 charnum, nsIDOMSVGPoint **_retval)
{ {
*_retval = nsnull; *_retval = nsnull;
nsCOMPtr<nsISVGTextContentMetrics> metrics = GetTextContentMetrics(); nsISVGTextContentMetrics *metrics = GetTextContentMetrics();
if (!metrics) return NS_ERROR_FAILURE; if (!metrics) return NS_ERROR_FAILURE;
@ -298,7 +298,7 @@ NS_IMETHODIMP nsSVGTextElement::GetStartPositionOfChar(PRUint32 charnum, nsIDOMS
NS_IMETHODIMP nsSVGTextElement::GetEndPositionOfChar(PRUint32 charnum, nsIDOMSVGPoint **_retval) NS_IMETHODIMP nsSVGTextElement::GetEndPositionOfChar(PRUint32 charnum, nsIDOMSVGPoint **_retval)
{ {
*_retval = nsnull; *_retval = nsnull;
nsCOMPtr<nsISVGTextContentMetrics> metrics = GetTextContentMetrics(); nsISVGTextContentMetrics *metrics = GetTextContentMetrics();
if (!metrics) return NS_ERROR_FAILURE; if (!metrics) return NS_ERROR_FAILURE;
@ -309,7 +309,7 @@ NS_IMETHODIMP nsSVGTextElement::GetEndPositionOfChar(PRUint32 charnum, nsIDOMSVG
NS_IMETHODIMP nsSVGTextElement::GetExtentOfChar(PRUint32 charnum, nsIDOMSVGRect **_retval) NS_IMETHODIMP nsSVGTextElement::GetExtentOfChar(PRUint32 charnum, nsIDOMSVGRect **_retval)
{ {
*_retval = nsnull; *_retval = nsnull;
nsCOMPtr<nsISVGTextContentMetrics> metrics = GetTextContentMetrics(); nsISVGTextContentMetrics *metrics = GetTextContentMetrics();
if (!metrics) return NS_ERROR_FAILURE; if (!metrics) return NS_ERROR_FAILURE;
@ -321,7 +321,7 @@ NS_IMETHODIMP nsSVGTextElement::GetRotationOfChar(PRUint32 charnum, float *_retv
{ {
*_retval = 0.0; *_retval = 0.0;
nsCOMPtr<nsISVGTextContentMetrics> metrics = GetTextContentMetrics(); nsISVGTextContentMetrics *metrics = GetTextContentMetrics();
if (!metrics) return NS_ERROR_FAILURE; if (!metrics) return NS_ERROR_FAILURE;
@ -335,7 +335,7 @@ NS_IMETHODIMP nsSVGTextElement::GetCharNumAtPosition(nsIDOMSVGPoint *point, PRIn
if (!point) if (!point)
return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR; return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR;
nsCOMPtr<nsISVGTextContentMetrics> metrics = GetTextContentMetrics(); nsISVGTextContentMetrics *metrics = GetTextContentMetrics();
if (metrics) if (metrics)
return metrics->GetCharNumAtPosition(point, _retval); return metrics->GetCharNumAtPosition(point, _retval);
@ -369,7 +369,7 @@ nsSVGTextElement::IsAttributeMapped(const nsIAtom* name) const
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// implementation helpers: // implementation helpers:
already_AddRefed<nsISVGTextContentMetrics> nsISVGTextContentMetrics*
nsSVGTextElement::GetTextContentMetrics() nsSVGTextElement::GetTextContentMetrics()
{ {
nsIFrame* frame = GetPrimaryFrame(Flush_Layout); nsIFrame* frame = GetPrimaryFrame(Flush_Layout);
@ -378,7 +378,6 @@ nsSVGTextElement::GetTextContentMetrics()
return nsnull; return nsnull;
} }
nsISVGTextContentMetrics* metrics; nsISVGTextContentMetrics* metrics = do_QueryFrame(frame);
CallQueryInterface(frame, &metrics);
return metrics; return metrics;
} }

Просмотреть файл

@ -155,7 +155,7 @@ NS_IMETHODIMP nsSVGTextPathElement::GetLengthAdjust(nsIDOMSVGAnimatedEnumeration
/* long getNumberOfChars (); */ /* long getNumberOfChars (); */
NS_IMETHODIMP nsSVGTextPathElement::GetNumberOfChars(PRInt32 *_retval) NS_IMETHODIMP nsSVGTextPathElement::GetNumberOfChars(PRInt32 *_retval)
{ {
nsCOMPtr<nsISVGTextContentMetrics> metrics = GetTextContentMetrics(); nsISVGTextContentMetrics *metrics = GetTextContentMetrics();
if (metrics) if (metrics)
return metrics->GetNumberOfChars(_retval); return metrics->GetNumberOfChars(_retval);
@ -167,7 +167,7 @@ NS_IMETHODIMP nsSVGTextPathElement::GetNumberOfChars(PRInt32 *_retval)
/* float getComputedTextLength (); */ /* float getComputedTextLength (); */
NS_IMETHODIMP nsSVGTextPathElement::GetComputedTextLength(float *_retval) NS_IMETHODIMP nsSVGTextPathElement::GetComputedTextLength(float *_retval)
{ {
nsCOMPtr<nsISVGTextContentMetrics> metrics = GetTextContentMetrics(); nsISVGTextContentMetrics *metrics = GetTextContentMetrics();
if (metrics) if (metrics)
return metrics->GetComputedTextLength(_retval); return metrics->GetComputedTextLength(_retval);
@ -179,7 +179,7 @@ NS_IMETHODIMP nsSVGTextPathElement::GetComputedTextLength(float *_retval)
/* float getSubStringLength (in unsigned long charnum, in unsigned long nchars); */ /* float getSubStringLength (in unsigned long charnum, in unsigned long nchars); */
NS_IMETHODIMP nsSVGTextPathElement::GetSubStringLength(PRUint32 charnum, PRUint32 nchars, float *_retval) NS_IMETHODIMP nsSVGTextPathElement::GetSubStringLength(PRUint32 charnum, PRUint32 nchars, float *_retval)
{ {
nsCOMPtr<nsISVGTextContentMetrics> metrics = GetTextContentMetrics(); nsISVGTextContentMetrics *metrics = GetTextContentMetrics();
if (metrics) if (metrics)
return metrics->GetSubStringLength(charnum, nchars, _retval); return metrics->GetSubStringLength(charnum, nchars, _retval);
@ -192,7 +192,7 @@ NS_IMETHODIMP nsSVGTextPathElement::GetSubStringLength(PRUint32 charnum, PRUint3
NS_IMETHODIMP nsSVGTextPathElement::GetStartPositionOfChar(PRUint32 charnum, nsIDOMSVGPoint **_retval) NS_IMETHODIMP nsSVGTextPathElement::GetStartPositionOfChar(PRUint32 charnum, nsIDOMSVGPoint **_retval)
{ {
*_retval = nsnull; *_retval = nsnull;
nsCOMPtr<nsISVGTextContentMetrics> metrics = GetTextContentMetrics(); nsISVGTextContentMetrics *metrics = GetTextContentMetrics();
if (!metrics) return NS_ERROR_FAILURE; if (!metrics) return NS_ERROR_FAILURE;
@ -203,7 +203,7 @@ NS_IMETHODIMP nsSVGTextPathElement::GetStartPositionOfChar(PRUint32 charnum, nsI
NS_IMETHODIMP nsSVGTextPathElement::GetEndPositionOfChar(PRUint32 charnum, nsIDOMSVGPoint **_retval) NS_IMETHODIMP nsSVGTextPathElement::GetEndPositionOfChar(PRUint32 charnum, nsIDOMSVGPoint **_retval)
{ {
*_retval = nsnull; *_retval = nsnull;
nsCOMPtr<nsISVGTextContentMetrics> metrics = GetTextContentMetrics(); nsISVGTextContentMetrics *metrics = GetTextContentMetrics();
if (!metrics) return NS_ERROR_FAILURE; if (!metrics) return NS_ERROR_FAILURE;
@ -214,7 +214,7 @@ NS_IMETHODIMP nsSVGTextPathElement::GetEndPositionOfChar(PRUint32 charnum, nsIDO
NS_IMETHODIMP nsSVGTextPathElement::GetExtentOfChar(PRUint32 charnum, nsIDOMSVGRect **_retval) NS_IMETHODIMP nsSVGTextPathElement::GetExtentOfChar(PRUint32 charnum, nsIDOMSVGRect **_retval)
{ {
*_retval = nsnull; *_retval = nsnull;
nsCOMPtr<nsISVGTextContentMetrics> metrics = GetTextContentMetrics(); nsISVGTextContentMetrics *metrics = GetTextContentMetrics();
if (!metrics) return NS_ERROR_FAILURE; if (!metrics) return NS_ERROR_FAILURE;
@ -226,7 +226,7 @@ NS_IMETHODIMP nsSVGTextPathElement::GetRotationOfChar(PRUint32 charnum, float *_
{ {
*_retval = 0.0; *_retval = 0.0;
nsCOMPtr<nsISVGTextContentMetrics> metrics = GetTextContentMetrics(); nsISVGTextContentMetrics *metrics = GetTextContentMetrics();
if (!metrics) return NS_ERROR_FAILURE; if (!metrics) return NS_ERROR_FAILURE;
@ -241,7 +241,7 @@ NS_IMETHODIMP nsSVGTextPathElement::GetCharNumAtPosition(nsIDOMSVGPoint *point,
if (!point) if (!point)
return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR; return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR;
nsCOMPtr<nsISVGTextContentMetrics> metrics = GetTextContentMetrics(); nsISVGTextContentMetrics *metrics = GetTextContentMetrics();
if (metrics) if (metrics)
return metrics->GetCharNumAtPosition(point, _retval); return metrics->GetCharNumAtPosition(point, _retval);
@ -307,7 +307,7 @@ nsSVGTextPathElement::GetStringInfo()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// implementation helpers: // implementation helpers:
already_AddRefed<nsISVGTextContentMetrics> nsISVGTextContentMetrics*
nsSVGTextPathElement::GetTextContentMetrics() nsSVGTextPathElement::GetTextContentMetrics()
{ {
nsIFrame* frame = GetPrimaryFrame(Flush_Layout); nsIFrame* frame = GetPrimaryFrame(Flush_Layout);
@ -316,7 +316,6 @@ nsSVGTextPathElement::GetTextContentMetrics()
return nsnull; return nsnull;
} }
nsISVGTextContentMetrics* metrics; nsISVGTextContentMetrics* metrics = do_QueryFrame(frame);
CallQueryInterface(frame, &metrics);
return metrics; return metrics;
} }

Просмотреть файл

@ -82,7 +82,7 @@ protected:
virtual PRBool IsEventName(nsIAtom* aName); virtual PRBool IsEventName(nsIAtom* aName);
already_AddRefed<nsISVGTextContentMetrics> GetTextContentMetrics(); nsISVGTextContentMetrics* GetTextContentMetrics();
enum { STARTOFFSET }; enum { STARTOFFSET };
nsSVGLength2 mLengthAttributes[1]; nsSVGLength2 mLengthAttributes[1];

Просмотреть файл

@ -4345,8 +4345,7 @@ nsDocShell::GetScrollbarVisibility(PRBool * verticalVisible,
static_cast<nsIFrame*>(scrollView->View()->GetParent()->GetClientData()); static_cast<nsIFrame*>(scrollView->View()->GetParent()->GetClientData());
if (!scrollFrame) if (!scrollFrame)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
nsIScrollableFrame* scrollable = nsnull; nsIScrollableFrame* scrollable = do_QueryFrame(scrollFrame);
CallQueryInterface(scrollFrame, &scrollable);
if (!scrollable) if (!scrollable)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
@ -9264,8 +9263,8 @@ nsDocShell::SetHasFocus(PRBool aHasFocus)
// child lists. aFrame must be non-null. // child lists. aFrame must be non-null.
static nsICanvasFrame* FindCanvasFrame(nsIFrame* aFrame) static nsICanvasFrame* FindCanvasFrame(nsIFrame* aFrame)
{ {
nsICanvasFrame* canvasFrame; nsICanvasFrame* canvasFrame = do_QueryFrame(aFrame);
if (NS_SUCCEEDED(CallQueryInterface(aFrame, &canvasFrame))) { if (canvasFrame) {
return canvasFrame; return canvasFrame;
} }
@ -9302,8 +9301,8 @@ nsDocShell::SetCanvasHasFocus(PRBool aCanvasHasFocus)
if (frame) { if (frame) {
frame = frame->GetParent(); frame = frame->GetParent();
if (frame) { if (frame) {
nsICanvasFrame* canvasFrame; nsICanvasFrame* canvasFrame = do_QueryFrame(frame);
if (NS_SUCCEEDED(CallQueryInterface(frame, &canvasFrame))) { if (canvasFrame) {
return canvasFrame->SetHasFocus(aCanvasHasFocus); return canvasFrame->SetHasFocus(aCanvasHasFocus);
} }
} }

Просмотреть файл

@ -2730,9 +2730,7 @@ nsHTMLEditor::GetCellIndexes(nsIDOMElement *aCell,
nsIFrame *layoutObject = ps->GetPrimaryFrameFor(nodeAsContent); nsIFrame *layoutObject = ps->GetPrimaryFrameFor(nodeAsContent);
if (!layoutObject) return NS_ERROR_FAILURE; if (!layoutObject) return NS_ERROR_FAILURE;
nsITableCellLayout *cellLayoutObject=nsnull; // again, frames are not ref-counted nsITableCellLayout *cellLayoutObject = do_QueryFrame(layoutObject);
res = layoutObject->QueryInterface(NS_GET_IID(nsITableCellLayout), (void**)(&cellLayoutObject));
if (NS_FAILED(res)) return res;
if (!cellLayoutObject) return NS_ERROR_FAILURE; if (!cellLayoutObject) return NS_ERROR_FAILURE;
return cellLayoutObject->GetCellIndexes(*aRowIndex, *aColIndex); return cellLayoutObject->GetCellIndexes(*aRowIndex, *aColIndex);
} }
@ -2752,8 +2750,8 @@ nsHTMLEditor::GetTableLayoutObject(nsIDOMElement* aTable, nsITableLayout **table
nsIFrame *layoutObject = ps->GetPrimaryFrameFor(nodeAsContent); nsIFrame *layoutObject = ps->GetPrimaryFrameFor(nodeAsContent);
if (!layoutObject) return NS_ERROR_FAILURE; if (!layoutObject) return NS_ERROR_FAILURE;
return layoutObject->QueryInterface(NS_GET_IID(nsITableLayout), *tableLayoutObject = do_QueryFrame(layoutObject);
(void**)(tableLayoutObject)); return *tableLayoutObject ? NS_OK : NS_NOINTERFACE;
} }
//Return actual number of cells (a cell with colspan > 1 counts as just 1) //Return actual number of cells (a cell with colspan > 1 counts as just 1)

Просмотреть файл

@ -378,8 +378,7 @@ nsFindContentIterator::SetupInnerIterator(nsIContent* aContent)
if (!frame) if (!frame)
return; return;
nsITextControlFrame* tcFrame = nsnull; nsITextControlFrame* tcFrame = do_QueryFrame(frame);
CallQueryInterface(frame, &tcFrame);
if (!tcFrame) if (!tcFrame)
return; return;

Просмотреть файл

@ -440,7 +440,7 @@ void nsWebBrowserFind::SetSelectionAndScroll(nsIDOMWindow* aWindow,
nsIFrame* f = presShell->GetPrimaryFrameFor(content); nsIFrame* f = presShell->GetPrimaryFrameFor(content);
if (!f) if (!f)
return; return;
CallQueryInterface(f, &tcFrame); tcFrame = do_QueryFrame(f);
break; break;
} }
} }

Просмотреть файл

@ -53,8 +53,6 @@
#include "nsInlineFrame.h" #include "nsInlineFrame.h"
#include "nsPlaceholderFrame.h" #include "nsPlaceholderFrame.h"
static NS_DEFINE_IID(kInlineFrameCID, NS_INLINE_FRAME_CID);
static const PRUnichar kSpace = 0x0020; static const PRUnichar kSpace = 0x0020;
static const PRUnichar kLineSeparator = 0x2028; static const PRUnichar kLineSeparator = 0x2028;
static const PRUnichar kObjectSubstitute = 0xFFFC; static const PRUnichar kObjectSubstitute = 0xFFFC;
@ -852,9 +850,7 @@ nsBidiPresUtils::RepositionFrame(nsIFrame* aFrame,
isLeftMost /* out */, isLeftMost /* out */,
isRightMost /* out */); isRightMost /* out */);
nsIFrame* testFrame; nsInlineFrame* testFrame = do_QueryFrame(aFrame);
aFrame->QueryInterface(kInlineFrameCID, (void**)&testFrame);
if (testFrame) { if (testFrame) {
aFrame->AddStateBits(NS_INLINE_FRAME_BIDI_VISUAL_STATE_IS_SET); aFrame->AddStateBits(NS_INLINE_FRAME_BIDI_VISUAL_STATE_IS_SET);

Просмотреть файл

@ -4518,8 +4518,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIContent* aDocElement,
PR_TRUE, PR_TRUE,
newFrame); newFrame);
nsIScrollableFrame* scrollable; nsIScrollableFrame* scrollable = do_QueryFrame(newFrame);
CallQueryInterface(newFrame, &scrollable);
NS_ENSURE_TRUE(scrollable, NS_ERROR_FAILURE); NS_ENSURE_TRUE(scrollable, NS_ERROR_FAILURE);
nsIScrollableView* scrollableView = scrollable->GetScrollableView(); nsIScrollableView* scrollableView = scrollable->GetScrollableView();
@ -4674,8 +4673,8 @@ nsCSSFrameConstructor::ConstructRadioControlFrame(nsIFrame** aNewFrame,
radioStyle = mPresShell->StyleSet()->ResolvePseudoStyleFor(aContent, radioStyle = mPresShell->StyleSet()->ResolvePseudoStyleFor(aContent,
nsCSSAnonBoxes::radio, nsCSSAnonBoxes::radio,
aStyleContext); aStyleContext);
nsIRadioControlFrame* radio = nsnull; nsIRadioControlFrame* radio = do_QueryFrame(*aNewFrame);
if (*aNewFrame && NS_SUCCEEDED(CallQueryInterface(*aNewFrame, &radio))) { if (radio) {
radio->SetRadioButtonFaceStyleContext(radioStyle); radio->SetRadioButtonFaceStyleContext(radioStyle);
} }
return NS_OK; return NS_OK;
@ -4695,8 +4694,8 @@ nsCSSFrameConstructor::ConstructCheckboxControlFrame(nsIFrame** aNewFrame,
checkboxStyle = mPresShell->StyleSet()->ResolvePseudoStyleFor(aContent, checkboxStyle = mPresShell->StyleSet()->ResolvePseudoStyleFor(aContent,
nsCSSAnonBoxes::check, nsCSSAnonBoxes::check,
aStyleContext); aStyleContext);
nsICheckboxControlFrame* checkbox = nsnull; nsICheckboxControlFrame* checkbox = do_QueryFrame(*aNewFrame);
if (*aNewFrame && NS_SUCCEEDED(CallQueryInterface(*aNewFrame, &checkbox))) { if (checkbox) {
checkbox->SetCheckboxFaceStyleContext(checkboxStyle); checkbox->SetCheckboxFaceStyleContext(checkboxStyle);
} }
return NS_OK; return NS_OK;
@ -4773,8 +4772,7 @@ nsCSSFrameConstructor::ConstructButtonFrame(nsFrameConstructorState& aState,
#ifdef DEBUG #ifdef DEBUG
// Make sure that we're an anonymous content creator exactly when we're a // Make sure that we're an anonymous content creator exactly when we're a
// leaf // leaf
nsIAnonymousContentCreator* creator = nsnull; nsIAnonymousContentCreator* creator = do_QueryFrame(buttonFrame);
CallQueryInterface(buttonFrame, &creator);
NS_ASSERTION(!creator == !isLeaf, NS_ASSERTION(!creator == !isLeaf,
"Should be creator exactly when we're a leaf"); "Should be creator exactly when we're a leaf");
#endif #endif
@ -4792,8 +4790,7 @@ nsCSSFrameConstructor::ConstructButtonFrame(nsFrameConstructorState& aState,
#ifdef DEBUG #ifdef DEBUG
// Make sure that anonymous child creation will have no effect in this case // Make sure that anonymous child creation will have no effect in this case
nsIAnonymousContentCreator* creator = nsnull; nsIAnonymousContentCreator* creator = do_QueryFrame(blockFrame);
CallQueryInterface(blockFrame, &creator);
NS_ASSERTION(!creator, "Shouldn't be an anonymous content creator!"); NS_ASSERTION(!creator, "Shouldn't be an anonymous content creator!");
#endif #endif
@ -4879,8 +4876,7 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsFrameConstructorState& aState,
/////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////
// Combobox - Old Native Implementation // Combobox - Old Native Implementation
/////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////
nsIComboboxControlFrame* comboBox = nsnull; nsIComboboxControlFrame* comboBox = do_QueryFrame(comboboxFrame);
CallQueryInterface(comboboxFrame, &comboBox);
NS_ASSERTION(comboBox, "NS_NewComboboxControlFrame returned frame that " NS_ASSERTION(comboBox, "NS_NewComboboxControlFrame returned frame that "
"doesn't implement nsIComboboxControlFrame"); "doesn't implement nsIComboboxControlFrame");
@ -4894,9 +4890,8 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsFrameConstructorState& aState,
nsIFrame* listFrame = NS_NewListControlFrame(mPresShell, listStyle); nsIFrame* listFrame = NS_NewListControlFrame(mPresShell, listStyle);
// Notify the listbox that it is being used as a dropdown list. // Notify the listbox that it is being used as a dropdown list.
nsIListControlFrame * listControlFrame; nsIListControlFrame * listControlFrame = do_QueryFrame(listFrame);
rv = CallQueryInterface(listFrame, &listControlFrame); if (listControlFrame) {
if (NS_SUCCEEDED(rv)) {
listControlFrame->SetComboboxFrame(comboboxFrame); listControlFrame->SetComboboxFrame(comboboxFrame);
} }
// Notify combobox that it should use the listbox as it's popup // Notify combobox that it should use the listbox as it's popup
@ -5116,13 +5111,12 @@ nsCSSFrameConstructor::ConstructFieldSetFrame(nsFrameConstructorState& aState,
ProcessChildren(aState, aContent, aStyleContext, blockFrame, PR_TRUE, ProcessChildren(aState, aContent, aStyleContext, blockFrame, PR_TRUE,
childItems, PR_TRUE); childItems, PR_TRUE);
static NS_DEFINE_IID(kLegendFrameCID, NS_LEGEND_FRAME_CID);
nsIFrame * child = childItems.childList; nsIFrame * child = childItems.childList;
nsIFrame * previous = nsnull; nsIFrame * previous = nsnull;
nsIFrame* legendFrame = nsnull; nsLegendFrame* legendFrame = nsnull;
while (nsnull != child) { while (nsnull != child) {
nsresult result = child->QueryInterface(kLegendFrameCID, (void**)&legendFrame); legendFrame = do_QueryFrame(child);
if (NS_SUCCEEDED(result) && legendFrame) { if (legendFrame) {
// We want the legend to be the first frame in the fieldset child list. // We want the legend to be the first frame in the fieldset child list.
// That way the EventStateManager will do the right thing when tabbing // That way the EventStateManager will do the right thing when tabbing
// from a selection point within the legend (bug 236071), which is // from a selection point within the legend (bug 236071), which is
@ -5189,8 +5183,7 @@ nsCSSFrameConstructor::ConstructTextFrame(nsFrameConstructorState& aState,
if (aParentFrame->IsFrameOfType(nsIFrame::eSVG)) { if (aParentFrame->IsFrameOfType(nsIFrame::eSVG)) {
nsIFrame *ancestorFrame = SVG_GetFirstNonAAncestorFrame(aParentFrame); nsIFrame *ancestorFrame = SVG_GetFirstNonAAncestorFrame(aParentFrame);
if (ancestorFrame) { if (ancestorFrame) {
nsISVGTextContentMetrics* metrics; nsISVGTextContentMetrics* metrics = do_QueryFrame(ancestorFrame);
CallQueryInterface(ancestorFrame, &metrics);
if (!metrics) { if (!metrics) {
return NS_OK; return NS_OK;
} }
@ -5580,8 +5573,7 @@ nsCSSFrameConstructor::CreateAnonymousFrames(nsFrameConstructorState& aState,
nsIFrame* aParentFrame, nsIFrame* aParentFrame,
nsFrameItems& aChildItems) nsFrameItems& aChildItems)
{ {
nsIAnonymousContentCreator* creator = nsnull; nsIAnonymousContentCreator* creator = do_QueryFrame(aParentFrame);
CallQueryInterface(aParentFrame, &creator);
if (!creator) if (!creator)
return NS_OK; return NS_OK;
@ -6994,8 +6986,7 @@ nsCSSFrameConstructor::ConstructSVGFrame(nsFrameConstructorState& aState,
else if (aTag == nsGkAtoms::text) { else if (aTag == nsGkAtoms::text) {
nsIFrame *ancestorFrame = SVG_GetFirstNonAAncestorFrame(aParentFrame); nsIFrame *ancestorFrame = SVG_GetFirstNonAAncestorFrame(aParentFrame);
if (ancestorFrame) { if (ancestorFrame) {
nsISVGTextContentMetrics* metrics; nsISVGTextContentMetrics* metrics = do_QueryFrame(ancestorFrame);
CallQueryInterface(ancestorFrame, &metrics);
// Text cannot be nested // Text cannot be nested
if (!metrics) if (!metrics)
newFrame = NS_NewSVGTextFrame(mPresShell, aContent, aStyleContext); newFrame = NS_NewSVGTextFrame(mPresShell, aContent, aStyleContext);
@ -7004,8 +6995,7 @@ nsCSSFrameConstructor::ConstructSVGFrame(nsFrameConstructorState& aState,
else if (aTag == nsGkAtoms::tspan) { else if (aTag == nsGkAtoms::tspan) {
nsIFrame *ancestorFrame = SVG_GetFirstNonAAncestorFrame(aParentFrame); nsIFrame *ancestorFrame = SVG_GetFirstNonAAncestorFrame(aParentFrame);
if (ancestorFrame) { if (ancestorFrame) {
nsISVGTextContentMetrics* metrics; nsISVGTextContentMetrics* metrics = do_QueryFrame(ancestorFrame);
CallQueryInterface(ancestorFrame, &metrics);
if (metrics) if (metrics)
newFrame = NS_NewSVGTSpanFrame(mPresShell, aContent, newFrame = NS_NewSVGTSpanFrame(mPresShell, aContent,
ancestorFrame, aStyleContext); ancestorFrame, aStyleContext);
@ -8500,8 +8490,7 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer,
#ifdef DEBUG #ifdef DEBUG
if (gReallyNoisyContentUpdates) { if (gReallyNoisyContentUpdates) {
nsIFrameDebug* fdbg = nsnull; nsIFrameDebug* fdbg = do_QueryFrame(parentFrame);
CallQueryInterface(parentFrame, &fdbg);
if (fdbg) { if (fdbg) {
printf("nsCSSFrameConstructor::ContentAppended: resulting frame model:\n"); printf("nsCSSFrameConstructor::ContentAppended: resulting frame model:\n");
fdbg->List(stdout, 0); fdbg->List(stdout, 0);
@ -8648,8 +8637,7 @@ nsCSSFrameConstructor::ContentInserted(nsIContent* aContainer,
InvalidateCanvasIfNeeded(docElementFrame); InvalidateCanvasIfNeeded(docElementFrame);
#ifdef DEBUG #ifdef DEBUG
if (gReallyNoisyContentUpdates) { if (gReallyNoisyContentUpdates) {
nsIFrameDebug* fdbg = nsnull; nsIFrameDebug* fdbg = do_QueryFrame(docElementFrame);
CallQueryInterface(docElementFrame, &fdbg);
if (fdbg) { if (fdbg) {
printf("nsCSSFrameConstructor::ContentInserted: resulting frame model:\n"); printf("nsCSSFrameConstructor::ContentInserted: resulting frame model:\n");
fdbg->List(stdout, 0); fdbg->List(stdout, 0);
@ -8941,8 +8929,7 @@ nsCSSFrameConstructor::ContentInserted(nsIContent* aContainer,
#ifdef DEBUG #ifdef DEBUG
if (gReallyNoisyContentUpdates && parentFrame) { if (gReallyNoisyContentUpdates && parentFrame) {
nsIFrameDebug* fdbg = nsnull; nsIFrameDebug* fdbg = do_QueryFrame(parentFrame);
CallQueryInterface(parentFrame, &fdbg);
if (fdbg) { if (fdbg) {
printf("nsCSSFrameConstructor::ContentInserted: resulting frame model:\n"); printf("nsCSSFrameConstructor::ContentInserted: resulting frame model:\n");
fdbg->List(stdout, 0); fdbg->List(stdout, 0);
@ -9320,8 +9307,7 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
nsFrame::ListTag(stdout, childFrame); nsFrame::ListTag(stdout, childFrame);
printf("\n"); printf("\n");
nsIFrameDebug* fdbg = nsnull; nsIFrameDebug* fdbg = do_QueryFrame(parentFrame);
CallQueryInterface(parentFrame, &fdbg);
if (fdbg) if (fdbg)
fdbg->List(stdout, 0); fdbg->List(stdout, 0);
} }
@ -9385,8 +9371,7 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
#ifdef DEBUG #ifdef DEBUG
if (gReallyNoisyContentUpdates && parentFrame) { if (gReallyNoisyContentUpdates && parentFrame) {
nsIFrameDebug* fdbg = nsnull; nsIFrameDebug* fdbg = do_QueryFrame(parentFrame);
CallQueryInterface(parentFrame, &fdbg);
if (fdbg) { if (fdbg) {
printf("nsCSSFrameConstructor::ContentRemoved: resulting frame model:\n"); printf("nsCSSFrameConstructor::ContentRemoved: resulting frame model:\n");
fdbg->List(stdout, 0); fdbg->List(stdout, 0);
@ -12537,16 +12522,15 @@ nsCSSFrameConstructor::ConstructInline(nsFrameConstructorState& aState,
nsIFrameDebug* frameDebug; nsIFrameDebug* frameDebug;
printf("nsCSSFrameConstructor::ConstructInline:\n"); printf("nsCSSFrameConstructor::ConstructInline:\n");
if (NS_SUCCEEDED(CallQueryInterface(aNewFrame, &frameDebug))) { if ( (frameDebug = do_QueryFrame(aNewFrame)) ) {
printf(" ==> leading inline frame:\n"); printf(" ==> leading inline frame:\n");
frameDebug->List(stdout, 2); frameDebug->List(stdout, 2);
} }
if (NS_SUCCEEDED(CallQueryInterface(blockFrame, &frameDebug))) { if ( (frameDebug = do_QueryFrame(blockFrame)) ) {
printf(" ==> block frame:\n"); printf(" ==> block frame:\n");
frameDebug->List(stdout, 2); frameDebug->List(stdout, 2);
} }
if (inlineFrame && if ( (frameDebug = do_QueryFrame(inlineFrame)) ) {
NS_SUCCEEDED(CallQueryInterface(inlineFrame, &frameDebug))) {
printf(" ==> trailing inline frame:\n"); printf(" ==> trailing inline frame:\n");
frameDebug->List(stdout, 2); frameDebug->List(stdout, 2);
} }

Просмотреть файл

@ -240,14 +240,13 @@ protected:
if (mBidiEnabled) { if (mBidiEnabled) {
// Find the containing block frame // Find the containing block frame
nsIFrame* frame = aFrame; nsIFrame* frame = aFrame;
nsresult rv = NS_ERROR_FAILURE; do {
while (frame &&
frame->IsFrameOfType(nsIFrame::eLineParticipant) &&
NS_FAILED(rv)) {
frame = frame->GetParent(); frame = frame->GetParent();
rv = frame->QueryInterface(kBlockFrameCID, (void**)&mBlockFrame); mBlockFrame = do_QueryFrame(frame);
} }
NS_ASSERTION(NS_SUCCEEDED(rv) && mBlockFrame, "Cannot find containing block."); while (frame && frame->IsFrameOfType(nsIFrame::eLineParticipant));
NS_ASSERTION(mBlockFrame, "Cannot find containing block.");
mLineContinuationPoint = mContinuationPoint; mLineContinuationPoint = mContinuationPoint;
} }

Просмотреть файл

@ -1184,8 +1184,7 @@ nsresult nsCaret::UpdateCaretRects(nsIFrame* aFrame, PRInt32 aFrameOffset)
if (scrollFrame) if (scrollFrame)
{ {
// First, use the scrollFrame to get at the scrollable view that we're in. // First, use the scrollFrame to get at the scrollable view that we're in.
nsIScrollableFrame *scrollable; nsIScrollableFrame *scrollable = do_QueryFrame(scrollFrame);
CallQueryInterface(scrollFrame, &scrollable);
nsIScrollableView *scrollView = scrollable->GetScrollableView(); nsIScrollableView *scrollView = scrollable->GetScrollableView();
nsIView *view; nsIView *view;
scrollView->GetScrolledView(view); scrollView->GetScrolledView(view);

Просмотреть файл

@ -3737,8 +3737,8 @@ DocumentViewerImpl::PrintPreviewNavigate(PRInt16 aType, PRInt32 aPageNum)
if (fndPageFrame && scrollableView) { if (fndPageFrame && scrollableView) {
nscoord deadSpaceGapTwips = 0; nscoord deadSpaceGapTwips = 0;
nsIPageSequenceFrame * sqf; nsIPageSequenceFrame * sqf = do_QueryFrame(seqFrame);
if (NS_SUCCEEDED(CallQueryInterface(seqFrame, &sqf))) { if (sqf) {
sqf->GetDeadSpaceValue(&deadSpaceGapTwips); sqf->GetDeadSpaceValue(&deadSpaceGapTwips);
} }

Просмотреть файл

@ -734,9 +734,8 @@ DumpContext(nsIFrame* aFrame, nsStyleContext* aContext)
if (aFrame) { if (aFrame) {
fputs("frame: ", stdout); fputs("frame: ", stdout);
nsAutoString name; nsAutoString name;
nsIFrameDebug* frameDebug; nsIFrameDebug *frameDebug = do_QueryFrame(aFrame);
if (frameDebug) {
if (NS_SUCCEEDED(aFrame->QueryInterface(NS_GET_IID(nsIFrameDebug), (void**)&frameDebug))) {
frameDebug->GetFrameName(name); frameDebug->GetFrameName(name);
fputs(NS_LossyConvertUTF16toASCII(name).get(), stdout); fputs(NS_LossyConvertUTF16toASCII(name).get(), stdout);
} }
@ -1585,9 +1584,7 @@ nsFrameManager::CaptureFrameStateFor(nsIFrame* aFrame,
} }
// Only capture state for stateful frames // Only capture state for stateful frames
nsIStatefulFrame* statefulFrame; nsIStatefulFrame* statefulFrame = do_QueryFrame(aFrame);
CallQueryInterface(aFrame, &statefulFrame);
if (!statefulFrame) { if (!statefulFrame) {
return; return;
} }
@ -1652,8 +1649,7 @@ nsFrameManager::RestoreFrameStateFor(nsIFrame* aFrame,
} }
// Only restore state for stateful frames // Only restore state for stateful frames
nsIStatefulFrame* statefulFrame; nsIStatefulFrame* statefulFrame = do_QueryFrame(aFrame);
CallQueryInterface(aFrame, &statefulFrame);
if (!statefulFrame) { if (!statefulFrame) {
return; return;
} }

Просмотреть файл

@ -38,22 +38,20 @@
#ifndef nsIPercentHeightObserver_h___ #ifndef nsIPercentHeightObserver_h___
#define nsIPercentHeightObserver_h___ #define nsIPercentHeightObserver_h___
#include "nsQueryFrame.h"
struct nsHTMLReflowState; struct nsHTMLReflowState;
class nsPresContext; class nsPresContext;
// IID for the nsIPercentHeightObserver interface
#define NS_IPERCENTHEIGHTOBSERVER_IID \
{ 0x9cdc174b, 0x4f39, 0x41ad, {0xbc, 0x16, 0x5a, 0xc5, 0xa8, 0x64, 0x14, 0xa1}}
/** /**
* This interface is supported by frames that need to provide computed height * This interface is supported by frames that need to provide computed height
* values to children during reflow which would otherwise not happen. Currently only * values to children during reflow which would otherwise not happen. Currently only
* table cells support this. * table cells support this.
*/ */
class nsIPercentHeightObserver : public nsISupports class nsIPercentHeightObserver
{ {
public: public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPERCENTHEIGHTOBSERVER_IID) NS_DECLARE_FRAME_ACCESSOR(nsIPercentHeightObserver)
// Notify the observer that aReflowState has no computed height, but it has a percent height // Notify the observer that aReflowState has no computed height, but it has a percent height
virtual void NotifyPercentHeight(const nsHTMLReflowState& aReflowState) = 0; virtual void NotifyPercentHeight(const nsHTMLReflowState& aReflowState) = 0;
@ -62,7 +60,4 @@ public:
virtual PRBool NeedsToObserve(const nsHTMLReflowState& aReflowState) = 0; virtual PRBool NeedsToObserve(const nsHTMLReflowState& aReflowState) = 0;
}; };
NS_DEFINE_STATIC_IID_ACCESSOR(nsIPercentHeightObserver,
NS_IPERCENTHEIGHTOBSERVER_IID)
#endif // nsIPercentHeightObserver_h___ #endif // nsIPercentHeightObserver_h___

Просмотреть файл

@ -159,10 +159,7 @@ PrintDisplayListTo(nsDisplayListBuilder* aBuilder, const nsDisplayList& aList,
fputc(' ', aOutput); fputc(' ', aOutput);
} }
nsIFrame* f = i->GetUnderlyingFrame(); nsIFrame* f = i->GetUnderlyingFrame();
nsIFrameDebug* fDebug = nsnull; nsIFrameDebug* fDebug = do_QueryFrame(f);
if (f) {
CallQueryInterface(f, &fDebug);
}
nsAutoString fName; nsAutoString fName;
if (fDebug) { if (fDebug) {
fDebug->GetFrameName(fName); fDebug->GetFrameName(fName);

Просмотреть файл

@ -546,8 +546,7 @@ nsLayoutUtils::GetScrollableFrameFor(nsIFrame *aScrolledFrame)
if (!frame) { if (!frame) {
return nsnull; return nsnull;
} }
nsIScrollableFrame *sf; nsIScrollableFrame *sf = do_QueryFrame(frame);
CallQueryInterface(frame, &sf);
return sf; return sf;
} }
@ -556,12 +555,8 @@ nsIScrollableFrame*
nsLayoutUtils::GetScrollableFrameFor(nsIScrollableView *aScrollableView) nsLayoutUtils::GetScrollableFrameFor(nsIScrollableView *aScrollableView)
{ {
nsIFrame *frame = GetFrameFor(aScrollableView->View()->GetParent()); nsIFrame *frame = GetFrameFor(aScrollableView->View()->GetParent());
if (frame) { nsIScrollableFrame *sf = do_QueryFrame(frame);
nsIScrollableFrame *sf;
CallQueryInterface(frame, &sf);
return sf; return sf;
}
return nsnull;
} }
//static //static
@ -1534,10 +1529,8 @@ nsLayoutUtils::FindChildContainingDescendant(nsIFrame* aParent, nsIFrame* aDesce
nsBlockFrame* nsBlockFrame*
nsLayoutUtils::GetAsBlock(nsIFrame* aFrame) nsLayoutUtils::GetAsBlock(nsIFrame* aFrame)
{ {
nsBlockFrame* block; nsBlockFrame* block = do_QueryFrame(aFrame);
if (NS_SUCCEEDED(aFrame->QueryInterface(kBlockFrameCID, (void**)&block)))
return block; return block;
return nsnull;
} }
nsBlockFrame* nsBlockFrame*
@ -1682,8 +1675,7 @@ nsLayoutUtils::IsViewportScrollbarFrame(nsIFrame* aFrame)
if (!rootScrollFrame) if (!rootScrollFrame)
return PR_FALSE; return PR_FALSE;
nsIScrollableFrame* rootScrollableFrame = nsnull; nsIScrollableFrame* rootScrollableFrame = do_QueryFrame(rootScrollFrame);
CallQueryInterface(rootScrollFrame, &rootScrollableFrame);
NS_ASSERTION(rootScrollableFrame, "The root scorollable frame is null"); NS_ASSERTION(rootScrollableFrame, "The root scorollable frame is null");
if (!IsProperAncestorFrame(rootScrollFrame, aFrame)) if (!IsProperAncestorFrame(rootScrollFrame, aFrame))
@ -2526,9 +2518,8 @@ nsLayoutUtils::GetFirstLineBaseline(const nsIFrame* aFrame, nscoord* aResult)
// For first-line baselines, we have to consider scroll frames. // For first-line baselines, we have to consider scroll frames.
if (fType == nsGkAtoms::scrollFrame) { if (fType == nsGkAtoms::scrollFrame) {
nsIScrollableFrame *sFrame; nsIScrollableFrame *sFrame = do_QueryFrame(const_cast<nsIFrame*>(aFrame));
if (NS_FAILED(CallQueryInterface(const_cast<nsIFrame*> if (!sFrame) {
(aFrame), &sFrame)) || !sFrame) {
NS_NOTREACHED("not scroll frame"); NS_NOTREACHED("not scroll frame");
} }
nscoord kidBaseline; nscoord kidBaseline;

Просмотреть файл

@ -2930,8 +2930,7 @@ nsIPresShell::GetRootScrollFrameAsScrollable() const
nsIFrame* frame = GetRootScrollFrame(); nsIFrame* frame = GetRootScrollFrame();
if (!frame) if (!frame)
return nsnull; return nsnull;
nsIScrollableFrame* scrollableFrame = nsnull; nsIScrollableFrame* scrollableFrame = do_QueryFrame(frame);
CallQueryInterface(frame, &scrollableFrame);
NS_ASSERTION(scrollableFrame, NS_ASSERTION(scrollableFrame,
"All scroll frames must implement nsIScrollableFrame"); "All scroll frames must implement nsIScrollableFrame");
return scrollableFrame; return scrollableFrame;
@ -2947,9 +2946,7 @@ PresShell::GetPageSequenceFrame(nsIPageSequenceFrame** aResult) const
*aResult = nsnull; *aResult = nsnull;
nsIFrame* frame = mFrameConstructor->GetPageSequenceFrame(); nsIFrame* frame = mFrameConstructor->GetPageSequenceFrame();
if (frame) { *aResult = do_QueryFrame(frame);
CallQueryInterface(frame, aResult);
}
return *aResult ? NS_OK : NS_ERROR_FAILURE; return *aResult ? NS_OK : NS_ERROR_FAILURE;
} }
@ -3003,8 +3000,7 @@ PresShell::RestoreRootScrollPosition()
if (historyState) { if (historyState) {
nsIFrame* scrollFrame = GetRootScrollFrame(); nsIFrame* scrollFrame = GetRootScrollFrame();
if (scrollFrame) { if (scrollFrame) {
nsIScrollableFrame* scrollableFrame; nsIScrollableFrame* scrollableFrame = do_QueryFrame(scrollFrame);
CallQueryInterface(scrollFrame, &scrollableFrame);
if (scrollableFrame) { if (scrollableFrame) {
FrameManager()->RestoreFrameStateFor(scrollFrame, historyState, FrameManager()->RestoreFrameStateFor(scrollFrame, historyState,
nsIStatefulFrame::eDocumentScrollState); nsIStatefulFrame::eDocumentScrollState);
@ -3222,8 +3218,7 @@ PresShell::GetViewToScroll(nsLayoutUtils::Direction aDirection)
if (focusedContent) { if (focusedContent) {
nsIFrame* startFrame = GetPrimaryFrameFor(focusedContent); nsIFrame* startFrame = GetPrimaryFrameFor(focusedContent);
if (startFrame) { if (startFrame) {
nsIScrollableViewProvider* svp; nsIScrollableViewProvider* svp = do_QueryFrame(startFrame);
CallQueryInterface(startFrame, &svp);
// If this very frame provides a scroll view, start there instead of frame's // If this very frame provides a scroll view, start there instead of frame's
// closest view, because the scroll view may be inside a child frame. // closest view, because the scroll view may be inside a child frame.
// For example, this happens in the case of overflow:scroll. // For example, this happens in the case of overflow:scroll.
@ -5995,9 +5990,7 @@ StopPluginInstance(PresShell *aShell, nsIContent *aContent)
{ {
nsIFrame *frame = aShell->FrameManager()->GetPrimaryFrameFor(aContent, -1); nsIFrame *frame = aShell->FrameManager()->GetPrimaryFrameFor(aContent, -1);
nsIObjectFrame *objectFrame = nsnull; nsIObjectFrame *objectFrame = do_QueryFrame(frame);
if (frame)
CallQueryInterface(frame, &objectFrame);
if (!objectFrame) if (!objectFrame)
return; return;
@ -6281,10 +6274,9 @@ void
PresShell::DoVerifyReflow() PresShell::DoVerifyReflow()
{ {
if (nsIFrameDebug::GetVerifyTreeEnable()) { if (nsIFrameDebug::GetVerifyTreeEnable()) {
nsIFrameDebug* frameDebug;
nsIFrame* rootFrame = FrameManager()->GetRootFrame(); nsIFrame* rootFrame = FrameManager()->GetRootFrame();
if (NS_SUCCEEDED(rootFrame->QueryInterface(NS_GET_IID(nsIFrameDebug), nsIFrameDebug *frameDebug = do_QueryFrame(rootFrame);
(void**)&frameDebug))) { if (frameDebug) {
frameDebug->VerifyTree(); frameDebug->VerifyTree();
} }
} }
@ -6426,8 +6418,7 @@ ReResolveMenusAndTrees(nsIFrame *aFrame, void *aClosure)
{ {
// Trees have a special style cache that needs to be flushed when // Trees have a special style cache that needs to be flushed when
// the theme changes. // the theme changes.
nsTreeBodyFrame *treeBody = nsnull; nsTreeBodyFrame *treeBody = do_QueryFrame(aFrame);
CallQueryInterface(aFrame, &treeBody);
if (treeBody) if (treeBody)
treeBody->ClearStyleAndImageCaches(); treeBody->ClearStyleAndImageCaches();
@ -6601,10 +6592,8 @@ LogVerifyMessage(nsIFrame* k1, nsIFrame* k2, const char* aMsg)
printf("verifyreflow: "); printf("verifyreflow: ");
nsAutoString name; nsAutoString name;
if (nsnull != k1) { if (nsnull != k1) {
nsIFrameDebug* frameDebug; nsIFrameDebug *frameDebug = do_QueryFrame(k1);
if (frameDebug) {
if (NS_SUCCEEDED(k1->QueryInterface(NS_GET_IID(nsIFrameDebug),
(void**)&frameDebug))) {
frameDebug->GetFrameName(name); frameDebug->GetFrameName(name);
} }
} }
@ -6618,10 +6607,8 @@ LogVerifyMessage(nsIFrame* k1, nsIFrame* k2, const char* aMsg)
printf(" != "); printf(" != ");
if (nsnull != k2) { if (nsnull != k2) {
nsIFrameDebug* frameDebug; nsIFrameDebug *frameDebug = do_QueryFrame(k2);
if (frameDebug) {
if (NS_SUCCEEDED(k2->QueryInterface(NS_GET_IID(nsIFrameDebug),
(void**)&frameDebug))) {
frameDebug->GetFrameName(name); frameDebug->GetFrameName(name);
} }
} }
@ -6641,10 +6628,8 @@ LogVerifyMessage(nsIFrame* k1, nsIFrame* k2, const char* aMsg,
{ {
printf("VerifyReflow Error:\n"); printf("VerifyReflow Error:\n");
nsAutoString name; nsAutoString name;
nsIFrameDebug* frameDebug; nsIFrameDebug *frameDebug = do_QueryFrame(k1);
if (frameDebug) {
if (NS_SUCCEEDED(k1->QueryInterface(NS_GET_IID(nsIFrameDebug),
(void**)&frameDebug))) {
fprintf(stdout, " "); fprintf(stdout, " ");
frameDebug->GetFrameName(name); frameDebug->GetFrameName(name);
fputs(NS_LossyConvertUTF16toASCII(name).get(), stdout); fputs(NS_LossyConvertUTF16toASCII(name).get(), stdout);
@ -6654,8 +6639,8 @@ LogVerifyMessage(nsIFrame* k1, nsIFrame* k2, const char* aMsg,
printf(" != \n"); printf(" != \n");
if (NS_SUCCEEDED(k2->QueryInterface(NS_GET_IID(nsIFrameDebug), frameDebug = do_QueryFrame(k2);
(void**)&frameDebug))) { if (frameDebug) {
fprintf(stdout, " "); fprintf(stdout, " ");
frameDebug->GetFrameName(name); frameDebug->GetFrameName(name);
fputs(NS_LossyConvertUTF16toASCII(name).get(), stdout); fputs(NS_LossyConvertUTF16toASCII(name).get(), stdout);
@ -7013,13 +6998,13 @@ PresShell::VerifyIncrementalReflow()
PRBool ok = CompareTrees(mPresContext, root1, cx, root2); PRBool ok = CompareTrees(mPresContext, root1, cx, root2);
if (!ok && (VERIFY_REFLOW_NOISY & gVerifyReflowFlags)) { if (!ok && (VERIFY_REFLOW_NOISY & gVerifyReflowFlags)) {
printf("Verify reflow failed, primary tree:\n"); printf("Verify reflow failed, primary tree:\n");
nsIFrameDebug* frameDebug; nsIFrameDebug* frameDebug = do_QueryFrame(root1);
if (frameDebug) {
if (NS_SUCCEEDED(CallQueryInterface(root1, &frameDebug))) {
frameDebug->List(stdout, 0); frameDebug->List(stdout, 0);
} }
printf("Verification tree:\n"); printf("Verification tree:\n");
if (NS_SUCCEEDED(CallQueryInterface(root2, &frameDebug))) { frameDebug = do_QueryFrame(root2);
if (frameDebug) {
frameDebug->List(stdout, 0); frameDebug->List(stdout, 0);
} }
} }

Просмотреть файл

@ -287,36 +287,28 @@ nsComboboxControlFrame::~nsComboboxControlFrame()
} }
//-------------------------------------------------------------- //--------------------------------------------------------------
// Frames are not refcounted, no need to AddRef
NS_IMETHODIMP NS_QUERYFRAME_HEAD(nsComboboxControlFrame)
nsComboboxControlFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr) NS_QUERYFRAME_ENTRY(nsIComboboxControlFrame)
NS_QUERYFRAME_ENTRY(nsIFormControlFrame)
NS_QUERYFRAME_ENTRY(nsIAnonymousContentCreator)
NS_QUERYFRAME_ENTRY(nsISelectControlFrame)
NS_QUERYFRAME_ENTRY(nsIStatefulFrame)
NS_QUERYFRAME_ENTRY(nsIScrollableViewProvider)
NS_QUERYFRAME_TAIL_INHERITING(nsBlockFrame)
NS_IMPL_QUERY_INTERFACE1(nsComboboxControlFrame, nsIRollupListener)
NS_IMETHODIMP_(nsrefcnt)
nsComboboxControlFrame::AddRef()
{ {
NS_PRECONDITION(aInstancePtr, "null out param"); return 2;
}
if (aIID.Equals(NS_GET_IID(nsIComboboxControlFrame))) { NS_IMETHODIMP_(nsrefcnt)
*aInstancePtr = static_cast<nsIComboboxControlFrame*>(this); nsComboboxControlFrame::Release()
return NS_OK; {
} else if (aIID.Equals(NS_GET_IID(nsIFormControlFrame))) { return 1;
*aInstancePtr = static_cast<nsIFormControlFrame*>(this);
return NS_OK;
} else if (aIID.Equals(NS_GET_IID(nsIAnonymousContentCreator))) {
*aInstancePtr = static_cast<nsIAnonymousContentCreator*>(this);
return NS_OK;
} else if (aIID.Equals(NS_GET_IID(nsISelectControlFrame))) {
*aInstancePtr = static_cast<nsISelectControlFrame*>(this);
return NS_OK;
} else if (aIID.Equals(NS_GET_IID(nsIStatefulFrame))) {
*aInstancePtr = static_cast<nsIStatefulFrame*>(this);
return NS_OK;
} else if (aIID.Equals(NS_GET_IID(nsIRollupListener))) {
*aInstancePtr = static_cast<nsIRollupListener*>(this);
return NS_OK;
} else if (aIID.Equals(NS_GET_IID(nsIScrollableViewProvider))) {
*aInstancePtr = static_cast<nsIScrollableViewProvider*>(this);
return NS_OK;
}
return nsBlockFrame::QueryInterface(aIID, aInstancePtr);
} }
#ifdef ACCESSIBILITY #ifdef ACCESSIBILITY
@ -425,8 +417,7 @@ nsComboboxControlFrame::ShowList(nsPresContext* aPresContext, PRBool aShowList)
return PR_FALSE; return PR_FALSE;
} }
nsIFrame* listFrame; nsIFrame* listFrame = do_QueryFrame(mListControlFrame);
CallQueryInterface(mListControlFrame, &listFrame);
if (listFrame) { if (listFrame) {
nsIView* view = listFrame->GetView(); nsIView* view = listFrame->GetView();
NS_ASSERTION(view, "nsComboboxControlFrame view is null"); NS_ASSERTION(view, "nsComboboxControlFrame view is null");
@ -570,8 +561,7 @@ nsComboboxControlFrame::GetIntrinsicWidth(nsIRenderingContext* aRenderingContext
nscoord scrollbarWidth = 0; nscoord scrollbarWidth = 0;
nsPresContext* presContext = PresContext(); nsPresContext* presContext = PresContext();
if (mListControlFrame) { if (mListControlFrame) {
nsIScrollableFrame* scrollable; nsIScrollableFrame* scrollable = do_QueryFrame(mListControlFrame);
CallQueryInterface(mListControlFrame, &scrollable);
NS_ASSERTION(scrollable, "List must be a scrollable frame"); NS_ASSERTION(scrollable, "List must be a scrollable frame");
scrollbarWidth = scrollbarWidth =
scrollable->GetDesiredScrollbarSizes(presContext, aRenderingContext).LeftRight(); scrollable->GetDesiredScrollbarSizes(presContext, aRenderingContext).LeftRight();
@ -676,8 +666,7 @@ nsComboboxControlFrame::Reflow(nsPresContext* aPresContext,
buttonWidth = 0; buttonWidth = 0;
} }
else { else {
nsIScrollableFrame* scrollable; nsIScrollableFrame* scrollable = do_QueryFrame(mListControlFrame);
CallQueryInterface(mListControlFrame, &scrollable);
NS_ASSERTION(scrollable, "List must be a scrollable frame"); NS_ASSERTION(scrollable, "List must be a scrollable frame");
buttonWidth = buttonWidth =
scrollable->GetDesiredScrollbarSizes(PresContext(), scrollable->GetDesiredScrollbarSizes(PresContext(),
@ -774,8 +763,7 @@ void
nsComboboxControlFrame::SetDropDown(nsIFrame* aDropDownFrame) nsComboboxControlFrame::SetDropDown(nsIFrame* aDropDownFrame)
{ {
mDropdownFrame = aDropDownFrame; mDropdownFrame = aDropDownFrame;
mListControlFrame = do_QueryFrame(mDropdownFrame);
CallQueryInterface(mDropdownFrame, &mListControlFrame);
} }
nsIFrame* nsIFrame*
@ -878,15 +866,11 @@ nsComboboxControlFrame::GetIndexOfDisplayArea()
NS_IMETHODIMP NS_IMETHODIMP
nsComboboxControlFrame::DoneAddingChildren(PRBool aIsDone) nsComboboxControlFrame::DoneAddingChildren(PRBool aIsDone)
{ {
nsISelectControlFrame* listFrame = nsnull; nsISelectControlFrame* listFrame = do_QueryFrame(mDropdownFrame);
nsresult rv = NS_ERROR_FAILURE; if (!listFrame)
if (mDropdownFrame != nsnull) { return NS_ERROR_FAILURE;
rv = CallQueryInterface(mDropdownFrame, &listFrame);
if (listFrame) { return listFrame->DoneAddingChildren(aIsDone);
rv = listFrame->DoneAddingChildren(aIsDone);
}
}
return rv;
} }
NS_IMETHODIMP NS_IMETHODIMP
@ -924,10 +908,9 @@ nsComboboxControlFrame::RemoveOption(nsPresContext* aPresContext, PRInt32 aIndex
NS_IMETHODIMP NS_IMETHODIMP
nsComboboxControlFrame::GetOptionSelected(PRInt32 aIndex, PRBool* aValue) nsComboboxControlFrame::GetOptionSelected(PRInt32 aIndex, PRBool* aValue)
{ {
nsISelectControlFrame* listFrame = nsnull;
NS_ASSERTION(mDropdownFrame, "No dropdown frame!"); NS_ASSERTION(mDropdownFrame, "No dropdown frame!");
CallQueryInterface(mDropdownFrame, &listFrame); nsISelectControlFrame* listFrame = do_QueryFrame(mDropdownFrame);
NS_ASSERTION(listFrame, "No list frame!"); NS_ASSERTION(listFrame, "No list frame!");
return listFrame->GetOptionSelected(aIndex, aValue); return listFrame->GetOptionSelected(aIndex, aValue);
@ -937,11 +920,9 @@ NS_IMETHODIMP
nsComboboxControlFrame::OnSetSelectedIndex(PRInt32 aOldIndex, PRInt32 aNewIndex) nsComboboxControlFrame::OnSetSelectedIndex(PRInt32 aOldIndex, PRInt32 aNewIndex)
{ {
RedisplayText(aNewIndex); RedisplayText(aNewIndex);
nsISelectControlFrame* listFrame = nsnull;
NS_ASSERTION(mDropdownFrame, "No dropdown frame!"); NS_ASSERTION(mDropdownFrame, "No dropdown frame!");
CallQueryInterface(mDropdownFrame, &listFrame); nsISelectControlFrame* listFrame = do_QueryFrame(mDropdownFrame);
NS_ASSERTION(listFrame, "No list frame!"); NS_ASSERTION(listFrame, "No list frame!");
return listFrame->OnSetSelectedIndex(aOldIndex, aNewIndex); return listFrame->OnSetSelectedIndex(aOldIndex, aNewIndex);
@ -977,29 +958,23 @@ nsComboboxControlFrame::HandleEvent(nsPresContext* aPresContext,
nsresult nsresult
nsComboboxControlFrame::SetFormProperty(nsIAtom* aName, const nsAString& aValue) nsComboboxControlFrame::SetFormProperty(nsIAtom* aName, const nsAString& aValue)
{ {
nsIFormControlFrame* fcFrame = nsnull; nsIFormControlFrame* fcFrame = do_QueryFrame(mDropdownFrame);
nsresult result = CallQueryInterface(mDropdownFrame, &fcFrame); if (!fcFrame) {
if (NS_FAILED(result)) { return NS_NOINTERFACE;
return result;
} }
if (fcFrame) {
return fcFrame->SetFormProperty(aName, aValue); return fcFrame->SetFormProperty(aName, aValue);
}
return NS_OK;
} }
nsresult nsresult
nsComboboxControlFrame::GetFormProperty(nsIAtom* aName, nsAString& aValue) const nsComboboxControlFrame::GetFormProperty(nsIAtom* aName, nsAString& aValue) const
{ {
nsIFormControlFrame* fcFrame = nsnull; nsIFormControlFrame* fcFrame = do_QueryFrame(mDropdownFrame);
nsresult result = CallQueryInterface(mDropdownFrame, &fcFrame); if (!fcFrame) {
if(NS_FAILED(result)) { return NS_ERROR_FAILURE;
return result;
} }
if (fcFrame) {
return fcFrame->GetFormProperty(aName, aValue); return fcFrame->GetFormProperty(aName, aValue);
}
return NS_OK;
} }
nsIFrame* nsIFrame*
@ -1229,8 +1204,8 @@ nsComboboxControlFrame::Destroy()
if (mDroppedDown) { if (mDroppedDown) {
// Get parent view // Get parent view
nsIFrame * listFrame; nsIFrame * listFrame = do_QueryFrame(mListControlFrame);
if (NS_OK == mListControlFrame->QueryInterface(NS_GET_IID(nsIFrame), (void **)&listFrame)) { if (listFrame) {
nsIView* view = listFrame->GetView(); nsIView* view = listFrame->GetView();
NS_ASSERTION(view, "nsComboboxControlFrame view is null"); NS_ASSERTION(view, "nsComboboxControlFrame view is null");
if (view) { if (view) {
@ -1446,9 +1421,8 @@ nsIScrollableView* nsComboboxControlFrame::GetScrollableView()
if (!mDropdownFrame) if (!mDropdownFrame)
return nsnull; return nsnull;
nsIScrollableFrame* scrollable = nsnull; nsIScrollableFrame* scrollable = do_QueryFrame(mDropdownFrame);
nsresult rv = CallQueryInterface(mDropdownFrame, &scrollable); if (!scrollable)
if (NS_FAILED(rv))
return nsnull; return nsnull;
return scrollable->GetScrollableView(); return scrollable->GetScrollableView();
@ -1464,8 +1438,7 @@ nsComboboxControlFrame::OnOptionSelected(nsPresContext* aPresContext,
PRBool aSelected) PRBool aSelected)
{ {
if (mDroppedDown) { if (mDroppedDown) {
nsCOMPtr<nsISelectControlFrame> selectFrame nsISelectControlFrame *selectFrame = do_QueryFrame(mListControlFrame);
= do_QueryInterface(mListControlFrame);
if (selectFrame) { if (selectFrame) {
selectFrame->OnOptionSelected(aPresContext, aIndex, aSelected); selectFrame->OnOptionSelected(aPresContext, aIndex, aSelected);
} }
@ -1517,8 +1490,7 @@ nsComboboxControlFrame::SaveState(SpecialStateID aStateID,
if (!mListControlFrame) if (!mListControlFrame)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
nsIStatefulFrame* stateful; nsIStatefulFrame* stateful = do_QueryFrame(mListControlFrame);
CallQueryInterface(mListControlFrame, &stateful);
return stateful->SaveState(aStateID, aState); return stateful->SaveState(aStateID, aState);
} }
@ -1528,11 +1500,9 @@ nsComboboxControlFrame::RestoreState(nsPresState* aState)
if (!mListControlFrame) if (!mListControlFrame)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
nsIStatefulFrame* stateful; nsIStatefulFrame* stateful = do_QueryFrame(mListControlFrame);
nsresult rv = CallQueryInterface(mListControlFrame, &stateful); NS_ASSERTION(stateful, "Must implement nsIStatefulFrame");
NS_ASSERTION(NS_SUCCEEDED(rv), "Must implement nsIStatefulFrame"); return stateful->RestoreState(aState);
rv = stateful->RestoreState(aState);
return rv;
} }

Просмотреть файл

@ -96,8 +96,8 @@ public:
nsComboboxControlFrame(nsStyleContext* aContext); nsComboboxControlFrame(nsStyleContext* aContext);
~nsComboboxControlFrame(); ~nsComboboxControlFrame();
// nsISupports NS_DECL_QUERYFRAME
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); NS_DECL_ISUPPORTS_INHERITED
// nsIAnonymousContentCreator // nsIAnonymousContentCreator
virtual nsresult CreateAnonymousContent(nsTArray<nsIContent*>& aElements); virtual nsresult CreateAnonymousContent(nsTArray<nsIContent*>& aElements);
@ -292,10 +292,6 @@ protected:
#ifdef DO_REFLOW_COUNTER #ifdef DO_REFLOW_COUNTER
PRInt32 mReflowId; PRInt32 mReflowId;
#endif #endif
private:
NS_IMETHOD_(nsrefcnt) AddRef() { return NS_OK; }
NS_IMETHOD_(nsrefcnt) Release() { return NS_OK; }
}; };
#endif #endif

Просмотреть файл

@ -228,23 +228,10 @@ nsFileControlFrame::CreateAnonymousContent(nsTArray<nsIContent*>& aElements)
return NS_OK; return NS_OK;
} }
// Frames are not refcounted, no need to AddRef NS_QUERYFRAME_HEAD(nsFileControlFrame)
NS_IMETHODIMP NS_QUERYFRAME_ENTRY(nsIAnonymousContentCreator)
nsFileControlFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr) NS_QUERYFRAME_ENTRY(nsIFormControlFrame)
{ NS_QUERYFRAME_TAIL_INHERITING(nsBlockFrame)
NS_PRECONDITION(aInstancePtr, "null out param");
if (aIID.Equals(NS_GET_IID(nsIAnonymousContentCreator))) {
*aInstancePtr = static_cast<nsIAnonymousContentCreator*>(this);
return NS_OK;
}
if (aIID.Equals(NS_GET_IID(nsIFormControlFrame))) {
*aInstancePtr = static_cast<nsIFormControlFrame*>(this);
return NS_OK;
}
return nsBlockFrame::QueryInterface(aIID, aInstancePtr);
}
void void
nsFileControlFrame::SetFocus(PRBool aOn, PRBool aRepaint) nsFileControlFrame::SetFocus(PRBool aOn, PRBool aRepaint)

Просмотреть файл

@ -63,7 +63,7 @@ public:
const nsRect& aDirtyRect, const nsRect& aDirtyRect,
const nsDisplayListSet& aLists); const nsDisplayListSet& aLists);
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); NS_DECL_QUERYFRAME
// nsIFormControlFrame // nsIFormControlFrame
virtual nsresult SetFormProperty(nsIAtom* aName, const nsAString& aValue); virtual nsresult SetFormProperty(nsIAtom* aName, const nsAString& aValue);
@ -183,9 +183,6 @@ private:
*/ */
void SyncAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute, void SyncAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
PRInt32 aWhichControls); PRInt32 aWhichControls);
NS_IMETHOD_(nsrefcnt) AddRef() { return 1; }
NS_IMETHOD_(nsrefcnt) Release() { return 1; }
}; };
#endif #endif

Просмотреть файл

@ -62,19 +62,9 @@ nsFormControlFrame::Destroy()
nsLeafFrame::Destroy(); nsLeafFrame::Destroy();
} }
// Frames are not refcounted, no need to AddRef NS_QUERYFRAME_HEAD(nsFormControlFrame)
NS_IMETHODIMP NS_QUERYFRAME_ENTRY(nsIFormControlFrame)
nsFormControlFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr) NS_QUERYFRAME_TAIL_INHERITING(nsLeafFrame)
{
NS_PRECONDITION(aInstancePtr, "null out param");
if (aIID.Equals(NS_GET_IID(nsIFormControlFrame))) {
*aInstancePtr = static_cast<nsIFormControlFrame*>(this);
return NS_OK;
}
return nsLeafFrame::QueryInterface(aIID, aInstancePtr);
}
nscoord nscoord
nsFormControlFrame::GetIntrinsicWidth() nsFormControlFrame::GetIntrinsicWidth()

Просмотреть файл

@ -64,7 +64,7 @@ public:
~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock)); ~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock));
} }
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); NS_DECL_QUERYFRAME
/** /**
* Respond to a gui event * Respond to a gui event
@ -124,11 +124,6 @@ protected:
*/ */
void GetCurrentCheckState(PRBool* aState); void GetCurrentCheckState(PRBool* aState);
private:
NS_IMETHOD_(nsrefcnt) AddRef() { return NS_OK; }
NS_IMETHOD_(nsrefcnt) Release() { return NS_OK; }
}; };
#endif #endif

Просмотреть файл

@ -186,19 +186,9 @@ NS_IMETHODIMP nsGfxButtonControlFrame::GetAccessible(nsIAccessible** aAccessible
} }
#endif #endif
// Frames are not refcounted, no need to AddRef NS_QUERYFRAME_HEAD(nsGfxButtonControlFrame)
NS_IMETHODIMP NS_QUERYFRAME_ENTRY(nsIAnonymousContentCreator)
nsGfxButtonControlFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr) NS_QUERYFRAME_TAIL_INHERITING(nsHTMLButtonControlFrame)
{
NS_PRECONDITION(aInstancePtr, "null out param");
if (aIID.Equals(NS_GET_IID(nsIAnonymousContentCreator))) {
*aInstancePtr = static_cast<nsIAnonymousContentCreator*>(this);
return NS_OK;
}
return nsHTMLButtonControlFrame::QueryInterface(aIID, aInstancePtr);
}
// Initially we hardcoded the default strings here. // Initially we hardcoded the default strings here.
// Next, we used html.css to store the default label for various types // Next, we used html.css to store the default label for various types

Просмотреть файл

@ -74,8 +74,8 @@ public:
#ifdef DEBUG #ifdef DEBUG
NS_IMETHOD GetFrameName(nsAString& aResult) const; NS_IMETHOD GetFrameName(nsAString& aResult) const;
#endif #endif
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
NS_DECL_QUERYFRAME
// nsIAnonymousContentCreator // nsIAnonymousContentCreator
virtual nsresult CreateAnonymousContent(nsTArray<nsIContent*>& aElements); virtual nsresult CreateAnonymousContent(nsTArray<nsIContent*>& aElements);
@ -101,9 +101,6 @@ protected:
PRBool IsFileBrowseButton(PRInt32 type); // Browse button of file input PRBool IsFileBrowseButton(PRInt32 type); // Browse button of file input
private: private:
NS_IMETHOD_(nsrefcnt) AddRef() { return NS_OK; }
NS_IMETHOD_(nsrefcnt) Release() { return NS_OK; }
nsSize mSuggestedSize; nsSize mSuggestedSize;
nsCOMPtr<nsIContent> mTextContent; nsCOMPtr<nsIContent> mTextContent;
}; };

Просмотреть файл

@ -93,22 +93,9 @@ nsGfxCheckboxControlFrame::~nsGfxCheckboxControlFrame()
} }
//---------------------------------------------------------------------- NS_QUERYFRAME_HEAD(nsGfxCheckboxControlFrame)
// nsISupports NS_QUERYFRAME_ENTRY(nsICheckboxControlFrame)
//---------------------------------------------------------------------- NS_QUERYFRAME_TAIL_INHERITING(nsFormControlFrame)
// Frames are not refcounted, no need to AddRef
NS_IMETHODIMP
nsGfxCheckboxControlFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
NS_PRECONDITION(aInstancePtr, "null out param");
if (aIID.Equals(NS_GET_IID(nsICheckboxControlFrame))) {
*aInstancePtr = static_cast<nsICheckboxControlFrame*>(this);
return NS_OK;
}
return nsFormControlFrame::QueryInterface(aIID, aInstancePtr);
}
#ifdef ACCESSIBILITY #ifdef ACCESSIBILITY
NS_IMETHODIMP nsGfxCheckboxControlFrame::GetAccessible(nsIAccessible** aAccessible) NS_IMETHODIMP nsGfxCheckboxControlFrame::GetAccessible(nsIAccessible** aAccessible)

Просмотреть файл

@ -78,7 +78,7 @@ public:
virtual void SetAdditionalStyleContext(PRInt32 aIndex, virtual void SetAdditionalStyleContext(PRInt32 aIndex,
nsStyleContext* aStyleContext); nsStyleContext* aStyleContext);
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); NS_DECL_QUERYFRAME
void PaintCheckBox(nsIRenderingContext& aRenderingContext, void PaintCheckBox(nsIRenderingContext& aRenderingContext,
nsPoint aPt, const nsRect& aDirtyRect); nsPoint aPt, const nsRect& aDirtyRect);
@ -91,11 +91,6 @@ protected:
PRBool GetCheckboxState(); PRBool GetCheckboxState();
nsRefPtr<nsStyleContext> mCheckButtonFaceStyle; nsRefPtr<nsStyleContext> mCheckButtonFaceStyle;
private:
NS_IMETHOD_(nsrefcnt) AddRef() { return NS_OK; }
NS_IMETHOD_(nsrefcnt) Release() { return NS_OK; }
}; };
#endif #endif

Просмотреть файл

@ -61,19 +61,9 @@ nsGfxRadioControlFrame::~nsGfxRadioControlFrame()
{ {
} }
// Frames are not refcounted, no need to AddRef NS_QUERYFRAME_HEAD(nsGfxRadioControlFrame)
NS_IMETHODIMP NS_QUERYFRAME_ENTRY(nsIRadioControlFrame)
nsGfxRadioControlFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr) NS_QUERYFRAME_TAIL_INHERITING(nsFormControlFrame)
{
NS_PRECONDITION(aInstancePtr, "null out param");
if (aIID.Equals(NS_GET_IID(nsIRadioControlFrame))) {
*aInstancePtr = static_cast<nsIRadioControlFrame*>(this);
return NS_OK;
}
return nsFormControlFrame::QueryInterface(aIID, aInstancePtr);
}
#ifdef ACCESSIBILITY #ifdef ACCESSIBILITY
NS_IMETHODIMP nsGfxRadioControlFrame::GetAccessible(nsIAccessible** aAccessible) NS_IMETHODIMP nsGfxRadioControlFrame::GetAccessible(nsIAccessible** aAccessible)

Просмотреть файл

@ -60,8 +60,9 @@ public:
nsGfxRadioControlFrame(nsStyleContext* aContext); nsGfxRadioControlFrame(nsStyleContext* aContext);
~nsGfxRadioControlFrame(); ~nsGfxRadioControlFrame();
NS_DECL_QUERYFRAME
//nsIRadioControlFrame methods //nsIRadioControlFrame methods
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
NS_IMETHOD SetRadioButtonFaceStyleContext(nsStyleContext *aRadioButtonFaceStyleContext); NS_IMETHOD SetRadioButtonFaceStyleContext(nsStyleContext *aRadioButtonFaceStyleContext);
#ifdef ACCESSIBILITY #ifdef ACCESSIBILITY
NS_IMETHOD GetAccessible(nsIAccessible** aAccessible); NS_IMETHOD GetAccessible(nsIAccessible** aAccessible);
@ -81,10 +82,6 @@ public:
protected: protected:
nsRefPtr<nsStyleContext> mRadioButtonFaceStyle; nsRefPtr<nsStyleContext> mRadioButtonFaceStyle;
private:
NS_IMETHOD_(nsrefcnt) AddRef() { return NS_OK; }
NS_IMETHOD_(nsrefcnt) Release() { return NS_OK; }
}; };
#endif #endif

Просмотреть файл

@ -105,31 +105,9 @@ nsHTMLButtonControlFrame::Init(
return rv; return rv;
} }
nsrefcnt nsHTMLButtonControlFrame::AddRef(void) NS_QUERYFRAME_HEAD(nsHTMLButtonControlFrame)
{ NS_QUERYFRAME_ENTRY(nsIFormControlFrame)
NS_WARNING("not supported"); NS_QUERYFRAME_TAIL_INHERITING(nsHTMLContainerFrame)
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);
}
#ifdef ACCESSIBILITY #ifdef ACCESSIBILITY
NS_IMETHODIMP nsHTMLButtonControlFrame::GetAccessible(nsIAccessible** aAccessible) NS_IMETHODIMP nsHTMLButtonControlFrame::GetAccessible(nsIAccessible** aAccessible)

Просмотреть файл

@ -65,7 +65,7 @@ public:
virtual void Destroy(); virtual void Destroy();
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); NS_DECL_QUERYFRAME
NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder, NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect, const nsRect& aDirtyRect,
@ -142,9 +142,6 @@ protected:
nsMargin aFocusPadding, nsMargin aFocusPadding,
nsReflowStatus& aStatus); nsReflowStatus& aStatus);
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(nsrefcnt) Release(void);
PRIntn GetSkipSides() const; PRIntn GetSkipSides() const;
nsButtonFrameRenderer mRenderer; nsButtonFrameRenderer mRenderer;
}; };

Просмотреть файл

@ -38,24 +38,18 @@
#ifndef nsICheckControlFrame_h___ #ifndef nsICheckControlFrame_h___
#define nsICheckControlFrame_h___ #define nsICheckControlFrame_h___
#include "nsISupports.h" #include "nsQueryFrame.h"
class nsStyleContext; class nsStyleContext;
class nsPresContext; class nsPresContext;
// IID for the nsICheckControlFrame class
// {401347ED-0101-11d4-9706-0060B0FB9956}
#define NS_ICHECKBOXCONTROLFRAME_IID \
{ 0x401347ed, 0x101, 0x11d4, \
{ 0x97, 0x6, 0x0, 0x60, 0xb0, 0xfb, 0x99, 0x56 } }
/** /**
* nsICheckControlFrame is the common interface radio buttons. * nsICheckControlFrame is the common interface radio buttons.
* @see nsFromControlFrame and its base classes for more info * @see nsFromControlFrame and its base classes for more info
*/ */
class nsICheckboxControlFrame : public nsISupports { class nsICheckboxControlFrame
{
public: public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICHECKBOXCONTROLFRAME_IID) NS_DECLARE_FRAME_ACCESSOR(nsICheckboxControlFrame)
/** /**
* Sets the Pseudo Style Contexts for the Check button * Sets the Pseudo Style Contexts for the Check button
@ -69,8 +63,5 @@ public:
NS_IMETHOD OnChecked(nsPresContext* aPresContext, PRBool aChecked) = 0; NS_IMETHOD OnChecked(nsPresContext* aPresContext, PRBool aChecked) = 0;
}; };
NS_DEFINE_STATIC_IID_ACCESSOR(nsICheckboxControlFrame,
NS_ICHECKBOXCONTROLFRAME_IID)
#endif #endif

Просмотреть файл

@ -38,7 +38,7 @@
#ifndef nsIComboboxControlFrame_h___ #ifndef nsIComboboxControlFrame_h___
#define nsIComboboxControlFrame_h___ #define nsIComboboxControlFrame_h___
#include "nsISupports.h" #include "nsQueryFrame.h"
#include "nsFont.h" #include "nsFont.h"
class nsPresContext; class nsPresContext;
@ -47,21 +47,15 @@ class nsIContent;
class nsVoidArray; class nsVoidArray;
class nsCSSFrameConstructor; class nsCSSFrameConstructor;
// IID for the nsIComboboxControlFrame class
#define NS_ICOMBOBOXCONTROLFRAME_IID \
{ 0x23f75e9c, 0x6850, 0x11da, \
{ 0x95, 0x2c, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f } }
/** /**
* nsIComboboxControlFrame is the common interface for frames of form controls. It * nsIComboboxControlFrame is the common interface for frames of form controls. It
* provides a uniform way of creating widgets, resizing, and painting. * provides a uniform way of creating widgets, resizing, and painting.
* @see nsLeafFrame and its base classes for more info * @see nsLeafFrame and its base classes for more info
*/ */
class nsIComboboxControlFrame : public nsISupports { class nsIComboboxControlFrame : public nsQueryFrame
{
public: public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICOMBOBOXCONTROLFRAME_IID) NS_DECLARE_FRAME_ACCESSOR(nsIComboboxControlFrame)
/** /**
* Indicates whether the list is dropped down * Indicates whether the list is dropped down
@ -127,8 +121,5 @@ public:
virtual PRInt32 GetIndexOfDisplayArea() = 0; virtual PRInt32 GetIndexOfDisplayArea() = 0;
}; };
NS_DEFINE_STATIC_IID_ACCESSOR(nsIComboboxControlFrame,
NS_ICOMBOBOXCONTROLFRAME_IID)
#endif #endif

Просмотреть файл

@ -38,26 +38,21 @@
#ifndef nsIFormControlFrame_h___ #ifndef nsIFormControlFrame_h___
#define nsIFormControlFrame_h___ #define nsIFormControlFrame_h___
#include "nsISupports.h" #include "nsQueryFrame.h"
class nsAString; class nsAString;
class nsIContent; class nsIContent;
class nsIAtom; class nsIAtom;
struct nsSize; struct nsSize;
// IID for the nsIFormControlFrame class
#define NS_IFORMCONTROLFRAME_IID \
{ 0x189e1565, 0x44f, 0x11da, \
{ 0x94, 0xfc, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f } }
/** /**
* nsIFormControlFrame is the common interface for frames of form controls. It * nsIFormControlFrame is the common interface for frames of form controls. It
* provides a uniform way of creating widgets, resizing, and painting. * provides a uniform way of creating widgets, resizing, and painting.
* @see nsLeafFrame and its base classes for more info * @see nsLeafFrame and its base classes for more info
*/ */
class nsIFormControlFrame : public nsISupports { class nsIFormControlFrame : public nsQueryFrame
{
public: public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFORMCONTROLFRAME_IID) NS_DECLARE_FRAME_ACCESSOR(nsIFormControlFrame)
/** /**
* *
@ -86,7 +81,5 @@ public:
virtual nsresult GetFormProperty(nsIAtom* aName, nsAString& aValue) const = 0; virtual nsresult GetFormProperty(nsIAtom* aName, nsAString& aValue) const = 0;
}; };
NS_DEFINE_STATIC_IID_ACCESSOR(nsIFormControlFrame, NS_IFORMCONTROLFRAME_IID)
#endif #endif

Просмотреть файл

@ -38,24 +38,19 @@
#ifndef nsIListControlFrame_h___ #ifndef nsIListControlFrame_h___
#define nsIListControlFrame_h___ #define nsIListControlFrame_h___
#include "nsISupports.h" #include "nsQueryFrame.h"
#include "nsFont.h" #include "nsFont.h"
class nsPresContext; class nsPresContext;
class nsAString; class nsAString;
class nsIContent; class nsIContent;
// IID for the nsIListControlFrame class
#define NS_ILISTCONTROLFRAME_IID \
{ 0x4de9ab73, 0x31b5, 0x4d92, \
{ 0xb7, 0xe4, 0x73, 0xb4, 0x4d, 0xcb, 0xfc, 0xda } }
/** /**
* nsIListControlFrame is the interface for frame-based listboxes. * nsIListControlFrame is the interface for frame-based listboxes.
*/ */
class nsIListControlFrame : public nsISupports { class nsIListControlFrame : public nsQueryFrame
{
public: public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ILISTCONTROLFRAME_IID) NS_DECLARE_FRAME_ACCESSOR(nsIListControlFrame)
/** /**
* Sets the ComboBoxFrame * Sets the ComboBoxFrame
@ -126,7 +121,5 @@ public:
virtual void OnContentReset() = 0; virtual void OnContentReset() = 0;
}; };
NS_DEFINE_STATIC_IID_ACCESSOR(nsIListControlFrame, NS_ILISTCONTROLFRAME_IID)
#endif #endif

Просмотреть файл

@ -38,24 +38,17 @@
#ifndef nsIRadioControlFrame_h___ #ifndef nsIRadioControlFrame_h___
#define nsIRadioControlFrame_h___ #define nsIRadioControlFrame_h___
#include "nsISupports.h" #include "nsQueryFrame.h"
class nsStyleContext; class nsStyleContext;
// IID for the nsIRadioControlFrame class
// {06450E00-24D9-11d3-966B-00105A1B1B76}
#define NS_IRADIOCONTROLFRAME_IID \
{ 0x6450e00, 0x24d9, 0x11d3, \
{ 0x96, 0x6b, 0x0, 0x10, 0x5a, 0x1b, 0x1b, 0x76 } }
/** /**
* nsIRadioControlFrame is the common interface radio buttons. * nsIRadioControlFrame is the common interface radio buttons.
* @see nsFormControlFrame and its base classes for more info * @see nsFormControlFrame and its base classes for more info
*/ */
class nsIRadioControlFrame : public nsISupports { class nsIRadioControlFrame
{
public: public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IRADIOCONTROLFRAME_IID) NS_DECLARE_FRAME_ACCESSOR(nsIRadioControlFrame)
/** /**
* Sets the Pseudo Style Contexts for the Radio button * Sets the Pseudo Style Contexts for the Radio button
@ -69,7 +62,5 @@ public:
NS_IMETHOD OnChecked(nsPresContext* aPresContext, PRBool aChecked) = 0; NS_IMETHOD OnChecked(nsPresContext* aPresContext, PRBool aChecked) = 0;
}; };
NS_DEFINE_STATIC_IID_ACCESSOR(nsIRadioControlFrame, NS_IRADIOCONTROLFRAME_IID)
#endif #endif

Просмотреть файл

@ -39,23 +39,17 @@
#ifndef nsISelectControlFrame_h___ #ifndef nsISelectControlFrame_h___
#define nsISelectControlFrame_h___ #define nsISelectControlFrame_h___
#include "nsISupports.h" #include "nsQueryFrame.h"
// IID for the nsISelectControlFrame class
// f8a1b329-d0d8-4bd5-a9ab-08c3c0f2f166
#define NS_ISELECTCONTROLFRAME_IID \
{ 0xf8a1b329, 0xd0d8, 0x4bd5, \
{ 0xa9, 0xab, 0x08, 0xc3, 0xc0, 0xf2, 0xf1, 0x66 } }
class nsIDOMHTMLOptionElement; class nsIDOMHTMLOptionElement;
/** /**
* nsISelectControlFrame is the interface for combo boxes and listboxes * nsISelectControlFrame is the interface for combo boxes and listboxes
*/ */
class nsISelectControlFrame : public nsISupports { class nsISelectControlFrame
{
public: public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISELECTCONTROLFRAME_IID) NS_DECLARE_FRAME_ACCESSOR(nsISelectControlFrame)
/** /**
* Adds an option to the list at index * Adds an option to the list at index
@ -94,7 +88,4 @@ public:
}; };
NS_DEFINE_STATIC_IID_ACCESSOR(nsISelectControlFrame,
NS_ISELECTCONTROLFRAME_IID)
#endif #endif

Просмотреть файл

@ -45,15 +45,10 @@ class nsIDocShell;
class nsISelectionController; class nsISelectionController;
class nsFrameSelection; class nsFrameSelection;
#define NS_IGFXTEXTCONTROLFRAME2_IID \
{/* 0c3b64da-4431-11da-94fd-00e08161165f*/ \
0xc3b64da, 0x4431, 0x11da, \
{ 0x94, 0xfd, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f } }
class nsITextControlFrame : public nsIFormControlFrame class nsITextControlFrame : public nsIFormControlFrame
{ {
public: public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IGFXTEXTCONTROLFRAME2_IID) NS_DECLARE_FRAME_ACCESSOR(nsITextControlFrame)
NS_IMETHOD GetEditor(nsIEditor **aEditor) = 0; NS_IMETHOD GetEditor(nsIEditor **aEditor) = 0;
@ -94,7 +89,4 @@ public:
virtual nsresult GetPhonetic(nsAString& aPhonetic) = 0; virtual nsresult GetPhonetic(nsAString& aPhonetic) = 0;
}; };
NS_DEFINE_STATIC_IID_ACCESSOR(nsITextControlFrame,
NS_IGFXTEXTCONTROLFRAME2_IID)
#endif #endif

Просмотреть файл

@ -81,7 +81,8 @@ public:
NS_IMETHOD Init(nsIContent* aContent, NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent, nsIFrame* aParent,
nsIFrame* aPrevInFlow); nsIFrame* aPrevInFlow);
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
NS_DECL_QUERYFRAME
NS_IMETHOD Reflow(nsPresContext* aPresContext, NS_IMETHOD Reflow(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize, nsHTMLReflowMetrics& aDesiredSize,
@ -110,10 +111,6 @@ public:
virtual void SetFocus(PRBool aOn, PRBool aRepaint); virtual void SetFocus(PRBool aOn, PRBool aRepaint);
virtual nsresult SetFormProperty(nsIAtom* aName, const nsAString& aValue); virtual nsresult SetFormProperty(nsIAtom* aName, const nsAString& aValue);
virtual nsresult GetFormProperty(nsIAtom* aName, nsAString& aValue) const; virtual nsresult GetFormProperty(nsIAtom* aName, nsAString& aValue) const;
protected:
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(nsrefcnt) Release(void);
}; };
@ -160,19 +157,9 @@ nsImageControlFrame::Init(nsIContent* aContent,
IntPointDtorFunc); IntPointDtorFunc);
} }
// Frames are not refcounted, no need to AddRef NS_QUERYFRAME_HEAD(nsImageControlFrame)
NS_IMETHODIMP NS_QUERYFRAME_ENTRY(nsIFormControlFrame)
nsImageControlFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr) NS_QUERYFRAME_TAIL_INHERITING(nsImageControlFrameSuper)
{
NS_PRECONDITION(aInstancePtr, "null out param");
if (aIID.Equals(NS_GET_IID(nsIFormControlFrame))) {
*aInstancePtr = static_cast<nsIFormControlFrame*>(this);
return NS_OK;
}
return nsImageControlFrameSuper::QueryInterface(aIID, aInstancePtr);
}
#ifdef ACCESSIBILITY #ifdef ACCESSIBILITY
NS_IMETHODIMP nsImageControlFrame::GetAccessible(nsIAccessible** aAccessible) NS_IMETHODIMP nsImageControlFrame::GetAccessible(nsIAccessible** aAccessible)
@ -192,18 +179,6 @@ NS_IMETHODIMP nsImageControlFrame::GetAccessible(nsIAccessible** aAccessible)
} }
#endif #endif
nsrefcnt nsImageControlFrame::AddRef(void)
{
NS_WARNING("not supported");
return 1;
}
nsrefcnt nsImageControlFrame::Release(void)
{
NS_WARNING("not supported");
return 1;
}
nsIAtom* nsIAtom*
nsImageControlFrame::GetType() const nsImageControlFrame::GetType() const
{ {

Просмотреть файл

@ -147,7 +147,8 @@ nsIsIndexFrame::GetInputFrame(nsIFormControlFrame** oFrame)
if (presShell && mInputContent) { if (presShell && mInputContent) {
nsIFrame *frame = presShell->GetPrimaryFrameFor(mInputContent); nsIFrame *frame = presShell->GetPrimaryFrameFor(mInputContent);
if (frame) { if (frame) {
return CallQueryInterface(frame, oFrame); *oFrame = do_QueryFrame(frame);
return *oFrame ? NS_OK : NS_NOINTERFACE;
} }
} }
return NS_OK; return NS_OK;
@ -233,20 +234,17 @@ nsIsIndexFrame::CreateAnonymousContent(nsTArray<nsIContent*>& aElements)
return NS_OK; return NS_OK;
} }
NS_QUERYFRAME_HEAD(nsIsIndexFrame)
NS_QUERYFRAME_ENTRY(nsIAnonymousContentCreator)
NS_QUERYFRAME_ENTRY(nsIStatefulFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsBlockFrame)
// Frames are not refcounted, no need to AddRef // Frames are not refcounted, no need to AddRef
NS_IMETHODIMP NS_IMETHODIMP
nsIsIndexFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr) nsIsIndexFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{ {
NS_PRECONDITION(aInstancePtr, "null out param"); NS_PRECONDITION(aInstancePtr, "null out param");
if (aIID.Equals(NS_GET_IID(nsIAnonymousContentCreator))) {
*aInstancePtr = static_cast<nsIAnonymousContentCreator*>(this);
return NS_OK;
}
if (aIID.Equals(NS_GET_IID(nsIStatefulFrame))) {
*aInstancePtr = static_cast<nsIStatefulFrame*>(this);
return NS_OK;
}
if (aIID.Equals(NS_GET_IID(nsIDOMKeyListener))) { if (aIID.Equals(NS_GET_IID(nsIDOMKeyListener))) {
*aInstancePtr = static_cast<nsIDOMKeyListener*>(this); *aInstancePtr = static_cast<nsIDOMKeyListener*>(this);
return NS_OK; return NS_OK;
@ -256,7 +254,7 @@ nsIsIndexFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
return NS_OK; return NS_OK;
} }
return nsBlockFrame::QueryInterface(aIID, aInstancePtr); return NS_NOINTERFACE;
} }
nscoord nscoord

Просмотреть файл

@ -81,9 +81,12 @@ public:
*/ */
NS_IMETHOD KeyPress(nsIDOMEvent* aKeyEvent); // we only care when a key is pressed NS_IMETHOD KeyPress(nsIDOMEvent* aKeyEvent); // we only care when a key is pressed
// nsIFormControlFrame NS_DECL_QUERYFRAME
// nsISupports
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
// nsIFormControlFrame
virtual nscoord GetMinWidth(nsIRenderingContext *aRenderingContext); virtual nscoord GetMinWidth(nsIRenderingContext *aRenderingContext);
virtual PRBool IsLeaf() const; virtual PRBool IsLeaf() const;

Просмотреть файл

@ -52,8 +52,6 @@
#include "nsFont.h" #include "nsFont.h"
#include "nsFormControlFrame.h" #include "nsFormControlFrame.h"
static NS_DEFINE_IID(kLegendFrameCID, NS_LEGEND_FRAME_CID);
nsIFrame* nsIFrame*
NS_NewLegendFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) NS_NewLegendFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{ {
@ -77,19 +75,9 @@ nsLegendFrame::Destroy()
nsBlockFrame::Destroy(); nsBlockFrame::Destroy();
} }
// Frames are not refcounted, no need to AddRef NS_QUERYFRAME_HEAD(nsLegendFrame)
NS_IMETHODIMP NS_QUERYFRAME_ENTRY(nsLegendFrame)
nsLegendFrame::QueryInterface(REFNSIID aIID, void** aInstancePtr) NS_QUERYFRAME_TAIL_INHERITING(nsBlockFrame)
{
NS_PRECONDITION(aInstancePtr, "null out param");
if (aIID.Equals(kLegendFrameCID)) {
*aInstancePtr = this;
return NS_OK;
}
return nsBlockFrame::QueryInterface(aIID, aInstancePtr);
}
NS_IMETHODIMP NS_IMETHODIMP
nsLegendFrame::Reflow(nsPresContext* aPresContext, nsLegendFrame::Reflow(nsPresContext* aPresContext,

Просмотреть файл

@ -49,14 +49,13 @@ struct nsHTMLReflowMetrics;
class nsIRenderingContext; class nsIRenderingContext;
struct nsRect; struct nsRect;
#define NS_LEGEND_FRAME_CID \
{ 0x73805d40, 0x5a24, 0x11d2, { 0x80, 0x46, 0x0, 0x60, 0x8, 0x15, 0xa7, 0x91 } }
class nsLegendFrame : public nsBlockFrame { class nsLegendFrame : public nsBlockFrame {
public: public:
NS_DECLARE_FRAME_ACCESSOR(nsLegendFrame)
nsLegendFrame(nsStyleContext* aContext) : nsBlockFrame(aContext) {} nsLegendFrame(nsStyleContext* aContext) : nsBlockFrame(aContext) {}
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); NS_DECL_QUERYFRAME
NS_IMETHOD Reflow(nsPresContext* aPresContext, NS_IMETHOD Reflow(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize, nsHTMLReflowMetrics& aDesiredSize,

Просмотреть файл

@ -386,28 +386,11 @@ nsListControlFrame::InvalidateFocus()
} }
} }
//--------------------------------------------------------- NS_QUERYFRAME_HEAD(nsListControlFrame)
// Frames are not refcounted, no need to AddRef NS_QUERYFRAME_ENTRY(nsIFormControlFrame)
NS_IMETHODIMP NS_QUERYFRAME_ENTRY(nsIListControlFrame)
nsListControlFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr) NS_QUERYFRAME_ENTRY(nsISelectControlFrame)
{ NS_QUERYFRAME_TAIL_INHERITING(nsHTMLScrollFrame)
NS_PRECONDITION(aInstancePtr, "null out param");
if (aIID.Equals(NS_GET_IID(nsIFormControlFrame))) {
*aInstancePtr = static_cast<nsIFormControlFrame*>(this);
return NS_OK;
}
if (aIID.Equals(NS_GET_IID(nsIListControlFrame))) {
*aInstancePtr = static_cast<nsIListControlFrame*>(this);
return NS_OK;
}
if (aIID.Equals(NS_GET_IID(nsISelectControlFrame))) {
*aInstancePtr = static_cast<nsISelectControlFrame*>(this);
return NS_OK;
}
return nsHTMLScrollFrame::QueryInterface(aIID, aInstancePtr);
}
#ifdef ACCESSIBILITY #ifdef ACCESSIBILITY
NS_IMETHODIMP nsListControlFrame::GetAccessible(nsIAccessible** aAccessible) NS_IMETHODIMP nsListControlFrame::GetAccessible(nsIAccessible** aAccessible)
@ -1366,7 +1349,7 @@ void
nsListControlFrame::SetComboboxFrame(nsIFrame* aComboboxFrame) nsListControlFrame::SetComboboxFrame(nsIFrame* aComboboxFrame)
{ {
if (nsnull != aComboboxFrame) { if (nsnull != aComboboxFrame) {
aComboboxFrame->QueryInterface(NS_GET_IID(nsIComboboxControlFrame),(void**) &mComboboxFrame); mComboboxFrame = do_QueryFrame(aComboboxFrame);
} }
} }
@ -2201,8 +2184,7 @@ nsListControlFrame::MouseDown(nsIDOMEvent* aMouseEvent)
if (!nsComboboxControlFrame::ToolkitHasNativePopup()) if (!nsComboboxControlFrame::ToolkitHasNativePopup())
{ {
PRBool isDroppedDown = mComboboxFrame->IsDroppedDown(); PRBool isDroppedDown = mComboboxFrame->IsDroppedDown();
nsIFrame* comboFrame; nsIFrame* comboFrame = do_QueryFrame(mComboboxFrame);
CallQueryInterface(mComboboxFrame, &comboFrame);
nsWeakFrame weakFrame(comboFrame); nsWeakFrame weakFrame(comboFrame);
mComboboxFrame->ShowDropDown(!isDroppedDown); mComboboxFrame->ShowDropDown(!isDroppedDown);
if (!weakFrame.IsAlive()) if (!weakFrame.IsAlive())

Просмотреть файл

@ -80,8 +80,7 @@ class nsListControlFrame : public nsHTMLScrollFrame,
public: public:
friend nsIFrame* NS_NewListControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); friend nsIFrame* NS_NewListControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
// nsISupports NS_DECL_QUERYFRAME
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
// nsIFrame // nsIFrame
NS_IMETHOD HandleEvent(nsPresContext* aPresContext, NS_IMETHOD HandleEvent(nsPresContext* aPresContext,

Просмотреть файл

@ -1004,34 +1004,13 @@ NS_NewTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell) nsTextControlFrame(aPresShell, aContext); return new (aPresShell) nsTextControlFrame(aPresShell, aContext);
} }
NS_IMPL_ADDREF_INHERITED(nsTextControlFrame, nsBoxFrame) NS_QUERYFRAME_HEAD(nsTextControlFrame)
NS_IMPL_RELEASE_INHERITED(nsTextControlFrame, nsBoxFrame) NS_QUERYFRAME_ENTRY(nsIFormControlFrame)
NS_QUERYFRAME_ENTRY(nsIAnonymousContentCreator)
NS_QUERYFRAME_ENTRY(nsITextControlFrame)
NS_IMETHODIMP if (nsIScrollableViewProvider::kFrameIID == id && IsScrollable())
nsTextControlFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr) return static_cast<nsIScrollableViewProvider*>(this);
{ NS_QUERYFRAME_TAIL_INHERITING(nsBoxFrame)
NS_PRECONDITION(aInstancePtr, "null out param");
if (aIID.Equals(NS_GET_IID(nsIFormControlFrame))) {
*aInstancePtr = static_cast<nsIFormControlFrame*>(this);
return NS_OK;
}
if (aIID.Equals(NS_GET_IID(nsIAnonymousContentCreator))) {
*aInstancePtr = static_cast<nsIAnonymousContentCreator*>(this);
return NS_OK;
}
if (aIID.Equals(NS_GET_IID(nsITextControlFrame))) {
*aInstancePtr = static_cast<nsITextControlFrame*>(this);
return NS_OK;
}
if (aIID.Equals(NS_GET_IID(nsIScrollableViewProvider)) && IsScrollable()) {
*aInstancePtr = static_cast<nsIScrollableViewProvider*>(this);
return NS_OK;
}
return nsBoxFrame::QueryInterface(aIID, aInstancePtr);
}
#ifdef ACCESSIBILITY #ifdef ACCESSIBILITY
NS_IMETHODIMP nsTextControlFrame::GetAccessible(nsIAccessible** aAccessible) NS_IMETHODIMP nsTextControlFrame::GetAccessible(nsIAccessible** aAccessible)
@ -1394,8 +1373,7 @@ nsTextControlFrame::CalcIntrinsicSize(nsIRenderingContext* aRenderingContext,
if (IsTextArea()) { if (IsTextArea()) {
nsIFrame* first = GetFirstChild(nsnull); nsIFrame* first = GetFirstChild(nsnull);
nsIScrollableFrame *scrollableFrame; nsIScrollableFrame *scrollableFrame = do_QueryFrame(first);
CallQueryInterface(first, &scrollableFrame);
NS_ASSERTION(scrollableFrame, "Child must be scrollable"); NS_ASSERTION(scrollableFrame, "Child must be scrollable");
nsMargin scrollbarSizes = nsMargin scrollbarSizes =
@ -2818,8 +2796,7 @@ nsTextControlFrame::SetInitialChildList(nsIAtom* aListName,
// than descending from the root frame of the frame hierarchy. // than descending from the root frame of the frame hierarchy.
first->AddStateBits(NS_FRAME_REFLOW_ROOT); first->AddStateBits(NS_FRAME_REFLOW_ROOT);
nsIScrollableFrame *scrollableFrame = nsnull; nsIScrollableFrame *scrollableFrame = do_QueryFrame(first);
CallQueryInterface(first, &scrollableFrame);
NS_ASSERTION(scrollableFrame, "Child must be scrollable"); NS_ASSERTION(scrollableFrame, "Child must be scrollable");
// we must turn off scrollbars for singleline text controls // we must turn off scrollbars for singleline text controls
@ -2864,10 +2841,7 @@ nsTextControlFrame::SetInitialChildList(nsIAtom* aListName,
nsIScrollableView* nsTextControlFrame::GetScrollableView() nsIScrollableView* nsTextControlFrame::GetScrollableView()
{ {
nsIFrame* first = GetFirstChild(nsnull); nsIFrame* first = GetFirstChild(nsnull);
nsIScrollableFrame* scrollableFrame = nsnull; nsIScrollableFrame* scrollableFrame = do_QueryFrame(first);
if (first) {
CallQueryInterface(first, &scrollableFrame);
}
return scrollableFrame ? scrollableFrame->GetScrollableView() : nsnull; return scrollableFrame ? scrollableFrame->GetScrollableView() : nsnull;
} }

Просмотреть файл

@ -168,7 +168,7 @@ public:
NS_IMETHOD GetText(nsString* aText); NS_IMETHOD GetText(nsString* aText);
NS_DECL_ISUPPORTS_INHERITED NS_DECL_QUERYFRAME
public: //for methods who access nsTextControlFrame directly public: //for methods who access nsTextControlFrame directly
/** /**

Просмотреть файл

@ -83,6 +83,7 @@ REQUIRES += accessibility
endif endif
EXPORTS = \ EXPORTS = \
nsQueryFrame.h \
nsFrameList.h \ nsFrameList.h \
nsHTMLParts.h \ nsHTMLParts.h \
nsHTMLReflowMetrics.h \ nsHTMLReflowMetrics.h \

Просмотреть файл

@ -369,8 +369,8 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat
nsFrame::IndentBy(stdout,nsBlockFrame::gNoiseIndent); nsFrame::IndentBy(stdout,nsBlockFrame::gNoiseIndent);
printf("abs pos "); printf("abs pos ");
if (nsnull != aKidFrame) { if (nsnull != aKidFrame) {
nsIFrameDebug* frameDebug; nsIFrameDebug *frameDebug = do_QueryFrame(aKidFrame);
if (NS_SUCCEEDED(CallQueryInterface(aKidFrame, &frameDebug))) { if (frameDebug) {
nsAutoString name; nsAutoString name;
frameDebug->GetFrameName(name); frameDebug->GetFrameName(name);
printf("%s ", NS_LossyConvertUTF16toASCII(name).get()); printf("%s ", NS_LossyConvertUTF16toASCII(name).get());
@ -513,8 +513,8 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat
nsFrame::IndentBy(stdout,nsBlockFrame::gNoiseIndent - 1); nsFrame::IndentBy(stdout,nsBlockFrame::gNoiseIndent - 1);
printf("abs pos "); printf("abs pos ");
if (nsnull != aKidFrame) { if (nsnull != aKidFrame) {
nsIFrameDebug* frameDebug; nsIFrameDebug *frameDebug = do_QueryFrame(aKidFrame);
if (NS_SUCCEEDED(CallQueryInterface(aKidFrame, &frameDebug))) { if (frameDebug) {
nsAutoString name; nsAutoString name;
frameDebug->GetFrameName(name); frameDebug->GetFrameName(name);
printf("%s ", NS_LossyConvertUTF16toASCII(name).get()); printf("%s ", NS_LossyConvertUTF16toASCII(name).get());

Просмотреть файл

@ -281,7 +281,7 @@ NS_IMETHODIMP BRFrame::GetAccessible(nsIAccessible** aAccessible)
// "bogus node" used when there is no text in the control // "bogus node" used when there is no text in the control
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
return accService->CreateHTMLBRAccessible(static_cast<nsIFrame*>(this), aAccessible); return accService->CreateHTMLBRAccessible(this, aAccessible);
} }
#endif #endif

Просмотреть файл

@ -266,8 +266,6 @@ RecordReflowStatus(PRBool aChildIsBlock, nsReflowStatus aFrameReflowStatus)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const nsIID kBlockFrameCID = NS_BLOCK_FRAME_CID;
nsIFrame* nsIFrame*
NS_NewBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags) NS_NewBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags)
{ {
@ -330,17 +328,9 @@ nsBlockFrame::GetLineIterator()
return it; return it;
} }
NS_IMETHODIMP NS_QUERYFRAME_HEAD(nsBlockFrame)
nsBlockFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr) NS_QUERYFRAME_ENTRY(nsBlockFrame)
{ NS_QUERYFRAME_TAIL_INHERITING(nsBlockFrameSuper)
NS_PRECONDITION(aInstancePtr, "null out param");
if (aIID.Equals(kBlockFrameCID)) {
*aInstancePtr = static_cast<void*>(static_cast<nsBlockFrame*>(this));
return NS_OK;
}
return nsBlockFrameSuper::QueryInterface(aIID, aInstancePtr);
}
nsSplittableType nsSplittableType
nsBlockFrame::GetSplittableType() const nsBlockFrame::GetSplittableType() const
@ -449,9 +439,8 @@ nsBlockFrame::List(FILE* out, PRInt32 aIndent) const
} }
fputs("<\n", out); fputs("<\n", out);
while (kid) { while (kid) {
nsIFrameDebug* frameDebug; nsIFrameDebug *frameDebug = do_QueryFrame(kid);
if (frameDebug) {
if (NS_SUCCEEDED(CallQueryInterface(kid, &frameDebug))) {
frameDebug->List(out, aIndent + 1); frameDebug->List(out, aIndent + 1);
} }
kid = kid->GetNextSibling(); kid = kid->GetNextSibling();
@ -832,8 +821,7 @@ CalculateContainingBlockSizeForAbsolutes(const nsHTMLReflowState& aReflowState,
if (aLastRS != &aReflowState) { if (aLastRS != &aReflowState) {
// Scrollbars need to be specifically excluded, if present, because they are outside the // Scrollbars need to be specifically excluded, if present, because they are outside the
// padding-edge. We need better APIs for getting the various boxes from a frame. // padding-edge. We need better APIs for getting the various boxes from a frame.
nsIScrollableFrame* scrollFrame; nsIScrollableFrame* scrollFrame = do_QueryFrame(aLastRS->frame);
CallQueryInterface(aLastRS->frame, &scrollFrame);
nsMargin scrollbars(0,0,0,0); nsMargin scrollbars(0,0,0,0);
if (scrollFrame) { if (scrollFrame) {
scrollbars = scrollbars =

Просмотреть файл

@ -127,11 +127,6 @@ class nsIntervalSet;
#define nsBlockFrameSuper nsHTMLContainerFrame #define nsBlockFrameSuper nsHTMLContainerFrame
#define NS_BLOCK_FRAME_CID \
{ 0xa6cf90df, 0x15b3, 0x11d2,{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
extern const nsIID kBlockFrameCID;
/* /*
* Base class for block and inline frames. * Base class for block and inline frames.
* The block frame has an additional named child list: * The block frame has an additional named child list:
@ -142,6 +137,8 @@ extern const nsIID kBlockFrameCID;
class nsBlockFrame : public nsBlockFrameSuper class nsBlockFrame : public nsBlockFrameSuper
{ {
public: public:
NS_DECLARE_FRAME_ACCESSOR(nsBlockFrame)
typedef nsLineList::iterator line_iterator; typedef nsLineList::iterator line_iterator;
typedef nsLineList::const_iterator const_line_iterator; typedef nsLineList::const_iterator const_line_iterator;
typedef nsLineList::reverse_iterator reverse_line_iterator; typedef nsLineList::reverse_iterator reverse_line_iterator;
@ -158,8 +155,8 @@ public:
friend nsIFrame* NS_NewBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags); friend nsIFrame* NS_NewBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags);
// nsISupports // nsQueryFrame
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); NS_DECL_QUERYFRAME
// nsIFrame // nsIFrame
NS_IMETHOD Init(nsIContent* aContent, NS_IMETHOD Init(nsIContent* aContent,

Просмотреть файл

@ -1643,8 +1643,8 @@ nsContainerFrame::List(FILE* out, PRInt32 aIndent) const
NS_ASSERTION(kid->GetParent() == (nsIFrame*)this, "bad parent frame pointer"); NS_ASSERTION(kid->GetParent() == (nsIFrame*)this, "bad parent frame pointer");
// Have the child frame list // Have the child frame list
nsIFrameDebug* frameDebug; nsIFrameDebug *frameDebug = do_QueryFrame(kid);
if (NS_SUCCEEDED(kid->QueryInterface(NS_GET_IID(nsIFrameDebug), (void**)&frameDebug))) { if (frameDebug) {
frameDebug->List(out, aIndent + 1); frameDebug->List(out, aIndent + 1);
} }
kid = kid->GetNextSibling(); kid = kid->GetNextSibling();

Просмотреть файл

@ -372,7 +372,6 @@ nsFloatManager::List(FILE* out) const
fi.mRect.x, fi.mRect.y, fi.mRect.width, fi.mRect.height, fi.mRect.x, fi.mRect.y, fi.mRect.width, fi.mRect.height,
fi.mLeftYMost, fi.mRightYMost); fi.mLeftYMost, fi.mRightYMost);
} }
return NS_OK; return NS_OK;
} }
#endif #endif

Просмотреть файл

@ -273,10 +273,8 @@ nsIFrameDebug::RootFrameList(nsPresContext* aPresContext, FILE* out, PRInt32 aIn
if (nsnull != shell) { if (nsnull != shell) {
nsIFrame* frame = shell->FrameManager()->GetRootFrame(); nsIFrame* frame = shell->FrameManager()->GetRootFrame();
if(nsnull != frame) { if(nsnull != frame) {
nsIFrameDebug* debugFrame; nsIFrameDebug* debugFrame = do_QueryFrame(frame);
nsresult rv; if (debugFrame)
rv = frame->QueryInterface(NS_GET_IID(nsIFrameDebug), (void**)&debugFrame);
if(NS_SUCCEEDED(rv))
debugFrame->List(out, aIndent); debugFrame->List(out, aIndent);
} }
} }
@ -366,42 +364,12 @@ nsFrame::~nsFrame()
mStyleContext->Release(); mStyleContext->Release();
} }
///////////////////////////////////////////////////////////////////////////// NS_QUERYFRAME_HEAD(nsFrame)
// nsISupports NS_QUERYFRAME_ENTRY(nsIFrame)
NS_IMETHODIMP
nsFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
NS_PRECONDITION(aInstancePtr, "null out param");
#ifdef DEBUG #ifdef DEBUG
if (aIID.Equals(NS_GET_IID(nsIFrameDebug))) { NS_QUERYFRAME_ENTRY(nsIFrameDebug)
*aInstancePtr = static_cast<nsIFrameDebug*>(this);
return NS_OK;
}
#endif #endif
NS_QUERYFRAME_TAIL
if (aIID.Equals(NS_GET_IID(nsIFrame)) ||
aIID.Equals(NS_GET_IID(nsISupports))) {
*aInstancePtr = static_cast<nsIFrame*>(this);
return NS_OK;
}
*aInstancePtr = nsnull;
return NS_ERROR_NO_INTERFACE;
}
nsrefcnt nsFrame::AddRef(void)
{
NS_WARNING("not supported for frames");
return 1;
}
nsrefcnt nsFrame::Release(void)
{
NS_WARNING("not supported for frames");
return 1;
}
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// nsIFrame // nsIFrame
@ -1725,9 +1693,8 @@ nsFrame::GetDataForTableSelection(const nsFrameSelection *aFrameSelection,
while (frame && NS_SUCCEEDED(result)) while (frame && NS_SUCCEEDED(result))
{ {
// Check for a table cell by querying to a known CellFrame interface // Check for a table cell by querying to a known CellFrame interface
nsITableCellLayout *cellElement; nsITableCellLayout *cellElement = do_QueryFrame(frame);
result = (frame)->QueryInterface(NS_GET_IID(nsITableCellLayout), (void **)&cellElement); if (cellElement)
if (NS_SUCCEEDED(result) && cellElement)
{ {
foundCell = PR_TRUE; foundCell = PR_TRUE;
//TODO: If we want to use proximity to top or left border //TODO: If we want to use proximity to top or left border
@ -1739,9 +1706,8 @@ nsFrame::GetDataForTableSelection(const nsFrameSelection *aFrameSelection,
// If not a cell, check for table // If not a cell, check for table
// This will happen when starting frame is the table or child of a table, // This will happen when starting frame is the table or child of a table,
// such as a row (we were inbetween cells or in table border) // such as a row (we were inbetween cells or in table border)
nsITableLayout *tableElement; nsITableLayout *tableElement = do_QueryFrame(frame);
result = (frame)->QueryInterface(NS_GET_IID(nsITableLayout), (void **)&tableElement); if (tableElement)
if (NS_SUCCEEDED(result) && tableElement)
{ {
foundTable = PR_TRUE; foundTable = PR_TRUE;
//TODO: How can we select row when along left table edge //TODO: How can we select row when along left table edge
@ -4293,8 +4259,8 @@ nsFrame::GetSelectionController(nsPresContext *aPresContext, nsISelectionControl
nsIFrame *frame = this; nsIFrame *frame = this;
while (frame && (frame->GetStateBits() & NS_FRAME_INDEPENDENT_SELECTION)) { while (frame && (frame->GetStateBits() & NS_FRAME_INDEPENDENT_SELECTION)) {
nsITextControlFrame *tcf; nsITextControlFrame *tcf = do_QueryFrame(frame);
if (NS_SUCCEEDED(frame->QueryInterface(NS_GET_IID(nsITextControlFrame),(void**)&tcf))) { if (tcf) {
NS_IF_ADDREF(*aSelCon = tcf->GetOwnedSelectionController()); NS_IF_ADDREF(*aSelCon = tcf->GetOwnedSelectionController());
return NS_OK; return NS_OK;
} }
@ -4318,8 +4284,8 @@ nsIFrame::GetConstFrameSelection()
{ {
nsIFrame *frame = this; nsIFrame *frame = this;
while (frame && (frame->GetStateBits() & NS_FRAME_INDEPENDENT_SELECTION)) { while (frame && (frame->GetStateBits() & NS_FRAME_INDEPENDENT_SELECTION)) {
nsITextControlFrame *tcf; nsITextControlFrame *tcf = do_QueryFrame(frame);
if (NS_SUCCEEDED(frame->QueryInterface(NS_GET_IID(nsITextControlFrame),(void**)&tcf))) { if (tcf) {
return tcf->GetOwnedFrameSelection(); return tcf->GetOwnedFrameSelection();
} }
frame = frame->GetParent(); frame = frame->GetParent();
@ -4407,9 +4373,8 @@ nsFrame::DumpBaseRegressionData(nsPresContext* aPresContext, FILE* out, PRInt32
} }
aIndent++; aIndent++;
while (kid) { while (kid) {
nsIFrameDebug* frameDebug; nsIFrameDebug* frameDebug = do_QueryFrame(kid);
if (kid) {
if (NS_SUCCEEDED(kid->QueryInterface(NS_GET_IID(nsIFrameDebug), (void**)&frameDebug))) {
frameDebug->DumpRegressionData(aPresContext, out, aIndent, aIncludeStyleData); frameDebug->DumpRegressionData(aPresContext, out, aIndent, aIncludeStyleData);
} }
kid = kid->GetNextSibling(); kid = kid->GetNextSibling();
@ -4818,9 +4783,8 @@ FindBlockFrameOrBR(nsIFrame* aFrame, nsDirection aDirection)
// Treat form controls as inline leaves // Treat form controls as inline leaves
// XXX we really need a way to determine whether a frame is inline-level // XXX we really need a way to determine whether a frame is inline-level
nsIFormControlFrame* fcf; // used only for QI nsIFormControlFrame* fcf = do_QueryFrame(aFrame);
nsresult rv = aFrame->QueryInterface(NS_GET_IID(nsIFormControlFrame), (void**)&fcf); if (fcf)
if (NS_SUCCEEDED(rv))
return result; return result;
// Check the frame itself // Check the frame itself
@ -6086,7 +6050,7 @@ nsIFrame::IsFocusable(PRInt32 *aTabIndex, PRBool aWithMouse)
// because the extra focus outlines are considered unnecessarily ugly. // because the extra focus outlines are considered unnecessarily ugly.
// When clicked on, the selection position within the element // When clicked on, the selection position within the element
// will be enough to make them keyboard scrollable. // will be enough to make them keyboard scrollable.
nsCOMPtr<nsIScrollableFrame> scrollFrame = do_QueryInterface(this); nsIScrollableFrame *scrollFrame = do_QueryFrame(this);
if (scrollFrame) { if (scrollFrame) {
nsMargin margin = scrollFrame->GetActualScrollbarSizes(); nsMargin margin = scrollFrame->GetActualScrollbarSizes();
if (margin.top || margin.right || margin.bottom || margin.left) { if (margin.top || margin.right || margin.bottom || margin.left) {
@ -7372,8 +7336,8 @@ void DR_State::DisplayFrameTypeInfo(nsIFrame* aFrame,
} }
if(!strcmp(frameTypeInfo->mNameAbbrev, "unknown")) { if(!strcmp(frameTypeInfo->mNameAbbrev, "unknown")) {
nsAutoString name; nsAutoString name;
nsIFrameDebug* frameDebug; nsIFrameDebug* frameDebug = do_QueryFrame(aFrame);
if (NS_SUCCEEDED(aFrame->QueryInterface(NS_GET_IID(nsIFrameDebug), (void**)&frameDebug))) { if (frameDebug) {
frameDebug->GetFrameName(name); frameDebug->GetFrameName(name);
printf("%s %p ", NS_LossyConvertUTF16toASCII(name).get(), (void*)aFrame); printf("%s %p ", NS_LossyConvertUTF16toASCII(name).get(), (void*)aFrame);
} }

Просмотреть файл

@ -156,8 +156,8 @@ private:
public: public:
// nsISupports // nsQueryFrame
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); NS_DECL_QUERYFRAME
// nsIFrame // nsIFrame
NS_IMETHOD Init(nsIContent* aContent, NS_IMETHOD Init(nsIContent* aContent,
@ -442,9 +442,8 @@ public:
static void ListTag(FILE* out, nsIFrame* aFrame) { static void ListTag(FILE* out, nsIFrame* aFrame) {
nsAutoString tmp; nsAutoString tmp;
nsIFrameDebug* frameDebug; nsIFrameDebug* frameDebug = do_QueryFrame(aFrame);
if (frameDebug) {
if (NS_SUCCEEDED(aFrame->QueryInterface(NS_GET_IID(nsIFrameDebug), (void**)&frameDebug))) {
frameDebug->GetFrameName(tmp); frameDebug->GetFrameName(tmp);
} }
fputs(NS_LossyConvertUTF16toASCII(tmp).get(), out); fputs(NS_LossyConvertUTF16toASCII(tmp).get(), out);
@ -622,10 +621,6 @@ private:
NS_IMETHODIMP RefreshSizeCache(nsBoxLayoutState& aState); NS_IMETHODIMP RefreshSizeCache(nsBoxLayoutState& aState);
virtual nsILineIterator* GetLineIterator(); virtual nsILineIterator* GetLineIterator();
protected:
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(nsrefcnt) Release(void);
}; };
// Start Display Reflow Debugging // Start Display Reflow Debugging

Просмотреть файл

@ -120,10 +120,7 @@ public:
NS_IMETHOD GetFrameName(nsAString& aResult) const; NS_IMETHOD GetFrameName(nsAString& aResult) const;
#endif #endif
// nsISupports NS_DECL_QUERYFRAME
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
NS_IMETHOD_(nsrefcnt) AddRef(void) { return 2; }
NS_IMETHOD_(nsrefcnt) Release(void) { return 1; }
virtual nsIAtom* GetType() const; virtual nsIAtom* GetType() const;
@ -242,20 +239,9 @@ NS_IMETHODIMP nsSubDocumentFrame::GetAccessible(nsIAccessible** aAccessible)
} }
#endif #endif
//-------------------------------------------------------------- NS_QUERYFRAME_HEAD(nsSubDocumentFrame)
// Frames are not refcounted, no need to AddRef NS_QUERYFRAME_ENTRY(nsIFrameFrame)
NS_IMETHODIMP NS_QUERYFRAME_TAIL_INHERITING(nsLeafFrame)
nsSubDocumentFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
NS_PRECONDITION(aInstancePtr, "null out param");
if (aIID.Equals(NS_GET_IID(nsIFrameFrame))) {
*aInstancePtr = static_cast<nsIFrameFrame*>(this);
return NS_OK;
}
return nsLeafFrame::QueryInterface(aIID, aInstancePtr);
}
NS_IMETHODIMP NS_IMETHODIMP
nsSubDocumentFrame::Init(nsIContent* aContent, nsSubDocumentFrame::Init(nsIContent* aContent,
@ -656,10 +642,7 @@ nsSubDocumentFrame::AttributeChanged(PRInt32 aNameSpaceID,
if (parentFrame) { if (parentFrame) {
// There is no interface for nsHTMLFramesetFrame so QI'ing to // There is no interface for nsHTMLFramesetFrame so QI'ing to
// concrete class, yay! // concrete class, yay!
nsHTMLFramesetFrame* framesetFrame = nsnull; nsHTMLFramesetFrame* framesetFrame = do_QueryFrame(parentFrame);
parentFrame->QueryInterface(NS_GET_IID(nsHTMLFramesetFrame),
(void **)&framesetFrame);
if (framesetFrame) { if (framesetFrame) {
framesetFrame->RecalculateBorderResize(); framesetFrame->RecalculateBorderResize();
} }

Просмотреть файл

@ -414,8 +414,8 @@ nsFrameList::List(FILE* out) const
fputs("<\n", out); fputs("<\n", out);
for (nsIFrame* frame = mFirstChild; frame; for (nsIFrame* frame = mFirstChild; frame;
frame = frame->GetNextSibling()) { frame = frame->GetNextSibling()) {
nsIFrameDebug* frameDebug; nsIFrameDebug *frameDebug = do_QueryFrame(frame);
if (NS_SUCCEEDED(frame->QueryInterface(NS_GET_IID(nsIFrameDebug), (void**)&frameDebug))) { if (frameDebug) {
frameDebug->List(out, 1); frameDebug->List(out, 1);
} }
} }

Просмотреть файл

@ -253,18 +253,9 @@ nsHTMLFramesetFrame::~nsHTMLFramesetFrame()
FrameResizePrefCallback, this); FrameResizePrefCallback, this);
} }
NS_IMETHODIMP NS_QUERYFRAME_HEAD(nsHTMLFramesetFrame)
nsHTMLFramesetFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr) NS_QUERYFRAME_ENTRY(nsHTMLFramesetFrame)
{ NS_QUERYFRAME_TAIL_INHERITING(nsHTMLContainerFrame)
NS_PRECONDITION(aInstancePtr, "null out param");
if (aIID.Equals(NS_GET_IID(nsHTMLFramesetFrame))) {
*aInstancePtr = (void*)this;
return NS_OK;
}
return nsHTMLContainerFrame::QueryInterface(aIID, aInstancePtr);
}
// static // static
int int
@ -311,9 +302,7 @@ nsHTMLFramesetFrame::Init(nsIContent* aContent,
nsIFrame* parentFrame = GetParent(); nsIFrame* parentFrame = GetParent();
mTopLevelFrameset = (nsHTMLFramesetFrame*)this; mTopLevelFrameset = (nsHTMLFramesetFrame*)this;
while (parentFrame) { while (parentFrame) {
nsHTMLFramesetFrame* frameset = nsnull; nsHTMLFramesetFrame* frameset = do_QueryFrame(parentFrame);
CallQueryInterface(parentFrame, &frameset);
if (frameset) { if (frameset) {
mTopLevelFrameset = frameset; mTopLevelFrameset = frameset;
parentFrame = parentFrame->GetParent(); parentFrame = parentFrame->GetParent();
@ -1309,8 +1298,7 @@ nsHTMLFramesetFrame::IsLeaf() const
PRBool PRBool
nsHTMLFramesetFrame::ChildIsFrameset(nsIFrame* aChild) nsHTMLFramesetFrame::ChildIsFrameset(nsIFrame* aChild)
{ {
nsIFrame* childFrame = nsnull; nsHTMLFramesetFrame* childFrame = do_QueryFrame(aChild);
aChild->QueryInterface(NS_GET_IID(nsHTMLFramesetFrame), (void**)&childFrame);
if (childFrame) { if (childFrame) {
return PR_TRUE; return PR_TRUE;
} }

Просмотреть файл

@ -59,10 +59,6 @@ class nsHTMLFramesetBorderFrame;
class nsGUIEvent; class nsGUIEvent;
class nsHTMLFramesetFrame; class nsHTMLFramesetFrame;
#define NS_IFRAMESETFRAME_IID \
{ 0xf47deac0, 0x4200, 0x11d2, \
{ 0x80, 0x3c, 0x0, 0x60, 0x8, 0x15, 0xa7, 0x91 } }
#define NO_COLOR 0xFFFFFFFA #define NO_COLOR 0xFFFFFFFA
struct nsBorderColor struct nsBorderColor
@ -108,14 +104,13 @@ struct nsFramesetDrag {
class nsHTMLFramesetFrame : public nsHTMLContainerFrame class nsHTMLFramesetFrame : public nsHTMLContainerFrame
{ {
public: public:
// Woohoo, concrete class with an IID! NS_DECLARE_FRAME_ACCESSOR(nsHTMLFramesetFrame)
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFRAMESETFRAME_IID)
nsHTMLFramesetFrame(nsStyleContext* aContext); nsHTMLFramesetFrame(nsStyleContext* aContext);
virtual ~nsHTMLFramesetFrame(); virtual ~nsHTMLFramesetFrame();
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); NS_DECL_QUERYFRAME
NS_IMETHOD Init(nsIContent* aContent, NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent, nsIFrame* aParent,
@ -272,6 +267,4 @@ protected:
PRBool mForceFrameResizability; PRBool mForceFrameResizability;
}; };
NS_DEFINE_STATIC_IID_ACCESSOR(nsHTMLFramesetFrame, NS_IFRAMESETFRAME_IID)
#endif #endif

Просмотреть файл

@ -878,18 +878,6 @@ nsHTMLScrollFrame::Reflow(nsPresContext* aPresContext,
return rv; return rv;
} }
NS_IMETHODIMP_(nsrefcnt)
nsHTMLScrollFrame::AddRef(void)
{
return NS_OK;
}
NS_IMETHODIMP_(nsrefcnt)
nsHTMLScrollFrame::Release(void)
{
return NS_OK;
}
#ifdef NS_DEBUG #ifdef NS_DEBUG
NS_IMETHODIMP NS_IMETHODIMP
nsHTMLScrollFrame::GetFrameName(nsAString& aResult) const nsHTMLScrollFrame::GetFrameName(nsAString& aResult) const
@ -923,15 +911,15 @@ nsHTMLScrollFrame::CurPosAttributeChanged(nsIContent* aChild,
mInner.CurPosAttributeChanged(aChild); mInner.CurPosAttributeChanged(aChild);
} }
NS_INTERFACE_MAP_BEGIN(nsHTMLScrollFrame) NS_QUERYFRAME_HEAD(nsHTMLScrollFrame)
NS_INTERFACE_MAP_ENTRY(nsIAnonymousContentCreator) NS_QUERYFRAME_ENTRY(nsIAnonymousContentCreator)
#ifdef NS_DEBUG NS_QUERYFRAME_ENTRY(nsIScrollableFrame)
NS_INTERFACE_MAP_ENTRY(nsIFrameDebug) NS_QUERYFRAME_ENTRY(nsIScrollableViewProvider)
NS_QUERYFRAME_ENTRY(nsIStatefulFrame)
#ifdef DEBUG
NS_QUERYFRAME_ENTRY(nsIFrameDebug)
#endif #endif
NS_INTERFACE_MAP_ENTRY(nsIScrollableFrame) NS_QUERYFRAME_TAIL_INHERITING(nsHTMLContainerFrame)
NS_INTERFACE_MAP_ENTRY(nsIScrollableViewProvider)
NS_INTERFACE_MAP_ENTRY(nsIStatefulFrame)
NS_INTERFACE_MAP_END_INHERITING(nsHTMLContainerFrame)
//----------nsXULScrollFrame------------------------------------------- //----------nsXULScrollFrame-------------------------------------------
@ -1242,18 +1230,6 @@ nsXULScrollFrame::GetMinWidth(nsIRenderingContext *aRenderingContext)
} }
#endif #endif
NS_IMETHODIMP_(nsrefcnt)
nsXULScrollFrame::AddRef(void)
{
return NS_OK;
}
NS_IMETHODIMP_(nsrefcnt)
nsXULScrollFrame::Release(void)
{
return NS_OK;
}
#ifdef NS_DEBUG #ifdef NS_DEBUG
NS_IMETHODIMP NS_IMETHODIMP
nsXULScrollFrame::GetFrameName(nsAString& aResult) const nsXULScrollFrame::GetFrameName(nsAString& aResult) const
@ -1278,17 +1254,15 @@ nsXULScrollFrame::DoLayout(nsBoxLayoutState& aState)
return rv; return rv;
} }
NS_INTERFACE_MAP_BEGIN(nsXULScrollFrame) NS_QUERYFRAME_HEAD(nsXULScrollFrame)
NS_INTERFACE_MAP_ENTRY(nsIAnonymousContentCreator) NS_QUERYFRAME_ENTRY(nsIAnonymousContentCreator)
#ifdef NS_DEBUG NS_QUERYFRAME_ENTRY(nsIScrollableFrame)
NS_INTERFACE_MAP_ENTRY(nsIFrameDebug) NS_QUERYFRAME_ENTRY(nsIScrollableViewProvider)
NS_QUERYFRAME_ENTRY(nsIStatefulFrame)
#ifdef DEBUG
NS_QUERYFRAME_ENTRY(nsIFrameDebug)
#endif #endif
NS_INTERFACE_MAP_ENTRY(nsIScrollableFrame) NS_QUERYFRAME_TAIL_INHERITING(nsBoxFrame)
NS_INTERFACE_MAP_ENTRY(nsIScrollableViewProvider)
NS_INTERFACE_MAP_ENTRY(nsIStatefulFrame)
NS_INTERFACE_MAP_END_INHERITING(nsBoxFrame)
//-------------------- Inner ---------------------- //-------------------- Inner ----------------------
@ -1328,16 +1302,6 @@ nsGfxScrollFrameInner::~nsGfxScrollFrameInner()
{ {
} }
NS_IMETHODIMP_(nsrefcnt) nsGfxScrollFrameInner::AddRef(void)
{
return 2;
}
NS_IMETHODIMP_(nsrefcnt) nsGfxScrollFrameInner::Release(void)
{
return 1;
}
NS_IMPL_QUERY_INTERFACE1(nsGfxScrollFrameInner, nsIScrollPositionListener) NS_IMPL_QUERY_INTERFACE1(nsGfxScrollFrameInner, nsIScrollPositionListener)
nsresult nsresult
@ -1412,16 +1376,15 @@ nsGfxScrollFrameInner::NeedsClipWidget() const
return PR_FALSE; return PR_FALSE;
/* If we're a form element, we don't need a widget. */ /* If we're a form element, we don't need a widget. */
nsIFormControlFrame* fcFrame; nsIFormControlFrame* fcFrame = do_QueryFrame(parentFrame);
if ((NS_SUCCEEDED(parentFrame->QueryInterface(NS_GET_IID(nsIFormControlFrame), (void**)&fcFrame)))) { if (fcFrame) {
return PR_FALSE; return PR_FALSE;
} }
} }
// Scrollports that don't ever show associated scrollbars don't get // Scrollports that don't ever show associated scrollbars don't get
// widgets, because they will seldom actually be scrolled. // widgets, because they will seldom actually be scrolled.
nsIScrollableFrame *scrollableFrame; nsIScrollableFrame *scrollableFrame = do_QueryFrame(mOuter);
CallQueryInterface(mOuter, &scrollableFrame);
ScrollbarStyles scrollbars = scrollableFrame->GetScrollbarStyles(); ScrollbarStyles scrollbars = scrollableFrame->GetScrollbarStyles();
if ((scrollbars.mHorizontal == NS_STYLE_OVERFLOW_HIDDEN if ((scrollbars.mHorizontal == NS_STYLE_OVERFLOW_HIDDEN
|| scrollbars.mHorizontal == NS_STYLE_OVERFLOW_VISIBLE) || scrollbars.mHorizontal == NS_STYLE_OVERFLOW_VISIBLE)
@ -1687,8 +1650,7 @@ nsGfxScrollFrameInner::CreateAnonymousContent(nsTArray<nsIContent*>& aElements)
} }
} }
nsIScrollableFrame *scrollable; nsIScrollableFrame *scrollable = do_QueryFrame(mOuter);
CallQueryInterface(mOuter, &scrollable);
// At this stage in frame construction, the document element and/or // At this stage in frame construction, the document element and/or
// BODY overflow styles have not yet been propagated to the // BODY overflow styles have not yet been propagated to the
@ -1713,8 +1675,7 @@ nsGfxScrollFrameInner::CreateAnonymousContent(nsTArray<nsIContent*>& aElements)
} }
// The anonymous <div> used by <inputs> never gets scrollbars. // The anonymous <div> used by <inputs> never gets scrollbars.
nsITextControlFrame* textFrame = nsnull; nsITextControlFrame* textFrame = do_QueryFrame(parent);
CallQueryInterface(parent, &textFrame);
if (textFrame) { if (textFrame) {
// Make sure we are not a text area. // Make sure we are not a text area.
nsCOMPtr<nsIDOMHTMLTextAreaElement> textAreaElement(do_QueryInterface(parent->GetContent())); nsCOMPtr<nsIDOMHTMLTextAreaElement> textAreaElement(do_QueryInterface(parent->GetContent()));
@ -2714,14 +2675,13 @@ nsGfxScrollFrameInner::SetScrollbarVisibility(nsIBox* aScrollbar, PRBool aVisibl
if (!aScrollbar) if (!aScrollbar)
return; return;
nsIScrollbarFrame* scrollbar; nsIScrollbarFrame* scrollbar = do_QueryFrame(aScrollbar);
CallQueryInterface(aScrollbar, &scrollbar);
if (scrollbar) { if (scrollbar) {
// See if we have a mediator. // See if we have a mediator.
nsIScrollbarMediator* mediator = scrollbar->GetScrollbarMediator(); nsIScrollbarMediator* mediator = scrollbar->GetScrollbarMediator();
if (mediator) { if (mediator) {
// Inform the mediator of the visibility change. // Inform the mediator of the visibility change.
mediator->VisibilityChanged(scrollbar, aVisible); mediator->VisibilityChanged(aVisible);
} }
} }
} }
@ -2819,8 +2779,7 @@ nsGfxScrollFrameInner::SaveState(nsIStatefulFrame::SpecialStateID aStateID)
return nsnull; return nsnull;
} }
nsIScrollbarMediator* mediator; nsIScrollbarMediator* mediator = do_QueryFrame(GetScrolledFrame());
CallQueryInterface(GetScrolledFrame(), &mediator);
if (mediator) { if (mediator) {
// child handles its own scroll state, so don't bother saving state here // child handles its own scroll state, so don't bother saving state here
return nsnull; return nsnull;

Просмотреть файл

@ -66,8 +66,8 @@ class nsGfxScrollFrameInner : public nsIScrollPositionListener,
public nsIReflowCallback { public nsIReflowCallback {
public: public:
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr); NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr);
NS_IMETHOD_(nsrefcnt) AddRef(void); NS_IMETHOD_(nsrefcnt) AddRef(void) { return 2; }
NS_IMETHOD_(nsrefcnt) Release(void); NS_IMETHOD_(nsrefcnt) Release(void) { return 1; }
nsGfxScrollFrameInner(nsContainerFrame* aOuter, PRBool aIsRoot, nsGfxScrollFrameInner(nsContainerFrame* aOuter, PRBool aIsRoot,
PRBool aIsXUL); PRBool aIsXUL);
@ -248,7 +248,7 @@ class nsHTMLScrollFrame : public nsHTMLContainerFrame,
public: public:
friend nsIFrame* NS_NewHTMLScrollFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool aIsRoot); friend nsIFrame* NS_NewHTMLScrollFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool aIsRoot);
NS_DECL_ISUPPORTS NS_DECL_QUERYFRAME
// Called to set the child frames. We typically have three: the scroll area, // Called to set the child frames. We typically have three: the scroll area,
// the vertical scrollbar, and the horizontal scrollbar. // the vertical scrollbar, and the horizontal scrollbar.
@ -433,6 +433,8 @@ class nsXULScrollFrame : public nsBoxFrame,
public nsIAnonymousContentCreator, public nsIAnonymousContentCreator,
public nsIStatefulFrame { public nsIStatefulFrame {
public: public:
NS_DECL_QUERYFRAME
friend nsIFrame* NS_NewXULScrollFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool aIsRoot); friend nsIFrame* NS_NewXULScrollFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool aIsRoot);
// Called to set the child frames. We typically have three: the scroll area, // Called to set the child frames. We typically have three: the scroll area,
@ -493,9 +495,6 @@ public:
// nsIAnonymousContentCreator // nsIAnonymousContentCreator
virtual nsresult CreateAnonymousContent(nsTArray<nsIContent*>& aElements); virtual nsresult CreateAnonymousContent(nsTArray<nsIContent*>& aElements);
// nsIBox methods
NS_DECL_ISUPPORTS
virtual nsSize GetMinSize(nsBoxLayoutState& aBoxLayoutState); virtual nsSize GetMinSize(nsBoxLayoutState& aBoxLayoutState);
virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState); virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState);
virtual nsSize GetMaxSize(nsBoxLayoutState& aBoxLayoutState); virtual nsSize GetMaxSize(nsBoxLayoutState& aBoxLayoutState);

Просмотреть файл

@ -87,7 +87,9 @@ public:
: nsHTMLContainerFrame(aContext), mDoPaintFocus(PR_FALSE), : nsHTMLContainerFrame(aContext), mDoPaintFocus(PR_FALSE),
mAbsoluteContainer(nsGkAtoms::absoluteList) {} mAbsoluteContainer(nsGkAtoms::absoluteList) {}
// nsISupports NS_DECL_QUERYFRAME
// nsISupports (nsIScrollPositionListener)
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
NS_IMETHOD Init(nsIContent* aContent, NS_IMETHOD Init(nsIContent* aContent,
@ -188,24 +190,11 @@ NS_NewCanvasFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
return new (aPresShell)CanvasFrame(aContext); return new (aPresShell)CanvasFrame(aContext);
} }
//-------------------------------------------------------------- NS_IMPL_QUERY_INTERFACE1(CanvasFrame, nsIScrollPositionListener)
// Frames are not refcounted, no need to AddRef
NS_IMETHODIMP
CanvasFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
NS_PRECONDITION(aInstancePtr, "null out param");
if (aIID.Equals(NS_GET_IID(nsIScrollPositionListener))) { NS_QUERYFRAME_HEAD(CanvasFrame)
*aInstancePtr = static_cast<nsIScrollPositionListener*>(this); NS_QUERYFRAME_ENTRY(nsICanvasFrame)
return NS_OK; NS_QUERYFRAME_TAIL_INHERITING(nsHTMLContainerFrame)
}
if (aIID.Equals(NS_GET_IID(nsICanvasFrame))) {
*aInstancePtr = static_cast<nsICanvasFrame*>(this);
return NS_OK;
}
return nsHTMLContainerFrame::QueryInterface(aIID, aInstancePtr);
}
NS_IMETHODIMP NS_IMETHODIMP
CanvasFrame::Init(nsIContent* aContent, CanvasFrame::Init(nsIContent* aContent,
@ -407,8 +396,7 @@ nsRect CanvasFrame::CanvasArea() const
{ {
nsRect result(GetOverflowRect()); nsRect result(GetOverflowRect());
nsIScrollableFrame *scrollableFrame; nsIScrollableFrame *scrollableFrame = do_QueryFrame(GetParent());
CallQueryInterface(GetParent(), &scrollableFrame);
if (scrollableFrame) { if (scrollableFrame) {
nsIScrollableView* scrollableView = scrollableFrame->GetScrollableView(); nsIScrollableView* scrollableView = scrollableFrame->GetScrollableView();
nsRect vcr = scrollableView->View()->GetBounds(); nsRect vcr = scrollableView->View()->GetBounds();
@ -549,9 +537,7 @@ CanvasFrame::PaintFocus(nsIRenderingContext& aRenderingContext, nsPoint aPt)
{ {
nsRect focusRect(aPt, GetSize()); nsRect focusRect(aPt, GetSize());
nsIScrollableFrame *scrollableFrame; nsIScrollableFrame *scrollableFrame = do_QueryFrame(GetParent());
CallQueryInterface(GetParent(), &scrollableFrame);
if (scrollableFrame) { if (scrollableFrame) {
nsIScrollableView* scrollableView = scrollableFrame->GetScrollableView(); nsIScrollableView* scrollableView = scrollableFrame->GetScrollableView();
nsRect vcr = scrollableView->View()->GetBounds(); nsRect vcr = scrollableView->View()->GetBounds();

Просмотреть файл

@ -43,19 +43,13 @@
#ifndef nsIAnonymousContentCreator_h___ #ifndef nsIAnonymousContentCreator_h___
#define nsIAnonymousContentCreator_h___ #define nsIAnonymousContentCreator_h___
#include "nsISupports.h" #include "nsQueryFrame.h"
#include "nsIContent.h" #include "nsIContent.h"
class nsPresContext; class nsPresContext;
class nsIFrame; class nsIFrame;
template <class T> class nsTArray; template <class T> class nsTArray;
// {7568a516-3831-4db4-88a7-a42578acc136}
#define NS_IANONYMOUS_CONTENT_CREATOR_IID \
{ 0x7568a516, 0x3831, 0x4db4, \
{ 0x88, 0xa7, 0xa4, 0x25, 0x78, 0xac, 0xc1, 0x36 } }
/** /**
* Any source for anonymous content can implement this interface to provide it. * Any source for anonymous content can implement this interface to provide it.
* HTML frames like nsFileControlFrame currently use this as well as XUL frames * HTML frames like nsFileControlFrame currently use this as well as XUL frames
@ -63,9 +57,10 @@ template <class T> class nsTArray;
* *
* @see nsCSSFrameConstructor * @see nsCSSFrameConstructor
*/ */
class nsIAnonymousContentCreator : public nsISupports { class nsIAnonymousContentCreator
{
public: public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IANONYMOUS_CONTENT_CREATOR_IID) NS_DECLARE_FRAME_ACCESSOR(nsIAnonymousContentCreator)
/** /**
* Creates "native" anonymous content and adds the created content to * Creates "native" anonymous content and adds the created content to
@ -93,8 +88,5 @@ public:
virtual void PostCreateFrames() {} virtual void PostCreateFrames() {}
}; };
NS_DEFINE_STATIC_IID_ACCESSOR(nsIAnonymousContentCreator,
NS_IANONYMOUS_CONTENT_CREATOR_IID)
#endif #endif

Просмотреть файл

@ -40,16 +40,12 @@
#ifndef nsICanvasFrame_h__ #ifndef nsICanvasFrame_h__
#define nsICanvasFrame_h__ #define nsICanvasFrame_h__
#include "nsISupports.h" #include "nsQueryFrame.h"
// IID for the nsICanvasFrame interface class nsICanvasFrame
#define NS_ICANVASFRAME_IID \
{ 0x9df7db77, 0x49a2, 0x11d5, {0x97, 0x92, 0x0, 0x60, 0xb0, 0xfb, 0x99, 0x56} }
class nsICanvasFrame : public nsISupports
{ {
public: public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICANVASFRAME_IID) NS_DECLARE_FRAME_ACCESSOR(nsICanvasFrame)
/** SetHasFocus tells the CanvasFrame to draw with focus ring /** SetHasFocus tells the CanvasFrame to draw with focus ring
* @param aHasFocus PR_TRUE to show focus ring, PR_FALSE to hide it * @param aHasFocus PR_TRUE to show focus ring, PR_FALSE to hide it
@ -58,7 +54,5 @@ public:
}; };
NS_DEFINE_STATIC_IID_ACCESSOR(nsICanvasFrame, NS_ICANVASFRAME_IID)
#endif // nsICanvasFrame_h__ #endif // nsICanvasFrame_h__

Просмотреть файл

@ -47,7 +47,7 @@
variables in this file. -dwh */ variables in this file. -dwh */
#include <stdio.h> #include <stdio.h>
#include "nsISupports.h" #include "nsQueryFrame.h"
#include "nsEvent.h" #include "nsEvent.h"
#include "nsStyleStruct.h" #include "nsStyleStruct.h"
#include "nsStyleContext.h" #include "nsStyleContext.h"
@ -464,10 +464,10 @@ typedef PRBool nsDidReflowStatus;
* If you're not in layout but you must call functions in here, at least * If you're not in layout but you must call functions in here, at least
* restrict yourself to calling virtual methods, which won't hurt you as badly. * restrict yourself to calling virtual methods, which won't hurt you as badly.
*/ */
class nsIFrame : public nsISupports class nsIFrame : public nsQueryFrame
{ {
public: public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFRAME_IID) NS_DECLARE_FRAME_ACCESSOR(nsIFrame)
nsPresContext* PresContext() const { nsPresContext* PresContext() const {
return GetStyleContext()->GetRuleNode()->GetPresContext(); return GetStyleContext()->GetRuleNode()->GetPresContext();
@ -2348,9 +2348,6 @@ protected:
nsresult PeekOffsetParagraph(nsPeekOffsetStruct *aPos); nsresult PeekOffsetParagraph(nsPeekOffsetStruct *aPos);
private: private:
NS_IMETHOD_(nsrefcnt) AddRef(void) = 0;
NS_IMETHOD_(nsrefcnt) Release(void) = 0;
nsRect* GetOverflowAreaProperty(PRBool aCreateIfNecessary = PR_FALSE); nsRect* GetOverflowAreaProperty(PRBool aCreateIfNecessary = PR_FALSE);
}; };
@ -2425,7 +2422,4 @@ private:
nsIFrame* mFrame; nsIFrame* mFrame;
}; };
NS_DEFINE_STATIC_IID_ACCESSOR(nsIFrame, NS_IFRAME_IID)
#endif /* nsIFrame_h___ */ #endif /* nsIFrame_h___ */

Просмотреть файл

@ -40,23 +40,17 @@
#ifndef nsIFrameDebug_h___ #ifndef nsIFrameDebug_h___
#define nsIFrameDebug_h___ #define nsIFrameDebug_h___
#include "nsISupports.h"
#include "nsIFrame.h" #include "nsIFrame.h"
class nsPresContext; class nsPresContext;
struct PRLogModuleInfo; struct PRLogModuleInfo;
// IID for the nsIFrameDebug interface {a6cf9069-15b3-11d2-932e-00805f8add32}
#define NS_IFRAMEDEBUG_IID \
{ 0xa6cf9069, 0x15b3, 0x11d2, \
{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
/** /**
* Debug related functions * Debug related functions
*/ */
class nsIFrameDebug : public nsISupports { class nsIFrameDebug {
public: public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFRAMEDEBUG_IID) NS_DECLARE_FRAME_ACCESSOR(nsIFrameDebug)
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const = 0; NS_IMETHOD List(FILE* out, PRInt32 aIndent) const = 0;
/** /**
@ -134,12 +128,6 @@ public:
static PRBool GetShowEventTargetFrameBorder(); static PRBool GetShowEventTargetFrameBorder();
static void PrintDisplayList(nsDisplayListBuilder* aBuilder, const nsDisplayList& aList); static void PrintDisplayList(nsDisplayListBuilder* aBuilder, const nsDisplayList& aList);
private:
NS_IMETHOD_(nsrefcnt) AddRef(void) = 0;
NS_IMETHOD_(nsrefcnt) Release(void) = 0;
}; };
NS_DEFINE_STATIC_IID_ACCESSOR(nsIFrameDebug, NS_IFRAMEDEBUG_IID)
#endif /* nsIFrameDebug_h___ */ #endif /* nsIFrameDebug_h___ */

Просмотреть файл

@ -45,14 +45,10 @@
class nsIDocShell; class nsIDocShell;
#define NS_IFRAMEFRAME_IID \ class nsIFrameFrame
{ 0x22e34108, 0xc24b, 0x40ea, { \
0xb9, 0x79, 0x50, 0x18, 0x38, 0x8d, 0xd5, 0x88 } }
class nsIFrameFrame : public nsISupports
{ {
public: public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFRAMEFRAME_IID) NS_DECLARE_FRAME_ACCESSOR(nsIFrameFrame)
NS_IMETHOD GetDocShell(nsIDocShell **aDocShell) = 0; NS_IMETHOD GetDocShell(nsIDocShell **aDocShell) = 0;
@ -65,6 +61,4 @@ public:
virtual void EndSwapDocShells(nsIFrame* aOther) = 0; virtual void EndSwapDocShells(nsIFrame* aOther) = 0;
}; };
NS_DEFINE_STATIC_IID_ACCESSOR(nsIFrameFrame, NS_IFRAMEFRAME_IID)
#endif #endif

Просмотреть файл

@ -43,25 +43,19 @@
#ifndef nsIImageFrame_h___ #ifndef nsIImageFrame_h___
#define nsIImageFrame_h___ #define nsIImageFrame_h___
#include "nsISupports.h"
struct nsSize; struct nsSize;
class imgIRequest; class imgIRequest;
class nsPresContext; class nsPresContext;
class nsIImageMap; class nsIImageMap;
// {B261A0D5-E696-11d4-9885-00C04FA0CF4B} class nsIImageFrame
#define NS_IIMAGEFRAME_IID \ {
{ 0xb261a0d5, 0xe696, 0x11d4, { 0x98, 0x85, 0x0, 0xc0, 0x4f, 0xa0, 0xcf, 0x4b } }
class nsIImageFrame : public nsISupports {
public: public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IIMAGEFRAME_IID) NS_DECLARE_FRAME_ACCESSOR(nsIImageFrame)
NS_IMETHOD GetIntrinsicImageSize(nsSize& aSize) = 0; NS_IMETHOD GetIntrinsicImageSize(nsSize& aSize) = 0;
NS_IMETHOD GetImageMap(nsPresContext *aPresContext, nsIImageMap **aImageMap) = 0; NS_IMETHOD GetImageMap(nsPresContext *aPresContext, nsIImageMap **aImageMap) = 0;
}; };
NS_DEFINE_STATIC_IID_ACCESSOR(nsIImageFrame, NS_IIMAGEFRAME_IID)
#endif /* nsIImageFrame_h___ */ #endif /* nsIImageFrame_h___ */

Просмотреть файл

@ -47,13 +47,10 @@
class nsIPluginInstance; class nsIPluginInstance;
// {3e2df1fe-a898-4e2e-8763-4ca904fa338e} class nsIObjectFrame : public nsQueryFrame
#define NS_IOBJECTFRAME_IID \ {
{ 0x3e2df1fe, 0xa898, 0x4e2e, { 0x87, 0x63, 0x4c, 0xa9, 0x4, 0xfa, 0x33, 0x8e } }
class nsIObjectFrame : public nsISupports {
public: public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IOBJECTFRAME_IID) NS_DECLARE_FRAME_ACCESSOR(nsIObjectFrame)
NS_IMETHOD GetPluginInstance(nsIPluginInstance*& aPluginInstance) = 0; NS_IMETHOD GetPluginInstance(nsIPluginInstance*& aPluginInstance) = 0;
@ -94,6 +91,4 @@ public:
virtual void StopPlugin() = 0; virtual void StopPlugin() = 0;
}; };
NS_DEFINE_STATIC_IID_ACCESSOR(nsIObjectFrame, NS_IOBJECTFRAME_IID)
#endif /* nsIObjectFrame_h___ */ #endif /* nsIObjectFrame_h___ */

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше