WebKit Bugzilla
Attachment 357842 Details for
Bug 188727
: Pointer lock causes abandons documents
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing.
bug-188727-20181220114229.patch (text/plain), 3.81 KB, created by
Jeremy Jones
on 2018-12-20 11:42:30 PST
(
hide
)
Description:
Patch for landing.
Filename:
MIME Type:
Creator:
Jeremy Jones
Created:
2018-12-20 11:42:30 PST
Size:
3.81 KB
patch
obsolete
>Subversion Revision: 238527 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 54d01d09ea083b1bb2bed8bd0d5ef25845e618dd..2a49b94c2c74633b0269a94032c2312aff487e09 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,25 @@ >+2018-09-28 Jeremy Jones <jeremyj@apple.com> >+ >+ Pointer lock causes abandoned documents >+ https://bugs.webkit.org/show_bug.cgi?id=188727 >+ rdar://problem/44248197 >+ >+ Reviewed by Simon Fraser. >+ >+ Fixes --world-leaks in these tests: >+ >+ pointer-lock/locked-element-removed-from-dom.html >+ pointer-lock/mouse-event-delivery.html >+ fast/shadow-dom/pointerlockelement-in-slot.html >+ >+ PointerLockController now uses WeakPtr instead of RefPtr because it has no need to extend the lifetime of a document. >+ >+ * page/PointerLockController.cpp: >+ (WebCore::PointerLockController::elementRemoved): >+ (WebCore::PointerLockController::documentDetached): >+ (WebCore::PointerLockController::didAcquirePointerLock): >+ * page/PointerLockController.h: >+ > 2018-11-24 Ryosuke Niwa <rniwa@webkit.org> > > SVG use element inside a shadow tree cannot reference an element in the same tree >diff --git a/Source/WebCore/page/PointerLockController.cpp b/Source/WebCore/page/PointerLockController.cpp >index 4926394069bd59eaef8636e0f72f5eb2ec13fb2e..cfae41b51afe54d4daa56853b75d02c55e05a21d 100644 >--- a/Source/WebCore/page/PointerLockController.cpp >+++ b/Source/WebCore/page/PointerLockController.cpp >@@ -105,7 +105,7 @@ void PointerLockController::requestPointerUnlockAndForceCursorVisible() > void PointerLockController::elementRemoved(Element& element) > { > if (m_element == &element) { >- m_documentOfRemovedElementWhileWaitingForUnlock = &m_element->document(); >+ m_documentOfRemovedElementWhileWaitingForUnlock = makeWeakPtr(m_element->document()); > // Set element null immediately to block any future interaction with it > // including mouse events received before the unlock completes. > requestPointerUnlock(); >@@ -115,8 +115,11 @@ void PointerLockController::elementRemoved(Element& element) > > void PointerLockController::documentDetached(Document& document) > { >+ if (m_documentAllowedToRelockWithoutUserGesture == &document) >+ m_documentAllowedToRelockWithoutUserGesture = nullptr; >+ > if (m_element && &m_element->document() == &document) { >- m_documentOfRemovedElementWhileWaitingForUnlock = &m_element->document(); >+ m_documentOfRemovedElementWhileWaitingForUnlock = makeWeakPtr(m_element->document()); > requestPointerUnlock(); > clearElement(); > } >@@ -147,7 +150,7 @@ void PointerLockController::didAcquirePointerLock() > enqueueEvent(eventNames().pointerlockchangeEvent, m_element.get()); > m_lockPending = false; > m_forceCursorVisibleUponUnlock = false; >- m_documentAllowedToRelockWithoutUserGesture = &m_element->document(); >+ m_documentAllowedToRelockWithoutUserGesture = makeWeakPtr(m_element->document()); > } > > void PointerLockController::didNotAcquirePointerLock() >diff --git a/Source/WebCore/page/PointerLockController.h b/Source/WebCore/page/PointerLockController.h >index 5021ae9740808a71f98a04bdcbb4e0689f3a696f..49097ae59dfac2109cd25a57330f968579789976 100644 >--- a/Source/WebCore/page/PointerLockController.h >+++ b/Source/WebCore/page/PointerLockController.h >@@ -68,8 +68,8 @@ private: > bool m_unlockPending { false }; > bool m_forceCursorVisibleUponUnlock { false }; > RefPtr<Element> m_element; >- RefPtr<Document> m_documentOfRemovedElementWhileWaitingForUnlock; >- RefPtr<Document> m_documentAllowedToRelockWithoutUserGesture; >+ WeakPtr<Document> m_documentOfRemovedElementWhileWaitingForUnlock; >+ WeakPtr<Document> m_documentAllowedToRelockWithoutUserGesture; > }; > > } // namespace WebCore
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188727
:
351123
|
351125
|
351151
| 357842