Closed Bug 1609006 Opened 4 years ago Closed 4 years ago

Figma's editor doesn't load anymore (0x0 webgl contexts start lost)

Categories

(Core :: Graphics: CanvasWebGL, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla74
Tracking Status
firefox-esr68 --- unaffected
firefox72 --- unaffected
firefox73 --- unaffected
firefox74 --- fixed

People

(Reporter: Harald, Assigned: jgilbert)

References

(Regression, )

Details

(Keywords: regression)

Attachments

(1 file)

STR:

Open https://www.figma.com/file/CPUxAmWW5KMlZ293yn8pNp/Network%3A-Resource-Blocking

AR: Error and redirect to index page

exception thrown: TypeError: can't access property "match", glslVersion is null,_glGetString@https://static.figma.com/fullscreen/f2c6480893491800ae5e40f9813c8dad266e1e2f/compiled_wasm.js.br:2:280940
…

ER: Preview opens.

Assignee: nobody → jgilbert
Priority: -- → P1

Not really sure what's going on, but I can repro it. Redirect-on-error makes it hard to try things, though!

Here's the function:


    function _glGetString(name_) {
        if (GL.stringCache[name_]) return GL.stringCache[name_];
        var ret;
        switch (name_) {
            case 7939:
                var exts = GLctx.getSupportedExtensions() || [];
                exts = exts.concat(exts.map(function(e) {
                    return "GL_" + e
                }));
                ret = stringToNewUTF8(exts.join(" "));
                break;
            case 7936:
            case 7937:
            case 37445:
            case 37446:
                var s = GLctx.getParameter(name_);
                if (!s) {
                    GL.recordError(1280)
                }
                ret = stringToNewUTF8(s);
                break;
            case 7938:
                var glVersion = GLctx.getParameter(GLctx.VERSION); {
                    glVersion = "OpenGL ES 2.0 (" + glVersion + ")"
                }
                ret = stringToNewUTF8(glVersion);
                break;
            case 35724:
                var glslVersion = GLctx.getParameter(GLctx.SHADING_LANGUAGE_VERSION);
                var ver_re = /^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/;
                var ver_num = glslVersion.match(ver_re);
                if (ver_num !== null) {
                    if (ver_num[1].length == 3) ver_num[1] = ver_num[1] + "0";
                    glslVersion = "OpenGL ES GLSL ES " + ver_num[1] + " (" + glslVersion + ")"
                }
                ret = stringToNewUTF8(glslVersion);
                break;
            default:
                GL.recordError(1280);
                return 0
        }
        GL.stringCache[name_] = ret;
        return ret
    }

getParameter(GLctx.SHADING_LANGUAGE_VERSION) should only return null on context-loss. Context-loss code definitely changed, but the behavior as-tested hasn't, so this is somewhat surprising.

Catching this in the Firefox Debugger it looks like it's context-lost, but again, nothing is showing up in the log about it.

Got it.

There's a bug when creating a 0x0 context, where part of context creation logic sees that we're already at 0x0, and assumes this is a no-op resize request, not a context-creation request.
I'm working on adding a test.

Summary: Figma's editor doesn't load anymore → Figma's editor doesn't load anymore (0x0 webgl contexts start lost)

Also, always resize, not just on change. (As per spec)

This does fix the Figma loading for me locally.

See Also: → 1609289
See Also: → 1609292
Pushed by jgilbert@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2c23ef124914
0x0 canvas yields 1x1 webgl context. r=lsalzman
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74
QA Whiteboard: [qa-74b-p2]
Regressions: 1621523
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: