зеркало из https://github.com/mozilla/gecko-dev.git
Don't crash in the document observer methods when the container arg is null. b=301025 r+sr=bzbarsky a=benjamin
This commit is contained in:
Родитель
204695d4bf
Коммит
64fca33b3c
|
@ -20,6 +20,7 @@
|
|||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Mats Palmgren <mats.palmgren@bredband.net>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
|
@ -955,22 +956,12 @@ nsImageMap::Draw(nsPresContext* aCX, nsIRenderingContext& aRC)
|
|||
}
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsImageMap::IsAncestorOf(nsIContent* aContent,
|
||||
nsIContent* aAncestorContent)
|
||||
{
|
||||
for (nsIContent *a = aContent->GetParent(); a; a = a->GetParent())
|
||||
if (a == aAncestorContent)
|
||||
return PR_TRUE;
|
||||
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
nsImageMap::MaybeUpdateAreas(nsIContent *aContent)
|
||||
{
|
||||
if (aContent == mMap ||
|
||||
(mContainsBlockContents && IsAncestorOf(aContent, mMap))) {
|
||||
if (aContent && (aContent == mMap ||
|
||||
(mContainsBlockContents &&
|
||||
nsContentUtils::ContentIsDescendantOf(aContent, mMap)))) {
|
||||
UpdateAreas();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -116,9 +116,6 @@ protected:
|
|||
nsresult UpdateAreas();
|
||||
nsresult UpdateAreasForBlock(nsIContent* aParent, PRBool* aFoundAnchor);
|
||||
|
||||
static PRBool IsAncestorOf(nsIContent* aContent,
|
||||
nsIContent* aAncestorContent);
|
||||
|
||||
nsresult AddArea(nsIContent* aArea);
|
||||
|
||||
nsresult ChangeFocus(nsIDOMEvent* aEvent, PRBool aFocus);
|
||||
|
|
Загрузка…
Ссылка в новой задаче