Loading dom/base/Document.h +9 −0 Original line number Diff line number Diff line Loading @@ -4859,6 +4859,15 @@ class Document : public nsINode, uint32_t mLazyLoadImageReachViewportLoaded; uint32_t mContentEditableCount; /** * Count of the number of active LockRequest objects, including ones from * workers. Note that the value won't be updated while the document is being * destroyed. * * TODO(krosylight): We may want to move this to window object instead, but * it's not clear whether the spec relates locks to the window/agent or the * document. See also https://github.com/WICG/web-locks/issues/95. */ uint32_t mLockCount = 0; EditingState mEditingState; Loading dom/locks/LockRequestChild.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -54,8 +54,12 @@ LockRequestChild::LockRequestChild( } void LockRequestChild::ActorDestroy(ActorDestroyReason aReason) { if (aReason != ActorDestroyReason::AncestorDeletion) { // Ping the manager if it's still alive, otherwise we don't have to as the // document is being destroyed CastedManager()->NotifyRequestDestroy(); } } IPCResult LockRequestChild::RecvResolve(const LockMode& aLockMode, bool aIsAvailable) { Loading testing/web-platform/tests/web-locks/crashtests/iframe-append.https.html 0 → 100644 +22 −0 Original line number Diff line number Diff line <!DOCTYPE html> <html class="test-wait"> <meta charset="utf-8"> <iframe id="id_0"></iframe> <script> /** @param {HTMLIFrameElement} iframe */ function waitForLoad(iframe) { // iframe is initialized immediately on Chrome while it needs some time on Firefox if (iframe.contentDocument.readyState === "complete") { return; } return new Promise(r => iframe.onload = r); } const iframe = document.getElementById("id_0"); iframe.contentWindow.navigator.locks.request("weblock_0", async () => { await waitForLoad(iframe); document.body.append(iframe); await waitForLoad(iframe); document.documentElement.classList.remove("test-wait"); }); </script> Loading
dom/base/Document.h +9 −0 Original line number Diff line number Diff line Loading @@ -4859,6 +4859,15 @@ class Document : public nsINode, uint32_t mLazyLoadImageReachViewportLoaded; uint32_t mContentEditableCount; /** * Count of the number of active LockRequest objects, including ones from * workers. Note that the value won't be updated while the document is being * destroyed. * * TODO(krosylight): We may want to move this to window object instead, but * it's not clear whether the spec relates locks to the window/agent or the * document. See also https://github.com/WICG/web-locks/issues/95. */ uint32_t mLockCount = 0; EditingState mEditingState; Loading
dom/locks/LockRequestChild.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -54,8 +54,12 @@ LockRequestChild::LockRequestChild( } void LockRequestChild::ActorDestroy(ActorDestroyReason aReason) { if (aReason != ActorDestroyReason::AncestorDeletion) { // Ping the manager if it's still alive, otherwise we don't have to as the // document is being destroyed CastedManager()->NotifyRequestDestroy(); } } IPCResult LockRequestChild::RecvResolve(const LockMode& aLockMode, bool aIsAvailable) { Loading
testing/web-platform/tests/web-locks/crashtests/iframe-append.https.html 0 → 100644 +22 −0 Original line number Diff line number Diff line <!DOCTYPE html> <html class="test-wait"> <meta charset="utf-8"> <iframe id="id_0"></iframe> <script> /** @param {HTMLIFrameElement} iframe */ function waitForLoad(iframe) { // iframe is initialized immediately on Chrome while it needs some time on Firefox if (iframe.contentDocument.readyState === "complete") { return; } return new Promise(r => iframe.onload = r); } const iframe = document.getElementById("id_0"); iframe.contentWindow.navigator.locks.request("weblock_0", async () => { await waitForLoad(iframe); document.body.append(iframe); await waitForLoad(iframe); document.documentElement.classList.remove("test-wait"); }); </script>