dom: should change media element's currentSrc to children source element's src in resource selection algorithm. (#36408)

Set the `htmlmediaelement`'s `currenSrc` in
resource-selection-algorithm.
Change the `htmlsourceelement`'s src and srcset to USVString type.

According to
[Spec](https://html.spec.whatwg.org/multipage/media.html#concept-media-load-algorithm),
Step 9.3 for mode is children, should set the `currentSrc` to `src` of
children `htmlsourceelement`.
Also, In the `htmlsourceelement` [interface
definition](https://html.spec.whatwg.org/multipage/embedded-content.html#the-source-element),
the `src` and `srcset` attribute should be type `USVString`.

Testing: More WPT tests related to resource selection algorithm are
passing.
Fix: Some spec fix

[Try](1434753561)
cc @xiaochengh

Signed-off-by: rayguo17 <rayguo17@gmail.com>
This commit is contained in:
TIN TUN AUNG 2025-04-11 14:32:34 +08:00 committed by GitHub
parent c8ecb57d97
commit 972ca77ce1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 22 additions and 45 deletions

View file

@ -8,8 +8,5 @@
[The 'src' attribute of the 'embed' element]
expected: FAIL
[The 'src' attribute of the 'source' element]
expected: FAIL
[The 'data' attribute of the 'object' element]
expected: FAIL

View file

@ -8,8 +8,5 @@
[The 'src' attribute of the 'embed' element]
expected: FAIL
[The 'src' attribute of the 'source' element]
expected: FAIL
[The 'data' attribute of the 'object' element]
expected: FAIL

View file

@ -1,4 +0,0 @@
[resource-selection-candidate-insert-before.html]
[inserting another source before the candidate]
expected: FAIL

View file

@ -1,19 +0,0 @@
[currentSrc.html]
[audio.currentSrc after adding source element with src attribute " "]
expected: FAIL
[video.currentSrc after adding source element with src attribute "."]
expected: FAIL
[video.currentSrc after adding source element with src attribute "data:,"]
expected: FAIL
[audio.currentSrc after adding source element with src attribute "."]
expected: FAIL
[audio.currentSrc after adding source element with src attribute "data:,"]
expected: FAIL
[video.currentSrc after adding source element with src attribute " "]
expected: FAIL