LibWeb: Don't expose XMLHttpRequest.responseXML in workers

This commit is contained in:
Tim Ledbetter 2025-06-30 23:29:30 +01:00 committed by Jelle Raaijmakers
commit 7724a96efa
Notes: github-actions[bot] 2025-06-30 23:05:26 +00:00
4 changed files with 19 additions and 1 deletions

View file

@ -50,6 +50,6 @@ interface XMLHttpRequest : XMLHttpRequestEventTarget {
attribute XMLHttpRequestResponseType responseType;
readonly attribute any response;
readonly attribute DOMString responseText;
readonly attribute Document? responseXML;
[Exposed=Window] readonly attribute Document? responseXML;
};

View file

@ -0,0 +1,12 @@
<!DOCTYPE html>
<script src="../include.js"></script>
<script>
asyncTest(done => {
let work = new Worker("XHttpRequest-responseXML-unavailable-in-worker.js");
work.onmessage = (evt) => {
println(evt.data);
done();
};
work.postMessage("")
});
</script>

View file

@ -0,0 +1,5 @@
self.onmessage = function () {
let xhr = new XMLHttpRequest();
postMessage(xhr.responseXML === undefined ? "PASS" : "FAIL");
self.close();
};