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

[Public WebGL] Improving "explicit context loss handling"



Based on the earlier discussion with Boris and Cameron, I'll suggest the following:

1. Replace the "The following methods have explicit context lost handling..." section with WebIDL extended attributes.  Remove that list, and add the [WebGLContextLoss] attribute to those methods, eg.

    [WebGLContextLoss] boolean isContextLost();
    [WebGLContextLoss] GLenum checkFramebufferStatus(GLenum target);

2. In 5.14, replace step 1. with: "1. If the [WebGLContextLoss] extended attribute appears on the called method, perform the implementation of the called method, return its result and terminate these steps."

This makes it much easier to see a function's behavior by looking at the IDL.  Currently you have to "just know" that there's a list of functions somewhere that may affect it; this attribute is a much clearer tip-off, even on first reading.

It makes it possible to automatically sanity-check the IDL, to ensure that all functions with non-nullable, non-any return values are also [WebGLContextLoss].  It may also be usable by implementors, to automatically generate the binding logic for these functions.

--
Glenn Maynard