[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] Null return values from create*

Glenn Maynard:
Many functions still have neither a nullable nor "any" return value, nor
explicit context lost handling, which isn't valid.  A sample:
getSupportedExtensions, getProgramInfoLog, getShaderPrecisionFormat,
getShaderSource.  It's bad that it's so hard to detect these.  It would
be a lot nicer if the "explicit context lost handling" was something we
could annotate in WebIDL, eg. something like

boolean isContextLost() annotate(explicit_context_loss=True);

so these invalid cases could be detected automatically.  It might be
useful for people generating bindings, too.

+CC Cameron: Is there any way to do this now, or could something like
this be added, so we can annotate functions with arbitrary, API-specific
strings?  This would have no effect on the IDL; it would just be for
API-specific flags.

Do you want annotations that just control the behaviour of the operations (to save writing prose on each one checking for whether the context has been lost and returning null)? If so, I think using an extended attribute for this would be fine:


I don't see any problem with defining say [WebGLContextLoss] in the WebGL spec and writing

  [WebGLContextLoss] sequence<DOMString>? getSupportedExtensions();

(Is it worth Web IDL having an explicit spec-local naming convention for extended attributes like this? Or perhaps some character that introduces spec-local extended attributes, like [@ContextLoss]?)

You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email:
unsubscribe public_webgl