Bug 1028497 - Part 8: Implement Length and array access on FontFaceSet. r=jfkthame

This is a temporary measure until we support iterators on the
FontFaceSet; the spec does not expose FontFaces as indexed properties on
the FontFaceSet.
This commit is contained in:
Cameron McCormack 2014-10-02 12:32:06 +10:00
parent 3691030343
commit 407073516d

View File

@ -163,14 +163,23 @@ FontFaceSet::Has(FontFace& aFontFace)
FontFace*
FontFaceSet::IndexedGetter(uint32_t aIndex, bool& aFound)
{
aFound = false;
return nullptr;
mPresContext->FlushUserFontSet();
if (aIndex >= mRules.Length()) {
aFound = false;
return nullptr;
}
aFound = true;
return FontFaceForRule(mRules[aIndex].mContainer.mRule);
}
uint32_t
FontFaceSet::Length()
{
return 0;
mPresContext->FlushUserFontSet();
return mRules.Length();
}
static PLDHashOperator DestroyIterator(nsPtrHashKey<nsFontFaceLoader>* aKey,