Bug 182388

Summary: Implement createImageBitmap(HTMLVideoElement)
Product: WebKit Reporter: Ms2ger (he/him; ⌚ UTC+1/+2) <Ms2ger>
Component: CanvasAssignee: Ms2ger (he/him; ⌚ UTC+1/+2) <Ms2ger>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, commit-queue, dino, esprehn+autocc, ews-watchlist, gyuyoung.kim, rniwa, ross.kirsling, webkit-bug-importer, zan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 182424    
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from ews104 for mac-sierra-wk2
none
Archive of layout-test-results from ews101 for mac-sierra
none
Patch
none
Patch
none
Patch
none
Patch
none
Archive of layout-test-results from ews125 for ios-simulator-wk2
none
Patch none

Description Ms2ger (he/him; ⌚ UTC+1/+2) 2018-02-01 07:22:27 PST
.
Comment 1 Ms2ger (he/him; ⌚ UTC+1/+2) 2018-02-01 07:41:06 PST
Created attachment 332877 [details]
Patch
Comment 2 EWS Watchlist 2018-02-01 08:28:51 PST
Comment on attachment 332877 [details]
Patch

Attachment 332877 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/6316783

New failing tests:
imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage.html
Comment 3 EWS Watchlist 2018-02-01 08:28:53 PST
Created attachment 332880 [details]
Archive of layout-test-results from ews104 for mac-sierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104  Port: mac-sierra-wk2  Platform: Mac OS X 10.12.6
Comment 4 EWS Watchlist 2018-02-01 08:42:35 PST
Comment on attachment 332877 [details]
Patch

Attachment 332877 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/6317075

New failing tests:
imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage.html
Comment 5 EWS Watchlist 2018-02-01 08:42:36 PST
Created attachment 332881 [details]
Archive of layout-test-results from ews101 for mac-sierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-sierra  Platform: Mac OS X 10.12.6
Comment 6 Ms2ger (he/him; ⌚ UTC+1/+2) 2018-02-01 08:53:09 PST
Created attachment 332882 [details]
Patch
Comment 7 Ms2ger (he/him; ⌚ UTC+1/+2) 2018-02-01 09:11:49 PST Comment hidden (obsolete)
Comment 8 Zan Dobersek 2018-02-01 14:21:45 PST
Comment on attachment 332882 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=332882&action=review

> Source/WebCore/ChangeLog:14
> +        Implement createImageBitmap(HTMLVideoElement)
> +        https://bugs.webkit.org/show_bug.cgi?id=182388
> +
> +        Reviewed by NOBODY (OOPS!).
> +
> +        Tests:
> +
> +        - web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage.html
> +        - web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args.html
> +
> +
> +        * html/ImageBitmap.cpp:

Please put in the effort and describe the changes that have been made. OTOH, the ChangeLog entry looks incomplete, since neither taintsOrigin() or ImageBitmap::createPromise() are listed as changed.

> Source/WebCore/html/ImageBitmap.cpp:397
>      // 3. If the video element's readyState attribute is either HAVE_NOTHING or
>      //    HAVE_METADATA, then return a promise rejected with an "InvalidStateError"
>      //    DOMException and abort these steps.
> +    if (video->readyState() == HTMLMediaElement::HAVE_NOTHING || video->readyState() == HTMLMediaElement::HAVE_METADATA) {
> +        promise.reject(InvalidStateError, "Cannot create ImageBitmap before the HTMLVideoElement has data");
> +        return;
> +    }

Do you know what version of what spec the comments and implementation follow? The current WHATWG specification for instance doesn't contain this condition.

> Source/WebCore/html/ImageBitmap.cpp:439
> +    promise.resolve(imageBitmap);

imageBitmap should be moved into the resolve() call.
Comment 9 Ms2ger (he/him; ⌚ UTC+1/+2) 2018-02-02 08:27:21 PST
Created attachment 332970 [details]
Patch
Comment 10 Ms2ger (he/him; ⌚ UTC+1/+2) 2018-02-02 08:29:33 PST
Created attachment 332971 [details]
Patch
Comment 11 Zan Dobersek 2018-02-03 23:56:02 PST
Comment on attachment 332971 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=332971&action=review

> Source/WebCore/html/ImageBitmap.cpp:404
> +    // 5. Let imageBitmap be a new ImageBitmap object.
> +    auto imageBitmap = create();

Following the spec steps, this should sit before the 6.1. step.

> Source/WebCore/html/ImageBitmap.cpp:421
> +    GraphicsContext& c = bitmapData->context();

This can go in the scope below.
Comment 12 Ms2ger (he/him; ⌚ UTC+1/+2) 2018-02-04 03:13:53 PST
Created attachment 333050 [details]
Patch
Comment 13 WebKit Commit Bot 2018-02-04 03:15:44 PST
Comment on attachment 333050 [details]
Patch

Rejecting attachment 333050 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-02', 'apply-attachment', '--no-update', '--non-interactive', 333050, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Last 500 characters of output:
rdparty/autoinstalled/mechanize/_urllib2_fork.py", line 332, in _call_chain
    result = func(*args)
  File "/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_urllib2_fork.py", line 1170, in https_open
    return self.do_open(conn_factory, req)
  File "/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_urllib2_fork.py", line 1118, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error [Errno 60] Operation timed out>

Full output: http://webkit-queues.webkit.org/results/6353958
Comment 14 EWS Watchlist 2018-02-04 04:42:27 PST
Comment on attachment 333050 [details]
Patch

Attachment 333050 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/6354205

New failing tests:
imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args.html
Comment 15 EWS Watchlist 2018-02-04 04:42:28 PST
Created attachment 333051 [details]
Archive of layout-test-results from ews125 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews125  Port: ios-simulator-wk2  Platform: Mac OS X 10.12.6
Comment 16 Zan Dobersek 2018-02-04 23:41:45 PST
LayoutTests/platform/ios/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt also needs to be updated.
Comment 17 Ms2ger (he/him; ⌚ UTC+1/+2) 2018-02-05 01:17:40 PST
Created attachment 333065 [details]
Patch
Comment 18 WebKit Commit Bot 2018-02-05 01:22:44 PST
Comment on attachment 333065 [details]
Patch

Rejecting attachment 333065 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-02', 'apply-attachment', '--no-update', '--non-interactive', 333065, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Last 500 characters of output:
rdparty/autoinstalled/mechanize/_urllib2_fork.py", line 332, in _call_chain
    result = func(*args)
  File "/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_urllib2_fork.py", line 1170, in https_open
    return self.do_open(conn_factory, req)
  File "/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_urllib2_fork.py", line 1118, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error [Errno 60] Operation timed out>

Full output: http://webkit-queues.webkit.org/results/6362062
Comment 19 WebKit Commit Bot 2018-02-05 02:25:02 PST
Comment on attachment 333065 [details]
Patch

Clearing flags on attachment: 333065

Committed r228092: <https://trac.webkit.org/changeset/228092>
Comment 20 WebKit Commit Bot 2018-02-05 02:25:04 PST
All reviewed patches have been landed.  Closing bug.
Comment 21 Radar WebKit Bug Importer 2018-02-05 02:26:49 PST
<rdar://problem/37230157>
Comment 22 Ross Kirsling 2018-02-06 10:25:17 PST
This patch is missing an #if ENABLE(VIDEO) guard. I've submitted a fix here:
https://bugs.webkit.org/show_bug.cgi?id=182539