Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Member Functions | Protected Attributes
nsImageMap Class Reference

#include <nsImageMap.h>

Inheritance diagram for nsImageMap:
Inheritance graph
[legend]
Collaboration diagram for nsImageMap:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsImageMap ()
nsresult Init (nsIPresShell *aPresShell, nsIFrame *aImageFrame, nsIDOMHTMLMapElement *aMap)
PRBool IsInside (nscoord aX, nscoord aY, nsIContent **aContent) const
 See if the given aX,aY pixel coordinates are in the image map.
void Draw (nsPresContext *aCX, nsIRenderingContext &aRC)
void Destroy (void)
 Called just before the nsImageFrame releases us.
virtual NS_DECL_ISUPPORTS void AttributeChanged (nsIDocument *aDocument, nsIContent *aContent, PRInt32 aNameSpaceID, nsIAtom *aAttribute, PRInt32 aModType)
 Notification that the content model has changed.
virtual void ContentAppended (nsIDocument *aDocument, nsIContent *aContainer, PRInt32 aNewIndexInContainer)
 Notifcation that the content model has had data appended to the given content object.
virtual void ContentInserted (nsIDocument *aDocument, nsIContent *aContainer, nsIContent *aChild, PRInt32 aIndexInContainer)
 Notification that content has been inserted.
virtual void ContentRemoved (nsIDocument *aDocument, nsIContent *aContainer, nsIContent *aChild, PRInt32 aIndexInContainer)
 Content has just been removed.
NS_IMETHOD Focus (nsIDOMEvent *aEvent)
 Processes a focus event.
NS_IMETHOD Blur (nsIDOMEvent *aEvent)
 Processes a blur event.
NS_IMETHOD HandleEvent (nsIDOMEvent *aEvent)
NS_IMETHOD GetBoundsForAreaContent (nsIContent *aContent, nsPresContext *aPresContext, nsRect &aBounds)
virtual void BeginUpdate (nsIDocument *aDocument, nsUpdateType aUpdateType)=0
 Notify that a content model update is beginning.
virtual void EndUpdate (nsIDocument *aDocument, nsUpdateType aUpdateType)=0
 Notify that a content model update is finished.
virtual void BeginLoad (nsIDocument *aDocument)=0
 Notify the observer that a document load is beginning.
virtual void EndLoad (nsIDocument *aDocument)=0
 Notify the observer that a document load has finished.
virtual void BeginReflow (nsIDocument *aDocument, nsIPresShell *aShell)=0
 Notify the observer that the document is being reflowed in the given presentation shell.
virtual void EndReflow (nsIDocument *aDocument, nsIPresShell *aShell)=0
 Notify the observer that the document is done being reflowed in the given presentation shell.
virtual void CharacterDataChanged (nsIDocument *aDocument, nsIContent *aContent, PRBool aAppend)=0
 Notification that the content model has changed.
virtual void ContentStatesChanged (nsIDocument *aDocument, nsIContent *aContent1, nsIContent *aContent2, PRInt32 aStateMask)=0
 Notification that the state of a content node has changed.
virtual void StyleSheetAdded (nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, PRBool aDocumentSheet)=0
 A StyleSheet has just been added to the document.
virtual void StyleSheetRemoved (nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, PRBool aDocumentSheet)=0
 A StyleSheet has just been removed from the document.
virtual void StyleSheetApplicableStateChanged (nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, PRBool aApplicable)=0
 A StyleSheet has just changed its applicable state.
virtual void StyleRuleChanged (nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, nsIStyleRule *aOldStyleRule, nsIStyleRule *aNewStyleRule)=0
 A StyleRule has just been modified within a style sheet.
virtual void StyleRuleAdded (nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, nsIStyleRule *aStyleRule)=0
 A StyleRule has just been added to a style sheet.
virtual void StyleRuleRemoved (nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, nsIStyleRule *aStyleRule)=0
 A StyleRule has just been removed from a style sheet.
virtual void DocumentWillBeDestroyed (nsIDocument *aDocument)=0
 The document is in the process of being destroyed.
void handleEvent (in nsIDOMEvent event)
 This method is called whenever an event occurs of the type for which the EventListener interface was registered.

Protected Member Functions

virtual ~nsImageMap ()
void FreeAreas ()
nsresult UpdateAreas ()
nsresult UpdateAreasForBlock (nsIContent *aParent, PRBool *aFoundAnchor)
nsresult AddArea (nsIContent *aArea)
nsresult ChangeFocus (nsIDOMEvent *aEvent, PRBool aFocus)
void MaybeUpdateAreas (nsIContent *aContent)

Protected Attributes

nsIPresShellmPresShell
nsIFramemImageFrame
nsIDocumentmDocument
nsCOMPtr< nsIContentmMap
nsAutoVoidArray mAreas
PRBool mContainsBlockContents

Detailed Description

Definition at line 56 of file nsImageMap.h.


Constructor & Destructor Documentation

nsImageMap::~nsImageMap ( ) [protected, virtual]

Definition at line 729 of file nsImageMap.cpp.

{
  NS_ASSERTION(mAreas.Count() == 0, "Destroy was not called");
}

Member Function Documentation

nsresult nsImageMap::AddArea ( nsIContent aArea) [protected]

Definition at line 867 of file nsImageMap.cpp.

{
  nsAutoString shape, coords;
  aArea->GetAttr(kNameSpaceID_None, nsHTMLAtoms::shape, shape);
  aArea->GetAttr(kNameSpaceID_None, nsHTMLAtoms::coords, coords);

  Area* area;
  if (shape.IsEmpty() ||
      shape.LowerCaseEqualsLiteral("rect") ||
      shape.LowerCaseEqualsLiteral("rectangle")) {
    area = new RectArea(aArea);
  }
  else if (shape.LowerCaseEqualsLiteral("poly") ||
           shape.LowerCaseEqualsLiteral("polygon")) {
    area = new PolyArea(aArea);
  }
  else if (shape.LowerCaseEqualsLiteral("circle") ||
           shape.LowerCaseEqualsLiteral("circ")) {
    area = new CircleArea(aArea);
  }
  else if (shape.LowerCaseEqualsLiteral("default")) {
    area = new DefaultArea(aArea);
  }
  else {
    // Unknown area type; bail
    return NS_OK;
  }
  if (!area)
    return NS_ERROR_OUT_OF_MEMORY;

  //Add focus listener to track area focus changes
  nsCOMPtr<nsIDOMEventReceiver> rec(do_QueryInterface(aArea));
  if (rec) {
    rec->AddEventListenerByIID(this, NS_GET_IID(nsIDOMFocusListener));
  }

  mPresShell->FrameManager()->SetPrimaryFrameFor(aArea, mImageFrame);
  aArea->SetMayHaveFrame(PR_TRUE);
  NS_ASSERTION(aArea->MayHaveFrame(), "SetMayHaveFrame failed?");

  area->ParseCoords(coords);
  mAreas.AppendElement(area);
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsImageMap::AttributeChanged ( nsIDocument aDocument,
nsIContent aContent,
PRInt32  aNameSpaceID,
nsIAtom aAttribute,
PRInt32  aModType 
) [virtual]

Notification that the content model has changed.

This method is called automatically by content objects when an attribute's value has changed (therefore there is normally no need to invoke this method directly). The notification is passed to any IDocumentObservers document observers.

Parameters:
aDocumentThe document being observed
aContentthe piece of content whose attribute changed
aAttributethe atom name of the attribute
aModTypeWhether or not the attribute was added, changed, or removed. The constants are defined in nsIDOMMutationEvent.h.

Implements nsIDocumentObserver.

Definition at line 951 of file nsImageMap.cpp.

{
  // If the parent of the changing content node is our map then update
  // the map.
  MaybeUpdateAreas(aContent->GetParent());
}

Here is the call graph for this function:

virtual void nsIDocumentObserver::BeginLoad ( nsIDocument aDocument) [pure virtual, inherited]

Notify the observer that a document load is beginning.

Implemented in PresShell.

virtual void nsIDocumentObserver::BeginReflow ( nsIDocument aDocument,
nsIPresShell aShell 
) [pure virtual, inherited]

Notify the observer that the document is being reflowed in the given presentation shell.

virtual void nsIDocumentObserver::BeginUpdate ( nsIDocument aDocument,
nsUpdateType  aUpdateType 
) [pure virtual, inherited]

Notify that a content model update is beginning.

This call can be nested.

Implemented in nsFragmentObserver, PresShell, HTMLContentSink, and nsXMLPrettyPrinter.

nsresult nsImageMap::Blur ( nsIDOMEvent aEvent) [virtual]

Processes a blur event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMFocusListener.

Definition at line 995 of file nsImageMap.cpp.

{
  return ChangeFocus(aEvent, PR_FALSE);
}

Here is the call graph for this function:

nsresult nsImageMap::ChangeFocus ( nsIDOMEvent aEvent,
PRBool  aFocus 
) [protected]

Definition at line 1001 of file nsImageMap.cpp.

                                                          {
  //Set which one of our areas changed focus
  nsCOMPtr<nsIDOMEventTarget> target;
  if (NS_SUCCEEDED(aEvent->GetTarget(getter_AddRefs(target))) && target) {
    nsCOMPtr<nsIContent> targetContent(do_QueryInterface(target));
    if (targetContent) {
      PRInt32 i, n = mAreas.Count();
      for (i = 0; i < n; i++) {
        Area* area = (Area*) mAreas.ElementAt(i);
        nsCOMPtr<nsIContent> areaContent;
        area->GetArea(getter_AddRefs(areaContent));
        if (areaContent) {
          if (areaContent.get() == targetContent.get()) {
            //Set or Remove internal focus
            area->HasFocus(aFocus);
            //Now invalidate the rect
            nsCOMPtr<nsIDocument> doc = targetContent->GetDocument();
            //This check is necessary to see if we're still attached to the doc
            if (doc) {
              nsIPresShell *presShell = doc->GetShellAt(0);
              if (presShell) {
                nsIFrame* imgFrame;
                if (NS_SUCCEEDED(presShell->GetPrimaryFrameFor(targetContent, &imgFrame)) && imgFrame) {
                  nsPresContext *presContext = presShell->GetPresContext();
                  if (presContext) {
                    nsRect dmgRect;
                    area->GetRect(presContext, dmgRect);
                    imgFrame->Invalidate(dmgRect, PR_TRUE);
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void nsIDocumentObserver::CharacterDataChanged ( nsIDocument aDocument,
nsIContent aContent,
PRBool  aAppend 
) [pure virtual, inherited]

Notification that the content model has changed.

This method is called automatically by content objects when their state is changed (therefore there is normally no need to invoke this method directly). The notification is passed to any IDocumentObservers. The notification is passed on to all of the document observers.

This notification is not sent when a piece of content is added/removed from the document (the other notifications are used for that).

Parameters:
aDocumentThe document being observed
aContentthe piece of content that changed
aAppendWhether the change was an append

Implemented in PresShell.

void nsImageMap::ContentAppended ( nsIDocument aDocument,
nsIContent aContainer,
PRInt32  aNewIndexInContainer 
) [virtual]

Notifcation that the content model has had data appended to the given content object.

This method is called automatically by the content container objects when a new content object is appended to the container (therefore there is normally no need to invoke this method directly). The notification is passed on to all of the document observers.

Parameters:
aDocumentThe document being observed
aContainerthe container that had a new child appended
aNewIndexInContainerthe index in the container of the first new child

Implements nsIDocumentObserver.

Definition at line 963 of file nsImageMap.cpp.

{
  MaybeUpdateAreas(aContainer);
}

Here is the call graph for this function:

void nsImageMap::ContentInserted ( nsIDocument aDocument,
nsIContent aContainer,
nsIContent aChild,
PRInt32  aIndexInContainer 
) [virtual]

Notification that content has been inserted.

This method is called automatically by the content container objects when a new content object is inserted in the container (therefore there is normally no need to invoke this method directly). The notification is passed on to all of the document observers.

Parameters:
aDocumentThe document being observed
aContainerthe container that now contains aChild
aChildthe child that was inserted
aIndexInContainerthe index of the child in the container

Implements nsIDocumentObserver.

Definition at line 971 of file nsImageMap.cpp.

{
  MaybeUpdateAreas(aContainer);
}

Here is the call graph for this function:

void nsImageMap::ContentRemoved ( nsIDocument aDocument,
nsIContent aContainer,
nsIContent aChild,
PRInt32  aIndexInContainer 
) [virtual]

Content has just been removed.

This method is called automatically by content container objects when a content object has just been removed from the container (therefore there is normally no need to invoke this method directly). The notification is passed on to all of the document observers.

Parameters:
aDocumentThe document being observed
aContainerthe container that had a child removed
aChildthe child that was just removed
aIndexInContainerthe index of the child in the container before it was removed

Implements nsIDocumentObserver.

Definition at line 980 of file nsImageMap.cpp.

{
  MaybeUpdateAreas(aContainer);
}

Here is the call graph for this function:

virtual void nsIDocumentObserver::ContentStatesChanged ( nsIDocument aDocument,
nsIContent aContent1,
nsIContent aContent2,
PRInt32  aStateMask 
) [pure virtual, inherited]

Notification that the state of a content node has changed.

(ie: gained or lost focus, became active or hovered over) This method is called automatically by content objects when their state is changed (therefore there is normally no need to invoke this method directly). The notification is passed to any IDocumentObservers. The notification is passed on to all of the document observers.

This notification is not sent when a piece of content is added/removed from the document or the content itself changed (the other notifications are used for that).

The optional second content node is to allow optimization of the case where state moves from one node to another (as is likely for :focus and :hover)

Either content node may be nsnull, but not both

Parameters:
aDocumentThe document being observed
aContent1the piece of content that changed
aContent2optional second piece of content that changed

Implemented in PresShell, and nsTreeContentView.

Called just before the nsImageFrame releases us.

Used to break the cycle caused by the DOM listener.

Definition at line 1048 of file nsImageMap.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void nsIDocumentObserver::DocumentWillBeDestroyed ( nsIDocument aDocument) [pure virtual, inherited]

The document is in the process of being destroyed.

This method is called automatically during document destruction.

Parameters:
aDocumentThe document being observed

Implemented in nsFragmentObserver, nsDOMStyleSheetList, nsContentList, nsBindingManager, nsXULContentBuilder, nsXULTreeBuilder, nsXULTemplateBuilder, nsTreeContentView, and nsXMLPrettyPrinter.

Definition at line 931 of file nsImageMap.cpp.

{
  PRInt32 i, n = mAreas.Count();
  for (i = 0; i < n; i++) {
    Area* area = (Area*) mAreas.ElementAt(i);
    area->Draw(aCX, aRC);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void nsIDocumentObserver::EndLoad ( nsIDocument aDocument) [pure virtual, inherited]

Notify the observer that a document load has finished.

Note that the associated reflow of the document will be done before EndLoad is invoked, not after.

Implemented in PresShell.

virtual void nsIDocumentObserver::EndReflow ( nsIDocument aDocument,
nsIPresShell aShell 
) [pure virtual, inherited]

Notify the observer that the document is done being reflowed in the given presentation shell.

virtual void nsIDocumentObserver::EndUpdate ( nsIDocument aDocument,
nsUpdateType  aUpdateType 
) [pure virtual, inherited]

Notify that a content model update is finished.

This call can be nested.

Implemented in PresShell, HTMLContentSink, and nsXMLPrettyPrinter.

nsresult nsImageMap::Focus ( nsIDOMEvent aEvent) [virtual]

Processes a focus event.

Parameters:
aMouseEvent
See also:
nsIDOMEvent.h
Returns:
whether the event was consumed or ignored.
See also:
nsresult

Implements nsIDOMFocusListener.

Definition at line 989 of file nsImageMap.cpp.

{
  return ChangeFocus(aEvent, PR_TRUE);
}

Here is the call graph for this function:

void nsImageMap::FreeAreas ( ) [protected]

Definition at line 758 of file nsImageMap.cpp.

{
  nsFrameManager *frameManager = mPresShell->FrameManager();

  PRInt32 i, n = mAreas.Count();
  for (i = 0; i < n; i++) {
    Area* area = (Area*) mAreas.ElementAt(i);
    frameManager->RemoveAsPrimaryFrame(area->mArea, mImageFrame);

    nsCOMPtr<nsIContent> areaContent;
    area->GetArea(getter_AddRefs(areaContent));
    if (areaContent) {
      nsCOMPtr<nsIDOMEventReceiver> rec(do_QueryInterface(areaContent));
      if (rec) {
        rec->RemoveEventListenerByIID(this, NS_GET_IID(nsIDOMFocusListener));
      }
    }
    delete area;
  }
  mAreas.Clear();
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHOD nsImageMap::GetBoundsForAreaContent ( nsIContent aContent,
nsPresContext aPresContext,
nsRect aBounds 
) [virtual]

Implements nsIImageMap.

This method is called whenever an event occurs of the type for which the EventListener interface was registered.

Parameters:
evtThe Event contains contextual information about the event. It also contains the stopPropagation and preventDefault methods which are used in determining the event's flow and default action.

Definition at line 1042 of file nsImageMap.cpp.

{
  return NS_OK;
}
nsresult nsImageMap::Init ( nsIPresShell aPresShell,
nsIFrame aImageFrame,
nsIDOMHTMLMapElement aMap 
)

Definition at line 781 of file nsImageMap.cpp.

{
  NS_PRECONDITION(nsnull != aMap, "null ptr");
  if (nsnull == aMap) {
    return NS_ERROR_NULL_POINTER;
  }
  mPresShell = aPresShell;
  mImageFrame = aImageFrame;

  nsresult rv;
  mMap = do_QueryInterface(aMap, &rv);
  NS_ASSERTION(mMap, "aMap is not an nsIContent!");
  mDocument = mMap->GetDocument();
  if (mPresShell) {
    NS_STATIC_CAST(nsIPresShell_MOZILLA_1_8_BRANCH2*, mPresShell)->AddObserver(this);
  }

  // "Compile" the areas in the map into faster access versions
  rv = UpdateAreas();
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool nsImageMap::IsInside ( nscoord  aX,
nscoord  aY,
nsIContent **  aContent 
) const

See if the given aX,aY pixel coordinates are in the image map.

If they are then PR_TRUE is returned and aContent points to the found area. If the coordinates are not in the map then PR_FALSE is returned.

Definition at line 913 of file nsImageMap.cpp.

{
  NS_ASSERTION(mMap, "Not initialized");
  PRInt32 i, n = mAreas.Count();
  for (i = 0; i < n; i++) {
    Area* area = (Area*) mAreas.ElementAt(i);
    if (area->IsInside(aX, aY)) {
      area->GetArea(aContent);

      return PR_TRUE;
    }
  }

  return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsImageMap::MaybeUpdateAreas ( nsIContent aContent) [protected]

Definition at line 941 of file nsImageMap.cpp.

{
  if (aContent && (aContent == mMap ||
                   (mContainsBlockContents &&
                    nsContentUtils::ContentIsDescendantOf(aContent, mMap)))) {
    UpdateAreas();
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void nsIDocumentObserver::StyleRuleAdded ( nsIDocument aDocument,
nsIStyleSheet aStyleSheet,
nsIStyleRule aStyleRule 
) [pure virtual, inherited]

A StyleRule has just been added to a style sheet.

This method is called automatically when the rule gets added to the sheet. The style sheet passes this notification to the document. The notification is passed on to all of the document observers.

Parameters:
aDocumentThe document being observed
aStyleSheetthe StyleSheet that has been modified
aStyleRulethe rule that was added

Implemented in PresShell.

virtual void nsIDocumentObserver::StyleRuleChanged ( nsIDocument aDocument,
nsIStyleSheet aStyleSheet,
nsIStyleRule aOldStyleRule,
nsIStyleRule aNewStyleRule 
) [pure virtual, inherited]

A StyleRule has just been modified within a style sheet.

This method is called automatically when the rule gets modified. The style sheet passes this notification to the document. The notification is passed on to all of the document observers.

Since nsIStyleRule objects are immutable, there is a new object replacing the old one. However, the use of this method (rather than StyleRuleAdded and StyleRuleRemoved) implies that the new rule matches the same elements and has the same priority (weight, origin, specificity) as the old one. (However, if it is a CSS style rule, there may be a change in whether it has an important rule.)

Parameters:
aDocumentThe document being observed
aStyleSheetthe StyleSheet that contians the rule
aOldStyleRuleThe rule being removed. This rule may not be fully valid anymore -- however, it can still be used for pointer comparison and |QueryInterface|.
aNewStyleRuleThe rule being added.

Implemented in PresShell.

virtual void nsIDocumentObserver::StyleRuleRemoved ( nsIDocument aDocument,
nsIStyleSheet aStyleSheet,
nsIStyleRule aStyleRule 
) [pure virtual, inherited]

A StyleRule has just been removed from a style sheet.

This method is called automatically when the rule gets removed from the sheet. The style sheet passes this notification to the document. The notification is passed on to all of the document observers.

Parameters:
aDocumentThe document being observed
aStyleSheetthe StyleSheet that has been modified
aStyleRulethe rule that was removed

Implemented in PresShell.

virtual void nsIDocumentObserver::StyleSheetAdded ( nsIDocument aDocument,
nsIStyleSheet aStyleSheet,
PRBool  aDocumentSheet 
) [pure virtual, inherited]

A StyleSheet has just been added to the document.

This method is called automatically when a StyleSheet gets added to the document, even if the stylesheet is not applicable. The notification is passed on to all of the document observers.

Parameters:
aDocumentThe document being observed
aStyleSheetthe StyleSheet that has been added
aDocumentSheetTrue if sheet is in document's style sheet list, false if sheet is not (i.e., UA or user sheet)

Implemented in PresShell, and nsDOMStyleSheetList.

virtual void nsIDocumentObserver::StyleSheetApplicableStateChanged ( nsIDocument aDocument,
nsIStyleSheet aStyleSheet,
PRBool  aApplicable 
) [pure virtual, inherited]

A StyleSheet has just changed its applicable state.

This method is called automatically when the applicable state of a StyleSheet gets changed. The style sheet passes this notification to the document. The notification is passed on to all of the document observers.

Parameters:
aDocumentThe document being observed
aStyleSheetthe StyleSheet that has changed state
aApplicablePR_TRUE if the sheet is applicable, PR_FALSE if it is not applicable

Implemented in PresShell.

virtual void nsIDocumentObserver::StyleSheetRemoved ( nsIDocument aDocument,
nsIStyleSheet aStyleSheet,
PRBool  aDocumentSheet 
) [pure virtual, inherited]

A StyleSheet has just been removed from the document.

This method is called automatically when a StyleSheet gets removed from the document, even if the stylesheet is not applicable. The notification is passed on to all of the document observers.

Parameters:
aDocumentThe document being observed
aStyleSheetthe StyleSheet that has been removed
aDocumentSheetTrue if sheet is in document's style sheet list, false if sheet is not (i.e., UA or user sheet)

Implemented in PresShell, and nsDOMStyleSheetList.

Definition at line 827 of file nsImageMap.cpp.

{
  // Get rid of old area data
  FreeAreas();

  PRUint32 i, n = mMap->GetChildCount();
  PRBool containsBlock = PR_FALSE, containsArea = PR_FALSE;

  for (i = 0; i < n; i++) {
    nsIContent *child = mMap->GetChildAt(i);

    // Only look at elements and not text, comments, etc.
    if (!child->IsContentOfType(nsIContent::eHTML))
      continue;

    // First check if this map element contains an AREA element.
    // If so, we only look for AREA elements
    if (!containsBlock) {
      nsCOMPtr<nsIDOMHTMLAreaElement> area = do_QueryInterface(child);
      if (area) {
        containsArea = PR_TRUE;
        AddArea(child);
      }
    }
      
    // If we haven't determined that the map element contains an
    // AREA element yet, the look for a block element with children
    // that are anchors.
    if (!containsArea) {
      UpdateAreasForBlock(child, &containsBlock);

      if (containsBlock)
        mContainsBlockContents = PR_TRUE;
    }
  }

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsImageMap::UpdateAreasForBlock ( nsIContent aParent,
PRBool aFoundAnchor 
) [protected]

Definition at line 805 of file nsImageMap.cpp.

{
  nsresult rv = NS_OK;
  PRUint32 i, n = aParent->GetChildCount();

  for (i = 0; (i < n) && NS_SUCCEEDED(rv); i++) {
    nsIContent *child = aParent->GetChildAt(i);

    nsCOMPtr<nsIDOMHTMLAnchorElement> area = do_QueryInterface(child);
    if (area) {
      *aFoundAnchor = PR_TRUE;
      rv = AddArea(child);
    }
    else {
      rv = UpdateAreasForBlock(child, aFoundAnchor);
    }
  }
  
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

nsAutoVoidArray nsImageMap::mAreas [protected]

Definition at line 123 of file nsImageMap.h.

Definition at line 124 of file nsImageMap.h.

Definition at line 121 of file nsImageMap.h.

Definition at line 120 of file nsImageMap.h.

Definition at line 122 of file nsImageMap.h.

Definition at line 119 of file nsImageMap.h.


The documentation for this class was generated from the following files: