mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 06:43:32 +00:00
Bug 1917654, pass some reasonable object as the owner to Event's constructor, r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D221640
This commit is contained in:
parent
4bd881078b
commit
5145c88e01
17
dom/events/crashtests/1917654.html
Normal file
17
dom/events/crashtests/1917654.html
Normal file
@ -0,0 +1,17 @@
|
||||
<script id="worker" type="javascript/worker">
|
||||
(() => {
|
||||
const func_0 = (e) => {
|
||||
e.returnValue = false
|
||||
}
|
||||
self.addEventListener("error", func_0, {"passive": true})
|
||||
const ref = new WeakRef(self)
|
||||
self.reportError(ref)
|
||||
})()
|
||||
</script>
|
||||
<script>
|
||||
window.addEventListener("DOMContentLoaded", () => {
|
||||
const blob = new Blob([document.querySelector('#worker').textContent], { type: "text/javascript" })
|
||||
const sw = new SharedWorker(window.URL.createObjectURL(blob))
|
||||
sw.port.postMessage([], [])
|
||||
})
|
||||
</script>
|
@ -17,3 +17,4 @@ load recursive-DOMNodeInserted.html
|
||||
load recursive-onload.html
|
||||
load 1397711.html
|
||||
load 1856737.html
|
||||
load 1917654.html
|
||||
|
@ -323,8 +323,8 @@ void WorkerErrorReport::ReportError(
|
||||
|
||||
MOZ_ASSERT(globalScope->GetWrapperPreserveColor() == global);
|
||||
|
||||
RefPtr<ErrorEvent> event =
|
||||
ErrorEvent::Constructor(aTarget, u"error"_ns, init);
|
||||
RefPtr<ErrorEvent> event = ErrorEvent::Constructor(
|
||||
aTarget ? aTarget : globalScope, u"error"_ns, init);
|
||||
event->SetTrusted(true);
|
||||
|
||||
if (NS_FAILED(EventDispatcher::DispatchDOMEvent(
|
||||
|
Loading…
Reference in New Issue
Block a user