Re: [Public WebGL] Should WebGLContextAttributes be a callback interface?

On 3/31/12 11:10 AM, Glenn Maynard wrote:
> I forgot, I talked with Cameron on IRC a while back about the dictionary
> vs. callback thing:
>
> http://krijnhoetmer.nl/irc-logs/whatwg/20111208#l-281

Ah, thank you.  That discussion is actually a good argument in some ways 
for having separate types in the getContext() call (where values can be 
left out, etc) and the getContextAttributes() return value (where values 
are guaranteed to be present)...

> Honestly, I'm not sure I'm a fan of the "single getContext method"
> approach in the first place.

I'm not sure of that either, but we seem to be somewhat stuck with it...

> You *can* return a dictionary type from functions, so it could, in fact,
> just define a dictionary used by both getContext and
> getContextAttributes.  It'd lose the interface, but I can't think of any
> use cases for an interface there anyway.  But I guess there's otherwise
> no real difference between doing that and just making the attributes
> nullable.

Oh, there are plenty of differences in terms of actual behavior.  They 
might not matter, though.

-Boris

Received on Saturday, 31 March 2012 15:26:43 UTC