WICG / WICG/shape-detection-api

Some ImageBitmapSource variants unhandled

Open
#87 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Bikeshed
Stars
316
Forks
39
Avg merge
8d 3h
Merged PRs (30d)
1

Description

The ImageBitmapSource union is defined as,

typedef (HTMLImageElement or
         SVGImageElement) HTMLOrSVGImageElement;

typedef (HTMLOrSVGImageElement or
         HTMLVideoElement or
         HTMLCanvasElement or
         ImageBitmap or
         OffscreenCanvas) CanvasImageSource;

typedef (CanvasImageSource or
         Blob or
         ImageData) ImageBitmapSource;

This specification does not have cases covering the Blob, OffscreenCanvas or SVGImageElement cases for this union. The implementation in Chromium handles OffscreenCanvas in the most obvious fashion but not the other two.

Handling of Blob inputs is particularly tricky because it requires first decoding the blob. For practical purposes developers should simply call createImageBitmap() with the Blob and pass the resulting ImageBitmap to the detect() method.

It may be best to simply redefine handling of this union in terms of createImageBitmap().

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 with the ImageBitmapSource union and the specification's existing cases, then compare them with the Chromium behavior mentioned in the issue. Consider how createImageBitmap() relates to Blob, OffscreenCanvas, and SVGImageElement inputs. Done means the specification explicitly covers the missing variants or clearly defines the intended handling.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.