KhronosGroup / KhronosGroup/WebGL

Clarify that webglcontextcreationerror must be fired synchronously to JS.

Open
#1,702 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
2.9k
Forks
704
Avg merge
2d 9h
Merged PRs (30d)
4

Description

If webgl context creation fails, canvas.getContext will return null and fire webglcontextcreationerror to the canvas. From the spec wording in https://www.khronos.org/registry/webgl/specs/latest/1.0/#2.1, it is not immediately clear if this event is fired synchronously or asynchronously (e.g. at a later turn of the browser event loop).

Looking at the example code in https://www.khronos.org/registry/webgl/specs/latest/1.0/#fire-a-webgl-context-creation-error however, it illustrates that the intent is that the error is always raised synchronously, since the code prints out the error immediately after calling getContext.

I propose that step 6.1 in https://www.khronos.org/registry/webgl/specs/latest/1.0/#2.1 is updated to explicitly state that the event will be synchronously delivered.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read section 2.1 and the “fire a webglcontextcreationerror” example linked in the issue, focusing on step 6.1 and the timing implied by the example. Update the specification wording to explicitly say the event is delivered synchronously, and confirm that the wording matches the example’s behavior.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.