RESOLVED FIXED 174573
Video errors should be instances of Error
https://bugs.webkit.org/show_bug.cgi?id=174573
Summary Video errors should be instances of Error
Andrew Morris
Reported 2017-07-16 18:14:43 PDT
jsbin: http://output.jsbin.com/jewolar Output: error instanceof Error: false Expected output: error instanceof Error: true
Attachments
WIP Patch (3.24 KB, patch)
2017-09-19 16:49 PDT, Chris Dumez
no flags
Archive of layout-test-results from ews102 for mac-elcapitan (1.56 MB, application/zip)
2017-09-19 17:57 PDT, Build Bot
no flags
Archive of layout-test-results from ews123 for ios-simulator-wk2 (1.40 MB, application/zip)
2017-09-19 18:09 PDT, Build Bot
no flags
Archive of layout-test-results from ews106 for mac-elcapitan-wk2 (1.83 MB, application/zip)
2017-09-19 18:36 PDT, Build Bot
no flags
Archive of layout-test-results from ews114 for mac-elcapitan (2.33 MB, application/zip)
2017-09-19 18:43 PDT, Build Bot
no flags
Patch (11.66 KB, patch)
2017-09-20 09:09 PDT, Chris Dumez
no flags
Patch (12.37 KB, patch)
2017-09-20 10:08 PDT, Chris Dumez
no flags
Jon Lee
Comment 1 2017-07-31 11:32:02 PDT
It reports two different errors. On first load on Safari 11 on High Sierra the result is false, then true when I reload. The error on load is "AbortError". Subsequently it is a "NotAllowedError". Repro steps: 1. Set a break point on line 35 on the webpage source ahead of time. 2. Open a new tab. 3. Go to any website (google.com) 4. Open the web inspector. 5. Load the webpage and notice the AbortError. 6. Continue. Reload the page. 7. Notice the NotAllowedError.
Radar WebKit Bug Importer
Comment 2 2017-09-14 15:53:32 PDT
Chris Dumez
Comment 3 2017-09-19 10:18:53 PDT
DOMException correctly inherits from EcmaScript's Error. So it could be that media code is not using DOMException in some places (maybe its own kind of exception)?
Chris Dumez
Comment 4 2017-09-19 10:20:54 PDT
In particular, the following interface looks interesting: interface MediaError; Because it is an IDL interface and not an IDL exception, it likely does not inherit from Error.
Chris Dumez
Comment 5 2017-09-19 10:22:05 PDT
(In reply to Chris Dumez from comment #4) > In particular, the following interface looks interesting: > interface MediaError; > > Because it is an IDL interface and not an IDL exception, it likely does not > inherit from Error. We match the spec though: https://html.spec.whatwg.org/multipage/media.html#error-codes So maybe it is not supposed to inherit Error?
Chris Dumez
Comment 6 2017-09-19 10:24:20 PDT
Displaying more information about the error, we see that it is a: DOMError {name: "AbortError", message: "The operation was aborted."} not a DOMException, nor a MediaError.
Chris Dumez
Comment 7 2017-09-19 10:27:25 PDT
DOMError does not exist in the specification anymore and we are supposed to use Error nowadays: https://heycam.github.io/webidl/#es-Error I think the right fix is to drop DOMError and use JS's Error directly instead.
Chris Dumez
Comment 8 2017-09-19 10:29:37 PDT
Media code relies on DOMError here in HTMLMediaElement.h: void rejectPendingPlayPromises(DOMError&);
Chris Dumez
Comment 10 2017-09-19 16:49:28 PDT
Created attachment 321266 [details] WIP Patch
Chris Dumez
Comment 11 2017-09-19 16:49:55 PDT
(In reply to Chris Dumez from comment #10) > Created attachment 321266 [details] > WIP Patch Patch should work but needs layout test coverage.
Build Bot
Comment 12 2017-09-19 17:57:26 PDT
Comment on attachment 321266 [details] WIP Patch Attachment 321266 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/4598896 New failing tests: imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/paused_true_during_pause.html imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/event_play_noautoplay.html imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/event_pause_noautoplay.html http/tests/security/video-cross-origin-caching.html
Build Bot
Comment 13 2017-09-19 17:57:27 PDT
Created attachment 321270 [details] Archive of layout-test-results from ews102 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews102 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Build Bot
Comment 14 2017-09-19 18:09:18 PDT
Comment on attachment 321266 [details] WIP Patch Attachment 321266 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/4598770 New failing tests: http/tests/security/video-cross-origin-caching.html
Build Bot
Comment 15 2017-09-19 18:09:20 PDT
Created attachment 321271 [details] Archive of layout-test-results from ews123 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews123 Port: ios-simulator-wk2 Platform: Mac OS X 10.12.5
Build Bot
Comment 16 2017-09-19 18:36:37 PDT
Comment on attachment 321266 [details] WIP Patch Attachment 321266 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/4599114 New failing tests: http/tests/security/video-cross-origin-caching.html imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/paused_true_during_pause.html imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/event_play_noautoplay.html imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/event_pause_noautoplay.html fast/mediastream/MediaStream-MediaElement-setObject-null.html
Build Bot
Comment 17 2017-09-19 18:36:38 PDT
Created attachment 321272 [details] Archive of layout-test-results from ews106 for mac-elcapitan-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews106 Port: mac-elcapitan-wk2 Platform: Mac OS X 10.11.6
Build Bot
Comment 18 2017-09-19 18:43:37 PDT
Comment on attachment 321266 [details] WIP Patch Attachment 321266 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/4599109 New failing tests: imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/paused_true_during_pause.html imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/event_play_noautoplay.html imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/event_pause_noautoplay.html http/tests/security/video-cross-origin-caching.html
Build Bot
Comment 19 2017-09-19 18:43:38 PDT
Created attachment 321275 [details] Archive of layout-test-results from ews114 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews114 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Chris Dumez
Comment 20 2017-09-20 09:09:34 PDT
youenn fablet
Comment 21 2017-09-20 09:59:55 PDT
Comment on attachment 321322 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=321322&action=review > Source/WebCore/html/HTMLMediaElement.cpp:1045 > + promise.rejectType<IDLInterface<DOMException>>(error); If that is a pattern that will happen often, maybe we should be able to write it as promise.reject(error) or promise.rejectAsException(error)?
Chris Dumez
Comment 22 2017-09-20 10:08:23 PDT
WebKit Commit Bot
Comment 23 2017-09-20 10:38:31 PDT
Comment on attachment 321327 [details] Patch Clearing flags on attachment: 321327 Committed r222270: <http://trac.webkit.org/changeset/222270>
WebKit Commit Bot
Comment 24 2017-09-20 10:38:33 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.