|
|
|
Lines 145-151
nsSVGImageFrame::~nsSVGImageFrame()
|
Link Here
|
|---|
|
| 145 |
if (mListener) { |
145 |
if (mListener) { |
| 146 |
nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(mContent); |
146 |
nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(mContent); |
| 147 |
if (imageLoader) { |
147 |
if (imageLoader) { |
| 148 |
imageLoader->RemoveObserver(mListener); |
148 |
// Push a null JSContext on the stack so that code that runs |
|
|
149 |
// within the below code doesn't think it's being called by |
| 150 |
// JS. See bug 604262. |
| 151 |
nsCxPusher pusher; |
| 152 |
pusher.PushNull(); |
| 153 |
|
| 154 |
imageLoader->RemoveObserver(mListener); |
| 149 |
} |
155 |
} |
| 150 |
reinterpret_cast<nsSVGImageListener*>(mListener.get())->SetFrame(nsnull); |
156 |
reinterpret_cast<nsSVGImageListener*>(mListener.get())->SetFrame(nsnull); |
| 151 |
} |
157 |
} |
|
Lines 169-174
nsSVGImageFrame::Init(nsIContent* aConte
|
Link Here
|
|---|
|
| 169 |
if (!mListener) return NS_ERROR_OUT_OF_MEMORY; |
175 |
if (!mListener) return NS_ERROR_OUT_OF_MEMORY; |
| 170 |
nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(mContent); |
176 |
nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(mContent); |
| 171 |
NS_ENSURE_TRUE(imageLoader, NS_ERROR_UNEXPECTED); |
177 |
NS_ENSURE_TRUE(imageLoader, NS_ERROR_UNEXPECTED); |
|
|
178 |
|
| 179 |
// Push a null JSContext on the stack so that code that runs within |
| 180 |
// the below code doesn't think it's being called by JS. See bug |
| 181 |
// 604262. |
| 182 |
nsCxPusher pusher; |
| 183 |
pusher.PushNull(); |
| 184 |
|
| 172 |
imageLoader->AddObserver(mListener); |
185 |
imageLoader->AddObserver(mListener); |
| 173 |
|
186 |
|
| 174 |
return NS_OK; |
187 |
return NS_OK; |