htmlvideoelement: Fix poster frame processing algorithm (#37533)

According to HTML specification the poster attribute determines the
element's poster frame
(regardless of the value of the element's show poster flag).
https://html.spec.whatwg.org/multipage/#poster-frame

So the poster frame and the show poster flag is orthogonal to each
other, the latest one only controls
when browser should display the poster frame and should do not block
accepting video frames
from media pipeline (e.g. on new_preroll callback from video sink).

During layout the video element should select the current frame which
will be presented
based on first matching condition from the list:

https://html.spec.whatwg.org/multipage/#the-video-element:the-video-element-7

Testing: Improvements in the following WPT tests
- html/canvas/element/manual/imagebitmap/createImageBitmap*
- html/semantics/embedded-content/the-canvas-element/*

Fixes: #37165

---------

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Andrei Volykhin 2025-06-19 12:55:10 +03:00 committed by GitHub
parent d0100797e8
commit 06b5422abf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 70 additions and 112 deletions

View file

@ -1,6 +1,3 @@
[createImageBitmap-colorSpaceConversion.html]
[createImageBitmap from a Blob, and drawImage on the created ImageBitmap with colorSpaceConversion: none]
expected: FAIL
[createImageBitmap from a Video, and drawImage on the created ImageBitmap with colorSpaceConversion: none]
expected: FAIL

View file

@ -1,45 +1,27 @@
[createImageBitmap-origin.sub.html]
[redirected to cross-origin HTMLVideoElement: origin unclear 2dContext.drawImage]
expected: FAIL
[redirected to cross-origin HTMLVideoElement: origin unclear bitmaprenderer.transferFromImageBitmap]
expected: FAIL
[unclean HTMLCanvasElement: origin unclear bitmaprenderer.transferFromImageBitmap]
expected: FAIL
[cross-origin HTMLVideoElement: origin unclear getImageData]
expected: FAIL
[cross-origin SVGImageElement: origin unclear bitmaprenderer.transferFromImageBitmap]
expected: FAIL
[cross-origin HTMLVideoElement: origin unclear bitmaprenderer.transferFromImageBitmap]
expected: FAIL
[redirected to same-origin HTMLVideoElement: origin unclear getImageData]
expected: FAIL
[cross-origin SVGImageElement: origin unclear 2dContext.drawImage]
expected: FAIL
[cross-origin HTMLImageElement: origin unclear bitmaprenderer.transferFromImageBitmap]
expected: FAIL
[redirected to same-origin HTMLVideoElement: origin unclear 2dContext.drawImage]
expected: FAIL
[unclean ImageBitmap: origin unclear bitmaprenderer.transferFromImageBitmap]
expected: FAIL
[redirected to same-origin HTMLVideoElement: origin unclear bitmaprenderer.transferFromImageBitmap]
expected: FAIL
[redirected to cross-origin HTMLVideoElement: origin unclear getImageData]
expected: FAIL
[cross-origin HTMLVideoElement: origin unclear 2dContext.drawImage]
expected: FAIL
[cross-origin SVGImageElement: origin unclear getImageData]
expected: FAIL

View file

@ -1,10 +1,4 @@
[createImageBitmap-resolves-in-task.any.html]
[createImageBitmap with an HTMLVideoElement source should resolve async]
expected: FAIL
[createImageBitmap with an HTMLVideoElement from a data URL source should resolve async]
expected: FAIL
[createImageBitmap with a vector HTMLImageElement source should resolve async]
expected: FAIL

View file

@ -2,12 +2,6 @@
[Serialize ImageBitmap created from a vector SVGImageElement]
expected: FAIL
[Serialize ImageBitmap created from an HTMLVideoElement]
expected: FAIL
[Serialize ImageBitmap created from an HTMLVideoElement from a data URL]
expected: FAIL
[Serialize ImageBitmap created from a vector HTMLImageElement]
expected: FAIL

View file

@ -8,11 +8,5 @@
[Transfer ImageBitmap created from a Blob]
expected: FAIL
[Transfer ImageBitmap created from an HTMLVideoElement from a data URL]
expected: FAIL
[Transfer ImageBitmap created from a bitmap SVGImageElement]
expected: FAIL
[Transfer ImageBitmap created from an HTMLVideoElement]
expected: FAIL

View file

@ -2,23 +2,5 @@
[cross-origin SVGImageElement: Setting fillStyle to an origin-unclean pattern makes the canvas origin-unclean]
expected: FAIL
[cross-origin HTMLVideoElement: Setting fillStyle to an origin-unclean pattern makes the canvas origin-unclean]
expected: FAIL
[redirected to cross-origin HTMLVideoElement: Setting fillStyle to an origin-unclean pattern makes the canvas origin-unclean]
expected: FAIL
[redirected to same-origin HTMLVideoElement: Setting fillStyle to an origin-unclean pattern makes the canvas origin-unclean]
expected: FAIL
[cross-origin SVGImageElement: Setting fillStyle to an origin-unclean offscreen canvas pattern makes the canvas origin-unclean]
expected: FAIL
[cross-origin HTMLVideoElement: Setting fillStyle to an origin-unclean offscreen canvas pattern makes the canvas origin-unclean]
expected: FAIL
[redirected to cross-origin HTMLVideoElement: Setting fillStyle to an origin-unclean offscreen canvas pattern makes the canvas origin-unclean]
expected: FAIL
[redirected to same-origin HTMLVideoElement: Setting fillStyle to an origin-unclean offscreen canvas pattern makes the canvas origin-unclean]
expected: FAIL