[css-font-loading] document.fonts for a document with no browsing context

If I create a document that isn’t associated with a browsing context,
such as one returned from document.implementation.createHTMLDocument(),
should we be returning a FontFaceSet object from its fonts property, and
if so, should it work just as well as one that comes from a document
that is associated with a browsing context?

I notice that Chrome does return a FontFaceSet here, but that it ignores
attempts to add FontFace objects to it.

Also, calling check("16px Helvetica") on it returns false, while the
same call on a FontFaceSet from a document with a browsing context
returns true (on machine machine).

I would be happy with the spec requiring that null be returned from
document.fonts for such documents.  (I’m not sure how useful it is to
return a useless FontFaceSet.)

Alternatively, it should behave the same as a separately constructed
FontFaceSet object (i.e. it has nothing to do with the document you got
it from), but as I’ve said previously, I don’t think a constructable
FontFaceSet is that useful and so far I haven’t implemented support for
that.

-- 
Cameron McCormack ≝ http://mcc.id.au/

Received on Thursday, 7 May 2015 03:07:08 UTC