Changeset 279978 in webkit
- Timestamp:
- Jul 15, 2021 11:15:47 PM (12 months ago)
- Location:
- trunk
- Files:
-
- 8 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt (modified) (2 diffs)
-
LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt (modified) (2 diffs)
-
LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt (modified) (2 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/html/HTMLMediaElement.cpp (modified) (4 diffs)
-
Source/WebCore/html/MediaError.h (modified) (1 diff)
-
Source/WebCore/html/MediaError.idl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r279973 r279978 1 2021-07-15 Chris Dumez <cdumez@apple.com> 2 3 Add support for MediaError.message 4 https://bugs.webkit.org/show_bug.cgi?id=228008 5 6 Reviewed by Alex Christensen. 7 8 Rebaseline WPT test now that more checks are passing. 9 10 * platform/mac-wk1/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt: 11 * platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt: 12 1 13 2021-07-15 Jean-Yves Avenard <jya@apple.com> 2 14 -
trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt
r279971 r279978 1399 1399 PASS MediaError interface: constant MEDIA_ERR_SRC_NOT_SUPPORTED on interface prototype object 1400 1400 PASS MediaError interface: attribute code 1401 FAIL MediaError interface: attribute message assert_true: The prototype object must have a property "message" expected true got false1401 PASS MediaError interface: attribute message 1402 1402 PASS MediaError must be primary interface of errorVideo.error 1403 1403 PASS Stringification of errorVideo.error … … 1407 1407 PASS MediaError interface: errorVideo.error must inherit property "MEDIA_ERR_SRC_NOT_SUPPORTED" with the proper type 1408 1408 PASS MediaError interface: errorVideo.error must inherit property "code" with the proper type 1409 FAIL MediaError interface: errorVideo.error must inherit property "message" with the proper type assert_inherits: property "message" not found in prototype chain 1409 PASS MediaError interface: errorVideo.error must inherit property "message" with the proper type 1410 1410 PASS AudioTrackList interface: existence and properties of interface object 1411 1411 PASS AudioTrackList interface object length -
trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt
r279971 r279978 1399 1399 PASS MediaError interface: constant MEDIA_ERR_SRC_NOT_SUPPORTED on interface prototype object 1400 1400 PASS MediaError interface: attribute code 1401 FAIL MediaError interface: attribute message assert_true: The prototype object must have a property "message" expected true got false1401 PASS MediaError interface: attribute message 1402 1402 PASS MediaError must be primary interface of errorVideo.error 1403 1403 PASS Stringification of errorVideo.error … … 1407 1407 PASS MediaError interface: errorVideo.error must inherit property "MEDIA_ERR_SRC_NOT_SUPPORTED" with the proper type 1408 1408 PASS MediaError interface: errorVideo.error must inherit property "code" with the proper type 1409 FAIL MediaError interface: errorVideo.error must inherit property "message" with the proper type assert_inherits: property "message" not found in prototype chain 1409 PASS MediaError interface: errorVideo.error must inherit property "message" with the proper type 1410 1410 PASS AudioTrackList interface: existence and properties of interface object 1411 1411 PASS AudioTrackList interface object length -
trunk/LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt
r279971 r279978 1399 1399 PASS MediaError interface: constant MEDIA_ERR_SRC_NOT_SUPPORTED on interface prototype object 1400 1400 PASS MediaError interface: attribute code 1401 FAIL MediaError interface: attribute message assert_true: The prototype object must have a property "message" expected true got false1401 PASS MediaError interface: attribute message 1402 1402 PASS MediaError must be primary interface of errorVideo.error 1403 1403 PASS Stringification of errorVideo.error … … 1407 1407 PASS MediaError interface: errorVideo.error must inherit property "MEDIA_ERR_SRC_NOT_SUPPORTED" with the proper type 1408 1408 PASS MediaError interface: errorVideo.error must inherit property "code" with the proper type 1409 FAIL MediaError interface: errorVideo.error must inherit property "message" with the proper type assert_inherits: property "message" not found in prototype chain 1409 PASS MediaError interface: errorVideo.error must inherit property "message" with the proper type 1410 1410 PASS AudioTrackList interface: existence and properties of interface object 1411 1411 PASS AudioTrackList interface object length -
trunk/Source/WebCore/ChangeLog
r279974 r279978 1 2021-07-15 Chris Dumez <cdumez@apple.com> 2 3 Add support for MediaError.message 4 https://bugs.webkit.org/show_bug.cgi?id=228008 5 6 Reviewed by Alex Christensen. 7 8 Add support for MediaError.message: 9 - https://html.spec.whatwg.org/multipage/media.html#mediaerror 10 11 Both Chrome and Firefox already support this. 12 13 No new tests, rebaselined existing test. 14 15 * html/HTMLMediaElement.cpp: 16 (WebCore::HTMLMediaElement::noneSupported): 17 (WebCore::HTMLMediaElement::mediaLoadingFailedFatally): 18 (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded): 19 (WebCore::HTMLMediaElement::userCancelledLoad): 20 * html/MediaError.h: 21 (WebCore::MediaError::create): 22 (WebCore::MediaError::message const): 23 (WebCore::MediaError::MediaError): 24 * html/MediaError.idl: 25 1 26 2021-07-15 Jean-Yves Avenard <jya@apple.com> 2 27 -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r279914 r279978 2070 2070 // 6.1 - Set the error attribute to a new MediaError object whose code attribute is set to 2071 2071 // MEDIA_ERR_SRC_NOT_SUPPORTED. 2072 m_error = MediaError::create(MediaError::MEDIA_ERR_SRC_NOT_SUPPORTED );2072 m_error = MediaError::create(MediaError::MEDIA_ERR_SRC_NOT_SUPPORTED, "Unsupported source type"_s); 2073 2073 2074 2074 // 6.2 - Forget the media element's media-resource-specific text tracks. … … 2111 2111 // set to MEDIA_ERR_NETWORK/MEDIA_ERR_DECODE. 2112 2112 if (error == MediaPlayer::NetworkState::NetworkError) 2113 m_error = MediaError::create(MediaError::MEDIA_ERR_NETWORK );2113 m_error = MediaError::create(MediaError::MEDIA_ERR_NETWORK, "Media failed to load"_s); 2114 2114 else if (error == MediaPlayer::NetworkState::DecodeError) 2115 m_error = MediaError::create(MediaError::MEDIA_ERR_DECODE );2115 m_error = MediaError::create(MediaError::MEDIA_ERR_DECODE, "Media failed to decode"_s); 2116 2116 else 2117 2117 ASSERT_NOT_REACHED(); … … 2495 2495 #endif 2496 2496 ) { 2497 m_error = MediaError::create(MediaError::MEDIA_ERR_ENCRYPTED );2497 m_error = MediaError::create(MediaError::MEDIA_ERR_ENCRYPTED, "Media is encrypted"_s); 2498 2498 scheduleEvent(eventNames().errorEvent); 2499 2499 return; … … 5526 5526 5527 5527 // 2 - Set the error attribute to a new MediaError object whose code attribute is set to MEDIA_ERR_ABORTED. 5528 m_error = MediaError::create(MediaError::MEDIA_ERR_ABORTED );5528 m_error = MediaError::create(MediaError::MEDIA_ERR_ABORTED, "Load was aborted"_s); 5529 5529 5530 5530 // 3 - Queue a task to fire a simple event named error at the media element. -
trunk/Source/WebCore/html/MediaError.h
r208179 r279978 44 44 }; 45 45 46 static Ref<MediaError> create(Code code) { return adoptRef(*new MediaError(code)); } 46 static Ref<MediaError> create(Code code, String&& message) 47 { 48 return adoptRef(*new MediaError(code, WTFMove(message))); 49 } 47 50 48 51 Code code() const { return m_code; } 52 const String& message() const { return m_message; } 49 53 50 54 private: 51 MediaError(Code code) : m_code(code) { } 55 MediaError(Code code, String&& message) 56 : m_code(code) 57 , m_message(WTFMove(message)) 58 { } 52 59 53 60 Code m_code; 61 String m_message; 54 62 }; 55 63 -
trunk/Source/WebCore/html/MediaError.idl
r267813 r279978 35 35 [Conditional=LEGACY_ENCRYPTED_MEDIA] const unsigned short MEDIA_ERR_ENCRYPTED = 5; 36 36 readonly attribute unsigned short code; 37 readonly attribute DOMString message; 37 38 };
Note: See TracChangeset
for help on using the changeset viewer.