mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-31 19:47:32 +09:00
parent
db72493615
commit
693a79ca08
14 changed files with 88 additions and 72 deletions
|
|
@ -3031,20 +3031,9 @@ Element*
|
|||
nsIDocument::GetActiveElement()
|
||||
{
|
||||
// Get the focused element.
|
||||
if (nsCOMPtr<nsPIDOMWindowOuter> window = GetWindow()) {
|
||||
nsCOMPtr<nsPIDOMWindowOuter> focusedWindow;
|
||||
nsIContent* focusedContent =
|
||||
nsFocusManager::GetFocusedDescendant(window, false,
|
||||
getter_AddRefs(focusedWindow));
|
||||
// be safe and make sure the element is from this document
|
||||
if (focusedContent && focusedContent->OwnerDoc() == this) {
|
||||
if (focusedContent->ChromeOnlyAccess()) {
|
||||
focusedContent = focusedContent->FindFirstNonChromeOnlyAccessContent();
|
||||
}
|
||||
if (focusedContent) {
|
||||
return focusedContent->AsElement();
|
||||
}
|
||||
}
|
||||
Element* focusedElement = GetRetargetedFocusedElement();
|
||||
if (focusedElement) {
|
||||
return focusedElement;
|
||||
}
|
||||
|
||||
// No focused element anywhere in this document. Try to get the BODY.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue