gl.VIEWPORT constant is mis-defined as gl.VIEWPORT_RECT

RESOLVED DUPLICATE of bug 586938

Status

()

RESOLVED DUPLICATE of bug 586938
8 years ago
8 years ago

People

(Reporter: ben.vanik, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

8 years ago
User-Agent:       Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b7) Gecko/20100101 Firefox/4.0b7
Build Identifier: 4.0b7

The OpenGL ES 2 and WebGL specs define the VIEWPORT constant = 0x0BA2 and WebKit and Chromium conform to this. Firefox, however, uses VIEWPORT_RECT instead.

Relevant line of IDL in trunk WebGL spec:
const GLenum VIEWPORT                       = 0x0BA2;
https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/WebGL-spec.html

Trunk idl showing VIEWPORT_RECT instead:
http://hg.mozilla.org/mozilla-central/file/95e9c2e8708d/dom/interfaces/canvas/nsICanvasRenderingContextWebGL.idl



Reproducible: Always

Steps to Reproduce:
1. Attempt to use gl.VIEWPORT (such as in a query via gl.getParameter())
Actual Results:  
VIEWPORT is undefined

Expected Results:  
viewport is defined and usage works

Hacky workaround is, on context creation:
if (!gl.VIEWPORT) {
    gl.VIEWPORT = gl.VIEWPORT_RECT;
}

Everything works fine after this. But it means that code won't work cross-browser out of the box.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 586938
You need to log in before you can comment on or make changes to this bug.