Repository navigation
script: Reject AudioContext promises when the document is not fully active. - #46611
amittenak47 wants to merge 9 commits into
Conversation
|
@amittenak47 Have you used generative AI (such as Codex or Claude Code) to write this PR or PR description? |
I referenced the guide here https://book.servo.org/contributing/making-a-pull-request.html#title-and-description but only to format my post description. When i made the PR, my commit message and the default template mixed, so I just tried to re-format the PR |
aaabeae to
8c13033
Compare
|
You can also update the Testing section of the pull request description to read "Testing: New passing WPT tests." |
2f1a59f to
fb04493
Compare
|
Replaced
Following @jdm feedback, updated
Reference identical optimizations from Gecko+SM (and Blink, somewhat):
Testing |
jdm
left a comment
There was a problem hiding this comment.
Thank you! This is great work, and I appreciate the effort to clean up the javascript URL evaluation.
a49fba0 to
74c3d39
Compare
…ctive. Reject decodeAudioData, resume, suspend, and close with a promise rejected with InvalidStateError when the associated Document is not fully active, matching the Web Audio API. Update Document::is_fully_active so a discarded browsing context (for example after iframe removal) is treated as not fully active. Without that, the activity flag can still report FullyActive and the new checks never run, leaving those promises pending until the tests time out. Fixes servo#46600. Signed-off-by: Amit Anilkumar <aanilkumar30@gatech.edu>
…entation of is_fully_active Signed-off-by: Amit Anilkumar <aanilkumar30@gatech.edu>
…hecks. Signed-off-by: Amit Anilkumar <aanilkumar30@gatech.edu>
…js_on_global cannot run script. Signed-off-by: Amit Anilkumar <aanilkumar30@gatech.edu>
…ript assert Signed-off-by: Amit Anilkumar <aanilkumar30@gatech.edu>
Use CompletionValue::Discarded/Needed instead of bare no_script_rval bool. Store on ClassicScript and debug_assert when rval is passed at run time. Signed-off-by: Amit Anilkumar <aanilkumar30@gatech.edu>
Signed-off-by: Amit Anilkumar <aanilkumar30@gatech.edu>
Signed-off-by: Amit Anilkumar <aanilkumar30@gatech.edu>
Co-authored-by: Josh Matthews <josh@joshmatthews.net> Signed-off-by: amittenak47 <55721729+amittenak47@users.noreply.github.com>
78ce3e5 to
3f93bf1
Compare
Draft. Blocked on #47486.
After #47486 lands I will rebase this onto
mainand drop the overlapping work:javascript:URL evaluation via create/run classic script (CompletionValue,eval_js_url) — covered by script: More faithfully implement "evaluate a JavaScript URL" #47486Document::is_fully_activerequiring a browsing context, plus the history/XHR expectation updates that came with it — already in script: Do not considerDocuments without browsing contexts to be active #47485What remains here is the original Web Audio change.
Changes
Reject
decodeAudioData,resume,suspend, andclosewith a promise rejected withInvalidStateErrorwhen the Document is not fully active, matching the Web Audio API.Testing
New passing WPT tests.
Are there already automated tests that cover the code that is being changed?
Yes. The WPT check the existence of a detached iframe and discarded browsing context.
If not, does this pull request include new automated tests?
N/A; the existing tests cover the changes.
If not, what prevents adding at least one new test?
N/A; Tests already exist.
Fixes #46600.
see WebAudio/web-audio-api#2176