Skip to content

Commit

Permalink
Sync 'VideoPlaybackQuality.idl' with web specification and add partia…
Browse files Browse the repository at this point in the history
…l interface to 'HTMLVideoElement.idl'

https://bugs.webkit.org/show_bug.cgi?id=125474
rdar://problem/99826631

Reviewed by Eric Carlson.

This patch aligns WebKit with Web Specification [1] & [2].

[1] https://w3c.github.io/media-playback-quality/#videoplaybackquality-interface
[2] https://w3c.github.io/media-playback-quality/#extension-to-the-htmlvideoelement-interface

In this PR, we removed 'FIXME' about 'LegacyNoInterfaceObject' as well as implementation
and also added missing 'Exposed=Window'. Additionally, we updated 'HTMLVideoElement.idl'
to have partial interface for 'getVideoPlaybackQuality'.

Additionally, we synced WPT tests from upstream:

Upstream Hash: 9f24a7061dc47c00ffe3f0f6dda5822a9b15c2a5

* Source/WebCore/Modules/mediasource/VideoPlaybackQuality.idl:
* Source/WebCore/html/HTMLVideoElement.idl:
* LayoutTests/imported/w3c/resources/import-expectations.json:
* LayoutTests/imported/w3c/web-platform-tests/media-playback-quality/w3c-import.log:
* LayoutTests/imported/w3c/web-platform-tests/media-playback-quality/META.yml:
* LayoutTests/imported/w3c/web-platform-tests/media-playback-quality/idlharness.window.js:
* LayoutTests/imported/w3c/web-platform-tests/media-playback-quality/idlharness.window.html:
* LayoutTests/imported/w3c/web-platform-tests/media-playback-quality/idlharness.window-expected.txt:

Canonical link: https://commits.webkit.org/269893@main
  • Loading branch information
Ahmad-S792 authored and Ahmad Saleem committed Oct 28, 2023
1 parent 6c8a22c commit b5ffcfb
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@
"web-platform-tests/mathml": "import",
"web-platform-tests/media": "import",
"web-platform-tests/media-capabilities": "import",
"web-platform-tests/media-playback-quality": "import",
"web-platform-tests/media-source": "import",
"web-platform-tests/mediacapture-image": "skip",
"web-platform-tests/mediacapture-record": "import",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
spec: https://w3c.github.io/media-playback-quality/
suggested_reviewers:
- mounirlamouri
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

PASS idl_test setup
PASS idl_test validation
PASS Partial interface HTMLVideoElement: original interface defined
PASS Partial interface HTMLVideoElement: member names are unique
PASS HTMLElement includes GlobalEventHandlers: member names are unique
PASS HTMLElement includes DocumentAndElementEventHandlers: member names are unique
PASS HTMLElement includes ElementContentEditable: member names are unique
PASS HTMLElement includes HTMLOrSVGElement: member names are unique
PASS Element includes ParentNode: member names are unique
PASS Element includes NonDocumentTypeChildNode: member names are unique
PASS Element includes ChildNode: member names are unique
PASS Element includes Slottable: member names are unique
PASS VideoPlaybackQuality interface: existence and properties of interface object
PASS VideoPlaybackQuality interface object length
PASS VideoPlaybackQuality interface object name
PASS VideoPlaybackQuality interface: existence and properties of interface prototype object
PASS VideoPlaybackQuality interface: existence and properties of interface prototype object's "constructor" property
PASS VideoPlaybackQuality interface: existence and properties of interface prototype object's @@unscopables property
PASS VideoPlaybackQuality interface: attribute creationTime
PASS VideoPlaybackQuality interface: attribute droppedVideoFrames
PASS VideoPlaybackQuality interface: attribute totalVideoFrames
PASS VideoPlaybackQuality interface: attribute corruptedVideoFrames
PASS VideoPlaybackQuality must be primary interface of videoPlaybackQuality
PASS Stringification of videoPlaybackQuality
PASS VideoPlaybackQuality interface: videoPlaybackQuality must inherit property "creationTime" with the proper type
PASS VideoPlaybackQuality interface: videoPlaybackQuality must inherit property "droppedVideoFrames" with the proper type
PASS VideoPlaybackQuality interface: videoPlaybackQuality must inherit property "totalVideoFrames" with the proper type
PASS VideoPlaybackQuality interface: videoPlaybackQuality must inherit property "corruptedVideoFrames" with the proper type
PASS HTMLVideoElement interface: operation getVideoPlaybackQuality()
PASS HTMLVideoElement interface: video must inherit property "getVideoPlaybackQuality()" with the proper type

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- This file is required for WebKit test infrastructure to run the templated test -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// META: script=/resources/WebIDLParser.js
// META: script=/resources/idlharness.js

// https://w3c.github.io/media-playback-quality/

'use strict';

idl_test(
['media-playback-quality'],
['html', 'dom'],
idl_array => {
idl_array.add_objects({
HTMLVideoElement: ['video'],
VideoPlaybackQuality: ['videoPlaybackQuality']
});

self.video = document.createElement('video');
self.videoPlaybackQuality = video.getVideoPlaybackQuality();
}
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
The tests in this directory were imported from the W3C repository.
Do NOT modify these tests directly in WebKit.
Instead, create a pull request on the WPT github:
https://github.com/web-platform-tests/wpt

Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport

Do NOT modify or remove this file.

------------------------------------------------------------------------
Properties requiring vendor prefixes:
None
Property values requiring vendor prefixes:
None
------------------------------------------------------------------------
List of files:
/LayoutTests/imported/w3c/web-platform-tests/media-playback-quality/META.yml
/LayoutTests/imported/w3c/web-platform-tests/media-playback-quality/idlharness.window.js
17 changes: 11 additions & 6 deletions Source/WebCore/Modules/mediasource/VideoPlaybackQuality.idl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
* Copyright (C) 2013-2023 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand All @@ -23,16 +23,21 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/

// https://w3c.github.io/media-playback-quality/#idl-def-videoplaybackquality
// FIXME: This is not specified as "LegacyNoInterfaceObject". It should have an interface object.
// https://w3c.github.io/media-playback-quality/#videoplaybackquality-interface

typedef double DOMHighResTimeStamp;

[
Conditional=VIDEO,
LegacyNoInterfaceObject,
Exposed=Window
] interface VideoPlaybackQuality {
readonly attribute unrestricted double creationTime;
readonly attribute unsigned long totalVideoFrames;
readonly attribute DOMHighResTimeStamp creationTime;
readonly attribute unsigned long droppedVideoFrames;
readonly attribute unsigned long totalVideoFrames;

// Deprecated!
readonly attribute unsigned long corruptedVideoFrames;

[EnabledBySetting=videoQualityIncludesDisplayCompositingEnabled] readonly attribute unsigned long displayCompositedVideoFrames;
readonly attribute unrestricted double totalFrameDelay;
};
3 changes: 3 additions & 0 deletions Source/WebCore/html/HTMLVideoElement.idl
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@
// The number of decoded frames that have been dropped by the player for performance reasons during playback.
[Conditional=MEDIA_STATISTICS] readonly attribute unsigned long webkitDroppedFrameCount;

// https://w3c.github.io/media-playback-quality/#extension-to-the-htmlvideoelement-interface
VideoPlaybackQuality getVideoPlaybackQuality();

[Conditional=VIDEO_PRESENTATION_MODE, EnabledBySetting=VideoPresentationModeAPIEnabled] boolean webkitSupportsPresentationMode(VideoPresentationMode mode);
[Conditional=VIDEO_PRESENTATION_MODE, EnabledBySetting=VideoPresentationModeAPIEnabled] readonly attribute VideoPresentationMode webkitPresentationMode;
[Conditional=VIDEO_PRESENTATION_MODE, EnabledBySetting=VideoPresentationModeAPIEnabled] undefined webkitSetPresentationMode(VideoPresentationMode mode);
Expand Down

0 comments on commit b5ffcfb

Please sign in to comment.