зеркало из https://github.com/mozilla/gecko-dev.git
fix for bug 199503 - consolidate layout atoms into the main layout atom lists
sr=bryner, r=jag
This commit is contained in:
Родитель
ecb9202673
Коммит
bff73e5ad2
|
@ -39,6 +39,7 @@
|
|||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsXBLPrototypeHandler.h"
|
||||
#include "nsXBLAtoms.h"
|
||||
#include "nsXBLContextMenuHandler.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIScriptContext.h"
|
||||
|
@ -63,32 +64,21 @@
|
|||
#include "nsIURI.h"
|
||||
#include "nsXPIDLString.h"
|
||||
|
||||
PRUint32 nsXBLContextMenuHandler::gRefCnt = 0;
|
||||
nsIAtom* nsXBLContextMenuHandler::kContextMenuAtom = nsnull;
|
||||
|
||||
nsXBLContextMenuHandler::nsXBLContextMenuHandler(nsIDOMEventReceiver* aReceiver,
|
||||
nsXBLPrototypeHandler* aHandler)
|
||||
: nsXBLEventHandler(aReceiver, aHandler)
|
||||
{
|
||||
gRefCnt++;
|
||||
if (gRefCnt == 1) {
|
||||
kContextMenuAtom = NS_NewAtom("contextmenu");
|
||||
}
|
||||
}
|
||||
|
||||
nsXBLContextMenuHandler::~nsXBLContextMenuHandler()
|
||||
{
|
||||
gRefCnt--;
|
||||
if (gRefCnt == 0) {
|
||||
NS_RELEASE(kContextMenuAtom);
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED1(nsXBLContextMenuHandler, nsXBLEventHandler, nsIDOMContextMenuListener)
|
||||
|
||||
nsresult nsXBLContextMenuHandler::ContextMenu(nsIDOMEvent* aContextMenuEvent)
|
||||
{
|
||||
return DoMouse(kContextMenuAtom, aContextMenuEvent);
|
||||
return DoMouse(nsXBLAtoms::contextmenu, aContextMenuEvent);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -67,10 +67,6 @@ public:
|
|||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
protected:
|
||||
static PRUint32 gRefCnt;
|
||||
static nsIAtom* kContextMenuAtom;
|
||||
|
||||
protected:
|
||||
// Members
|
||||
};
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "nsCOMPtr.h"
|
||||
#include "nsXBLPrototypeHandler.h"
|
||||
#include "nsXBLDragHandler.h"
|
||||
#include "nsXBLAtoms.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIDOMMouseEvent.h"
|
||||
#include "nsIScriptContext.h"
|
||||
|
@ -62,64 +63,41 @@
|
|||
#include "nsIURI.h"
|
||||
#include "nsXPIDLString.h"
|
||||
|
||||
PRUint32 nsXBLDragHandler::gRefCnt = 0;
|
||||
nsIAtom* nsXBLDragHandler::kDragEnterAtom = nsnull;
|
||||
nsIAtom* nsXBLDragHandler::kDragOverAtom = nsnull;
|
||||
nsIAtom* nsXBLDragHandler::kDragExitAtom = nsnull;
|
||||
nsIAtom* nsXBLDragHandler::kDragDropAtom = nsnull;
|
||||
nsIAtom* nsXBLDragHandler::kDragGestureAtom = nsnull;
|
||||
|
||||
nsXBLDragHandler::nsXBLDragHandler(nsIDOMEventReceiver* aReceiver,
|
||||
nsXBLPrototypeHandler* aHandler)
|
||||
: nsXBLEventHandler(aReceiver, aHandler)
|
||||
{
|
||||
gRefCnt++;
|
||||
if (gRefCnt == 1) {
|
||||
kDragEnterAtom = NS_NewAtom("dragenter");
|
||||
kDragOverAtom = NS_NewAtom("dragover");
|
||||
kDragExitAtom = NS_NewAtom("dragexit");
|
||||
kDragDropAtom = NS_NewAtom("dragdrop");
|
||||
kDragGestureAtom = NS_NewAtom("draggesture");
|
||||
}
|
||||
}
|
||||
|
||||
nsXBLDragHandler::~nsXBLDragHandler()
|
||||
{
|
||||
gRefCnt--;
|
||||
if (gRefCnt == 0) {
|
||||
NS_RELEASE(kDragEnterAtom);
|
||||
NS_RELEASE(kDragOverAtom);
|
||||
NS_RELEASE(kDragExitAtom);
|
||||
NS_RELEASE(kDragDropAtom);
|
||||
NS_RELEASE(kDragGestureAtom);
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED1(nsXBLDragHandler, nsXBLEventHandler, nsIDOMDragListener)
|
||||
|
||||
nsresult nsXBLDragHandler::DragEnter(nsIDOMEvent* aMouseEvent)
|
||||
{
|
||||
return DoMouse(kDragEnterAtom, aMouseEvent);
|
||||
return DoMouse(nsXBLAtoms::dragenter, aMouseEvent);
|
||||
}
|
||||
|
||||
nsresult nsXBLDragHandler::DragOver(nsIDOMEvent* aMouseEvent)
|
||||
{
|
||||
return DoMouse(kDragOverAtom, aMouseEvent);
|
||||
return DoMouse(nsXBLAtoms::dragover, aMouseEvent);
|
||||
}
|
||||
|
||||
nsresult nsXBLDragHandler::DragDrop(nsIDOMEvent* aMouseEvent)
|
||||
{
|
||||
return DoMouse(kDragDropAtom, aMouseEvent);
|
||||
return DoMouse(nsXBLAtoms::dragdrop, aMouseEvent);
|
||||
}
|
||||
|
||||
nsresult nsXBLDragHandler::DragExit(nsIDOMEvent* aMouseEvent)
|
||||
{
|
||||
return DoMouse(kDragExitAtom, aMouseEvent);
|
||||
return DoMouse(nsXBLAtoms::dragexit, aMouseEvent);
|
||||
}
|
||||
|
||||
nsresult nsXBLDragHandler::DragGesture(nsIDOMEvent* aMouseEvent)
|
||||
{
|
||||
return DoMouse(kDragGestureAtom, aMouseEvent);
|
||||
return DoMouse(nsXBLAtoms::draggesture, aMouseEvent);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -70,14 +70,6 @@ public:
|
|||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
protected:
|
||||
static PRUint32 gRefCnt;
|
||||
static nsIAtom* kDragEnterAtom;
|
||||
static nsIAtom* kDragOverAtom;
|
||||
static nsIAtom* kDragExitAtom;
|
||||
static nsIAtom* kDragDropAtom;
|
||||
static nsIAtom* kDragGestureAtom;
|
||||
|
||||
protected:
|
||||
// Members
|
||||
};
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "nsCOMPtr.h"
|
||||
#include "nsXBLPrototypeHandler.h"
|
||||
#include "nsXBLFocusHandler.h"
|
||||
#include "nsXBLAtoms.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIScriptContext.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
|
@ -61,41 +62,27 @@
|
|||
#include "nsIURI.h"
|
||||
#include "nsXPIDLString.h"
|
||||
|
||||
PRUint32 nsXBLFocusHandler::gRefCnt = 0;
|
||||
nsIAtom* nsXBLFocusHandler::kFocusAtom = nsnull;
|
||||
nsIAtom* nsXBLFocusHandler::kBlurAtom = nsnull;
|
||||
|
||||
nsXBLFocusHandler::nsXBLFocusHandler(nsIDOMEventReceiver* aReceiver,
|
||||
nsXBLPrototypeHandler* aHandler)
|
||||
: nsXBLEventHandler(aReceiver, aHandler)
|
||||
{
|
||||
gRefCnt++;
|
||||
if (gRefCnt == 1) {
|
||||
kFocusAtom = NS_NewAtom("focus");
|
||||
kBlurAtom = NS_NewAtom("blur");
|
||||
}
|
||||
}
|
||||
|
||||
nsXBLFocusHandler::~nsXBLFocusHandler()
|
||||
{
|
||||
gRefCnt--;
|
||||
if (gRefCnt == 0) {
|
||||
NS_RELEASE(kFocusAtom);
|
||||
NS_RELEASE(kBlurAtom);
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED1(nsXBLFocusHandler, nsXBLEventHandler, nsIDOMFocusListener)
|
||||
|
||||
nsresult nsXBLFocusHandler::Focus(nsIDOMEvent* aEvent)
|
||||
{
|
||||
return DoGeneric(kFocusAtom, aEvent);
|
||||
return DoGeneric(nsXBLAtoms::focus, aEvent);
|
||||
}
|
||||
|
||||
|
||||
nsresult nsXBLFocusHandler::Blur(nsIDOMEvent* aEvent)
|
||||
{
|
||||
return DoGeneric(kBlurAtom, aEvent);
|
||||
return DoGeneric(nsXBLAtoms::blur, aEvent);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -67,11 +67,6 @@ public:
|
|||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
protected:
|
||||
static PRUint32 gRefCnt;
|
||||
static nsIAtom* kFocusAtom;
|
||||
static nsIAtom* kBlurAtom;
|
||||
|
||||
protected:
|
||||
// Members
|
||||
};
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "nsCOMPtr.h"
|
||||
#include "nsXBLPrototypeHandler.h"
|
||||
#include "nsXBLFormHandler.h"
|
||||
#include "nsXBLAtoms.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIScriptContext.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
|
@ -54,64 +55,41 @@
|
|||
#include "nsIURI.h"
|
||||
#include "nsXPIDLString.h"
|
||||
|
||||
PRUint32 nsXBLFormHandler::gRefCnt = 0;
|
||||
nsIAtom* nsXBLFormHandler::kSubmitAtom = nsnull;
|
||||
nsIAtom* nsXBLFormHandler::kResetAtom = nsnull;
|
||||
nsIAtom* nsXBLFormHandler::kInputAtom = nsnull;
|
||||
nsIAtom* nsXBLFormHandler::kSelectAtom = nsnull;
|
||||
nsIAtom* nsXBLFormHandler::kChangeAtom = nsnull;
|
||||
|
||||
nsXBLFormHandler::nsXBLFormHandler(nsIDOMEventReceiver* aReceiver,
|
||||
nsXBLPrototypeHandler* aHandler)
|
||||
: nsXBLEventHandler(aReceiver, aHandler)
|
||||
{
|
||||
gRefCnt++;
|
||||
if (gRefCnt == 1) {
|
||||
kInputAtom = NS_NewAtom("input");
|
||||
kSelectAtom = NS_NewAtom("select");
|
||||
kChangeAtom = NS_NewAtom("change");
|
||||
kSubmitAtom = NS_NewAtom("submit");
|
||||
kResetAtom = NS_NewAtom("reset");
|
||||
}
|
||||
}
|
||||
|
||||
nsXBLFormHandler::~nsXBLFormHandler()
|
||||
{
|
||||
gRefCnt--;
|
||||
if (gRefCnt == 0) {
|
||||
NS_RELEASE(kInputAtom);
|
||||
NS_RELEASE(kSubmitAtom);
|
||||
NS_RELEASE(kResetAtom);
|
||||
NS_RELEASE(kSelectAtom);
|
||||
NS_RELEASE(kChangeAtom);
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED1(nsXBLFormHandler, nsXBLEventHandler, nsIDOMFormListener)
|
||||
|
||||
nsresult nsXBLFormHandler::Submit(nsIDOMEvent* aEvent)
|
||||
{
|
||||
return DoGeneric(kSubmitAtom, aEvent);
|
||||
return DoGeneric(nsXBLAtoms::submit, aEvent);
|
||||
}
|
||||
|
||||
nsresult nsXBLFormHandler::Reset(nsIDOMEvent* aEvent)
|
||||
{
|
||||
return DoGeneric(kResetAtom, aEvent);
|
||||
return DoGeneric(nsXBLAtoms::reset, aEvent);
|
||||
}
|
||||
|
||||
nsresult nsXBLFormHandler::Select(nsIDOMEvent* aEvent)
|
||||
{
|
||||
return DoGeneric(kSelectAtom, aEvent);
|
||||
return DoGeneric(nsXBLAtoms::select, aEvent);
|
||||
}
|
||||
|
||||
nsresult nsXBLFormHandler::Change(nsIDOMEvent* aEvent)
|
||||
{
|
||||
return DoGeneric(kChangeAtom, aEvent);
|
||||
return DoGeneric(nsXBLAtoms::change, aEvent);
|
||||
}
|
||||
|
||||
nsresult nsXBLFormHandler::Input(nsIDOMEvent* aEvent)
|
||||
{
|
||||
return DoGeneric(kInputAtom, aEvent);
|
||||
return DoGeneric(nsXBLAtoms::input, aEvent);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -70,14 +70,6 @@ public:
|
|||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
protected:
|
||||
static PRUint32 gRefCnt;
|
||||
static nsIAtom* kSubmitAtom;
|
||||
static nsIAtom* kResetAtom;
|
||||
static nsIAtom* kChangeAtom;
|
||||
static nsIAtom* kSelectAtom;
|
||||
static nsIAtom* kInputAtom;
|
||||
|
||||
protected:
|
||||
// Members
|
||||
};
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "nsCOMPtr.h"
|
||||
#include "nsXBLPrototypeHandler.h"
|
||||
#include "nsXBLKeyHandler.h"
|
||||
#include "nsXBLAtoms.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIScriptContext.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
|
@ -61,48 +62,31 @@
|
|||
#include "nsIURI.h"
|
||||
#include "nsXPIDLString.h"
|
||||
|
||||
PRUint32 nsXBLKeyHandler::gRefCnt = 0;
|
||||
nsIAtom* nsXBLKeyHandler::kKeyDownAtom = nsnull;
|
||||
nsIAtom* nsXBLKeyHandler::kKeyUpAtom = nsnull;
|
||||
nsIAtom* nsXBLKeyHandler::kKeyPressAtom = nsnull;
|
||||
|
||||
nsXBLKeyHandler::nsXBLKeyHandler(nsIDOMEventReceiver* aReceiver,
|
||||
nsXBLPrototypeHandler* aHandler)
|
||||
: nsXBLEventHandler(aReceiver, aHandler)
|
||||
{
|
||||
gRefCnt++;
|
||||
if (gRefCnt == 1) {
|
||||
kKeyUpAtom = NS_NewAtom("keyup");
|
||||
kKeyDownAtom = NS_NewAtom("keydown");
|
||||
kKeyPressAtom = NS_NewAtom("keypress");
|
||||
}
|
||||
}
|
||||
|
||||
nsXBLKeyHandler::~nsXBLKeyHandler()
|
||||
{
|
||||
gRefCnt--;
|
||||
if (gRefCnt == 0) {
|
||||
NS_RELEASE(kKeyUpAtom);
|
||||
NS_RELEASE(kKeyDownAtom);
|
||||
NS_RELEASE(kKeyPressAtom);
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED1(nsXBLKeyHandler, nsXBLEventHandler, nsIDOMKeyListener)
|
||||
|
||||
nsresult nsXBLKeyHandler::KeyUp(nsIDOMEvent* aKeyEvent)
|
||||
{
|
||||
return DoKey(kKeyUpAtom, aKeyEvent);
|
||||
return DoKey(nsXBLAtoms::keyup, aKeyEvent);
|
||||
}
|
||||
|
||||
nsresult nsXBLKeyHandler::KeyDown(nsIDOMEvent* aKeyEvent)
|
||||
{
|
||||
return DoKey(kKeyDownAtom, aKeyEvent);
|
||||
return DoKey(nsXBLAtoms::keydown, aKeyEvent);
|
||||
}
|
||||
|
||||
nsresult nsXBLKeyHandler::KeyPress(nsIDOMEvent* aKeyEvent)
|
||||
{
|
||||
return DoKey(kKeyPressAtom, aKeyEvent);
|
||||
return DoKey(nsXBLAtoms::keypress, aKeyEvent);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -71,12 +71,6 @@ public:
|
|||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
protected:
|
||||
static PRUint32 gRefCnt;
|
||||
static nsIAtom* kKeyUpAtom;
|
||||
static nsIAtom* kKeyDownAtom;
|
||||
static nsIAtom* kKeyPressAtom;
|
||||
|
||||
protected:
|
||||
// Members
|
||||
};
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "nsCOMPtr.h"
|
||||
#include "nsXBLPrototypeHandler.h"
|
||||
#include "nsXBLLoadHandler.h"
|
||||
#include "nsXBLAtoms.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIScriptContext.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
|
@ -54,56 +55,36 @@
|
|||
#include "nsIURI.h"
|
||||
#include "nsXPIDLString.h"
|
||||
|
||||
PRUint32 nsXBLLoadHandler::gRefCnt = 0;
|
||||
nsIAtom* nsXBLLoadHandler::kLoadAtom = nsnull;
|
||||
nsIAtom* nsXBLLoadHandler::kUnloadAtom = nsnull;
|
||||
nsIAtom* nsXBLLoadHandler::kAbortAtom = nsnull;
|
||||
nsIAtom* nsXBLLoadHandler::kErrorAtom = nsnull;
|
||||
|
||||
nsXBLLoadHandler::nsXBLLoadHandler(nsIDOMEventReceiver* aReceiver,
|
||||
nsXBLPrototypeHandler* aHandler)
|
||||
: nsXBLEventHandler(aReceiver, aHandler)
|
||||
{
|
||||
gRefCnt++;
|
||||
if (gRefCnt == 1) {
|
||||
kAbortAtom = NS_NewAtom("abort");
|
||||
kErrorAtom = NS_NewAtom("error");
|
||||
kLoadAtom = NS_NewAtom("load");
|
||||
kUnloadAtom = NS_NewAtom("unload");
|
||||
}
|
||||
}
|
||||
|
||||
nsXBLLoadHandler::~nsXBLLoadHandler()
|
||||
{
|
||||
gRefCnt--;
|
||||
if (gRefCnt == 0) {
|
||||
NS_RELEASE(kAbortAtom);
|
||||
NS_RELEASE(kLoadAtom);
|
||||
NS_RELEASE(kUnloadAtom);
|
||||
NS_RELEASE(kErrorAtom);
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED1(nsXBLLoadHandler, nsXBLEventHandler, nsIDOMLoadListener)
|
||||
|
||||
nsresult nsXBLLoadHandler::Load(nsIDOMEvent* aEvent)
|
||||
{
|
||||
return DoGeneric(kLoadAtom, aEvent);
|
||||
return DoGeneric(nsXBLAtoms::load, aEvent);
|
||||
}
|
||||
|
||||
nsresult nsXBLLoadHandler::Unload(nsIDOMEvent* aEvent)
|
||||
{
|
||||
return DoGeneric(kUnloadAtom, aEvent);
|
||||
return DoGeneric(nsXBLAtoms::unload, aEvent);
|
||||
}
|
||||
|
||||
nsresult nsXBLLoadHandler::Error(nsIDOMEvent* aEvent)
|
||||
{
|
||||
return DoGeneric(kErrorAtom, aEvent);
|
||||
return DoGeneric(nsXBLAtoms::error, aEvent);
|
||||
}
|
||||
|
||||
nsresult nsXBLLoadHandler::Abort(nsIDOMEvent* aEvent)
|
||||
{
|
||||
return DoGeneric(kAbortAtom, aEvent);
|
||||
return DoGeneric(nsXBLAtoms::abort, aEvent);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -69,13 +69,6 @@ public:
|
|||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
protected:
|
||||
static PRUint32 gRefCnt;
|
||||
static nsIAtom* kLoadAtom;
|
||||
static nsIAtom* kUnloadAtom;
|
||||
static nsIAtom* kAbortAtom;
|
||||
static nsIAtom* kErrorAtom;
|
||||
|
||||
protected:
|
||||
// Members
|
||||
};
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "nsCOMPtr.h"
|
||||
#include "nsXBLPrototypeHandler.h"
|
||||
#include "nsXBLMouseHandler.h"
|
||||
#include "nsXBLAtoms.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIDOMMouseEvent.h"
|
||||
#include "nsIScriptContext.h"
|
||||
|
@ -62,72 +63,46 @@
|
|||
#include "nsIURI.h"
|
||||
#include "nsXPIDLString.h"
|
||||
|
||||
PRUint32 nsXBLMouseHandler::gRefCnt = 0;
|
||||
nsIAtom* nsXBLMouseHandler::kMouseDownAtom = nsnull;
|
||||
nsIAtom* nsXBLMouseHandler::kMouseUpAtom = nsnull;
|
||||
nsIAtom* nsXBLMouseHandler::kMouseClickAtom = nsnull;
|
||||
nsIAtom* nsXBLMouseHandler::kMouseDblClickAtom = nsnull;
|
||||
nsIAtom* nsXBLMouseHandler::kMouseOverAtom = nsnull;
|
||||
nsIAtom* nsXBLMouseHandler::kMouseOutAtom = nsnull;
|
||||
|
||||
nsXBLMouseHandler::nsXBLMouseHandler(nsIDOMEventReceiver* aReceiver,
|
||||
nsXBLPrototypeHandler* aHandler)
|
||||
: nsXBLEventHandler(aReceiver, aHandler)
|
||||
{
|
||||
gRefCnt++;
|
||||
if (gRefCnt == 1) {
|
||||
kMouseDownAtom = NS_NewAtom("mousedown");
|
||||
kMouseUpAtom = NS_NewAtom("mouseup");
|
||||
kMouseClickAtom = NS_NewAtom("click");
|
||||
kMouseDblClickAtom = NS_NewAtom("dblclick");
|
||||
kMouseOverAtom = NS_NewAtom("mouseover");
|
||||
kMouseOutAtom = NS_NewAtom("mouseout");
|
||||
}
|
||||
}
|
||||
|
||||
nsXBLMouseHandler::~nsXBLMouseHandler()
|
||||
{
|
||||
gRefCnt--;
|
||||
if (gRefCnt == 0) {
|
||||
NS_RELEASE(kMouseUpAtom);
|
||||
NS_RELEASE(kMouseDownAtom);
|
||||
NS_RELEASE(kMouseClickAtom);
|
||||
NS_RELEASE(kMouseDblClickAtom);
|
||||
NS_RELEASE(kMouseOverAtom);
|
||||
NS_RELEASE(kMouseOutAtom);
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED1(nsXBLMouseHandler, nsXBLEventHandler, nsIDOMMouseListener)
|
||||
|
||||
nsresult nsXBLMouseHandler::MouseDown(nsIDOMEvent* aMouseEvent)
|
||||
{
|
||||
return DoMouse(kMouseDownAtom, aMouseEvent);
|
||||
return DoMouse(nsXBLAtoms::mousedown, aMouseEvent);
|
||||
}
|
||||
|
||||
nsresult nsXBLMouseHandler::MouseUp(nsIDOMEvent* aMouseEvent)
|
||||
{
|
||||
return DoMouse(kMouseUpAtom, aMouseEvent);
|
||||
return DoMouse(nsXBLAtoms::mouseup, aMouseEvent);
|
||||
}
|
||||
|
||||
nsresult nsXBLMouseHandler::MouseClick(nsIDOMEvent* aMouseEvent)
|
||||
{
|
||||
return DoMouse(kMouseClickAtom, aMouseEvent);
|
||||
return DoMouse(nsXBLAtoms::click, aMouseEvent);
|
||||
}
|
||||
|
||||
nsresult nsXBLMouseHandler::MouseDblClick(nsIDOMEvent* aMouseEvent)
|
||||
{
|
||||
return DoMouse(kMouseDblClickAtom, aMouseEvent);
|
||||
return DoMouse(nsXBLAtoms::dblclick, aMouseEvent);
|
||||
}
|
||||
|
||||
nsresult nsXBLMouseHandler::MouseOver(nsIDOMEvent* aMouseEvent)
|
||||
{
|
||||
return DoMouse(kMouseOverAtom, aMouseEvent);
|
||||
return DoMouse(nsXBLAtoms::mouseover, aMouseEvent);
|
||||
}
|
||||
|
||||
nsresult nsXBLMouseHandler::MouseOut(nsIDOMEvent* aMouseEvent)
|
||||
{
|
||||
return DoMouse(kMouseOutAtom, aMouseEvent);
|
||||
return DoMouse(nsXBLAtoms::mouseout, aMouseEvent);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -72,15 +72,6 @@ public:
|
|||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
protected:
|
||||
static PRUint32 gRefCnt;
|
||||
static nsIAtom* kMouseDownAtom;
|
||||
static nsIAtom* kMouseUpAtom;
|
||||
static nsIAtom* kMouseClickAtom;
|
||||
static nsIAtom* kMouseDblClickAtom;
|
||||
static nsIAtom* kMouseOverAtom;
|
||||
static nsIAtom* kMouseOutAtom;
|
||||
|
||||
protected:
|
||||
// Members
|
||||
};
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "nsCOMPtr.h"
|
||||
#include "nsXBLPrototypeHandler.h"
|
||||
#include "nsXBLMouseMotionHandler.h"
|
||||
#include "nsXBLAtoms.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIDOMMouseEvent.h"
|
||||
#include "nsIScriptContext.h"
|
||||
|
@ -62,32 +63,21 @@
|
|||
#include "nsIURI.h"
|
||||
#include "nsXPIDLString.h"
|
||||
|
||||
PRUint32 nsXBLMouseMotionHandler::gRefCnt = 0;
|
||||
nsIAtom* nsXBLMouseMotionHandler::kMouseMoveAtom = nsnull;
|
||||
|
||||
nsXBLMouseMotionHandler::nsXBLMouseMotionHandler(nsIDOMEventReceiver* aReceiver,
|
||||
nsXBLPrototypeHandler* aHandler)
|
||||
: nsXBLEventHandler(aReceiver, aHandler)
|
||||
{
|
||||
gRefCnt++;
|
||||
if (gRefCnt == 1) {
|
||||
kMouseMoveAtom = NS_NewAtom("mousemove");
|
||||
}
|
||||
}
|
||||
|
||||
nsXBLMouseMotionHandler::~nsXBLMouseMotionHandler()
|
||||
{
|
||||
gRefCnt--;
|
||||
if (gRefCnt == 0) {
|
||||
NS_RELEASE(kMouseMoveAtom);
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED1(nsXBLMouseMotionHandler, nsXBLEventHandler, nsIDOMMouseMotionListener)
|
||||
|
||||
nsresult nsXBLMouseMotionHandler::MouseMove(nsIDOMEvent* aMouseEvent)
|
||||
{
|
||||
return DoMouse(kMouseMoveAtom, aMouseEvent);
|
||||
return DoMouse(nsXBLAtoms::mousemove, aMouseEvent);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -72,10 +72,6 @@ public:
|
|||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
protected:
|
||||
static PRUint32 gRefCnt;
|
||||
static nsIAtom* kMouseMoveAtom;
|
||||
|
||||
protected:
|
||||
// Members
|
||||
};
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "nsCOMPtr.h"
|
||||
#include "nsXBLPrototypeHandler.h"
|
||||
#include "nsXBLMutationHandler.h"
|
||||
#include "nsXBLAtoms.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIScriptContext.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
|
@ -54,80 +55,51 @@
|
|||
#include "nsIURI.h"
|
||||
#include "nsXPIDLString.h"
|
||||
|
||||
PRUint32 nsXBLMutationHandler::gRefCnt = 0;
|
||||
nsIAtom* nsXBLMutationHandler::kSubtreeModifiedAtom = nsnull;
|
||||
nsIAtom* nsXBLMutationHandler::kAttrModifiedAtom = nsnull;
|
||||
nsIAtom* nsXBLMutationHandler::kCharacterDataModifiedAtom = nsnull;
|
||||
nsIAtom* nsXBLMutationHandler::kNodeRemovedAtom = nsnull;
|
||||
nsIAtom* nsXBLMutationHandler::kNodeInsertedAtom = nsnull;
|
||||
nsIAtom* nsXBLMutationHandler::kNodeRemovedFromDocumentAtom = nsnull;
|
||||
nsIAtom* nsXBLMutationHandler::kNodeInsertedIntoDocumentAtom = nsnull;
|
||||
|
||||
nsXBLMutationHandler::nsXBLMutationHandler(nsIDOMEventReceiver* aReceiver,
|
||||
nsXBLPrototypeHandler* aHandler)
|
||||
: nsXBLEventHandler(aReceiver, aHandler)
|
||||
{
|
||||
gRefCnt++;
|
||||
if (gRefCnt == 1) {
|
||||
kNodeRemovedAtom = NS_NewAtom("DOMNodeRemoved");
|
||||
kNodeInsertedAtom = NS_NewAtom("DOMNodeInserted");
|
||||
kNodeRemovedFromDocumentAtom = NS_NewAtom("DOMNodeRemovedFromDocument");
|
||||
kNodeInsertedIntoDocumentAtom = NS_NewAtom("DOMNodeInsertedIntoDocument");
|
||||
kSubtreeModifiedAtom = NS_NewAtom("DOMSubtreeModified");
|
||||
kAttrModifiedAtom = NS_NewAtom("DOMAttrModified");
|
||||
kCharacterDataModifiedAtom = NS_NewAtom("DOMCharacterDataModified");
|
||||
}
|
||||
}
|
||||
|
||||
nsXBLMutationHandler::~nsXBLMutationHandler()
|
||||
{
|
||||
gRefCnt--;
|
||||
if (gRefCnt == 0) {
|
||||
NS_RELEASE(kSubtreeModifiedAtom);
|
||||
NS_RELEASE(kAttrModifiedAtom);
|
||||
NS_RELEASE(kCharacterDataModifiedAtom);
|
||||
NS_RELEASE(kNodeInsertedAtom);
|
||||
NS_RELEASE(kNodeRemovedAtom);
|
||||
NS_RELEASE(kNodeInsertedIntoDocumentAtom);
|
||||
NS_RELEASE(kNodeRemovedFromDocumentAtom);
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED1(nsXBLMutationHandler, nsXBLEventHandler, nsIDOMMutationListener)
|
||||
|
||||
nsresult nsXBLMutationHandler::SubtreeModified(nsIDOMEvent* aEvent)
|
||||
{
|
||||
return DoGeneric(kSubtreeModifiedAtom, aEvent);
|
||||
return DoGeneric(nsXBLAtoms::DOMSubtreeModified, aEvent);
|
||||
}
|
||||
|
||||
nsresult nsXBLMutationHandler::AttrModified(nsIDOMEvent* aEvent)
|
||||
{
|
||||
return DoGeneric(kAttrModifiedAtom, aEvent);
|
||||
return DoGeneric(nsXBLAtoms::DOMAttrModified, aEvent);
|
||||
}
|
||||
|
||||
nsresult nsXBLMutationHandler::CharacterDataModified(nsIDOMEvent* aEvent)
|
||||
{
|
||||
return DoGeneric(kCharacterDataModifiedAtom, aEvent);
|
||||
return DoGeneric(nsXBLAtoms::DOMCharacterDataModified, aEvent);
|
||||
}
|
||||
|
||||
nsresult nsXBLMutationHandler::NodeInserted(nsIDOMEvent* aEvent)
|
||||
{
|
||||
return DoGeneric(kNodeInsertedAtom, aEvent);
|
||||
return DoGeneric(nsXBLAtoms::DOMNodeInserted, aEvent);
|
||||
}
|
||||
|
||||
nsresult nsXBLMutationHandler::NodeRemoved(nsIDOMEvent* aEvent)
|
||||
{
|
||||
return DoGeneric(kNodeRemovedAtom, aEvent);
|
||||
return DoGeneric(nsXBLAtoms::DOMNodeRemoved, aEvent);
|
||||
}
|
||||
|
||||
nsresult nsXBLMutationHandler::NodeInsertedIntoDocument(nsIDOMEvent* aEvent)
|
||||
{
|
||||
return DoGeneric(kNodeInsertedAtom, aEvent);
|
||||
return DoGeneric(nsXBLAtoms::DOMNodeInsertedIntoDocument, aEvent);
|
||||
}
|
||||
|
||||
nsresult nsXBLMutationHandler::NodeRemovedFromDocument(nsIDOMEvent* aEvent)
|
||||
{
|
||||
return DoGeneric(kNodeRemovedAtom, aEvent);
|
||||
return DoGeneric(nsXBLAtoms::DOMNodeRemovedFromDocument, aEvent);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -72,16 +72,6 @@ public:
|
|||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
protected:
|
||||
static PRUint32 gRefCnt;
|
||||
static nsIAtom* kSubtreeModifiedAtom;
|
||||
static nsIAtom* kAttrModifiedAtom;
|
||||
static nsIAtom* kCharacterDataModifiedAtom;
|
||||
static nsIAtom* kNodeInsertedAtom;
|
||||
static nsIAtom* kNodeRemovedAtom;
|
||||
static nsIAtom* kNodeInsertedIntoDocumentAtom;
|
||||
static nsIAtom* kNodeRemovedFromDocumentAtom;
|
||||
|
||||
protected:
|
||||
// Members
|
||||
};
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "nsCOMPtr.h"
|
||||
#include "nsXBLPrototypeHandler.h"
|
||||
#include "nsXBLScrollHandler.h"
|
||||
#include "nsXBLAtoms.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIScriptContext.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
|
@ -55,48 +56,31 @@
|
|||
#include "nsIURI.h"
|
||||
#include "nsXPIDLString.h"
|
||||
|
||||
PRUint32 nsXBLScrollHandler::gRefCnt = 0;
|
||||
nsIAtom* nsXBLScrollHandler::kOverflowAtom = nsnull;
|
||||
nsIAtom* nsXBLScrollHandler::kUnderflowAtom = nsnull;
|
||||
nsIAtom* nsXBLScrollHandler::kOverflowChangedAtom = nsnull;
|
||||
|
||||
nsXBLScrollHandler::nsXBLScrollHandler(nsIDOMEventReceiver* aReceiver,
|
||||
nsXBLPrototypeHandler* aHandler)
|
||||
: nsXBLEventHandler(aReceiver, aHandler)
|
||||
{
|
||||
gRefCnt++;
|
||||
if (gRefCnt == 1) {
|
||||
kOverflowAtom = NS_NewAtom("overflow");
|
||||
kUnderflowAtom = NS_NewAtom("underflow");
|
||||
kOverflowChangedAtom = NS_NewAtom("overflowchanged");
|
||||
}
|
||||
}
|
||||
|
||||
nsXBLScrollHandler::~nsXBLScrollHandler()
|
||||
{
|
||||
gRefCnt--;
|
||||
if (gRefCnt == 0) {
|
||||
NS_RELEASE(kOverflowAtom);
|
||||
NS_RELEASE(kUnderflowAtom);
|
||||
NS_RELEASE(kOverflowChangedAtom);
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED1(nsXBLScrollHandler, nsXBLEventHandler, nsIDOMScrollListener)
|
||||
|
||||
nsresult nsXBLScrollHandler::Overflow(nsIDOMEvent* aEvent)
|
||||
{
|
||||
return DoGeneric(kOverflowAtom, aEvent);
|
||||
return DoGeneric(nsXBLAtoms::overflow, aEvent);
|
||||
}
|
||||
|
||||
nsresult nsXBLScrollHandler::Underflow(nsIDOMEvent* aEvent)
|
||||
{
|
||||
return DoGeneric(kUnderflowAtom, aEvent);
|
||||
return DoGeneric(nsXBLAtoms::underflow, aEvent);
|
||||
}
|
||||
|
||||
nsresult nsXBLScrollHandler::OverflowChanged(nsIDOMEvent* aEvent)
|
||||
{
|
||||
return DoGeneric(kOverflowChangedAtom, aEvent);
|
||||
return DoGeneric(nsXBLAtoms::overflowchanged, aEvent);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -68,12 +68,6 @@ public:
|
|||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
protected:
|
||||
static PRUint32 gRefCnt;
|
||||
static nsIAtom* kOverflowAtom;
|
||||
static nsIAtom* kUnderflowAtom;
|
||||
static nsIAtom* kOverflowChangedAtom;
|
||||
|
||||
protected:
|
||||
// Members
|
||||
};
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "nsCOMPtr.h"
|
||||
#include "nsXBLPrototypeHandler.h"
|
||||
#include "nsXBLWindowDragHandler.h"
|
||||
#include "nsXBLAtoms.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIAtom.h"
|
||||
#include "nsIDOMNSUIEvent.h"
|
||||
|
@ -52,37 +53,13 @@
|
|||
#include "nsIScriptGlobalObject.h"
|
||||
#include "nsIDOMElement.h"
|
||||
|
||||
PRUint32 nsXBLWindowDragHandler::gRefCnt = 0;
|
||||
nsIAtom* nsXBLWindowDragHandler::kDragGestureAtom = nsnull;
|
||||
nsIAtom* nsXBLWindowDragHandler::kDragOverAtom = nsnull;
|
||||
nsIAtom* nsXBLWindowDragHandler::kDragEnterAtom = nsnull;
|
||||
nsIAtom* nsXBLWindowDragHandler::kDragExitAtom = nsnull;
|
||||
nsIAtom* nsXBLWindowDragHandler::kDragDropAtom = nsnull;
|
||||
|
||||
nsXBLWindowDragHandler::nsXBLWindowDragHandler(nsIDOMEventReceiver* aReceiver)
|
||||
: nsXBLWindowHandler(nsnull, aReceiver)
|
||||
{
|
||||
|
||||
gRefCnt++;
|
||||
if (gRefCnt == 1) {
|
||||
kDragEnterAtom = NS_NewAtom("dragenter");
|
||||
kDragOverAtom = NS_NewAtom("dragover");
|
||||
kDragExitAtom = NS_NewAtom("dragexit");
|
||||
kDragDropAtom = NS_NewAtom("dragdrop");
|
||||
kDragGestureAtom = NS_NewAtom("draggesture");
|
||||
}
|
||||
}
|
||||
|
||||
nsXBLWindowDragHandler::~nsXBLWindowDragHandler()
|
||||
{
|
||||
gRefCnt--;
|
||||
if (gRefCnt == 0) {
|
||||
NS_RELEASE(kDragEnterAtom);
|
||||
NS_RELEASE(kDragOverAtom);
|
||||
NS_RELEASE(kDragExitAtom);
|
||||
NS_RELEASE(kDragDropAtom);
|
||||
NS_RELEASE(kDragGestureAtom);
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsXBLWindowDragHandler, nsIDOMDragListener)
|
||||
|
@ -130,31 +107,31 @@ nsXBLWindowDragHandler::WalkHandlers(nsIDOMEvent* aDragEvent, nsIAtom* aEventTyp
|
|||
nsresult
|
||||
nsXBLWindowDragHandler::DragGesture(nsIDOMEvent* aDragEvent)
|
||||
{
|
||||
return WalkHandlers(aDragEvent, kDragGestureAtom);
|
||||
return WalkHandlers(aDragEvent, nsXBLAtoms::draggesture);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsXBLWindowDragHandler::DragEnter(nsIDOMEvent* aDragEvent)
|
||||
{
|
||||
return WalkHandlers(aDragEvent, kDragEnterAtom);
|
||||
return WalkHandlers(aDragEvent, nsXBLAtoms::dragenter);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsXBLWindowDragHandler::DragExit(nsIDOMEvent* aDragEvent)
|
||||
{
|
||||
return WalkHandlers(aDragEvent, kDragExitAtom);
|
||||
return WalkHandlers(aDragEvent, nsXBLAtoms::dragexit);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsXBLWindowDragHandler::DragOver(nsIDOMEvent* aDragEvent)
|
||||
{
|
||||
return WalkHandlers(aDragEvent, kDragOverAtom);
|
||||
return WalkHandlers(aDragEvent, nsXBLAtoms::dragevent);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsXBLWindowDragHandler::DragDrop(nsIDOMEvent* aDragEvent)
|
||||
{
|
||||
return WalkHandlers(aDragEvent, kDragDropAtom);
|
||||
return WalkHandlers(aDragEvent, nsXBLAtoms::dragdrop);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -72,16 +72,6 @@ protected:
|
|||
PRBool EventMatched(nsXBLPrototypeHandler* inHandler, nsIAtom* inEventType,
|
||||
nsIDOMEvent* inEvent);
|
||||
|
||||
// We need our own refcount (even though our base class has one) because
|
||||
// we have our own statics that need to be initialized and the creation of
|
||||
// other subclasses would cause us to miss things if we shared the counter.
|
||||
static PRUint32 gRefCnt;
|
||||
static nsIAtom* kDragGestureAtom;
|
||||
static nsIAtom* kDragOverAtom;
|
||||
static nsIAtom* kDragEnterAtom;
|
||||
static nsIAtom* kDragExitAtom;
|
||||
static nsIAtom* kDragDropAtom;
|
||||
|
||||
};
|
||||
|
||||
nsresult
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
#include "nsCOMPtr.h"
|
||||
#include "nsXBLPrototypeHandler.h"
|
||||
#include "nsXBLWindowKeyHandler.h"
|
||||
#include "nsXBLAtoms.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIAtom.h"
|
||||
#include "nsIDOMNSUIEvent.h"
|
||||
|
@ -55,22 +56,10 @@
|
|||
#include "nsIDOMElement.h"
|
||||
#include "nsXBLAtoms.h"
|
||||
|
||||
PRUint32 nsXBLWindowKeyHandler::gRefCnt = 0;
|
||||
nsIAtom* nsXBLWindowKeyHandler::kKeyDownAtom = nsnull;
|
||||
nsIAtom* nsXBLWindowKeyHandler::kKeyUpAtom = nsnull;
|
||||
nsIAtom* nsXBLWindowKeyHandler::kKeyPressAtom = nsnull;
|
||||
|
||||
|
||||
nsXBLWindowKeyHandler::nsXBLWindowKeyHandler(nsIDOMElement* aElement, nsIDOMEventReceiver* aReceiver)
|
||||
: nsXBLWindowHandler(aElement, aReceiver)
|
||||
{
|
||||
|
||||
gRefCnt++;
|
||||
if (gRefCnt == 1) {
|
||||
kKeyUpAtom = NS_NewAtom("keyup");
|
||||
kKeyDownAtom = NS_NewAtom("keydown");
|
||||
kKeyPressAtom = NS_NewAtom("keypress");
|
||||
}
|
||||
}
|
||||
|
||||
nsXBLWindowKeyHandler::~nsXBLWindowKeyHandler()
|
||||
|
@ -78,13 +67,6 @@ nsXBLWindowKeyHandler::~nsXBLWindowKeyHandler()
|
|||
// If mElement is non-null, we created a prototype handler.
|
||||
if (mElement)
|
||||
delete mHandler;
|
||||
|
||||
gRefCnt--;
|
||||
if (gRefCnt == 0) {
|
||||
NS_RELEASE(kKeyUpAtom);
|
||||
NS_RELEASE(kKeyDownAtom);
|
||||
NS_RELEASE(kKeyPressAtom);
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsXBLWindowKeyHandler, nsIDOMKeyListener)
|
||||
|
@ -184,17 +166,17 @@ nsXBLWindowKeyHandler::WalkHandlers(nsIDOMEvent* aKeyEvent, nsIAtom* aEventType)
|
|||
|
||||
nsresult nsXBLWindowKeyHandler::KeyUp(nsIDOMEvent* aKeyEvent)
|
||||
{
|
||||
return WalkHandlers(aKeyEvent, kKeyUpAtom);
|
||||
return WalkHandlers(aKeyEvent, nsXBLAtoms::keyup);
|
||||
}
|
||||
|
||||
nsresult nsXBLWindowKeyHandler::KeyDown(nsIDOMEvent* aKeyEvent)
|
||||
{
|
||||
return WalkHandlers(aKeyEvent, kKeyDownAtom);
|
||||
return WalkHandlers(aKeyEvent, nsXBLAtoms::keydown);
|
||||
}
|
||||
|
||||
nsresult nsXBLWindowKeyHandler::KeyPress(nsIDOMEvent* aKeyEvent)
|
||||
{
|
||||
return WalkHandlers(aKeyEvent, kKeyPressAtom);
|
||||
return WalkHandlers(aKeyEvent, nsXBLAtoms::keypress);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -63,44 +63,14 @@
|
|||
#include "nsXPIDLString.h"
|
||||
#include "nsXBLAtoms.h"
|
||||
|
||||
PRUint32 nsXBLXULHandler::gRefCnt = 0;
|
||||
nsIAtom* nsXBLXULHandler::kPopupShowingAtom = nsnull;
|
||||
nsIAtom* nsXBLXULHandler::kPopupShownAtom = nsnull;
|
||||
nsIAtom* nsXBLXULHandler::kPopupHidingAtom = nsnull;
|
||||
nsIAtom* nsXBLXULHandler::kPopupHiddenAtom = nsnull;
|
||||
nsIAtom* nsXBLXULHandler::kCloseAtom = nsnull;
|
||||
nsIAtom* nsXBLXULHandler::kCommandUpdateAtom = nsnull;
|
||||
nsIAtom* nsXBLXULHandler::kBroadcastAtom = nsnull;
|
||||
|
||||
nsXBLXULHandler::nsXBLXULHandler(nsIDOMEventReceiver* aReceiver,
|
||||
nsXBLPrototypeHandler* aHandler)
|
||||
: nsXBLEventHandler(aReceiver, aHandler)
|
||||
{
|
||||
gRefCnt++;
|
||||
if (gRefCnt == 1) {
|
||||
kPopupShowingAtom = NS_NewAtom("popupshowing");
|
||||
kPopupShownAtom = NS_NewAtom("popupshown");
|
||||
kPopupHidingAtom = NS_NewAtom("popuphiding");
|
||||
kPopupHiddenAtom = NS_NewAtom("popuphidden");
|
||||
|
||||
kCloseAtom = NS_NewAtom("close");
|
||||
kCommandUpdateAtom = NS_NewAtom("commandupdate");
|
||||
kBroadcastAtom = NS_NewAtom("broadcast");
|
||||
}
|
||||
}
|
||||
|
||||
nsXBLXULHandler::~nsXBLXULHandler()
|
||||
{
|
||||
gRefCnt--;
|
||||
if (gRefCnt == 0) {
|
||||
NS_RELEASE(kCloseAtom);
|
||||
NS_RELEASE(kCommandUpdateAtom);
|
||||
NS_RELEASE(kBroadcastAtom);
|
||||
NS_RELEASE(kPopupShowingAtom);
|
||||
NS_RELEASE(kPopupShownAtom);
|
||||
NS_RELEASE(kPopupHidingAtom);
|
||||
NS_RELEASE(kPopupHiddenAtom);
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED1(nsXBLXULHandler, nsXBLEventHandler, nsIDOMXULListener)
|
||||
|
@ -112,37 +82,37 @@ nsresult nsXBLXULHandler::Command(nsIDOMEvent* aEvent)
|
|||
|
||||
nsresult nsXBLXULHandler::PopupShowing(nsIDOMEvent* aEvent)
|
||||
{
|
||||
return DoGeneric(kPopupShowingAtom, aEvent);
|
||||
return DoGeneric(nsXBLAtoms::popupshowing, aEvent);
|
||||
}
|
||||
|
||||
nsresult nsXBLXULHandler::PopupShown(nsIDOMEvent* aEvent)
|
||||
{
|
||||
return DoGeneric(kPopupShownAtom, aEvent);
|
||||
return DoGeneric(nsXBLAtoms::popupshown, aEvent);
|
||||
}
|
||||
|
||||
nsresult nsXBLXULHandler::PopupHiding(nsIDOMEvent* aEvent)
|
||||
{
|
||||
return DoGeneric(kPopupHidingAtom, aEvent);
|
||||
return DoGeneric(nsXBLAtoms::popuphiding, aEvent);
|
||||
}
|
||||
|
||||
nsresult nsXBLXULHandler::PopupHidden(nsIDOMEvent* aEvent)
|
||||
{
|
||||
return DoGeneric(kPopupHiddenAtom, aEvent);
|
||||
return DoGeneric(nsXBLAtoms::popuphidden, aEvent);
|
||||
}
|
||||
|
||||
nsresult nsXBLXULHandler::Close(nsIDOMEvent* aEvent)
|
||||
{
|
||||
return DoGeneric(kCloseAtom, aEvent);
|
||||
return DoGeneric(nsXBLAtoms::close, aEvent);
|
||||
}
|
||||
|
||||
nsresult nsXBLXULHandler::Broadcast(nsIDOMEvent* aEvent)
|
||||
{
|
||||
return DoGeneric(kBroadcastAtom, aEvent);
|
||||
return DoGeneric(nsXBLAtoms::broadcast, aEvent);
|
||||
}
|
||||
|
||||
nsresult nsXBLXULHandler::CommandUpdate(nsIDOMEvent* aEvent)
|
||||
{
|
||||
return DoGeneric(kCommandUpdateAtom, aEvent);
|
||||
return DoGeneric(nsXBLAtoms::commandupdate, aEvent);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -74,17 +74,6 @@ public:
|
|||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
protected:
|
||||
static PRUint32 gRefCnt;
|
||||
static nsIAtom* kPopupShowingAtom;
|
||||
static nsIAtom* kPopupShownAtom;
|
||||
static nsIAtom* kPopupHidingAtom;
|
||||
static nsIAtom* kPopupHiddenAtom;
|
||||
static nsIAtom* kCloseAtom;
|
||||
static nsIAtom* kDestroyAtom;
|
||||
static nsIAtom* kCommandUpdateAtom;
|
||||
static nsIAtom* kBroadcastAtom;
|
||||
|
||||
protected:
|
||||
// Members
|
||||
};
|
||||
|
|
|
@ -38,6 +38,8 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsXMLElement.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsLayoutAtoms.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIAtom.h"
|
||||
#include "nsIEventListenerManager.h"
|
||||
|
@ -93,36 +95,12 @@ NS_NewXMLElement(nsIContent** aInstancePtrResult, nsINodeInfo *aNodeInfo)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
static nsIAtom* kHrefAtom;
|
||||
static nsIAtom* kShowAtom;
|
||||
static nsIAtom* kTypeAtom;
|
||||
static nsIAtom* kBaseAtom;
|
||||
static nsIAtom* kActuateAtom;
|
||||
static nsIAtom* kEmbedAtom;
|
||||
static PRUint32 kElementCount;
|
||||
|
||||
nsXMLElement::nsXMLElement() : mIsLink(PR_FALSE)
|
||||
{
|
||||
if (0 == kElementCount++) {
|
||||
kHrefAtom = NS_NewAtom("href");
|
||||
kShowAtom = NS_NewAtom("show");
|
||||
kTypeAtom = NS_NewAtom("type");
|
||||
kBaseAtom = NS_NewAtom("base");
|
||||
kActuateAtom = NS_NewAtom("actuate");
|
||||
kEmbedAtom = NS_NewAtom("embed");
|
||||
}
|
||||
}
|
||||
|
||||
nsXMLElement::~nsXMLElement()
|
||||
{
|
||||
if (0 == --kElementCount) {
|
||||
NS_RELEASE(kHrefAtom);
|
||||
NS_RELEASE(kShowAtom);
|
||||
NS_RELEASE(kTypeAtom);
|
||||
NS_RELEASE(kBaseAtom);
|
||||
NS_RELEASE(kActuateAtom);
|
||||
NS_RELEASE(kEmbedAtom);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -188,7 +166,7 @@ nsXMLElement::GetXMLBaseURI(nsIURI **aURI)
|
|||
nsCOMPtr<nsIContent> content(do_QueryInterface(NS_STATIC_CAST(nsIXMLContent*,this),&rv));
|
||||
while (NS_SUCCEEDED(rv) && content) {
|
||||
nsAutoString value;
|
||||
rv = content->GetAttr(kNameSpaceID_XML,kBaseAtom,value);
|
||||
rv = content->GetAttr(kNameSpaceID_XML,nsHTMLAtoms::base,value);
|
||||
PRInt32 value_len;
|
||||
if (rv == NS_CONTENT_ATTR_HAS_VALUE) {
|
||||
PRInt32 colon = value.FindChar(':');
|
||||
|
@ -314,7 +292,7 @@ nsXMLElement::SetAttr(nsINodeInfo *aNodeInfo,
|
|||
{
|
||||
NS_ENSURE_ARG_POINTER(aNodeInfo);
|
||||
|
||||
if (aNodeInfo->Equals(kTypeAtom, kNameSpaceID_XLink)) {
|
||||
if (aNodeInfo->Equals(nsHTMLAtoms::type, kNameSpaceID_XLink)) {
|
||||
|
||||
// NOTE: This really is a link according to the XLink spec,
|
||||
// we do not need to check other attributes. If there
|
||||
|
@ -402,7 +380,7 @@ nsXMLElement::MaybeTriggerAutoLink(nsIWebShell *aShell)
|
|||
// actuate="onLoad" ?
|
||||
nsAutoString value;
|
||||
rv = nsGenericContainerElement::GetAttr(kNameSpaceID_XLink,
|
||||
kActuateAtom,
|
||||
nsLayoutAtoms::actuate,
|
||||
value);
|
||||
if (rv == NS_CONTENT_ATTR_HAS_VALUE &&
|
||||
value.Equals(onloadString)) {
|
||||
|
@ -426,7 +404,7 @@ nsXMLElement::MaybeTriggerAutoLink(nsIWebShell *aShell)
|
|||
// show= ?
|
||||
nsLinkVerb verb = eLinkVerb_Undefined; // basically means same as replace
|
||||
rv = nsGenericContainerElement::GetAttr(kNameSpaceID_XLink,
|
||||
kShowAtom, value);
|
||||
nsLayoutAtoms::show, value);
|
||||
if (NS_FAILED(rv))
|
||||
break;
|
||||
|
||||
|
@ -469,7 +447,7 @@ nsXMLElement::MaybeTriggerAutoLink(nsIWebShell *aShell)
|
|||
|
||||
// href= ?
|
||||
rv = nsGenericContainerElement::GetAttr(kNameSpaceID_XLink,
|
||||
kHrefAtom,
|
||||
nsHTMLAtoms::href,
|
||||
value);
|
||||
if (rv == NS_CONTENT_ATTR_HAS_VALUE && !value.IsEmpty()) {
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
|
@ -533,7 +511,7 @@ nsXMLElement::HandleDOMEvent(nsIPresContext* aPresContext,
|
|||
nsIURI* baseURL = nsnull;
|
||||
nsLinkVerb verb = eLinkVerb_Undefined; // basically means same as replace
|
||||
nsGenericContainerElement::GetAttr(kNameSpaceID_XLink,
|
||||
kHrefAtom,
|
||||
nsHTMLAtoms::href,
|
||||
href);
|
||||
if (href.IsEmpty()) {
|
||||
*aEventStatus = nsEventStatus_eConsumeDoDefault;
|
||||
|
@ -541,7 +519,7 @@ nsXMLElement::HandleDOMEvent(nsIPresContext* aPresContext,
|
|||
}
|
||||
|
||||
nsGenericContainerElement::GetAttr(kNameSpaceID_XLink,
|
||||
kShowAtom,
|
||||
nsLayoutAtoms::show,
|
||||
show);
|
||||
|
||||
// XXX Should probably do this using atoms
|
||||
|
@ -611,7 +589,8 @@ nsXMLElement::HandleDOMEvent(nsIPresContext* aPresContext,
|
|||
{
|
||||
nsAutoString href, target;
|
||||
nsIURI* baseURL = nsnull;
|
||||
nsGenericContainerElement::GetAttr(kNameSpaceID_XLink, kHrefAtom,
|
||||
nsGenericContainerElement::GetAttr(kNameSpaceID_XLink,
|
||||
nsHTMLAtoms::href,
|
||||
href);
|
||||
if (href.IsEmpty()) {
|
||||
*aEventStatus = nsEventStatus_eConsumeDoDefault;
|
||||
|
|
|
@ -105,6 +105,7 @@
|
|||
#include "nsIExpatSink.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "nsXULAtoms.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
|
||||
static const char kNameSpaceSeparator = ':';
|
||||
static const char kNameSpaceDef[] = "xmlns";
|
||||
|
@ -145,8 +146,6 @@ protected:
|
|||
static nsrefcnt gRefCnt;
|
||||
static nsIXULPrototypeCache* gXULCache;
|
||||
|
||||
static nsIAtom* kScriptAtom;
|
||||
|
||||
PRUnichar* mText;
|
||||
PRInt32 mTextLength;
|
||||
PRInt32 mTextSize;
|
||||
|
@ -253,8 +252,6 @@ protected:
|
|||
nsrefcnt XULContentSinkImpl::gRefCnt;
|
||||
nsIXULPrototypeCache* XULContentSinkImpl::gXULCache;
|
||||
|
||||
nsIAtom* XULContentSinkImpl::kScriptAtom;
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
XULContentSinkImpl::ContextStack::ContextStack()
|
||||
|
@ -339,8 +336,6 @@ XULContentSinkImpl::XULContentSinkImpl(nsresult& rv)
|
|||
{
|
||||
|
||||
if (gRefCnt++ == 0) {
|
||||
kScriptAtom = NS_NewAtom("script");
|
||||
|
||||
rv = CallGetService(kXULPrototypeCacheCID, &gXULCache);
|
||||
}
|
||||
|
||||
|
@ -426,7 +421,6 @@ XULContentSinkImpl::~XULContentSinkImpl()
|
|||
PR_FREEIF(mText);
|
||||
|
||||
if (--gRefCnt == 0) {
|
||||
NS_IF_RELEASE(kScriptAtom);
|
||||
NS_IF_RELEASE(gXULCache);
|
||||
}
|
||||
}
|
||||
|
@ -1273,8 +1267,8 @@ XULContentSinkImpl::OpenRoot(const PRUnichar** aAttributes,
|
|||
|
||||
nsresult rv;
|
||||
|
||||
if (aNodeInfo->Equals(kScriptAtom, kNameSpaceID_XHTML) ||
|
||||
aNodeInfo->Equals(kScriptAtom, kNameSpaceID_XUL)) {
|
||||
if (aNodeInfo->Equals(nsHTMLAtoms::script, kNameSpaceID_XHTML) ||
|
||||
aNodeInfo->Equals(nsHTMLAtoms::script, kNameSpaceID_XUL)) {
|
||||
PR_LOG(gLog, PR_LOG_ALWAYS,
|
||||
("xul: script tag not allowed as root content element"));
|
||||
|
||||
|
@ -1353,8 +1347,8 @@ XULContentSinkImpl::OpenTag(const PRUnichar** aAttributes,
|
|||
|
||||
children->AppendElement(element);
|
||||
|
||||
if (aNodeInfo->Equals(kScriptAtom, kNameSpaceID_XHTML) ||
|
||||
aNodeInfo->Equals(kScriptAtom, kNameSpaceID_XUL)) {
|
||||
if (aNodeInfo->Equals(nsHTMLAtoms::script, kNameSpaceID_XHTML) ||
|
||||
aNodeInfo->Equals(nsHTMLAtoms::script, kNameSpaceID_XUL)) {
|
||||
// Do scripty things now. OpenScript will push the
|
||||
// nsPrototypeScriptElement onto the stack, so we're done after this.
|
||||
return OpenScript(aAttributes, aLineNumber);
|
||||
|
|
|
@ -79,6 +79,7 @@
|
|||
#include "nsIRDFContainerUtils.h"
|
||||
#include "nsXULAtoms.h"
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
|
||||
|
@ -144,14 +145,6 @@ protected:
|
|||
|
||||
private:
|
||||
static nsrefcnt gRefCnt;
|
||||
static nsIAtom *kStaticHintAtom;
|
||||
static nsIAtom *kStaticsSortLastHintAtom;
|
||||
static nsIAtom *kResourceAtom;
|
||||
static nsIAtom *kSortResourceAtom;
|
||||
static nsIAtom *kSortResource2Atom;
|
||||
static nsIAtom *kSortSeparatorsAtom;
|
||||
static nsIAtom *kRDF_type;
|
||||
|
||||
static nsString *kTrueStr;
|
||||
static nsString *kNaturalStr;
|
||||
static nsString *kAscendingStr;
|
||||
|
@ -195,14 +188,6 @@ nsIRDFService *XULSortServiceImpl::gRDFService = nsnull;
|
|||
nsIRDFContainerUtils *XULSortServiceImpl::gRDFC = nsnull;
|
||||
nsrefcnt XULSortServiceImpl::gRefCnt = 0;
|
||||
|
||||
nsIAtom* XULSortServiceImpl::kStaticHintAtom;
|
||||
nsIAtom* XULSortServiceImpl::kStaticsSortLastHintAtom;
|
||||
nsIAtom* XULSortServiceImpl::kResourceAtom;
|
||||
nsIAtom* XULSortServiceImpl::kSortResourceAtom;
|
||||
nsIAtom* XULSortServiceImpl::kSortResource2Atom;
|
||||
nsIAtom* XULSortServiceImpl::kSortSeparatorsAtom;
|
||||
nsIAtom* XULSortServiceImpl::kRDF_type;
|
||||
|
||||
nsString* XULSortServiceImpl::kTrueStr = nsnull;
|
||||
nsString* XULSortServiceImpl::kNaturalStr = nsnull;
|
||||
nsString* XULSortServiceImpl::kAscendingStr = nsnull;
|
||||
|
@ -213,14 +198,6 @@ nsString* XULSortServiceImpl::kDescendingStr = nsnull;
|
|||
XULSortServiceImpl::XULSortServiceImpl(void)
|
||||
{
|
||||
if (gRefCnt == 0) {
|
||||
kStaticHintAtom = NS_NewAtom("staticHint");
|
||||
kStaticsSortLastHintAtom = NS_NewAtom("sortStaticsLast");
|
||||
kResourceAtom = NS_NewAtom("resource");
|
||||
kSortResourceAtom = NS_NewAtom("sortResource");
|
||||
kSortResource2Atom = NS_NewAtom("sortResource2");
|
||||
kSortSeparatorsAtom = NS_NewAtom("sortSeparators");
|
||||
kRDF_type = NS_NewAtom("type");
|
||||
|
||||
kTrueStr = new nsString(NS_LITERAL_STRING("true"));
|
||||
kNaturalStr = new nsString(NS_LITERAL_STRING("natural"));
|
||||
kAscendingStr = new nsString(NS_LITERAL_STRING("ascending"));
|
||||
|
@ -272,14 +249,6 @@ XULSortServiceImpl::~XULSortServiceImpl(void) {
|
|||
delete kNaturalStr;
|
||||
kNaturalStr = nsnull;
|
||||
|
||||
NS_IF_RELEASE(kStaticHintAtom);
|
||||
NS_IF_RELEASE(kStaticsSortLastHintAtom);
|
||||
NS_IF_RELEASE(kResourceAtom);
|
||||
NS_IF_RELEASE(kSortResourceAtom);
|
||||
NS_IF_RELEASE(kSortResource2Atom);
|
||||
NS_IF_RELEASE(kSortSeparatorsAtom);
|
||||
NS_IF_RELEASE(kRDF_type);
|
||||
|
||||
NS_IF_RELEASE(gCollation);
|
||||
|
||||
NS_IF_RELEASE(gRDFService);
|
||||
|
@ -360,24 +329,24 @@ XULSortServiceImpl::SetSortHints(nsIContent *tree, const nsAString &sortResource
|
|||
// set hints on tree root node
|
||||
tree->SetAttr(kNameSpaceID_None, nsXULAtoms::sortActive, *kTrueStr, PR_FALSE);
|
||||
tree->SetAttr(kNameSpaceID_None, nsXULAtoms::sortDirection, sortDirection, PR_FALSE);
|
||||
tree->SetAttr(kNameSpaceID_None, kSortResourceAtom, sortResource, PR_FALSE);
|
||||
tree->SetAttr(kNameSpaceID_None, nsXULAtoms::sortResource, sortResource, PR_FALSE);
|
||||
|
||||
if (!sortResource2.IsEmpty())
|
||||
tree->SetAttr(kNameSpaceID_None, kSortResource2Atom, sortResource2, PR_FALSE);
|
||||
tree->SetAttr(kNameSpaceID_None, nsXULAtoms::sortResource2, sortResource2, PR_FALSE);
|
||||
else
|
||||
tree->UnsetAttr(kNameSpaceID_None, kSortResource2Atom, PR_FALSE);
|
||||
tree->UnsetAttr(kNameSpaceID_None, nsXULAtoms::sortResource2, PR_FALSE);
|
||||
} else {
|
||||
tree->UnsetAttr(kNameSpaceID_None, nsXULAtoms::sortActive, PR_FALSE);
|
||||
tree->UnsetAttr(kNameSpaceID_None, nsXULAtoms::sortDirection, PR_FALSE);
|
||||
tree->UnsetAttr(kNameSpaceID_None, kSortResourceAtom, PR_FALSE);
|
||||
tree->UnsetAttr(kNameSpaceID_None, kSortResource2Atom, PR_FALSE);
|
||||
tree->UnsetAttr(kNameSpaceID_None, nsXULAtoms::sortResource, PR_FALSE);
|
||||
tree->UnsetAttr(kNameSpaceID_None, nsXULAtoms::sortResource2, PR_FALSE);
|
||||
}
|
||||
|
||||
// optional hint
|
||||
if (inbetweenSeparatorSort == PR_TRUE)
|
||||
tree->SetAttr(kNameSpaceID_None, kSortSeparatorsAtom, *kTrueStr, PR_FALSE);
|
||||
tree->SetAttr(kNameSpaceID_None, nsXULAtoms::sortSeparators, *kTrueStr, PR_FALSE);
|
||||
else
|
||||
tree->UnsetAttr(kNameSpaceID_None, kSortSeparatorsAtom, PR_FALSE);
|
||||
tree->UnsetAttr(kNameSpaceID_None, nsXULAtoms::sortSeparators, PR_FALSE);
|
||||
|
||||
SetSortColumnHints(tree, sortResource, sortDirection);
|
||||
|
||||
|
@ -407,7 +376,7 @@ XULSortServiceImpl::SetSortColumnHints(nsIContent *content, const nsAString &sor
|
|||
tag == nsXULAtoms::listcol || tag == nsXULAtoms::listheader) {
|
||||
nsAutoString value;
|
||||
|
||||
if (NS_SUCCEEDED(rv = child->GetAttr(kNameSpaceID_None, kResourceAtom, value))
|
||||
if (NS_SUCCEEDED(rv = child->GetAttr(kNameSpaceID_None, nsXULAtoms::resource, value))
|
||||
&& rv == NS_CONTENT_ATTR_HAS_VALUE)
|
||||
{
|
||||
if (value == sortResource) {
|
||||
|
@ -440,7 +409,7 @@ XULSortServiceImpl::GetSortColumnInfo(nsIContent *tree, nsAString &sortResource,
|
|||
{
|
||||
if (value.EqualsIgnoreCase("true"))
|
||||
{
|
||||
if (NS_SUCCEEDED(rv = tree->GetAttr(kNameSpaceID_None, kSortResourceAtom, sortResource))
|
||||
if (NS_SUCCEEDED(rv = tree->GetAttr(kNameSpaceID_None, nsXULAtoms::sortResource, sortResource))
|
||||
&& (rv == NS_CONTENT_ATTR_HAS_VALUE))
|
||||
{
|
||||
if (NS_SUCCEEDED(rv = tree->GetAttr(kNameSpaceID_None, nsXULAtoms::sortDirection, sortDirection))
|
||||
|
@ -449,7 +418,7 @@ XULSortServiceImpl::GetSortColumnInfo(nsIContent *tree, nsAString &sortResource,
|
|||
rv = NS_OK;
|
||||
|
||||
// sort separator flag is optional
|
||||
if (NS_SUCCEEDED(rv = tree->GetAttr(kNameSpaceID_None, kSortSeparatorsAtom,
|
||||
if (NS_SUCCEEDED(rv = tree->GetAttr(kNameSpaceID_None, nsXULAtoms::sortSeparators,
|
||||
value)) && (rv == NS_CONTENT_ATTR_HAS_VALUE))
|
||||
{
|
||||
if (value.EqualsIgnoreCase("true"))
|
||||
|
@ -459,7 +428,7 @@ XULSortServiceImpl::GetSortColumnInfo(nsIContent *tree, nsAString &sortResource,
|
|||
}
|
||||
|
||||
// secondary sort info is optional
|
||||
if (NS_FAILED(rv = tree->GetAttr(kNameSpaceID_None, kSortResource2Atom, sortResource2))
|
||||
if (NS_FAILED(rv = tree->GetAttr(kNameSpaceID_None, nsXULAtoms::sortResource2, sortResource2))
|
||||
|| (rv != NS_CONTENT_ATTR_HAS_VALUE))
|
||||
{
|
||||
sortResource2.Truncate();
|
||||
|
@ -1164,7 +1133,7 @@ XULSortServiceImpl::SortContainer(nsIContent *container, sortPtr sortInfo, PRBoo
|
|||
nsAutoString type;
|
||||
for (loop=currentElement; loop< currentElement + numElements; ++loop) {
|
||||
if (NS_SUCCEEDED(rv = contentSortInfoArray[loop]->content->GetAttr(kNameSpaceID_RDF,
|
||||
kRDF_type, type)) && (rv == NS_CONTENT_ATTR_HAS_VALUE))
|
||||
nsXULAtoms::type, type)) && (rv == NS_CONTENT_ATTR_HAS_VALUE))
|
||||
{
|
||||
if (type.EqualsWithConversion(kURINC_BookmarkSeparator)) {
|
||||
if (loop > startIndex+1) {
|
||||
|
@ -1298,7 +1267,7 @@ XULSortServiceImpl::InsertContainerNode(nsIRDFCompositeDataSource *db, nsRDFSort
|
|||
|
||||
// look for sorting info on root node
|
||||
|
||||
if (NS_SUCCEEDED(rv = root->GetAttr(kNameSpaceID_None, kSortResourceAtom, sortResource))
|
||||
if (NS_SUCCEEDED(rv = root->GetAttr(kNameSpaceID_None, nsXULAtoms::sortResource, sortResource))
|
||||
&& (rv == NS_CONTENT_ATTR_HAS_VALUE))
|
||||
{
|
||||
if (NS_SUCCEEDED(rv = root->GetAttr(kNameSpaceID_None, nsXULAtoms::sortDirection, sortDirection))
|
||||
|
@ -1306,7 +1275,7 @@ XULSortServiceImpl::InsertContainerNode(nsIRDFCompositeDataSource *db, nsRDFSort
|
|||
{
|
||||
sortInfoAvailable = PR_TRUE;
|
||||
|
||||
if (NS_FAILED(rv = root->GetAttr(kNameSpaceID_None, kSortResource2Atom, sortResource2))
|
||||
if (NS_FAILED(rv = root->GetAttr(kNameSpaceID_None, nsXULAtoms::sortResource2, sortResource2))
|
||||
|| (rv != NS_CONTENT_ATTR_HAS_VALUE))
|
||||
{
|
||||
sortResource2.Truncate();
|
||||
|
@ -1442,7 +1411,7 @@ XULSortServiceImpl::InsertContainerNode(nsIRDFCompositeDataSource *db, nsRDFSort
|
|||
PRInt32 staticCount = 0;
|
||||
|
||||
nsAutoString staticValue;
|
||||
if (NS_SUCCEEDED(rv = container->GetAttr(kNameSpaceID_None, kStaticHintAtom, staticValue))
|
||||
if (NS_SUCCEEDED(rv = container->GetAttr(kNameSpaceID_None, nsXULAtoms::staticHint, staticValue))
|
||||
&& (rv == NS_CONTENT_ATTR_HAS_VALUE))
|
||||
{
|
||||
// found "static" XUL element count hint
|
||||
|
@ -1464,7 +1433,7 @@ XULSortServiceImpl::InsertContainerNode(nsIRDFCompositeDataSource *db, nsRDFSort
|
|||
++staticCount;
|
||||
}
|
||||
|
||||
if (NS_SUCCEEDED(rv = root->GetAttr(kNameSpaceID_None, kStaticsSortLastHintAtom, valueStr))
|
||||
if (NS_SUCCEEDED(rv = root->GetAttr(kNameSpaceID_None, nsXULAtoms::sortStaticsLast, valueStr))
|
||||
&& (rv == NS_CONTENT_ATTR_HAS_VALUE) && (valueStr.EqualsIgnoreCase("true")))
|
||||
{
|
||||
// indicate that static XUL comes after RDF-generated content by making negative
|
||||
|
@ -1474,7 +1443,7 @@ XULSortServiceImpl::InsertContainerNode(nsIRDFCompositeDataSource *db, nsRDFSort
|
|||
// save the "static" XUL element count hint
|
||||
valueStr.Truncate();
|
||||
valueStr.AppendInt(staticCount);
|
||||
container->SetAttr(kNameSpaceID_None, kStaticHintAtom, valueStr, PR_FALSE);
|
||||
container->SetAttr(kNameSpaceID_None, nsXULAtoms::staticHint, valueStr, PR_FALSE);
|
||||
}
|
||||
|
||||
if (staticCount <= 0) {
|
||||
|
@ -1582,7 +1551,7 @@ XULSortServiceImpl::Sort(nsIDOMNode* node, const nsAString& sortResource, const
|
|||
&& (rv == NS_CONTENT_ATTR_HAS_VALUE)
|
||||
&& (value.EqualsIgnoreCase("true")))
|
||||
{
|
||||
if (NS_SUCCEEDED(rv = dbNode->GetAttr(kNameSpaceID_None, kSortResourceAtom, value))
|
||||
if (NS_SUCCEEDED(rv = dbNode->GetAttr(kNameSpaceID_None, nsXULAtoms::sortResource, value))
|
||||
&& (rv == NS_CONTENT_ATTR_HAS_VALUE)
|
||||
&& (value.Equals(sortResource, nsCaseInsensitiveStringComparator())))
|
||||
{
|
||||
|
@ -1601,9 +1570,9 @@ XULSortServiceImpl::Sort(nsIDOMNode* node, const nsAString& sortResource, const
|
|||
// remove any sort hints on tree root node
|
||||
dbNode->UnsetAttr(kNameSpaceID_None, nsXULAtoms::sortActive, PR_FALSE);
|
||||
dbNode->UnsetAttr(kNameSpaceID_None, nsXULAtoms::sortDirection, PR_FALSE);
|
||||
dbNode->UnsetAttr(kNameSpaceID_None, kSortSeparatorsAtom, PR_FALSE);
|
||||
dbNode->UnsetAttr(kNameSpaceID_None, kSortResourceAtom, PR_FALSE);
|
||||
dbNode->UnsetAttr(kNameSpaceID_None, kSortResource2Atom, PR_FALSE);
|
||||
dbNode->UnsetAttr(kNameSpaceID_None, nsXULAtoms::sortSeparators, PR_FALSE);
|
||||
dbNode->UnsetAttr(kNameSpaceID_None, nsXULAtoms::sortResource, PR_FALSE);
|
||||
dbNode->UnsetAttr(kNameSpaceID_None, nsXULAtoms::sortResource2, PR_FALSE);
|
||||
|
||||
nsCOMPtr<nsIRDFCompositeDataSource> cds;
|
||||
if (NS_SUCCEEDED(rv = dbXULNode->GetDatabase(getter_AddRefs(cds))))
|
||||
|
|
Загрузка…
Ссылка в новой задаче