mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
Bug 1887615 - Micro-optimize PointerEventHandler::ReleaseIfCaptureByDescendant, r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D205547
This commit is contained in:
parent
74592b2a81
commit
21c5917a34
@ -461,11 +461,13 @@ Element* PointerEventHandler::GetPointerCapturingElement(
|
||||
void PointerEventHandler::ReleaseIfCaptureByDescendant(nsIContent* aContent) {
|
||||
// We should check that aChild does not contain pointer capturing elements.
|
||||
// If it does we should release the pointer capture for the elements.
|
||||
for (const auto& entry : *sPointerCaptureList) {
|
||||
PointerCaptureInfo* data = entry.GetWeak();
|
||||
if (data && data->mPendingElement &&
|
||||
data->mPendingElement->IsInclusiveDescendantOf(aContent)) {
|
||||
ReleasePointerCaptureById(entry.GetKey());
|
||||
if (!sPointerCaptureList->IsEmpty()) {
|
||||
for (const auto& entry : *sPointerCaptureList) {
|
||||
PointerCaptureInfo* data = entry.GetWeak();
|
||||
if (data && data->mPendingElement &&
|
||||
data->mPendingElement->IsInclusiveDescendantOf(aContent)) {
|
||||
ReleasePointerCaptureById(entry.GetKey());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user