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

This patch locally causes two REFTEST-UNEXPECTED-PASS for Bidi stuff. It's possible that I accidentally fixed a bug, but I'm not sure, so I'm going to wait for the tinderboxes to confirm my local results.
This commit is contained in:
Benjamin Smedberg 2008-11-05 14:25:30 -05:00
parent 8fefc53731
commit 802d1a10c7
201 changed files with 1154 additions and 2097 deletions

View File

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

View File

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

View File

@ -89,12 +89,11 @@ private:
* Return presentation shell, DOM node for 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
* given frame
* @param aContent [out] - DOM node associated with the given frame
*/
nsresult GetInfo(nsISupports *aFrame, nsIFrame **aRealFrame,
nsresult GetInfo(nsIFrame *aFrame,
nsIWeakReference **aShell,
nsIDOMNode **aContent);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -95,8 +95,7 @@ nsHTMLTableCellAccessible::GetAttributesInternal(nsIPersistentProperties *aAttri
NS_ASSERTION(frame, "The frame cannot be obtaied for HTML table cell.");
NS_ENSURE_STATE(frame);
nsITableCellLayout *cellLayout = nsnull;
CallQueryInterface(frame, &cellLayout);
nsITableCellLayout *cellLayout = do_QueryFrame(frame);
NS_ENSURE_STATE(cellLayout);
PRInt32 rowIdx = -1, cellIdx = -1;
@ -928,7 +927,11 @@ nsHTMLTableAccessible::GetTableLayout(nsITableLayout **aTableLayout)
NS_ENSURE_TRUE(shell, NS_ERROR_FAILURE);
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

View File

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

View File

@ -216,8 +216,7 @@ __try {
else {
// 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
nsIScrollableFrame *scrollFrame = nsnull;
CallQueryInterface(frame, &scrollFrame);
nsIScrollableFrame *scrollFrame = do_QueryFrame(frame);
if (scrollFrame) {
hwnd = (HWND)scrollFrame->GetScrolledFrame()->GetWindow()->GetNativeData(NS_NATIVE_WINDOW);
NS_ASSERTION(hwnd, "No window handle for window");

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -601,7 +601,7 @@ nsHTMLSelectElement::GetSelectFrame()
nsISelectControlFrame *select_frame = nsnull;
if (form_control_frame) {
CallQueryInterface(form_control_frame, &select_frame);
select_frame = do_QueryFrame(form_control_frame);
}
return select_frame;
@ -1440,9 +1440,7 @@ nsHTMLSelectElement::PreHandleEvent(nsEventChainPreVisitor& aVisitor)
nsIFrame* formFrame = nsnull;
if (formControlFrame &&
NS_SUCCEEDED(CallQueryInterface(formControlFrame, &formFrame)) &&
formFrame)
{
(formFrame = do_QueryFrame(formControlFrame))) {
const nsStyleUserInterface* uiStyle = formFrame->GetStyleUserInterface();
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
// frame or combo box control frame.
if (IsCombobox()) {
nsIComboboxControlFrame* comboFrame = nsnull;
CallQueryInterface(formControlFrame, &comboFrame);
nsIComboboxControlFrame* comboFrame = do_QueryFrame(formControlFrame);
if (comboFrame) {
comboFrame->OnContentReset();
}
} else {
nsIListControlFrame* listFrame = nsnull;
CallQueryInterface(formControlFrame, &listFrame);
nsIListControlFrame* listFrame = do_QueryFrame(formControlFrame);
if (listFrame) {
listFrame->OnContentReset();
}

View File

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

View File

@ -129,8 +129,7 @@ nsPluginStreamListener::OnStartRequest(nsIRequest* request, nsISupports *ctxt)
return rv;
}
nsIObjectFrame* objFrame;
CallQueryInterface(frame, &objFrame);
nsIObjectFrame* objFrame = do_QueryFrame(frame);
if (!objFrame) {
mPluginDoc->AllowNormalInstantiation();
return NS_ERROR_UNEXPECTED;
@ -328,9 +327,7 @@ nsPluginDocument::Print()
nsIFrame* frame = shell->GetPrimaryFrameFor(mPluginContent);
NS_ENSURE_TRUE(frame, NS_ERROR_FAILURE);
nsIObjectFrame* objectFrame = nsnull;
CallQueryInterface(frame, &objectFrame);
nsIObjectFrame* objectFrame = do_QueryFrame(frame);
if (objectFrame) {
nsCOMPtr<nsIPluginInstance> pi;
objectFrame->GetPluginInstance(*getter_AddRefs(pi));

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -4517,8 +4517,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIContent* aDocElement,
PR_TRUE,
newFrame);
nsIScrollableFrame* scrollable;
CallQueryInterface(newFrame, &scrollable);
nsIScrollableFrame* scrollable = do_QueryFrame(newFrame);
NS_ENSURE_TRUE(scrollable, NS_ERROR_FAILURE);
nsIScrollableView* scrollableView = scrollable->GetScrollableView();
@ -4673,8 +4672,8 @@ nsCSSFrameConstructor::ConstructRadioControlFrame(nsIFrame** aNewFrame,
radioStyle = mPresShell->StyleSet()->ResolvePseudoStyleFor(aContent,
nsCSSAnonBoxes::radio,
aStyleContext);
nsIRadioControlFrame* radio = nsnull;
if (*aNewFrame && NS_SUCCEEDED(CallQueryInterface(*aNewFrame, &radio))) {
nsIRadioControlFrame* radio = do_QueryFrame(*aNewFrame);
if (radio) {
radio->SetRadioButtonFaceStyleContext(radioStyle);
}
return NS_OK;
@ -4694,8 +4693,8 @@ nsCSSFrameConstructor::ConstructCheckboxControlFrame(nsIFrame** aNewFrame,
checkboxStyle = mPresShell->StyleSet()->ResolvePseudoStyleFor(aContent,
nsCSSAnonBoxes::check,
aStyleContext);
nsICheckboxControlFrame* checkbox = nsnull;
if (*aNewFrame && NS_SUCCEEDED(CallQueryInterface(*aNewFrame, &checkbox))) {
nsICheckboxControlFrame* checkbox = do_QueryFrame(*aNewFrame);
if (checkbox) {
checkbox->SetCheckboxFaceStyleContext(checkboxStyle);
}
return NS_OK;
@ -4772,8 +4771,7 @@ nsCSSFrameConstructor::ConstructButtonFrame(nsFrameConstructorState& aState,
#ifdef DEBUG
// Make sure that we're an anonymous content creator exactly when we're a
// leaf
nsIAnonymousContentCreator* creator = nsnull;
CallQueryInterface(buttonFrame, &creator);
nsIAnonymousContentCreator* creator = do_QueryFrame(buttonFrame);
NS_ASSERTION(!creator == !isLeaf,
"Should be creator exactly when we're a leaf");
#endif
@ -4791,8 +4789,7 @@ nsCSSFrameConstructor::ConstructButtonFrame(nsFrameConstructorState& aState,
#ifdef DEBUG
// Make sure that anonymous child creation will have no effect in this case
nsIAnonymousContentCreator* creator = nsnull;
CallQueryInterface(blockFrame, &creator);
nsIAnonymousContentCreator* creator = do_QueryFrame(blockFrame);
NS_ASSERTION(!creator, "Shouldn't be an anonymous content creator!");
#endif
@ -4878,8 +4875,7 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsFrameConstructorState& aState,
///////////////////////////////////////////////////////////////////
// Combobox - Old Native Implementation
///////////////////////////////////////////////////////////////////
nsIComboboxControlFrame* comboBox = nsnull;
CallQueryInterface(comboboxFrame, &comboBox);
nsIComboboxControlFrame* comboBox = do_QueryFrame(comboboxFrame);
NS_ASSERTION(comboBox, "NS_NewComboboxControlFrame returned frame that "
"doesn't implement nsIComboboxControlFrame");
@ -4893,9 +4889,8 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsFrameConstructorState& aState,
nsIFrame* listFrame = NS_NewListControlFrame(mPresShell, listStyle);
// Notify the listbox that it is being used as a dropdown list.
nsIListControlFrame * listControlFrame;
rv = CallQueryInterface(listFrame, &listControlFrame);
if (NS_SUCCEEDED(rv)) {
nsIListControlFrame * listControlFrame = do_QueryFrame(listFrame);
if (listControlFrame) {
listControlFrame->SetComboboxFrame(comboboxFrame);
}
// Notify combobox that it should use the listbox as it's popup
@ -5115,13 +5110,12 @@ nsCSSFrameConstructor::ConstructFieldSetFrame(nsFrameConstructorState& aState,
ProcessChildren(aState, aContent, aStyleContext, blockFrame, PR_TRUE,
childItems, PR_TRUE);
static NS_DEFINE_IID(kLegendFrameCID, NS_LEGEND_FRAME_CID);
nsIFrame * child = childItems.childList;
nsIFrame * previous = nsnull;
nsIFrame* legendFrame = nsnull;
nsLegendFrame* legendFrame = nsnull;
while (nsnull != child) {
nsresult result = child->QueryInterface(kLegendFrameCID, (void**)&legendFrame);
if (NS_SUCCEEDED(result) && legendFrame) {
legendFrame = do_QueryFrame(child);
if (legendFrame) {
// 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
// from a selection point within the legend (bug 236071), which is
@ -5188,8 +5182,7 @@ nsCSSFrameConstructor::ConstructTextFrame(nsFrameConstructorState& aState,
if (aParentFrame->IsFrameOfType(nsIFrame::eSVG)) {
nsIFrame *ancestorFrame = SVG_GetFirstNonAAncestorFrame(aParentFrame);
if (ancestorFrame) {
nsISVGTextContentMetrics* metrics;
CallQueryInterface(ancestorFrame, &metrics);
nsISVGTextContentMetrics* metrics = do_QueryFrame(ancestorFrame);
if (!metrics) {
return NS_OK;
}
@ -5579,8 +5572,7 @@ nsCSSFrameConstructor::CreateAnonymousFrames(nsFrameConstructorState& aState,
nsIFrame* aParentFrame,
nsFrameItems& aChildItems)
{
nsIAnonymousContentCreator* creator = nsnull;
CallQueryInterface(aParentFrame, &creator);
nsIAnonymousContentCreator* creator = do_QueryFrame(aParentFrame);
if (!creator)
return NS_OK;
@ -6993,8 +6985,7 @@ nsCSSFrameConstructor::ConstructSVGFrame(nsFrameConstructorState& aState,
else if (aTag == nsGkAtoms::text) {
nsIFrame *ancestorFrame = SVG_GetFirstNonAAncestorFrame(aParentFrame);
if (ancestorFrame) {
nsISVGTextContentMetrics* metrics;
CallQueryInterface(ancestorFrame, &metrics);
nsISVGTextContentMetrics* metrics = do_QueryFrame(ancestorFrame);
// Text cannot be nested
if (!metrics)
newFrame = NS_NewSVGTextFrame(mPresShell, aContent, aStyleContext);
@ -7003,8 +6994,7 @@ nsCSSFrameConstructor::ConstructSVGFrame(nsFrameConstructorState& aState,
else if (aTag == nsGkAtoms::tspan) {
nsIFrame *ancestorFrame = SVG_GetFirstNonAAncestorFrame(aParentFrame);
if (ancestorFrame) {
nsISVGTextContentMetrics* metrics;
CallQueryInterface(ancestorFrame, &metrics);
nsISVGTextContentMetrics* metrics = do_QueryFrame(ancestorFrame);
if (metrics)
newFrame = NS_NewSVGTSpanFrame(mPresShell, aContent,
ancestorFrame, aStyleContext);
@ -8499,8 +8489,7 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer,
#ifdef DEBUG
if (gReallyNoisyContentUpdates) {
nsIFrameDebug* fdbg = nsnull;
CallQueryInterface(parentFrame, &fdbg);
nsIFrameDebug* fdbg = do_QueryFrame(parentFrame);
if (fdbg) {
printf("nsCSSFrameConstructor::ContentAppended: resulting frame model:\n");
fdbg->List(stdout, 0);
@ -8647,8 +8636,7 @@ nsCSSFrameConstructor::ContentInserted(nsIContent* aContainer,
InvalidateCanvasIfNeeded(docElementFrame);
#ifdef DEBUG
if (gReallyNoisyContentUpdates) {
nsIFrameDebug* fdbg = nsnull;
CallQueryInterface(docElementFrame, &fdbg);
nsIFrameDebug* fdbg = do_QueryFrame(docElementFrame);
if (fdbg) {
printf("nsCSSFrameConstructor::ContentInserted: resulting frame model:\n");
fdbg->List(stdout, 0);
@ -8940,8 +8928,7 @@ nsCSSFrameConstructor::ContentInserted(nsIContent* aContainer,
#ifdef DEBUG
if (gReallyNoisyContentUpdates && parentFrame) {
nsIFrameDebug* fdbg = nsnull;
CallQueryInterface(parentFrame, &fdbg);
nsIFrameDebug* fdbg = do_QueryFrame(parentFrame);
if (fdbg) {
printf("nsCSSFrameConstructor::ContentInserted: resulting frame model:\n");
fdbg->List(stdout, 0);
@ -9319,8 +9306,7 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
nsFrame::ListTag(stdout, childFrame);
printf("\n");
nsIFrameDebug* fdbg = nsnull;
CallQueryInterface(parentFrame, &fdbg);
nsIFrameDebug* fdbg = do_QueryFrame(parentFrame);
if (fdbg)
fdbg->List(stdout, 0);
}
@ -9384,8 +9370,7 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer,
#ifdef DEBUG
if (gReallyNoisyContentUpdates && parentFrame) {
nsIFrameDebug* fdbg = nsnull;
CallQueryInterface(parentFrame, &fdbg);
nsIFrameDebug* fdbg = do_QueryFrame(parentFrame);
if (fdbg) {
printf("nsCSSFrameConstructor::ContentRemoved: resulting frame model:\n");
fdbg->List(stdout, 0);
@ -12536,16 +12521,15 @@ nsCSSFrameConstructor::ConstructInline(nsFrameConstructorState& aState,
nsIFrameDebug* frameDebug;
printf("nsCSSFrameConstructor::ConstructInline:\n");
if (NS_SUCCEEDED(CallQueryInterface(aNewFrame, &frameDebug))) {
if ( (frameDebug = do_QueryFrame(aNewFrame)) ) {
printf(" ==> leading inline frame:\n");
frameDebug->List(stdout, 2);
}
if (NS_SUCCEEDED(CallQueryInterface(blockFrame, &frameDebug))) {
if ( (frameDebug = do_QueryFrame(blockFrame)) ) {
printf(" ==> block frame:\n");
frameDebug->List(stdout, 2);
}
if (inlineFrame &&
NS_SUCCEEDED(CallQueryInterface(inlineFrame, &frameDebug))) {
if ( (frameDebug = do_QueryFrame(inlineFrame)) ) {
printf(" ==> trailing inline frame:\n");
frameDebug->List(stdout, 2);
}

View File

@ -240,14 +240,13 @@ protected:
if (mBidiEnabled) {
// Find the containing block frame
nsIFrame* frame = aFrame;
nsresult rv = NS_ERROR_FAILURE;
while (frame &&
frame->IsFrameOfType(nsIFrame::eLineParticipant) &&
NS_FAILED(rv)) {
do {
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;
}

View File

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

View File

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

View File

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

View File

@ -38,22 +38,20 @@
#ifndef nsIPercentHeightObserver_h___
#define nsIPercentHeightObserver_h___
#include "nsQueryFrame.h"
struct nsHTMLReflowState;
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
* values to children during reflow which would otherwise not happen. Currently only
* table cells support this.
*/
class nsIPercentHeightObserver : public nsISupports
class nsIPercentHeightObserver
{
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
virtual void NotifyPercentHeight(const nsHTMLReflowState& aReflowState) = 0;
@ -62,7 +60,4 @@ public:
virtual PRBool NeedsToObserve(const nsHTMLReflowState& aReflowState) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIPercentHeightObserver,
NS_IPERCENTHEIGHTOBSERVER_IID)
#endif // nsIPercentHeightObserver_h___

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -228,23 +228,10 @@ nsFileControlFrame::CreateAnonymousContent(nsTArray<nsIContent*>& aElements)
return NS_OK;
}
// Frames are not refcounted, no need to AddRef
NS_IMETHODIMP
nsFileControlFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
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);
}
NS_QUERYFRAME_HEAD(nsFileControlFrame)
NS_QUERYFRAME_ENTRY(nsIAnonymousContentCreator)
NS_QUERYFRAME_ENTRY(nsIFormControlFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsBlockFrame)
void
nsFileControlFrame::SetFocus(PRBool aOn, PRBool aRepaint)

View File

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

View File

@ -62,19 +62,9 @@ nsFormControlFrame::Destroy()
nsLeafFrame::Destroy();
}
// Frames are not refcounted, no need to AddRef
NS_IMETHODIMP
nsFormControlFrame::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 nsLeafFrame::QueryInterface(aIID, aInstancePtr);
}
NS_QUERYFRAME_HEAD(nsFormControlFrame)
NS_QUERYFRAME_ENTRY(nsIFormControlFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsLeafFrame)
nscoord
nsFormControlFrame::GetIntrinsicWidth()

View File

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

View File

@ -186,19 +186,9 @@ NS_IMETHODIMP nsGfxButtonControlFrame::GetAccessible(nsIAccessible** aAccessible
}
#endif
// Frames are not refcounted, no need to AddRef
NS_IMETHODIMP
nsGfxButtonControlFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
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);
}
NS_QUERYFRAME_HEAD(nsGfxButtonControlFrame)
NS_QUERYFRAME_ENTRY(nsIAnonymousContentCreator)
NS_QUERYFRAME_TAIL_INHERITING(nsHTMLButtonControlFrame)
// Initially we hardcoded the default strings here.
// Next, we used html.css to store the default label for various types

View File

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

View File

@ -93,22 +93,9 @@ nsGfxCheckboxControlFrame::~nsGfxCheckboxControlFrame()
}
//----------------------------------------------------------------------
// nsISupports
//----------------------------------------------------------------------
// 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);
}
NS_QUERYFRAME_HEAD(nsGfxCheckboxControlFrame)
NS_QUERYFRAME_ENTRY(nsICheckboxControlFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsFormControlFrame)
#ifdef ACCESSIBILITY
NS_IMETHODIMP nsGfxCheckboxControlFrame::GetAccessible(nsIAccessible** aAccessible)

View File

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

View File

@ -61,19 +61,9 @@ nsGfxRadioControlFrame::~nsGfxRadioControlFrame()
{
}
// Frames are not refcounted, no need to AddRef
NS_IMETHODIMP
nsGfxRadioControlFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
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);
}
NS_QUERYFRAME_HEAD(nsGfxRadioControlFrame)
NS_QUERYFRAME_ENTRY(nsIRadioControlFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsFormControlFrame)
#ifdef ACCESSIBILITY
NS_IMETHODIMP nsGfxRadioControlFrame::GetAccessible(nsIAccessible** aAccessible)

View File

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

View File

@ -105,31 +105,9 @@ nsHTMLButtonControlFrame::Init(
return rv;
}
nsrefcnt nsHTMLButtonControlFrame::AddRef(void)
{
NS_WARNING("not supported");
return 1;
}
nsrefcnt nsHTMLButtonControlFrame::Release(void)
{
NS_WARNING("not supported");
return 1;
}
// Frames are not refcounted, no need to AddRef
NS_IMETHODIMP
nsHTMLButtonControlFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
NS_PRECONDITION(aInstancePtr, "null out param");
if (aIID.Equals(NS_GET_IID(nsIFormControlFrame))) {
*aInstancePtr = static_cast<nsIFormControlFrame*>(this);
return NS_OK;
}
return nsHTMLContainerFrame::QueryInterface(aIID, aInstancePtr);
}
NS_QUERYFRAME_HEAD(nsHTMLButtonControlFrame)
NS_QUERYFRAME_ENTRY(nsIFormControlFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsHTMLContainerFrame)
#ifdef ACCESSIBILITY
NS_IMETHODIMP nsHTMLButtonControlFrame::GetAccessible(nsIAccessible** aAccessible)

View File

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

View File

@ -38,24 +38,18 @@
#ifndef nsICheckControlFrame_h___
#define nsICheckControlFrame_h___
#include "nsISupports.h"
#include "nsQueryFrame.h"
class nsStyleContext;
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.
* @see nsFromControlFrame and its base classes for more info
*/
class nsICheckboxControlFrame : public nsISupports {
class nsICheckboxControlFrame
{
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICHECKBOXCONTROLFRAME_IID)
NS_DECLARE_FRAME_ACCESSOR(nsICheckboxControlFrame)
/**
* Sets the Pseudo Style Contexts for the Check button
@ -69,8 +63,5 @@ public:
NS_IMETHOD OnChecked(nsPresContext* aPresContext, PRBool aChecked) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsICheckboxControlFrame,
NS_ICHECKBOXCONTROLFRAME_IID)
#endif

View File

@ -38,7 +38,7 @@
#ifndef nsIComboboxControlFrame_h___
#define nsIComboboxControlFrame_h___
#include "nsISupports.h"
#include "nsQueryFrame.h"
#include "nsFont.h"
class nsPresContext;
@ -47,21 +47,15 @@ class nsIContent;
class nsVoidArray;
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
* provides a uniform way of creating widgets, resizing, and painting.
* @see nsLeafFrame and its base classes for more info
*/
class nsIComboboxControlFrame : public nsISupports {
class nsIComboboxControlFrame : public nsQueryFrame
{
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICOMBOBOXCONTROLFRAME_IID)
NS_DECLARE_FRAME_ACCESSOR(nsIComboboxControlFrame)
/**
* Indicates whether the list is dropped down
@ -127,8 +121,5 @@ public:
virtual PRInt32 GetIndexOfDisplayArea() = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIComboboxControlFrame,
NS_ICOMBOBOXCONTROLFRAME_IID)
#endif

View File

@ -38,26 +38,21 @@
#ifndef nsIFormControlFrame_h___
#define nsIFormControlFrame_h___
#include "nsISupports.h"
#include "nsQueryFrame.h"
class nsAString;
class nsIContent;
class nsIAtom;
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
* provides a uniform way of creating widgets, resizing, and painting.
* @see nsLeafFrame and its base classes for more info
*/
class nsIFormControlFrame : public nsISupports {
class nsIFormControlFrame : public nsQueryFrame
{
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;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIFormControlFrame, NS_IFORMCONTROLFRAME_IID)
#endif

View File

@ -38,24 +38,19 @@
#ifndef nsIListControlFrame_h___
#define nsIListControlFrame_h___
#include "nsISupports.h"
#include "nsQueryFrame.h"
#include "nsFont.h"
class nsPresContext;
class nsAString;
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.
*/
class nsIListControlFrame : public nsISupports {
class nsIListControlFrame : public nsQueryFrame
{
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ILISTCONTROLFRAME_IID)
NS_DECLARE_FRAME_ACCESSOR(nsIListControlFrame)
/**
* Sets the ComboBoxFrame
@ -126,7 +121,5 @@ public:
virtual void OnContentReset() = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIListControlFrame, NS_ILISTCONTROLFRAME_IID)
#endif

View File

@ -38,24 +38,17 @@
#ifndef nsIRadioControlFrame_h___
#define nsIRadioControlFrame_h___
#include "nsISupports.h"
#include "nsQueryFrame.h"
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.
* @see nsFormControlFrame and its base classes for more info
*/
class nsIRadioControlFrame : public nsISupports {
class nsIRadioControlFrame
{
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IRADIOCONTROLFRAME_IID)
NS_DECLARE_FRAME_ACCESSOR(nsIRadioControlFrame)
/**
* Sets the Pseudo Style Contexts for the Radio button
@ -69,7 +62,5 @@ public:
NS_IMETHOD OnChecked(nsPresContext* aPresContext, PRBool aChecked) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIRadioControlFrame, NS_IRADIOCONTROLFRAME_IID)
#endif

View File

@ -39,23 +39,17 @@
#ifndef nsISelectControlFrame_h___
#define nsISelectControlFrame_h___
#include "nsISupports.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 } }
#include "nsQueryFrame.h"
class nsIDOMHTMLOptionElement;
/**
* nsISelectControlFrame is the interface for combo boxes and listboxes
*/
class nsISelectControlFrame : public nsISupports {
class nsISelectControlFrame
{
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISELECTCONTROLFRAME_IID)
NS_DECLARE_FRAME_ACCESSOR(nsISelectControlFrame)
/**
* Adds an option to the list at index
@ -94,7 +88,4 @@ public:
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsISelectControlFrame,
NS_ISELECTCONTROLFRAME_IID)
#endif

View File

@ -81,7 +81,8 @@ public:
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsIFrame* aPrevInFlow);
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
NS_DECL_QUERYFRAME
NS_IMETHOD Reflow(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
@ -110,10 +111,6 @@ public:
virtual void SetFocus(PRBool aOn, PRBool aRepaint);
virtual nsresult SetFormProperty(nsIAtom* aName, const nsAString& aValue);
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);
}
// Frames are not refcounted, no need to AddRef
NS_IMETHODIMP
nsImageControlFrame::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 nsImageControlFrameSuper::QueryInterface(aIID, aInstancePtr);
}
NS_QUERYFRAME_HEAD(nsImageControlFrame)
NS_QUERYFRAME_ENTRY(nsIFormControlFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsImageControlFrameSuper)
#ifdef ACCESSIBILITY
NS_IMETHODIMP nsImageControlFrame::GetAccessible(nsIAccessible** aAccessible)
@ -192,18 +179,6 @@ NS_IMETHODIMP nsImageControlFrame::GetAccessible(nsIAccessible** aAccessible)
}
#endif
nsrefcnt nsImageControlFrame::AddRef(void)
{
NS_WARNING("not supported");
return 1;
}
nsrefcnt nsImageControlFrame::Release(void)
{
NS_WARNING("not supported");
return 1;
}
nsIAtom*
nsImageControlFrame::GetType() const
{

View File

@ -147,7 +147,8 @@ nsIsIndexFrame::GetInputFrame(nsIFormControlFrame** oFrame)
if (presShell && mInputContent) {
nsIFrame *frame = presShell->GetPrimaryFrameFor(mInputContent);
if (frame) {
return CallQueryInterface(frame, oFrame);
*oFrame = do_QueryFrame(frame);
return *oFrame ? NS_OK : NS_NOINTERFACE;
}
}
return NS_OK;
@ -233,20 +234,17 @@ nsIsIndexFrame::CreateAnonymousContent(nsTArray<nsIContent*>& aElements)
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
NS_IMETHODIMP
nsIsIndexFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
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))) {
*aInstancePtr = static_cast<nsIDOMKeyListener*>(this);
return NS_OK;
@ -256,7 +254,7 @@ nsIsIndexFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
return NS_OK;
}
return nsBlockFrame::QueryInterface(aIID, aInstancePtr);
return NS_NOINTERFACE;
}
nscoord

View File

@ -81,9 +81,12 @@ public:
*/
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);
// nsIFormControlFrame
virtual nscoord GetMinWidth(nsIRenderingContext *aRenderingContext);
virtual PRBool IsLeaf() const;

View File

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

View File

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

View File

@ -386,28 +386,11 @@ nsListControlFrame::InvalidateFocus()
}
}
//---------------------------------------------------------
// Frames are not refcounted, no need to AddRef
NS_IMETHODIMP
nsListControlFrame::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;
}
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);
}
NS_QUERYFRAME_HEAD(nsListControlFrame)
NS_QUERYFRAME_ENTRY(nsIFormControlFrame)
NS_QUERYFRAME_ENTRY(nsIListControlFrame)
NS_QUERYFRAME_ENTRY(nsISelectControlFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsHTMLScrollFrame)
#ifdef ACCESSIBILITY
NS_IMETHODIMP nsListControlFrame::GetAccessible(nsIAccessible** aAccessible)
@ -1366,7 +1349,7 @@ void
nsListControlFrame::SetComboboxFrame(nsIFrame* 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())
{
PRBool isDroppedDown = mComboboxFrame->IsDroppedDown();
nsIFrame* comboFrame;
CallQueryInterface(mComboboxFrame, &comboFrame);
nsIFrame* comboFrame = do_QueryFrame(mComboboxFrame);
nsWeakFrame weakFrame(comboFrame);
mComboboxFrame->ShowDropDown(!isDroppedDown);
if (!weakFrame.IsAlive())

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -266,8 +266,6 @@ RecordReflowStatus(PRBool aChildIsBlock, nsReflowStatus aFrameReflowStatus)
//----------------------------------------------------------------------
const nsIID kBlockFrameCID = NS_BLOCK_FRAME_CID;
nsIFrame*
NS_NewBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags)
{
@ -330,17 +328,9 @@ nsBlockFrame::GetLineIterator()
return it;
}
NS_IMETHODIMP
nsBlockFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
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);
}
NS_QUERYFRAME_HEAD(nsBlockFrame)
NS_QUERYFRAME_ENTRY(nsBlockFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsBlockFrameSuper)
nsSplittableType
nsBlockFrame::GetSplittableType() const
@ -449,9 +439,8 @@ nsBlockFrame::List(FILE* out, PRInt32 aIndent) const
}
fputs("<\n", out);
while (kid) {
nsIFrameDebug* frameDebug;
if (NS_SUCCEEDED(CallQueryInterface(kid, &frameDebug))) {
nsIFrameDebug *frameDebug = do_QueryFrame(kid);
if (frameDebug) {
frameDebug->List(out, aIndent + 1);
}
kid = kid->GetNextSibling();
@ -832,8 +821,7 @@ CalculateContainingBlockSizeForAbsolutes(const nsHTMLReflowState& aReflowState,
if (aLastRS != &aReflowState) {
// 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.
nsIScrollableFrame* scrollFrame;
CallQueryInterface(aLastRS->frame, &scrollFrame);
nsIScrollableFrame* scrollFrame = do_QueryFrame(aLastRS->frame);
nsMargin scrollbars(0,0,0,0);
if (scrollFrame) {
scrollbars =

View File

@ -127,11 +127,6 @@ class nsIntervalSet;
#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.
* The block frame has an additional named child list:
@ -142,6 +137,8 @@ extern const nsIID kBlockFrameCID;
class nsBlockFrame : public nsBlockFrameSuper
{
public:
NS_DECLARE_FRAME_ACCESSOR(nsBlockFrame)
typedef nsLineList::iterator line_iterator;
typedef nsLineList::const_iterator const_line_iterator;
typedef nsLineList::reverse_iterator reverse_line_iterator;
@ -158,8 +155,8 @@ public:
friend nsIFrame* NS_NewBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags);
// nsISupports
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
// nsQueryFrame
NS_DECL_QUERYFRAME
// nsIFrame
NS_IMETHOD Init(nsIContent* aContent,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -43,19 +43,13 @@
#ifndef nsIAnonymousContentCreator_h___
#define nsIAnonymousContentCreator_h___
#include "nsISupports.h"
#include "nsQueryFrame.h"
#include "nsIContent.h"
class nsPresContext;
class nsIFrame;
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.
* HTML frames like nsFileControlFrame currently use this as well as XUL frames
@ -63,9 +57,10 @@ template <class T> class nsTArray;
*
* @see nsCSSFrameConstructor
*/
class nsIAnonymousContentCreator : public nsISupports {
class nsIAnonymousContentCreator
{
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
@ -93,8 +88,5 @@ public:
virtual void PostCreateFrames() {}
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIAnonymousContentCreator,
NS_IANONYMOUS_CONTENT_CREATOR_IID)
#endif

View File

@ -40,16 +40,12 @@
#ifndef nsICanvasFrame_h__
#define nsICanvasFrame_h__
#include "nsISupports.h"
#include "nsQueryFrame.h"
// IID for the nsICanvasFrame interface
#define NS_ICANVASFRAME_IID \
{ 0x9df7db77, 0x49a2, 0x11d5, {0x97, 0x92, 0x0, 0x60, 0xb0, 0xfb, 0x99, 0x56} }
class nsICanvasFrame : public nsISupports
class nsICanvasFrame
{
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICANVASFRAME_IID)
NS_DECLARE_FRAME_ACCESSOR(nsICanvasFrame)
/** SetHasFocus tells the CanvasFrame to draw with focus ring
* @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__

View File

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

View File

@ -40,23 +40,17 @@
#ifndef nsIFrameDebug_h___
#define nsIFrameDebug_h___
#include "nsISupports.h"
#include "nsIFrame.h"
class nsPresContext;
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
*/
class nsIFrameDebug : public nsISupports {
class nsIFrameDebug {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFRAMEDEBUG_IID)
NS_DECLARE_FRAME_ACCESSOR(nsIFrameDebug)
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const = 0;
/**
@ -134,12 +128,6 @@ public:
static PRBool GetShowEventTargetFrameBorder();
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___ */

View File

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

View File

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

View File

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

View File

@ -37,27 +37,21 @@
#ifndef nsIPageSequenceFrame_h___
#define nsIPageSequenceFrame_h___
#include "nsISupports.h"
#include "nsQueryFrame.h"
#include "nsRect.h"
class nsPresContext;
class nsIPrintSettings;
// IID for the nsIPageSequenceFrame interface
// a6cf90d2-15b3-11d2-932e-00805f8add32
#define NS_IPAGESEQUENCEFRAME_IID \
{ 0xa6cf90d2, 0x15b3, 0x11d2,{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
//----------------------------------------------------------------------
/**
* Interface for accessing special capabilities of the page sequence frame.
*
* Today all that exists are member functions for printing.
*/
class nsIPageSequenceFrame : public nsISupports {
class nsIPageSequenceFrame : public nsQueryFrame
{
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPAGESEQUENCEFRAME_IID)
NS_DECLARE_FRAME_ACCESSOR(nsIPageSequenceFrame)
/**
* Print the set of pages.
@ -92,14 +86,8 @@ public:
// For Shrink To Fit
NS_IMETHOD GetSTFPercent(float& aSTFPercent) = 0;
private:
NS_IMETHOD_(nsrefcnt) AddRef(void) = 0;
NS_IMETHOD_(nsrefcnt) Release(void) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIPageSequenceFrame, NS_IPAGESEQUENCEFRAME_IID)
#endif /* nsIPageSequenceFrame_h___ */

Some files were not shown because too many files have changed in this diff Show More