mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 15:25:52 +00:00
Bug 1680167 - Part 4: MOZ_CAN_RUN_SCRIPT in dom/xul r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D98627
This commit is contained in:
parent
8ab2900b08
commit
00c44d3b04
@ -14,8 +14,10 @@ webidl Element;
|
||||
[scriptable, uuid(a9fa9fd3-8d62-4f94-9ed8-3ea9c3cf0773)]
|
||||
interface nsIDOMXULCommandDispatcher : nsISupports
|
||||
{
|
||||
attribute Element focusedElement;
|
||||
attribute mozIDOMWindowProxy focusedWindow;
|
||||
[setter_can_run_script]
|
||||
attribute Element focusedElement;
|
||||
[setter_can_run_script]
|
||||
attribute mozIDOMWindowProxy focusedWindow;
|
||||
|
||||
void addCommandUpdater(in Element updater,
|
||||
in AString events,
|
||||
|
@ -150,7 +150,7 @@ nsXULCommandDispatcher::GetFocusedWindow(mozIDOMWindowProxy** aWindow) {
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXULCommandDispatcher::SetFocusedElement(Element* aElement) {
|
||||
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||
RefPtr<nsFocusManager> fm = nsFocusManager::GetFocusManager();
|
||||
NS_ENSURE_TRUE(fm, NS_ERROR_FAILURE);
|
||||
|
||||
if (aElement) {
|
||||
@ -170,7 +170,7 @@ nsXULCommandDispatcher::SetFocusedWindow(mozIDOMWindowProxy* aWindow) {
|
||||
nsCOMPtr<nsPIDOMWindowOuter> window = nsPIDOMWindowOuter::From(aWindow);
|
||||
NS_ENSURE_TRUE(window, NS_ERROR_FAILURE);
|
||||
|
||||
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||
RefPtr<nsFocusManager> fm = nsFocusManager::GetFocusManager();
|
||||
NS_ENSURE_TRUE(fm, NS_ERROR_FAILURE);
|
||||
|
||||
// get the containing frame for the window, and set it as focused. This will
|
||||
|
@ -210,8 +210,7 @@ nsresult nsXULPopupListener::FireFocusOnTargetContent(
|
||||
currFrame = currFrame->GetParent();
|
||||
}
|
||||
|
||||
nsFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||
if (fm) {
|
||||
if (RefPtr<nsFocusManager> fm = nsFocusManager::GetFocusManager()) {
|
||||
if (newFocusElement) {
|
||||
uint32_t focusFlags =
|
||||
nsIFocusManager::FLAG_BYMOUSE | nsIFocusManager::FLAG_NOSCROLL;
|
||||
|
@ -50,7 +50,8 @@ class nsXULPopupListener : public nsIDOMEventListener {
|
||||
private:
|
||||
#ifndef NS_CONTEXT_MENU_IS_MOUSEUP
|
||||
// When a context menu is opened, focus the target of the contextmenu event.
|
||||
nsresult FireFocusOnTargetContent(nsIContent* aTargetContent, bool aIsTouch);
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY nsresult
|
||||
FireFocusOnTargetContent(nsIContent* aTargetContent, bool aIsTouch);
|
||||
#endif
|
||||
|
||||
// |mElement| is the node to which this listener is attached.
|
||||
|
Loading…
Reference in New Issue
Block a user