On 9/16/16 9:58 AM, Philip Jägenstedt wrote:
> Boris, Chris,what do you see as the end state for document interfaces in
> Gecko and WebKit?
I don't know, honestly. The document interfaces are one of the more
screwed-up parts of the web platform, full of methods and properties
that only make sense in some situations but are shoehorned into always
being there...
In practice, I'm on board with moving things from HTMLDocument to
Document when it makes sense to do so. It's not clear to me whether it
makes sense for very HTML-specific things like
body/head/images/embeds/plugins/links/forms/scripts. It's also not
clear that it makes sense for open/close/write/writeln (which can never
work on non-HTML documents anyway, and don't even work on all
HTMLDocument instances). Not sure about the *Color attributes either.
As a separate concern, even if we moved everything I'm not sure what the
right thing to do with HTMLDocument is (i.e. whether it can just become
an alias for Document or not). It's hard to say whether that's even
web-compatible until someone actually tries shipping it...
> Do you it's OK that new Document is the only way to
> create a Document instance that's neither a HTMLDocument or XMLDocument
I don't think it's really a problem, no. In practical terms, it's just
like XMLDocument but without a load() (in Gecko; in other engines it's
really the same).
> and is that even true for Gecko and WebKit?
It's true in Gecko.
> If the new Document({ type: 'text/html' }) idea too crazy to entertain?
This could be done, I guess, but we could also just make HTMLDocument
constructible (and have it not be an alias of Document). If we did it
that way, it would still need a type, defaulting to "text/html", so you
could create application/xhtml+xml HTMLDocument instances...
If we do alias HTMLDocument to Document, then having a type arg to the
Document constructor makes sense to me; that would be the sane way of
producing an HTML document (flagged so internally, that is) in that world.
Hope that helps,
Boris