Bug 1317937: Rename nsImageMap::mContainsBlockContents to mConsiderWholeSubtree so it is more descriptive of what it actually does. r=mats

MozReview-Commit-ID: 4TpkkWmMIrc

--HG--
extra : rebase_source : cfe444f66bc17f74fe05e6ca58383ecf042fdbd2
This commit is contained in:
Timothy Nikkel 2017-11-08 16:02:05 +01:00
parent 110cc1954a
commit 397cbc598a
2 changed files with 12 additions and 8 deletions

View File

@ -677,9 +677,9 @@ void CircleArea::GetRect(nsIFrame* aFrame, nsRect& aRect)
//----------------------------------------------------------------------
nsImageMap::nsImageMap() :
mImageFrame(nullptr),
mContainsBlockContents(false)
nsImageMap::nsImageMap()
: mImageFrame(nullptr)
, mConsiderWholeSubtree(false)
{
}
@ -762,7 +762,7 @@ nsImageMap::SearchForAreas(nsIContent* aParent, bool& aFoundArea,
aFoundArea = true;
AddArea(child);
// Continue to next child. This stops mContainsBlockContents from
// Continue to next child. This stops mConsiderWholeSubtree from
// getting set. It also makes us ignore children of <area>s which
// is consistent with how we react to dynamic insertion of such
// children.
@ -777,7 +777,7 @@ nsImageMap::SearchForAreas(nsIContent* aParent, bool& aFoundArea,
}
if (child->IsElement()) {
mContainsBlockContents = true;
mConsiderWholeSubtree = true;
SearchForAreas(child, aFoundArea, aFoundAnchor);
}
}
@ -791,7 +791,7 @@ nsImageMap::UpdateAreas()
bool foundArea = false;
bool foundAnchor = false;
mContainsBlockContents = false;
mConsiderWholeSubtree = false;
SearchForAreas(mMap, foundArea, foundAnchor);
#ifdef ACCESSIBILITY
@ -888,7 +888,7 @@ nsImageMap::Draw(nsIFrame* aFrame, DrawTarget& aDrawTarget,
void
nsImageMap::MaybeUpdateAreas(nsIContent *aContent)
{
if (aContent == mMap || mContainsBlockContents) {
if (aContent == mMap || mConsiderWholeSubtree) {
UpdateAreas();
}
}

View File

@ -93,7 +93,11 @@ protected:
nsImageFrame* mImageFrame; // the frame that owns us
nsCOMPtr<nsIContent> mMap;
AutoTArray<Area*, 8> mAreas; // almost always has some entries
bool mContainsBlockContents;
// This is set when we search for all area children and tells us whether we
// should consider the whole subtree or just direct children when we get
// content notifications about changes inside the map subtree.
bool mConsiderWholeSubtree;
};
#endif /* nsImageMap_h */