Bug 237286 - [ Monterey ] imported/w3c/web-platform-tests/html/canvas/element/manual/wide-gamut-canvas/canvas-display-p3-drawImage-ImageBitmap-video.html is failing
Summary: [ Monterey ] imported/w3c/web-platform-tests/html/canvas/element/manual/wide-...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Cameron McCormack (:heycam)
URL:
Keywords: InRadar
Depends on: 235006
Blocks:
  Show dependency treegraph
 
Reported: 2022-02-28 14:06 PST by Truitt Savell
Modified: 2022-04-06 20:30 PDT (History)
12 users (show)

See Also:


Attachments
Patch (33.43 KB, patch)
2022-03-17 22:40 PDT, Cameron McCormack (:heycam)
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Truitt Savell 2022-02-28 14:06:25 PST
imported/w3c/web-platform-tests/html/canvas/element/manual/wide-gamut-canvas/canvas-display-p3-drawImage-ImageBitmap-video.html 

It looks like this began failing around https://github.com/WebKit/WebKit/commit/4199adb42a9e80dd3226314d894703c73c8d3b2a according to history

History:
https://results.webkit.org/?suite=layout-tests&test=imported%2Fw3c%2Fweb-platform-tests%2Fhtml%2Fcanvas%2Felement%2Fmanual%2Fwide-gamut-canvas%2Fcanvas-display-p3-drawImage-ImageBitmap-video.html


Diff:
--- /Volumes/Data/worker/monterey-release-tests-wk1/build/layout-test-results/imported/w3c/web-platform-tests/html/canvas/element/manual/wide-gamut-canvas/canvas-display-p3-drawImage-ImageBitmap-video-expected.txt
+++ /Volumes/Data/worker/monterey-release-tests-wk1/build/layout-test-results/imported/w3c/web-platform-tests/html/canvas/element/manual/wide-gamut-canvas/canvas-display-p3-drawImage-ImageBitmap-video-actual.txt
@@ -1,8 +1,8 @@
 
-PASS sRGB-FF0100, Context srgb, ImageData srgb, cropSource=false
+FAIL sRGB-FF0100, Context srgb, ImageData srgb, cropSource=false assert_true: Actual pixel value 0,0,0,0 is approximately equal to 255,1,0,255. expected true got false
 PASS sRGB-FF0100, Context srgb, ImageData srgb, cropSource=true
 PASS sRGB-FF0100, Context srgb, ImageData display-p3, cropSource=false
-PASS sRGB-FF0100, Context srgb, ImageData display-p3, cropSource=true
+FAIL sRGB-FF0100, Context srgb, ImageData display-p3, cropSource=true assert_true: Actual pixel value 0,0,0,0 is approximately equal to 234,51,35,255. expected true got false
 PASS sRGB-FF0100, Context display-p3, ImageData srgb, cropSource=false
 PASS sRGB-FF0100, Context display-p3, ImageData srgb, cropSource=true
 PASS sRGB-FF0100, Context display-p3, ImageData display-p3, cropSource=false
Comment 1 Radar WebKit Bug Importer 2022-02-28 14:06:43 PST
<rdar://problem/89580513>
Comment 2 Cameron McCormack (:heycam) 2022-03-16 22:04:29 PDT
Bisecting reveals that this started failing after https://bugs.webkit.org/show_bug.cgi?id=235006.
Comment 3 Cameron McCormack (:heycam) 2022-03-17 22:34:02 PDT
There are two separate issues which are contributing to the test intermittently failing:

* The test video files I created have a single frame in them, and calling drawImage with such videos sometimes results in empty pixel data being drawn.
* The loadeddata event doesn't really guarantee that the video will have pixels available for drawImage to use. Using requestVideoFrameCallback would be better.

Single frame videos are a bit of an edge case, so I'm not worried about the impact on content.

Additionally, requestVideoFrameCallback seems to be delayed a bit if the video that's passed to drawImage has been inserted into the document but is not playing.

I'll attach a patch to:

* change the test video files to have 10s of solid color, instead of a single frame
* use requestVideoFrameCallback if available
* play the video before waiting for the video frame callback

I'll file separate bugs on these issues.
Comment 4 Cameron McCormack (:heycam) 2022-03-17 22:40:11 PDT
Created attachment 455066 [details]
Patch
Comment 5 EWS Watchlist 2022-03-17 22:41:47 PDT
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Comment 6 EWS 2022-03-18 17:27:56 PDT
Committed r291509 (248616@main): <https://commits.webkit.org/248616@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 455066 [details].