Bug 1667081 - Part 1: Replace usage of nsIFocusManager with nsFocusManager; r=hsivonen
This patch is bascially done by: perl -p -i -e "s/nsIFocusManager\* /nsFocusManager* /g;" $( find . -name *.cpp ) perl -p -i -e "s/nsCOMPtr<nsIFocusManager>/RefPtr<nsFocusManager>/g;" $( find . -name *.cpp ) Differential Revision: https://phabricator.services.mozilla.com/D91287
This commit is contained in:
@@ -4097,7 +4097,7 @@ SVGSVGElement* Document::GetSVGRootElement() const {
|
|||||||
/* Return true if the document is in the focused top-level window, and is an
|
/* Return true if the document is in the focused top-level window, and is an
|
||||||
* ancestor of the focused DOMWindow. */
|
* ancestor of the focused DOMWindow. */
|
||||||
bool Document::HasFocus(ErrorResult& rv) const {
|
bool Document::HasFocus(ErrorResult& rv) const {
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
if (!fm) {
|
if (!fm) {
|
||||||
rv.Throw(NS_ERROR_NOT_AVAILABLE);
|
rv.Throw(NS_ERROR_NOT_AVAILABLE);
|
||||||
return false;
|
return false;
|
||||||
@@ -11405,7 +11405,7 @@ void Document::NotifyAbortedLoad() {
|
|||||||
|
|
||||||
static void FireOrClearDelayedEvents(nsTArray<nsCOMPtr<Document>>& aDocuments,
|
static void FireOrClearDelayedEvents(nsTArray<nsCOMPtr<Document>>& aDocuments,
|
||||||
bool aFireEvents) {
|
bool aFireEvents) {
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
if (!fm) return;
|
if (!fm) return;
|
||||||
|
|
||||||
for (uint32_t i = 0; i < aDocuments.Length(); ++i) {
|
for (uint32_t i = 0; i < aDocuments.Length(); ++i) {
|
||||||
|
|||||||
@@ -405,7 +405,7 @@ void Element::Blur(mozilla::ErrorResult& aError) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
nsPIDOMWindowOuter* win = doc->GetWindow();
|
nsPIDOMWindowOuter* win = doc->GetWindow();
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
if (win && fm) {
|
if (win && fm) {
|
||||||
aError = fm->ClearFocus(win);
|
aError = fm->ClearFocus(win);
|
||||||
}
|
}
|
||||||
@@ -2944,7 +2944,7 @@ nsresult Element::PostHandleEventForLinks(EventChainPostVisitor& aVisitor) {
|
|||||||
aVisitor.mEvent->mFlags.mMultipleActionsPrevented = true;
|
aVisitor.mEvent->mFlags.mMultipleActionsPrevented = true;
|
||||||
|
|
||||||
if (IsInComposedDoc()) {
|
if (IsInComposedDoc()) {
|
||||||
if (nsIFocusManager* fm = nsFocusManager::GetFocusManager()) {
|
if (nsFocusManager* fm = nsFocusManager::GetFocusManager()) {
|
||||||
RefPtr<Element> kungFuDeathGrip(this);
|
RefPtr<Element> kungFuDeathGrip(this);
|
||||||
fm->SetFocus(kungFuDeathGrip, nsIFocusManager::FLAG_BYMOUSE |
|
fm->SetFocus(kungFuDeathGrip, nsIFocusManager::FLAG_BYMOUSE |
|
||||||
nsIFocusManager::FLAG_NOSCROLL);
|
nsIFocusManager::FLAG_NOSCROLL);
|
||||||
|
|||||||
@@ -4327,7 +4327,7 @@ void nsContentUtils::RequestFrameFocus(Element& aFrameElement, bool aCanRaise,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsIFocusManager> fm = nsFocusManager::GetFocusManager();
|
RefPtr<nsFocusManager> fm = nsFocusManager::GetFocusManager();
|
||||||
if (!fm) {
|
if (!fm) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ nsresult nsSelectionCommandsBase::GetSelectionControllerFromWindow(
|
|||||||
// Helpers for nsSelectMoveScrollCommand and nsPhysicalSelectMoveScrollCommand
|
// Helpers for nsSelectMoveScrollCommand and nsPhysicalSelectMoveScrollCommand
|
||||||
static void AdjustFocusAfterCaretMove(nsPIDOMWindowOuter* aWindow) {
|
static void AdjustFocusAfterCaretMove(nsPIDOMWindowOuter* aWindow) {
|
||||||
// adjust the focus to the new caret position
|
// adjust the focus to the new caret position
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
if (fm) {
|
if (fm) {
|
||||||
RefPtr<dom::Element> result;
|
RefPtr<dom::Element> result;
|
||||||
fm->MoveFocus(aWindow, nullptr, nsIFocusManager::MOVEFOCUS_CARET,
|
fm->MoveFocus(aWindow, nullptr, nsIFocusManager::MOVEFOCUS_CARET,
|
||||||
|
|||||||
@@ -4269,7 +4269,7 @@ void nsGlobalWindowInner::SetReadyForFocus() {
|
|||||||
bool oldNeedsFocus = mNeedsFocus;
|
bool oldNeedsFocus = mNeedsFocus;
|
||||||
mNeedsFocus = false;
|
mNeedsFocus = false;
|
||||||
|
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
if (fm) {
|
if (fm) {
|
||||||
fm->WindowShown(GetOuterWindow(), oldNeedsFocus);
|
fm->WindowShown(GetOuterWindow(), oldNeedsFocus);
|
||||||
}
|
}
|
||||||
@@ -4280,7 +4280,7 @@ void nsGlobalWindowInner::PageHidden() {
|
|||||||
// no longer valid. Use the persisted field to determine if the document
|
// no longer valid. Use the persisted field to determine if the document
|
||||||
// is being destroyed.
|
// is being destroyed.
|
||||||
|
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
if (fm) {
|
if (fm) {
|
||||||
fm->WindowHidden(GetOuterWindow());
|
fm->WindowHidden(GetOuterWindow());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5191,7 +5191,7 @@ void nsGlobalWindowOuter::BlurOuter() {
|
|||||||
siteWindow->Blur();
|
siteWindow->Blur();
|
||||||
|
|
||||||
// if the root is focused, clear the focus
|
// if the root is focused, clear the focus
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
if (fm && mDoc) {
|
if (fm && mDoc) {
|
||||||
RefPtr<Element> element;
|
RefPtr<Element> element;
|
||||||
fm->GetFocusedElementForWindow(this, false, nullptr,
|
fm->GetFocusedElementForWindow(this, false, nullptr,
|
||||||
@@ -7512,7 +7512,7 @@ nsresult nsGlobalWindowOuter::RestoreWindowState(nsISupports* aState) {
|
|||||||
// it easy to tell which link was last clicked when going back a page.
|
// it easy to tell which link was last clicked when going back a page.
|
||||||
Element* focusedElement = inner->GetFocusedElement();
|
Element* focusedElement = inner->GetFocusedElement();
|
||||||
if (nsContentUtils::ContentIsLink(focusedElement)) {
|
if (nsContentUtils::ContentIsLink(focusedElement)) {
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
if (fm) {
|
if (fm) {
|
||||||
// XXXbz Do we need the stack strong ref here?
|
// XXXbz Do we need the stack strong ref here?
|
||||||
RefPtr<Element> kungFuDeathGrip(focusedElement);
|
RefPtr<Element> kungFuDeathGrip(focusedElement);
|
||||||
|
|||||||
@@ -3148,7 +3148,7 @@ void EventStateManager::PostHandleKeyboardEvent(
|
|||||||
}
|
}
|
||||||
|
|
||||||
EnsureDocument(mPresContext);
|
EnsureDocument(mPresContext);
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
if (fm && mDocument) {
|
if (fm && mDocument) {
|
||||||
// Shift focus forward or back depending on shift key
|
// Shift focus forward or back depending on shift key
|
||||||
bool isDocMove = aKeyboardEvent->IsControl() ||
|
bool isDocMove = aKeyboardEvent->IsControl() ||
|
||||||
@@ -3329,7 +3329,7 @@ nsresult EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
|
|||||||
|
|
||||||
MOZ_ASSERT_IF(newFocus, newFocus->IsElement());
|
MOZ_ASSERT_IF(newFocus, newFocus->IsElement());
|
||||||
|
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
if (fm) {
|
if (fm) {
|
||||||
// if something was found to focus, focus it. Otherwise, if the
|
// if something was found to focus, focus it. Otherwise, if the
|
||||||
// element that was clicked doesn't have -moz-user-focus: ignore,
|
// element that was clicked doesn't have -moz-user-focus: ignore,
|
||||||
@@ -5703,7 +5703,7 @@ void EventStateManager::FlushLayout(nsPresContext* aPresContext) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
nsIContent* EventStateManager::GetFocusedContent() {
|
nsIContent* EventStateManager::GetFocusedContent() {
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
EnsureDocument(mPresContext);
|
EnsureDocument(mPresContext);
|
||||||
if (!fm || !mDocument) return nullptr;
|
if (!fm || !mDocument) return nullptr;
|
||||||
|
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ void HTMLDialogElement::FocusDialog() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
if (fm) {
|
if (fm) {
|
||||||
// Clear the focus which ends up making the body gets focused
|
// Clear the focus which ends up making the body gets focused
|
||||||
fm->ClearFocus(OwnerDoc()->GetWindow());
|
fm->ClearFocus(OwnerDoc()->GetWindow());
|
||||||
|
|||||||
@@ -3711,7 +3711,7 @@ nsresult HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor) {
|
|||||||
// for text and password fields when the field was focused by the
|
// for text and password fields when the field was focused by the
|
||||||
// keyboard or a navigation, the platform allows it, and it wasn't
|
// keyboard or a navigation, the platform allows it, and it wasn't
|
||||||
// just because we raised a window.
|
// just because we raised a window.
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
if (fm && IsSingleLineTextControl(false) &&
|
if (fm && IsSingleLineTextControl(false) &&
|
||||||
!aVisitor.mEvent->AsFocusEvent()->mFromRaise &&
|
!aVisitor.mEvent->AsFocusEvent()->mFromRaise &&
|
||||||
SelectTextFieldOnFocus()) {
|
SelectTextFieldOnFocus()) {
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ void HTMLLegendElement::Focus(const FocusOptions& aOptions,
|
|||||||
|
|
||||||
// If the legend isn't focusable, focus whatever is focusable following
|
// If the legend isn't focusable, focus whatever is focusable following
|
||||||
// the legend instead, bug 81481.
|
// the legend instead, bug 81481.
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
if (!fm) {
|
if (!fm) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ mozilla::ipc::IPCResult BrowserBridgeChild::RecvRequestFocus(
|
|||||||
mozilla::ipc::IPCResult BrowserBridgeChild::RecvMoveFocus(
|
mozilla::ipc::IPCResult BrowserBridgeChild::RecvMoveFocus(
|
||||||
const bool& aForward, const bool& aForDocumentNavigation) {
|
const bool& aForward, const bool& aForDocumentNavigation) {
|
||||||
// Adapted from BrowserParent
|
// Adapted from BrowserParent
|
||||||
nsCOMPtr<nsIFocusManager> fm = nsFocusManager::GetFocusManager();
|
RefPtr<nsFocusManager> fm = nsFocusManager::GetFocusManager();
|
||||||
if (!fm) {
|
if (!fm) {
|
||||||
return IPC_OK();
|
return IPC_OK();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -763,7 +763,7 @@ mozilla::ipc::IPCResult BrowserParent::RecvMoveFocus(
|
|||||||
return IPC_OK();
|
return IPC_OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsIFocusManager> fm = nsFocusManager::GetFocusManager();
|
RefPtr<nsFocusManager> fm = nsFocusManager::GetFocusManager();
|
||||||
if (fm) {
|
if (fm) {
|
||||||
RefPtr<Element> dummy;
|
RefPtr<Element> dummy;
|
||||||
|
|
||||||
@@ -1983,7 +1983,7 @@ bool BrowserParent::SendHandleTap(TapType aType,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ((aType == TapType::eSingleTap || aType == TapType::eSecondTap)) {
|
if ((aType == TapType::eSingleTap || aType == TapType::eSecondTap)) {
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
if (fm) {
|
if (fm) {
|
||||||
RefPtr<nsFrameLoader> frameLoader = GetFrameLoader();
|
RefPtr<nsFrameLoader> frameLoader = GetFrameLoader();
|
||||||
if (frameLoader) {
|
if (frameLoader) {
|
||||||
|
|||||||
@@ -1474,7 +1474,7 @@ nsresult nsPluginInstanceOwner::ProcessMouseDown(Event* aMouseEvent) {
|
|||||||
// otherwise, we might not get key events
|
// otherwise, we might not get key events
|
||||||
if (mPluginFrame && mPluginWindow &&
|
if (mPluginFrame && mPluginWindow &&
|
||||||
mPluginWindow->type == NPWindowTypeDrawable) {
|
mPluginWindow->type == NPWindowTypeDrawable) {
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
if (fm) {
|
if (fm) {
|
||||||
nsCOMPtr<Element> elem = do_QueryReferent(mContent);
|
nsCOMPtr<Element> elem = do_QueryReferent(mContent);
|
||||||
fm->SetFocus(elem, 0);
|
fm->SetFocus(elem, 0);
|
||||||
|
|||||||
@@ -2221,7 +2221,7 @@ mozilla::ipc::IPCResult PluginInstanceParent::AnswerPluginFocusChange(
|
|||||||
if (gotFocus) {
|
if (gotFocus) {
|
||||||
nsPluginInstanceOwner* owner = GetOwner();
|
nsPluginInstanceOwner* owner = GetOwner();
|
||||||
if (owner) {
|
if (owner) {
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
RefPtr<dom::Element> element;
|
RefPtr<dom::Element> element;
|
||||||
owner->GetDOMElement(getter_AddRefs(element));
|
owner->GetDOMElement(getter_AddRefs(element));
|
||||||
if (fm && element) {
|
if (fm && element) {
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ nsXULCommandDispatcher::GetFocusedWindow(mozIDOMWindowProxy** aWindow) {
|
|||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsXULCommandDispatcher::SetFocusedElement(Element* aElement) {
|
nsXULCommandDispatcher::SetFocusedElement(Element* aElement) {
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
NS_ENSURE_TRUE(fm, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(fm, NS_ERROR_FAILURE);
|
||||||
|
|
||||||
if (aElement) {
|
if (aElement) {
|
||||||
@@ -170,7 +170,7 @@ nsXULCommandDispatcher::SetFocusedWindow(mozIDOMWindowProxy* aWindow) {
|
|||||||
nsCOMPtr<nsPIDOMWindowOuter> window = nsPIDOMWindowOuter::From(aWindow);
|
nsCOMPtr<nsPIDOMWindowOuter> window = nsPIDOMWindowOuter::From(aWindow);
|
||||||
NS_ENSURE_TRUE(window, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(window, NS_ERROR_FAILURE);
|
||||||
|
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
NS_ENSURE_TRUE(fm, NS_ERROR_FAILURE);
|
NS_ENSURE_TRUE(fm, NS_ERROR_FAILURE);
|
||||||
|
|
||||||
// get the containing frame for the window, and set it as focused. This will
|
// get the containing frame for the window, and set it as focused. This will
|
||||||
@@ -196,7 +196,7 @@ nsXULCommandDispatcher::RewindFocus() {
|
|||||||
GetRootFocusedContentAndWindow(getter_AddRefs(win));
|
GetRootFocusedContentAndWindow(getter_AddRefs(win));
|
||||||
|
|
||||||
RefPtr<Element> result;
|
RefPtr<Element> result;
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
if (fm)
|
if (fm)
|
||||||
return fm->MoveFocus(win, nullptr, nsIFocusManager::MOVEFOCUS_BACKWARD, 0,
|
return fm->MoveFocus(win, nullptr, nsIFocusManager::MOVEFOCUS_BACKWARD, 0,
|
||||||
getter_AddRefs(result));
|
getter_AddRefs(result));
|
||||||
@@ -209,7 +209,7 @@ nsXULCommandDispatcher::AdvanceFocusIntoSubtree(Element* aElt) {
|
|||||||
GetRootFocusedContentAndWindow(getter_AddRefs(win));
|
GetRootFocusedContentAndWindow(getter_AddRefs(win));
|
||||||
|
|
||||||
RefPtr<Element> result;
|
RefPtr<Element> result;
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
if (fm)
|
if (fm)
|
||||||
return fm->MoveFocus(win, aElt, nsIFocusManager::MOVEFOCUS_FORWARD, 0,
|
return fm->MoveFocus(win, aElt, nsIFocusManager::MOVEFOCUS_FORWARD, 0,
|
||||||
getter_AddRefs(result));
|
getter_AddRefs(result));
|
||||||
|
|||||||
@@ -485,7 +485,7 @@ bool nsXULElement::PerformAccesskey(bool aKeyCausesActivation,
|
|||||||
if (elm) {
|
if (elm) {
|
||||||
// Define behavior for each type of XUL element.
|
// Define behavior for each type of XUL element.
|
||||||
if (!content->IsXULElement(nsGkAtoms::toolbarbutton)) {
|
if (!content->IsXULElement(nsGkAtoms::toolbarbutton)) {
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
if (fm) {
|
if (fm) {
|
||||||
nsCOMPtr<Element> elementToFocus;
|
nsCOMPtr<Element> elementToFocus;
|
||||||
// for radio buttons, focus the radiogroup instead
|
// for radio buttons, focus the radiogroup instead
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ nsresult nsXULPopupListener::FireFocusOnTargetContent(
|
|||||||
currFrame = currFrame->GetParent();
|
currFrame = currFrame->GetParent();
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
if (fm) {
|
if (fm) {
|
||||||
if (newFocusElement) {
|
if (newFocusElement) {
|
||||||
uint32_t focusFlags =
|
uint32_t focusFlags =
|
||||||
|
|||||||
@@ -3195,7 +3195,7 @@ nsresult PresShell::GoToAnchor(const nsAString& aAnchorName, bool aScroll,
|
|||||||
// Now focus the document itself if focus is on an element within it.
|
// Now focus the document itself if focus is on an element within it.
|
||||||
nsPIDOMWindowOuter* win = mDocument->GetWindow();
|
nsPIDOMWindowOuter* win = mDocument->GetWindow();
|
||||||
|
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
if (fm && win) {
|
if (fm && win) {
|
||||||
nsCOMPtr<mozIDOMWindowProxy> focusedWindow;
|
nsCOMPtr<mozIDOMWindowProxy> focusedWindow;
|
||||||
fm->GetFocusedWindow(getter_AddRefs(focusedWindow));
|
fm->GetFocusedWindow(getter_AddRefs(focusedWindow));
|
||||||
@@ -6518,7 +6518,7 @@ PresShell::GetFocusedDOMWindowInOurWindow() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<nsIContent> PresShell::GetFocusedContentInOurWindow() const {
|
already_AddRefed<nsIContent> PresShell::GetFocusedContentInOurWindow() const {
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
if (fm && mDocument) {
|
if (fm && mDocument) {
|
||||||
RefPtr<Element> focusedElement;
|
RefPtr<Element> focusedElement;
|
||||||
fm->GetFocusedElementForWindow(mDocument->GetWindow(), false, nullptr,
|
fm->GetFocusedElementForWindow(mDocument->GetWindow(), false, nullptr,
|
||||||
|
|||||||
@@ -1476,13 +1476,13 @@ nsresult nsPluginFrame::HandleEvent(nsPresContext* aPresContext,
|
|||||||
mInstanceOwner->ConsiderNewEventloopNestingLevel();
|
mInstanceOwner->ConsiderNewEventloopNestingLevel();
|
||||||
|
|
||||||
if (anEvent->mMessage == ePluginActivate) {
|
if (anEvent->mMessage == ePluginActivate) {
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
if (fm) {
|
if (fm) {
|
||||||
RefPtr<dom::Element> elem = GetContent()->AsElement();
|
RefPtr<dom::Element> elem = GetContent()->AsElement();
|
||||||
return fm->SetFocus(elem, 0);
|
return fm->SetFocus(elem, 0);
|
||||||
}
|
}
|
||||||
} else if (anEvent->mMessage == ePluginFocus) {
|
} else if (anEvent->mMessage == ePluginFocus) {
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
if (fm) {
|
if (fm) {
|
||||||
RefPtr<dom::Element> elem = GetContent()->AsElement();
|
RefPtr<dom::Element> elem = GetContent()->AsElement();
|
||||||
return fm->FocusPlugin(elem);
|
return fm->FocusPlugin(elem);
|
||||||
|
|||||||
@@ -2348,7 +2348,7 @@ void nsPrintJob::SetIsPrintPreview(bool aIsPrintPreview) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Document* nsPrintJob::FindFocusedDocument(Document* aDoc) const {
|
Document* nsPrintJob::FindFocusedDocument(Document* aDoc) const {
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
NS_ENSURE_TRUE(fm, nullptr);
|
NS_ENSURE_TRUE(fm, nullptr);
|
||||||
|
|
||||||
nsPIDOMWindowOuter* window = aDoc->GetOriginalDocument()->GetWindow();
|
nsPIDOMWindowOuter* window = aDoc->GetOriginalDocument()->GetWindow();
|
||||||
|
|||||||
@@ -764,7 +764,7 @@ void nsXULPopupManager::ShowTooltipAtScreen(nsIContent* aPopup,
|
|||||||
static void CheckCaretDrawingState() {
|
static void CheckCaretDrawingState() {
|
||||||
// There is 1 caret per document, we need to find the focused
|
// There is 1 caret per document, we need to find the focused
|
||||||
// document and erase its caret.
|
// document and erase its caret.
|
||||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||||
if (fm) {
|
if (fm) {
|
||||||
nsCOMPtr<mozIDOMWindowProxy> window;
|
nsCOMPtr<mozIDOMWindowProxy> window;
|
||||||
fm->GetFocusedWindow(getter_AddRefs(window));
|
fm->GetFocusedWindow(getter_AddRefs(window));
|
||||||
|
|||||||
Reference in New Issue
Block a user