W3C home > Mailing lists > Public > public-script-coord@w3.org > January to March 2013

Re: [cssom] Proposal for obtaining robust style information via Javascript - getStyle()

From: Garrett Smith <dhtmlkitchen@gmail.com>
Date: Tue, 12 Feb 2013 14:59:35 -0800
Message-ID: <CABZUbM0Zeb5q0WVK3mUM69bmn=7XTs8KwGfM8FzNDUShRBcjeQ@mail.gmail.com>
To: Cameron McCormack <cam@mcc.id.au>
Cc: Bjoern Hoehrmann <derhoermi@gmx.net>, public-script-coord@w3.org
On 2/9/13, Cameron McCormack <cam@mcc.id.au> wrote:
> On 9/02/13 2:23 PM, Garrett Smith wrote:
>> I missed that thread. Why is it bad to have functions that have
>> additional properties?
>
> Actually it was "objects that are typeof 'object' but which are
> callable" are a bad thing, since it is not possible to implement objects
> like this without magic.  But this computedStyle proposal wouldn't need
> to have typeof being 'object', so it wouldn't be as bad.  I would still
> contend though that it is an uncommon API style and could be confusing.
>
Since ES 5, callable host objects must result "function" with typeof.

It is uncommon API design as far as w3c stuff goes, but I guess that's
because IDL or other programming languages like Java don't allow
methods with extra properties. Anyway, it might not matter right now,
but the idea doesn't seem confusing to me.

More important - I like the ideas from Mike and L Baron.
-- 
Garrett
Twitter: @xkit
personx.tumblr.com
Received on Tuesday, 12 February 2013 23:00:02 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:09 UTC