Re: DOMPoint dictionary problem

On Mon, Sep 16, 2013 at 3:46 AM, Robert O'Callahan <robert@ocallahan.org> wrote:
> Making DOMPoint a dictionary, as currently proposed, is a problem since it
> means other objects (such as the proposed DOMQuad) can't have DOMPoints as
> attributes. I'm assuming the WebIDL restriction that attributes can't be
> dictionaries is not easily removed.

Yes, this is fine with me.

> I think we probably should make DOMPoint a regular interface. For methods
> that take DOMPoints as parameters, we can retain the convenient literal
> syntax for points by adding a DOMPointLiteral dictionary type and using
> union types, e.g.
>   DOMPoint convertPoint((DOMPoint or DOMPointLiteral) point);

You don't even need to do that - as long as their
attribute/dict-member names match, a DOMPoint *is* a DOMPointLiteral,
so you can just write the function signature as:

    DOMPoint convertPoint(DOMPointLiteral point)

~TJ

Received on Monday, 16 September 2013 16:43:18 UTC