nsIContent* nsImageMap::GetArea(nscoord aX, nscoord aY) const { NS_ASSERTION(mMap, "Not initialized"); uint32_t i, n = mAreas.Length(); for (i = 0; i < n; i++) { Area* area = mAreas.ElementAt(i); if (area->IsInside(aX, aY)) { return area->mArea; } } return nullptr; }
PRBool nsImageMap::IsInside(nscoord aX, nscoord aY, nsIContent** aContent) const { NS_ASSERTION(mMap, "Not initialized"); PRUint32 i, n = mAreas.Length(); for (i = 0; i < n; i++) { Area* area = mAreas.ElementAt(i); if (area->IsInside(aX, aY)) { NS_ADDREF(*aContent = area->mArea); return PR_TRUE; } } return PR_FALSE; }