Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGL content can fail to show up immediately on Edge #29

Open
ianmackenzie opened this issue Jul 21, 2020 · 1 comment
Open

WebGL content can fail to show up immediately on Edge #29

ianmackenzie opened this issue Jul 21, 2020 · 1 comment

Comments

@ianmackenzie
Copy link

This was first reported at ianmackenzie/elm-3d-scene#87 but seems to be a general WebGL issue. On some versions of Microsoft Edge (tested on version 44.19041.1.0 on Windows 10), replacing a general HTML element with a WebGL canvas some time after the Elm app has started results in the WebGL scene not actually being displayed until a redraw is triggered (window resize, user drags the mouse over the canvas element, etc.).

SSCCE is at https://ellie-app.com/9tMP6X3FjVTa1. The expected behavior is that the page will display "Loading..." for 1 second and then switch to a blue square. On Edge, this can fail and the text disappears but the blue square does not appear until the page is resized or a redraw is otherwise forced. Replacing the Html.text "Loading..." with a dummy WebGL scene like

WebGL.toHtml
    [ Html.Attributes.width 300
    , Html.Attributes.height 300
    ]
    []

fixes the issue, so it seems to be a problem when the virtual DOM replaces a non-WebGL element with a WebGL one.

@w0rm
Copy link
Collaborator

w0rm commented Aug 10, 2020

This looks like Edge rendering bug. A possible fix could be to trigger repaint for the canvas element on the first draw. This worked for me in Edge:

Screenshot 2020-07-21 at 22 01 56

However I am not sure about this, because this has performance impact for all browsers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants