diff options
Diffstat (limited to 'D187418.patch')
-rw-r--r-- | D187418.patch | 88 |
1 files changed, 0 insertions, 88 deletions
diff --git a/D187418.patch b/D187418.patch deleted file mode 100644 index b95ec3f1a449..000000000000 --- a/D187418.patch +++ /dev/null @@ -1,88 +0,0 @@ -diff --git a/layout/xul/nsXULTooltipListener.cpp b/layout/xul/nsXULTooltipListener.cpp ---- a/layout/xul/nsXULTooltipListener.cpp -+++ b/layout/xul/nsXULTooltipListener.cpp -@@ -368,47 +368,50 @@ - GetTooltipFor(sourceNode, getter_AddRefs(tooltipNode)); - if (!tooltipNode || sourceNode == tooltipNode) - return NS_ERROR_FAILURE; // the target node doesn't need a tooltip - - // set the node in the document that triggered the tooltip and show it -- if (tooltipNode->GetComposedDoc() && -- nsContentUtils::IsChromeDoc(tooltipNode->GetComposedDoc())) { -- // Make sure the target node is still attached to some document. -- // It might have been deleted. -- if (sourceNode->IsInComposedDoc()) { -- if (!mIsSourceTree) { -- mLastTreeRow = -1; -- mLastTreeCol = nullptr; -- } -+ // Make sure the document still has focus. -+ auto* doc = tooltipNode->GetComposedDoc(); -+ if (!doc || !nsContentUtils::IsChromeDoc(doc) || -+ !doc->HasFocus(IgnoreErrors())) { -+ return NS_OK; -+ } -+ // Make sure the target node is still attached to some document. -+ // It might have been deleted. -+ if (sourceNode->IsInComposedDoc()) { -+ if (!mIsSourceTree) { -+ mLastTreeRow = -1; -+ mLastTreeCol = nullptr; -+ } - -- mCurrentTooltip = do_GetWeakReference(tooltipNode); -- LaunchTooltip(); -- mTargetNode = nullptr; -- -- nsCOMPtr<nsIContent> currentTooltip = do_QueryReferent(mCurrentTooltip); -- if (!currentTooltip) return NS_OK; -+ mCurrentTooltip = do_GetWeakReference(tooltipNode); -+ LaunchTooltip(); -+ mTargetNode = nullptr; - -- // listen for popuphidden on the tooltip node, so that we can -- // be sure DestroyPopup is called even if someone else closes the tooltip -- currentTooltip->AddSystemEventListener(u"popuphiding"_ns, this, false, -- false); -+ nsCOMPtr<nsIContent> currentTooltip = do_QueryReferent(mCurrentTooltip); -+ if (!currentTooltip) return NS_OK; -+ -+ // listen for popuphidden on the tooltip node, so that we can -+ // be sure DestroyPopup is called even if someone else closes the tooltip -+ currentTooltip->AddSystemEventListener(u"popuphiding"_ns, this, false, -+ false); - -- // listen for mousedown, mouseup, keydown, and mouse events at -- // document level -- if (Document* doc = sourceNode->GetComposedDoc()) { -- // Probably, we should listen to untrusted events for hiding tooltips -- // on content since tooltips might disturb something of web -- // applications. If we don't specify the aWantsUntrusted of -- // AddSystemEventListener(), the event target sets it to TRUE if the -- // target is in content. -- doc->AddSystemEventListener(u"wheel"_ns, this, true); -- doc->AddSystemEventListener(u"mousedown"_ns, this, true); -- doc->AddSystemEventListener(u"mouseup"_ns, this, true); -- doc->AddSystemEventListener(u"keydown"_ns, this, true); -- } -- mSourceNode = nullptr; -+ // listen for mousedown, mouseup, keydown, and mouse events at -+ // document level -+ if (Document* doc = sourceNode->GetComposedDoc()) { -+ // Probably, we should listen to untrusted events for hiding tooltips -+ // on content since tooltips might disturb something of web -+ // applications. If we don't specify the aWantsUntrusted of -+ // AddSystemEventListener(), the event target sets it to TRUE if the -+ // target is in content. -+ doc->AddSystemEventListener(u"wheel"_ns, this, true); -+ doc->AddSystemEventListener(u"mousedown"_ns, this, true); -+ doc->AddSystemEventListener(u"mouseup"_ns, this, true); -+ doc->AddSystemEventListener(u"keydown"_ns, this, true); - } -+ mSourceNode = nullptr; - } - - return NS_OK; - } - - |