mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-06 07:48:38 +09:00
Issue #2135 - Bug 1430303: Implement ShadowRoot.pointerLockElement
This commit is contained in:
parent
c920f32df3
commit
3dfffeaeca
9 changed files with 138 additions and 29 deletions
|
|
@ -4,6 +4,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "DocumentOrShadowRoot.h"
|
||||
#include "mozilla/EventStateManager.h"
|
||||
#include "mozilla/dom/StyleSheetList.h"
|
||||
#include "nsDocument.h"
|
||||
#include "nsFocusManager.h"
|
||||
|
|
@ -144,5 +145,20 @@ DocumentOrShadowRoot::GetRetargetedFocusedElement()
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
Element*
|
||||
DocumentOrShadowRoot::GetPointerLockElement()
|
||||
{
|
||||
nsCOMPtr<Element> pointerLockedElement =
|
||||
do_QueryReferent(EventStateManager::sPointerLockedElement);
|
||||
if (!pointerLockedElement) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsIContent* retargetedPointerLockedElement = Retarget(pointerLockedElement);
|
||||
return
|
||||
retargetedPointerLockedElement && retargetedPointerLockedElement->IsElement() ?
|
||||
retargetedPointerLockedElement->AsElement() : nullptr;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue