This commit is contained in:
saari%netscape.com 2000-05-11 22:43:32 +00:00
Родитель 58bded8675
Коммит b8aa8a1761
8 изменённых файлов: 90 добавлений и 2 удалений

Просмотреть файл

@ -579,6 +579,20 @@ nsXULCommandDispatcher::GetControllerForCommand(const nsString& command, nsICont
return NS_OK;
}
NS_IMETHODIMP
nsXULCommandDispatcher::GetSuppressFocusScroll(PRBool* aSuppressFocusScroll)
{
*aSuppressFocusScroll = mSuppressFocusScroll;
return NS_OK;
}
NS_IMETHODIMP
nsXULCommandDispatcher::SetSuppressFocusScroll(PRBool aSuppressFocusScroll)
{
mSuppressFocusScroll = aSuppressFocusScroll;
return NS_OK;
}
NS_IMETHODIMP
nsXULCommandDispatcher::GetSuppressFocus(PRBool* aSuppressFocus)
{

Просмотреть файл

@ -88,6 +88,7 @@ protected:
nsCOMPtr<nsIDOMWindow> mCurrentWindow; // [OWNER]
PRBool mSuppressFocus;
PRBool mSuppressFocusScroll;
PRBool mActive;
PRBool mFocusInitialized;

Просмотреть файл

@ -6,6 +6,7 @@ interface XULCommandDispatcher {
attribute Element focusedElement;
attribute Window focusedWindow;
attribute boolean suppressFocus;
attribute boolean suppressFocusScroll;
attribute boolean active;
void addCommandUpdater(in Element updater, in DOMString events, in DOMString targets);

Просмотреть файл

@ -57,7 +57,8 @@ enum XULCommandDispatcher_slots {
XULCOMMANDDISPATCHER_FOCUSEDELEMENT = -1,
XULCOMMANDDISPATCHER_FOCUSEDWINDOW = -2,
XULCOMMANDDISPATCHER_SUPPRESSFOCUS = -3,
XULCOMMANDDISPATCHER_ACTIVE = -4
XULCOMMANDDISPATCHER_SUPPRESSFOCUSSCROLL = -4,
XULCOMMANDDISPATCHER_ACTIVE = -5
};
/***********************************************************************/
@ -118,6 +119,18 @@ GetXULCommandDispatcherProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
}
break;
}
case XULCOMMANDDISPATCHER_SUPPRESSFOCUSSCROLL:
{
rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_XULCOMMANDDISPATCHER_SUPPRESSFOCUSSCROLL, PR_FALSE);
if (NS_SUCCEEDED(rv)) {
PRBool prop;
rv = a->GetSuppressFocusScroll(&prop);
if (NS_SUCCEEDED(rv)) {
*vp = BOOLEAN_TO_JSVAL(prop);
}
}
break;
}
case XULCOMMANDDISPATCHER_ACTIVE:
{
rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_XULCOMMANDDISPATCHER_ACTIVE, PR_FALSE);
@ -209,6 +222,20 @@ SetXULCommandDispatcherProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
}
break;
}
case XULCOMMANDDISPATCHER_SUPPRESSFOCUSSCROLL:
{
rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_XULCOMMANDDISPATCHER_SUPPRESSFOCUSSCROLL, PR_TRUE);
if (NS_SUCCEEDED(rv)) {
PRBool prop;
if (PR_FALSE == nsJSUtils::nsConvertJSValToBool(&prop, cx, *vp)) {
rv = NS_ERROR_DOM_NOT_BOOLEAN_ERR;
}
rv = a->SetSuppressFocusScroll(prop);
}
break;
}
case XULCOMMANDDISPATCHER_ACTIVE:
{
rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_XULCOMMANDDISPATCHER_ACTIVE, PR_TRUE);
@ -514,6 +541,7 @@ static JSPropertySpec XULCommandDispatcherProperties[] =
{"focusedElement", XULCOMMANDDISPATCHER_FOCUSEDELEMENT, JSPROP_ENUMERATE},
{"focusedWindow", XULCOMMANDDISPATCHER_FOCUSEDWINDOW, JSPROP_ENUMERATE},
{"suppressFocus", XULCOMMANDDISPATCHER_SUPPRESSFOCUS, JSPROP_ENUMERATE},
{"suppressFocusScroll", XULCOMMANDDISPATCHER_SUPPRESSFOCUSSCROLL, JSPROP_ENUMERATE},
{"active", XULCOMMANDDISPATCHER_ACTIVE, JSPROP_ENUMERATE},
{0}
};

Просмотреть файл

@ -6,6 +6,7 @@ interface XULCommandDispatcher {
attribute Element focusedElement;
attribute Window focusedWindow;
attribute boolean suppressFocus;
attribute boolean suppressFocusScroll;
attribute boolean active;
void addCommandUpdater(in Element updater, in DOMString events, in DOMString targets);

Просмотреть файл

@ -57,7 +57,8 @@ enum XULCommandDispatcher_slots {
XULCOMMANDDISPATCHER_FOCUSEDELEMENT = -1,
XULCOMMANDDISPATCHER_FOCUSEDWINDOW = -2,
XULCOMMANDDISPATCHER_SUPPRESSFOCUS = -3,
XULCOMMANDDISPATCHER_ACTIVE = -4
XULCOMMANDDISPATCHER_SUPPRESSFOCUSSCROLL = -4,
XULCOMMANDDISPATCHER_ACTIVE = -5
};
/***********************************************************************/
@ -118,6 +119,18 @@ GetXULCommandDispatcherProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
}
break;
}
case XULCOMMANDDISPATCHER_SUPPRESSFOCUSSCROLL:
{
rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_XULCOMMANDDISPATCHER_SUPPRESSFOCUSSCROLL, PR_FALSE);
if (NS_SUCCEEDED(rv)) {
PRBool prop;
rv = a->GetSuppressFocusScroll(&prop);
if (NS_SUCCEEDED(rv)) {
*vp = BOOLEAN_TO_JSVAL(prop);
}
}
break;
}
case XULCOMMANDDISPATCHER_ACTIVE:
{
rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_XULCOMMANDDISPATCHER_ACTIVE, PR_FALSE);
@ -209,6 +222,20 @@ SetXULCommandDispatcherProperty(JSContext *cx, JSObject *obj, jsval id, jsval *v
}
break;
}
case XULCOMMANDDISPATCHER_SUPPRESSFOCUSSCROLL:
{
rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_XULCOMMANDDISPATCHER_SUPPRESSFOCUSSCROLL, PR_TRUE);
if (NS_SUCCEEDED(rv)) {
PRBool prop;
if (PR_FALSE == nsJSUtils::nsConvertJSValToBool(&prop, cx, *vp)) {
rv = NS_ERROR_DOM_NOT_BOOLEAN_ERR;
}
rv = a->SetSuppressFocusScroll(prop);
}
break;
}
case XULCOMMANDDISPATCHER_ACTIVE:
{
rv = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_XULCOMMANDDISPATCHER_ACTIVE, PR_TRUE);
@ -514,6 +541,7 @@ static JSPropertySpec XULCommandDispatcherProperties[] =
{"focusedElement", XULCOMMANDDISPATCHER_FOCUSEDELEMENT, JSPROP_ENUMERATE},
{"focusedWindow", XULCOMMANDDISPATCHER_FOCUSEDWINDOW, JSPROP_ENUMERATE},
{"suppressFocus", XULCOMMANDDISPATCHER_SUPPRESSFOCUS, JSPROP_ENUMERATE},
{"suppressFocusScroll", XULCOMMANDDISPATCHER_SUPPRESSFOCUSSCROLL, JSPROP_ENUMERATE},
{"active", XULCOMMANDDISPATCHER_ACTIVE, JSPROP_ENUMERATE},
{0}
};

Просмотреть файл

@ -579,6 +579,20 @@ nsXULCommandDispatcher::GetControllerForCommand(const nsString& command, nsICont
return NS_OK;
}
NS_IMETHODIMP
nsXULCommandDispatcher::GetSuppressFocusScroll(PRBool* aSuppressFocusScroll)
{
*aSuppressFocusScroll = mSuppressFocusScroll;
return NS_OK;
}
NS_IMETHODIMP
nsXULCommandDispatcher::SetSuppressFocusScroll(PRBool aSuppressFocusScroll)
{
mSuppressFocusScroll = aSuppressFocusScroll;
return NS_OK;
}
NS_IMETHODIMP
nsXULCommandDispatcher::GetSuppressFocus(PRBool* aSuppressFocus)
{

Просмотреть файл

@ -88,6 +88,7 @@ protected:
nsCOMPtr<nsIDOMWindow> mCurrentWindow; // [OWNER]
PRBool mSuppressFocus;
PRBool mSuppressFocusScroll;
PRBool mActive;
PRBool mFocusInitialized;