WebGL texImage2D srcData: Clarify null is allowed

Open Beginner friendly
#46,493 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@abdul-karim-mia is already working on this.

Since Nov 13, 2026.

  • #46515 by @abdul-karim-mia — open

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
84/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript, web-dev
Domain
documentation

Research direction

The issue points to files/en-us/web/api/webglrenderingcontext/teximage2d/index.md, around line 153. Read the srcData description and nearby format guidance, then clarify whether null is generally allowed and what it means for texture contents. Done when the page states this clearly without implying the allowance applies only to one format.

Written by the indexing model from the issue text.

Description

area: WebGL Content:WebAPI

The line here implies, to me, that the srcData may be null perhaps only if this particular format is used:

https://github.com/mdn/content/blob/fd6a5b07ff0cee3eed0540c09e2f49145541dc76/files/en-us/web/api/webglrenderingcontext/teximage2d/index.md?plain=1#L153

Whereas I was looking at the MDN docs to verify whether I can use null for srcData in general (which does seem to be allowed), I didn't catch anywhere this is explicitly stated on this page. A few lines above (before the chart) might be good place to specify this more generally.

Current:

A TypedArray or DataView containing the compressed texture data. Its type must match the type parameter:

Possible:

A TypedArray or DataView containing the compressed texture data, or null to allocate storage in the texture without specifying its content (instead, the content will be <undefined/junk? || zeroed?>). Its type must match the type parameter:

Dominant language
Markdown
Stars
11.1k
Forks
23.3k
Avg merge
2d 14h
Merged PRs (30d)
165

Getting set up

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.

More from mdn/content

All issues in mdn/content

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.