Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement Audio constructor #21929
Implement Audio constructor #21929
Comments
|
Hi! If you have any questions regarding this issue, feel free to make a comment here, or ask it in the If you intend to work on this issue, then add |
|
Hey @HrushikeshBodas! Thanks for your interest in working on this issue. It's now assigned to you! |
|
@HrushikeshBodas There's a similar named constructor for HTMLImageElement, so you can use that as a guide - is the webidl, andservo/components/script/dom/htmlimageelement.rs Lines 1234 to 1248 in 819212e |
|
There was a question on IRC about calling setting the media element's src from this new constructor. You will need to import the HTMLMediaElementMethods trait in order to call the |
Implement Audio constructor <!-- Please describe your changes on the following line: --> Implement Audio constructor --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #21929 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because *tests were already there and the expectations were updated*. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22227) <!-- Reviewable:end -->
Spec:
https://html.spec.whatwg.org/multipage/media.html#the-audio-element (see NamedConstructor usage in WebIDL)
https://html.spec.whatwg.org/multipage/media.html#dom-audio
Code:
components/script/dom/webidls/HTMLAudioElement.webidl,components/script/dom/htmlaudioelement.rsTests:
./mach test-wpt https://github.com/servo/servo/tree/master/tests/wpt/web-platform-tests/html/semantics/embedded-content/the-audio-element./mach test-wpt tests/wpt/web-platform-tests/html/semantics/embedded-content/media-elements./mach test-wpt tests/wpt/web-platform-tests/html/dom/interfaces.https.htmlNow that we support actual audio output, we should implement the missing constructor that is used by many websites to create an HTMLAudioElement.