Skip to content

Commit 507f349

Browse files
committed
LibWeb/HTML: Update resource fetch algorithm to match current spec
Changes from whatwg/html#10792 No code changes, only comments.
1 parent 82c489f commit 507f349

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

Libraries/LibWeb/HTML/HTMLMediaElement.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -936,17 +936,20 @@ WebIDL::ExceptionOr<void> HTMLMediaElement::fetch_resource(URL::URL const& url_r
936936
auto& realm = this->realm();
937937
auto& vm = realm.vm();
938938

939-
// 1. If the algorithm was invoked with media provider object or a URL record whose blob URL entry is a blob URL entry whose object is a media provider
940-
// object, then let mode be local. Otherwise let mode be remote.
941-
// FIXME: Detect media provider object / blob URLs with a media provider object.
939+
// 1. Let mode be remote.
942940
auto mode = FetchMode::Remote;
943941

944-
// FIXME: 2. If mode is remote, then let the current media resource be the resource given by the URL record passed to this algorithm; otherwise, let the
942+
// FIXME: 2. If the algorithm was invoked with media provider object, then set mode to local.
943+
// Otherwise:
944+
// 1. Let object be the result of obtaining a blob object using the URL record's blob URL entry and the media
945+
// element's node document's relevant settings object.
946+
// 2. If object is a media provider object, then set mode to local.
947+
// FIXME: 3. If mode is remote, then let the current media resource be the resource given by the URL record passed to this algorithm; otherwise, let the
945948
// current media resource be the resource given by the media provider object. Either way, the current media resource is now the element's media
946949
// resource.
947-
// FIXME: 3. Remove all media-resource-specific text tracks from the media element's list of pending text tracks, if any.
950+
// FIXME: 4. Remove all media-resource-specific text tracks from the media element's list of pending text tracks, if any.
948951

949-
// 4. Run the appropriate steps from the following list:
952+
// 5. Run the appropriate steps from the following list:
950953
switch (mode) {
951954
// -> If mode is remote
952955
case FetchMode::Remote: {
@@ -1042,7 +1045,7 @@ WebIDL::ExceptionOr<void> HTMLMediaElement::fetch_resource(URL::URL const& url_r
10421045
// 5. Otherwise, incrementally read response's body given updateMedia, processEndOfMedia, an empty algorithm, and global.
10431046

10441047
VERIFY(response->body());
1045-
auto empty_algorithm = GC::create_function(heap(), [](JS::Value) {});
1048+
auto empty_algorithm = GC::create_function(heap(), [](JS::Value) { });
10461049

10471050
// FIXME: We are "fully" reading the response here, rather than "incrementally". Memory concerns aside, this should be okay for now as we are
10481051
// always setting byteRange to "entire resource". However, we should switch to incremental reads when that is implemented, and then

0 commit comments

Comments
 (0)