Bug 1072101 - Part 1: Implement FontFaceSet.size. r=peterv

This commit is contained in:
Cameron McCormack 2015-03-31 14:05:33 +11:00
parent 31c13b72d8
commit b7a4daf2fd
3 changed files with 5 additions and 6 deletions

View File

@ -17,10 +17,8 @@ enum FontFaceSetLoadStatus { "loading", "loaded" };
[Pref="layout.css.font-loading-api.enabled"]
interface FontFaceSet : EventTarget {
// Emulate the Set interface, until we can extend Set correctly.
// Implementing these commented out operations and the iterator is
// bug 1072101.
// readonly attribute unsigned long size;
// Emulate setlike behavior until we can use that directly.
readonly attribute unsigned long size;
[Throws] void add(FontFace font);
boolean has(FontFace font);
[Throws] boolean delete(FontFace font);

View File

@ -348,7 +348,7 @@ FontFaceSet::IndexedGetter(uint32_t aIndex, bool& aFound)
}
uint32_t
FontFaceSet::Length()
FontFaceSet::Size()
{
mPresContext->FlushUserFontSet();

View File

@ -176,8 +176,9 @@ public:
void Clear();
bool Delete(FontFace& aFontFace, mozilla::ErrorResult& aRv);
bool Has(FontFace& aFontFace);
uint32_t Size();
FontFace* IndexedGetter(uint32_t aIndex, bool& aFound);
uint32_t Length();
uint32_t Length() { return Size(); }
private:
~FontFaceSet();