RESOLVED FIXED37047
Passing null WebGLObjects should synthesize INVALID_VALUE error
https://bugs.webkit.org/show_bug.cgi?id=37047
Summary Passing null WebGLObjects should synthesize INVALID_VALUE error
Kenneth Russell
Reported 2010-04-02 15:11:32 PDT
There are several WebGL entry points which currently synthesize an INVALID_OPERATION error when receiving a null WebGLObject. These include bindAttribLocation, compileShader, detachShader, getActiveAttrib, getActiveUniform, getProgramParameter, getProgramInfoLog, getShaderParameter, getShaderInfoLog, getShaderSource, getUniform, getUniformLocation, linkProgram, and shaderSource. These should be changed to synthesize INVALID_VALUE in this case instead, because that is the semantically correct OpenGL error and matches the specification for the uniform[Matrix]* APIs.
Attachments
patch (19.43 KB, patch)
2010-04-08 14:40 PDT, Zhenyao Mo
no flags
revised patch : responding to Ken Russell's review (17.72 KB, patch)
2010-04-08 17:22 PDT, Zhenyao Mo
no flags
Zhenyao Mo
Comment 1 2010-04-08 14:40:12 PDT
Kenneth Russell
Comment 2 2010-04-08 15:39:48 PDT
In all of these cases, we need to split out the test against 0 from the other tests like whether the object came from this context. Those should continue to synthesize INVALID_OPERATION. I suggest adding a private helper function like bool validateWebGLObject(CanvasObject*) which does the test against 0 and synthesizes INVALID_VALUE if so, and which checks that the context is ourselves and synthesizes INVALID_OPERATION if not. Then all of the call sites can be refactored to just "if (!validateWebGLObject(...)) return [false];"
Zhenyao Mo
Comment 3 2010-04-08 17:22:31 PDT
Created attachment 52920 [details] revised patch : responding to Ken Russell's review
Kenneth Russell
Comment 4 2010-04-08 17:42:47 PDT
Comment on attachment 52920 [details] revised patch : responding to Ken Russell's review This looks great. Thanks for doing this cleanup.
WebKit Commit Bot
Comment 5 2010-04-09 03:37:27 PDT
Comment on attachment 52920 [details] revised patch : responding to Ken Russell's review Clearing flags on attachment: 52920 Committed r57324: <http://trac.webkit.org/changeset/57324>
WebKit Commit Bot
Comment 6 2010-04-09 03:37:32 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.