bug 522779: use nsTArray::Contains() instead of checking nsTArray::IndexOf() against various sentinel values, in three places in layout. r=dbaron
This commit is contained in:
@@ -6973,7 +6973,7 @@ DoDeletingFrameSubtree(nsFrameManager* aFrameManager,
|
||||
// the out-of-flow frame will be destroyed by aRemovedFrame.
|
||||
if (outOfFlowFrame->GetStyleDisplay()->mDisplay == NS_STYLE_DISPLAY_POPUP ||
|
||||
!nsLayoutUtils::IsProperAncestorFrame(aRemovedFrame, outOfFlowFrame)) {
|
||||
NS_ASSERTION(aDestroyQueue.IndexOf(outOfFlowFrame) == kNotFound,
|
||||
NS_ASSERTION(!aDestroyQueue.Contains(outOfFlowFrame),
|
||||
"out-of-flow is already in the destroy queue");
|
||||
aDestroyQueue.AppendElement(outOfFlowFrame);
|
||||
// Recurse into the out-of-flow, it is now the aRemovedFrame.
|
||||
|
||||
@@ -314,8 +314,7 @@ private:
|
||||
NS_DECL_IMGIDECODEROBSERVER
|
||||
|
||||
void AddIconObserver(nsImageFrame *frame) {
|
||||
NS_ABORT_IF_FALSE(mIconObservers.IndexOf(frame) ==
|
||||
nsTArray<nsImageFrame*>::NoIndex,
|
||||
NS_ABORT_IF_FALSE(!mIconObservers.Contains(frame),
|
||||
"Observer shouldn't aleady be in array");
|
||||
mIconObservers.AppendElement(frame);
|
||||
}
|
||||
|
||||
@@ -1527,7 +1527,7 @@ nsMathMLChar::StretchEnumContext::EnumCallback(const nsString& aFamily,
|
||||
nsGlyphTable* glyphTable = aGeneric ?
|
||||
&gGlyphTableList->mUnicodeTable : gGlyphTableList->GetGlyphTableFor(aFamily);
|
||||
|
||||
if (context->mTablesTried.IndexOf(glyphTable) != context->mTablesTried.NoIndex)
|
||||
if (context->mTablesTried.Contains(glyphTable))
|
||||
return PR_TRUE; // already tried this one
|
||||
|
||||
context->mGlyphTable = glyphTable;
|
||||
|
||||
Reference in New Issue
Block a user