mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 659743 - Part c: Reduce QIing in nsImageMap; r=smaug
This commit is contained in:
parent
e18ad59abc
commit
1bad80a509
@ -1457,8 +1457,7 @@ nsImageFrame::GetImageMap(nsPresContext* aPresContext)
|
||||
nsAutoString usemap;
|
||||
mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::usemap, usemap);
|
||||
|
||||
nsCOMPtr<nsIDOMHTMLMapElement> map =
|
||||
do_QueryInterface(doc->FindImageMap(usemap));
|
||||
nsCOMPtr<nsIContent> map = doc->FindImageMap(usemap);
|
||||
if (map) {
|
||||
mImageMap = new nsImageMap();
|
||||
NS_ADDREF(mImageMap);
|
||||
|
@ -39,21 +39,16 @@
|
||||
/* code for HTML client-side image maps */
|
||||
|
||||
#include "nsImageMap.h"
|
||||
|
||||
#include "nsString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsRenderingContext.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsTextFragment.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "nsIDOMHTMLElement.h"
|
||||
#include "nsIDOMHTMLMapElement.h"
|
||||
#include "nsIDOMHTMLAreaElement.h"
|
||||
#include "nsIDOMHTMLAnchorElement.h"
|
||||
#include "nsIDOMHTMLCollection.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsINameSpaceManager.h"
|
||||
#include "nsGkAtoms.h"
|
||||
@ -749,17 +744,16 @@ nsImageMap::FreeAreas()
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsImageMap::Init(nsIPresShell* aPresShell, nsIFrame* aImageFrame, nsIDOMHTMLMapElement* aMap)
|
||||
nsImageMap::Init(nsIPresShell* aPresShell, nsIFrame* aImageFrame, nsIContent* aMap)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aMap, "null ptr");
|
||||
if (nsnull == aMap) {
|
||||
NS_PRECONDITION(aMap, "null ptr");
|
||||
if (!aMap) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
mPresShell = aPresShell;
|
||||
mImageFrame = aImageFrame;
|
||||
|
||||
mMap = do_QueryInterface(aMap);
|
||||
NS_ASSERTION(mMap, "aMap is not an nsIContent!");
|
||||
mMap = aMap;
|
||||
mMap->AddMutationObserver(this);
|
||||
|
||||
// "Compile" the areas in the map into faster access versions
|
||||
|
@ -37,8 +37,8 @@
|
||||
|
||||
/* code for HTML client-side image maps */
|
||||
|
||||
#ifndef nsImageMap_h___
|
||||
#define nsImageMap_h___
|
||||
#ifndef nsImageMap_h
|
||||
#define nsImageMap_h
|
||||
|
||||
#include "nsISupports.h"
|
||||
#include "nsCoord.h"
|
||||
@ -47,20 +47,16 @@
|
||||
#include "nsIDOMFocusListener.h"
|
||||
#include "nsIFrame.h"
|
||||
|
||||
class nsIDOMHTMLAreaElement;
|
||||
class nsIDOMHTMLMapElement;
|
||||
class nsRenderingContext;
|
||||
class nsIURI;
|
||||
class nsString;
|
||||
class nsIDOMEvent;
|
||||
class Area;
|
||||
class nsIDOMEvent;
|
||||
class nsRenderingContext;
|
||||
|
||||
class nsImageMap : public nsStubMutationObserver, public nsIDOMFocusListener
|
||||
{
|
||||
public:
|
||||
nsImageMap();
|
||||
|
||||
nsresult Init(nsIPresShell* aPresShell, nsIFrame* aImageFrame, nsIDOMHTMLMapElement* aMap);
|
||||
nsresult Init(nsIPresShell* aPresShell, nsIFrame* aImageFrame, nsIContent* aMap);
|
||||
|
||||
/**
|
||||
* See if the given aX,aY <b>pixel</b> coordinates are in the image
|
||||
@ -77,7 +73,7 @@ public:
|
||||
* Called just before the nsImageFrame releases us.
|
||||
* Used to break the cycle caused by the DOM listener.
|
||||
*/
|
||||
void Destroy(void);
|
||||
void Destroy();
|
||||
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
@ -103,7 +99,7 @@ protected:
|
||||
|
||||
nsresult UpdateAreas();
|
||||
nsresult SearchForAreas(nsIContent* aParent, PRBool& aFoundArea,
|
||||
PRBool& aFoundAnchor);
|
||||
PRBool& aFoundAnchor);
|
||||
|
||||
nsresult AddArea(nsIContent* aArea);
|
||||
|
||||
@ -118,4 +114,4 @@ protected:
|
||||
PRBool mContainsBlockContents;
|
||||
};
|
||||
|
||||
#endif /* nsImageMap_h___ */
|
||||
#endif /* nsImageMap_h */
|
||||
|
Loading…
Reference in New Issue
Block a user