whatwg / whatwg/html

ImageBitmapRenderingContext: transferFromImageBitmap algorithm sort-of duplicates steps

Open
#3,166 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

clarification topic: canvas
Dominant language
HTML
Stars
9.4k
Forks
3.2k
PR merge metrics
PR metrics pending

Description

The algorithm described for transferFromImageBitmap could be cleaned up a little. In particular:

  1. Run the steps to set an ImageBitmapRenderingContext's output bitmap…
  1. Set the value of imageBitmap's [[Detached]] internal slot to true.
  1. Unset imageBitmap's bitmap data.

As step 4 is executed, it effectively must detach the bitmap data from the ImageBitmap as it transfers it into this context. After that step the ImageBitmap would have no data (as if close() had been called). This means that steps 5 and 6 have already happened.

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

Start by locating the transferFromImageBitmap algorithm in the HTML Standard and read steps 4–6. Confirm whether step 4 already detaches the bitmap data, then remove the redundant description while preserving the algorithm's behavior. Done means the algorithm no longer repeats the detachment and clearing steps.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
web-dev
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.