mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 01:08:39 +09:00
Issue #2135 - Bug 1323815: FocusEvent.relatedTarget should work consistently with MouseEvent.relatedTarget
* This incorporates changes from Bug 1413102.
This commit is contained in:
parent
1bb2009f61
commit
1185cfe3f0
7 changed files with 79 additions and 25 deletions
|
|
@ -557,6 +557,26 @@ Event::SetEventType(const nsAString& aEventTypeArg)
|
|||
mEvent->SetDefaultComposedInNativeAnonymousContent();
|
||||
}
|
||||
|
||||
already_AddRefed<EventTarget>
|
||||
Event::EnsureWebAccessibleRelatedTarget(EventTarget* aRelatedTarget)
|
||||
{
|
||||
nsCOMPtr<EventTarget> relatedTarget = aRelatedTarget;
|
||||
if (relatedTarget) {
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(relatedTarget);
|
||||
|
||||
if (content && content->ChromeOnlyAccess() &&
|
||||
!nsContentUtils::CanAccessNativeAnon()) {
|
||||
content = content->FindFirstNonChromeOnlyAccessContent();
|
||||
relatedTarget = do_QueryInterface(content);
|
||||
}
|
||||
|
||||
if (relatedTarget) {
|
||||
relatedTarget = relatedTarget->GetTargetForDOMEvent();
|
||||
}
|
||||
}
|
||||
return relatedTarget.forget();
|
||||
}
|
||||
|
||||
void
|
||||
Event::InitEvent(const nsAString& aEventTypeArg,
|
||||
bool aCanBubbleArg,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue