Removed tableselection notification from nsIDOMSelectionListener -- no longer needed. r=mjudge
This commit is contained in:
Родитель
75c08d7bd3
Коммит
3852c08832
|
@ -3,10 +3,4 @@
|
|||
{ 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} } */
|
||||
|
||||
void notifySelectionChanged();
|
||||
/* tableCellNotification is a call back for when a cell is trying to be
|
||||
selected. No selection action will take place. only this notification.
|
||||
currently CTRL-LEFTMOUSEBUTTON in a table cell is the event that will
|
||||
trigger this call.*/
|
||||
void tableCellNotification(in Node parent, in long offset);
|
||||
|
||||
};
|
||||
|
|
|
@ -796,7 +796,6 @@ enum nsDOMProp {
|
|||
NS_DOM_PROP_SELECTION_STARTBATCHCHANGES,
|
||||
NS_DOM_PROP_SELECTION_TOSTRING,
|
||||
NS_DOM_PROP_SELECTIONLISTENER_NOTIFYSELECTIONCHANGED,
|
||||
NS_DOM_PROP_SELECTIONLISTENER_TABLECELLNOTIFICATION,
|
||||
NS_DOM_PROP_STYLESHEET_DISABLED,
|
||||
NS_DOM_PROP_STYLESHEET_READONLY,
|
||||
NS_DOM_PROP_STYLESHEET_TYPE,
|
||||
|
|
|
@ -795,7 +795,6 @@
|
|||
"selection.startbatchchanges", \
|
||||
"selection.tostring", \
|
||||
"selectionlistener.notifyselectionchanged", \
|
||||
"selectionlistener.tablecellnotification", \
|
||||
"stylesheet.disabled", \
|
||||
"stylesheet.readonly", \
|
||||
"stylesheet.type", \
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include "nsString.h"
|
||||
#include "nsIScriptContext.h"
|
||||
|
||||
class nsIDOMNode;
|
||||
|
||||
#define NS_IDOMSELECTIONLISTENER_IID \
|
||||
{ 0xa6cf90e2, 0x15b3, 0x11d2, \
|
||||
|
@ -39,20 +38,16 @@ public:
|
|||
static const nsIID& GetIID() { static nsIID iid = NS_IDOMSELECTIONLISTENER_IID; return iid; }
|
||||
|
||||
NS_IMETHOD NotifySelectionChanged()=0;
|
||||
|
||||
NS_IMETHOD TableCellNotification(nsIDOMNode* aParent, PRInt32 aOffset)=0;
|
||||
};
|
||||
|
||||
|
||||
#define NS_DECL_IDOMSELECTIONLISTENER \
|
||||
NS_IMETHOD NotifySelectionChanged(); \
|
||||
NS_IMETHOD TableCellNotification(nsIDOMNode* aParent, PRInt32 aOffset); \
|
||||
|
||||
|
||||
|
||||
#define NS_FORWARD_IDOMSELECTIONLISTENER(_to) \
|
||||
NS_IMETHOD NotifySelectionChanged() { return _to NotifySelectionChanged(); } \
|
||||
NS_IMETHOD TableCellNotification(nsIDOMNode* aParent, PRInt32 aOffset) { return _to TableCellNotification(aParent, aOffset); } \
|
||||
|
||||
|
||||
extern "C" NS_DOM nsresult NS_InitSelectionListenerClass(nsIScriptContext *aContext, void **aPrototype);
|
||||
|
|
|
@ -104,10 +104,10 @@ GetMimeTypeArrayProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
|
||||
JSString *jsstring = JS_ValueToString(cx, id);
|
||||
if (nsnull != jsstring) {
|
||||
name.Assign(JS_GetStringChars(jsstring));
|
||||
name.SetString(JS_GetStringChars(jsstring));
|
||||
}
|
||||
else {
|
||||
name.Assign("");
|
||||
name.SetString("");
|
||||
}
|
||||
|
||||
result = a->NamedItem(name, &prop);
|
||||
|
|
|
@ -143,10 +143,10 @@ GetPluginProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
|
||||
JSString *jsstring = JS_ValueToString(cx, id);
|
||||
if (nsnull != jsstring) {
|
||||
name.Assign(JS_GetStringChars(jsstring));
|
||||
name.SetString(JS_GetStringChars(jsstring));
|
||||
}
|
||||
else {
|
||||
name.Assign("");
|
||||
name.SetString("");
|
||||
}
|
||||
|
||||
result = a->NamedItem(name, &prop);
|
||||
|
|
|
@ -104,10 +104,10 @@ GetPluginArrayProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
|
||||
JSString *jsstring = JS_ValueToString(cx, id);
|
||||
if (nsnull != jsstring) {
|
||||
name.Assign(JS_GetStringChars(jsstring));
|
||||
name.SetString(JS_GetStringChars(jsstring));
|
||||
}
|
||||
else {
|
||||
name.Assign("");
|
||||
name.SetString("");
|
||||
}
|
||||
|
||||
result = a->NamedItem(name, &prop);
|
||||
|
|
|
@ -104,10 +104,10 @@ GetWindowCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
|
||||
JSString *jsstring = JS_ValueToString(cx, id);
|
||||
if (nsnull != jsstring) {
|
||||
name.Assign(JS_GetStringChars(jsstring));
|
||||
name.SetString(JS_GetStringChars(jsstring));
|
||||
}
|
||||
else {
|
||||
name.Assign("");
|
||||
name.SetString("");
|
||||
}
|
||||
|
||||
result = a->NamedItem(name, &prop);
|
||||
|
|
|
@ -104,10 +104,10 @@ GetHTMLCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
|
||||
JSString *jsstring = JS_ValueToString(cx, id);
|
||||
if (nsnull != jsstring) {
|
||||
name.Assign(JS_GetStringChars(jsstring));
|
||||
name.SetString(JS_GetStringChars(jsstring));
|
||||
}
|
||||
else {
|
||||
name.Assign("");
|
||||
name.SetString("");
|
||||
}
|
||||
|
||||
result = a->NamedItem(name, &prop);
|
||||
|
|
|
@ -405,10 +405,10 @@ GetHTMLDocumentProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
|
||||
JSString *jsstring = JS_ValueToString(cx, id);
|
||||
if (nsnull != jsstring) {
|
||||
name.Assign(JS_GetStringChars(jsstring));
|
||||
name.SetString(JS_GetStringChars(jsstring));
|
||||
}
|
||||
else {
|
||||
name.Assign("");
|
||||
name.SetString("");
|
||||
}
|
||||
|
||||
if (NS_OK == a->QueryInterface(kINSHTMLDocumentIID, (void **)&b)) {
|
||||
|
|
|
@ -252,10 +252,10 @@ GetHTMLSelectElementProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
|
|||
|
||||
JSString *jsstring = JS_ValueToString(cx, id);
|
||||
if (nsnull != jsstring) {
|
||||
name.Assign(JS_GetStringChars(jsstring));
|
||||
name.SetString(JS_GetStringChars(jsstring));
|
||||
}
|
||||
else {
|
||||
name.Assign("");
|
||||
name.SetString("");
|
||||
}
|
||||
|
||||
if (NS_OK == a->QueryInterface(kINSHTMLSelectElementIID, (void **)&b)) {
|
||||
|
|
|
@ -117,10 +117,10 @@ GetNSHTMLOptionCollectionProperty(JSContext *cx, JSObject *obj, jsval id, jsval
|
|||
|
||||
JSString *jsstring = JS_ValueToString(cx, id);
|
||||
if (nsnull != jsstring) {
|
||||
name.Assign(JS_GetStringChars(jsstring));
|
||||
name.SetString(JS_GetStringChars(jsstring));
|
||||
}
|
||||
else {
|
||||
name.Assign("");
|
||||
name.SetString("");
|
||||
}
|
||||
|
||||
result = a->NamedItem(name, &prop);
|
||||
|
|
|
@ -34,14 +34,12 @@
|
|||
#include "nsCOMPtr.h"
|
||||
#include "nsDOMPropEnums.h"
|
||||
#include "nsString.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsIDOMSelectionListener.h"
|
||||
|
||||
|
||||
static NS_DEFINE_IID(kIScriptObjectOwnerIID, NS_ISCRIPTOBJECTOWNER_IID);
|
||||
static NS_DEFINE_IID(kIJSScriptObjectIID, NS_IJSSCRIPTOBJECT_IID);
|
||||
static NS_DEFINE_IID(kIScriptGlobalObjectIID, NS_ISCRIPTGLOBALOBJECT_IID);
|
||||
static NS_DEFINE_IID(kINodeIID, NS_IDOMNODE_IID);
|
||||
static NS_DEFINE_IID(kISelectionListenerIID, NS_IDOMSELECTIONLISTENER_IID);
|
||||
|
||||
|
||||
|
@ -179,57 +177,6 @@ SelectionListenerNotifySelectionChanged(JSContext *cx, JSObject *obj, uintN argc
|
|||
}
|
||||
|
||||
|
||||
//
|
||||
// Native method TableCellNotification
|
||||
//
|
||||
PR_STATIC_CALLBACK(JSBool)
|
||||
SelectionListenerTableCellNotification(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMSelectionListener *nativeThis = (nsIDOMSelectionListener*)nsJSUtils::nsGetNativeThis(cx, obj);
|
||||
nsresult result = NS_OK;
|
||||
nsCOMPtr<nsIDOMNode> b0;
|
||||
PRInt32 b1;
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if (nsnull == nativeThis) {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
{
|
||||
*rval = JSVAL_NULL;
|
||||
nsIScriptSecurityManager *secMan = nsJSUtils::nsGetSecurityManager(cx, obj);
|
||||
if (!secMan)
|
||||
return PR_FALSE;
|
||||
result = secMan->CheckScriptAccess(cx, obj, NS_DOM_PROP_SELECTIONLISTENER_TABLECELLNOTIFICATION, PR_FALSE);
|
||||
if (NS_FAILED(result)) {
|
||||
return nsJSUtils::nsReportError(cx, obj, result);
|
||||
}
|
||||
if (argc < 2) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_TOO_FEW_PARAMETERS_ERR);
|
||||
}
|
||||
|
||||
if (JS_FALSE == nsJSUtils::nsConvertJSValToObject((nsISupports **)(void**)getter_AddRefs(b0),
|
||||
kINodeIID,
|
||||
"Node",
|
||||
cx,
|
||||
argv[0])) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_OBJECT_ERR);
|
||||
}
|
||||
if (!JS_ValueToInt32(cx, argv[1], (int32 *)&b1)) {
|
||||
return nsJSUtils::nsReportError(cx, obj, NS_ERROR_DOM_NOT_NUMBER_ERR);
|
||||
}
|
||||
|
||||
result = nativeThis->TableCellNotification(b0, b1);
|
||||
if (NS_FAILED(result)) {
|
||||
return nsJSUtils::nsReportError(cx, obj, result);
|
||||
}
|
||||
|
||||
*rval = JSVAL_VOID;
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************/
|
||||
//
|
||||
// class for SelectionListener
|
||||
|
@ -265,7 +212,6 @@ static JSPropertySpec SelectionListenerProperties[] =
|
|||
static JSFunctionSpec SelectionListenerMethods[] =
|
||||
{
|
||||
{"notifySelectionChanged", SelectionListenerNotifySelectionChanged, 0},
|
||||
{"tableCellNotification", SelectionListenerTableCellNotification, 2},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче