More support for capturing, minor adjustments to window.open behavior.

This commit is contained in:
joki%netscape.com 1998-09-15 21:31:58 +00:00
Родитель 0bc0a1cdd9
Коммит 58d850764d
98 изменённых файлов: 739 добавлений и 427 удалений

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

@ -886,6 +886,9 @@ nsresult nsDocument::HandleDOMEvent(nsIPresContext& aPresContext,
}
//Capturing stage
/*if (mEventCapturer) {
mEventCapturer->HandleDOMEvent(aPresContext, aEvent, aDOMEvent, aFlags, aEventStatus);
}*/
//Local handling stage
if (nsnull != mListenerManager) {
@ -906,7 +909,11 @@ nsresult nsDocument::HandleDOMEvent(nsIPresContext& aPresContext,
if (DOM_EVENT_INIT == aFlags) {
// We're leaving the DOM event loop so if we created a DOM event, release here.
if (nsnull != *aDOMEvent) {
if (0 != (*aDOMEvent)->Release()) {
nsrefcnt rc;
nsIDOMEvent* DOMEvent = *aDOMEvent;
// Release the copy since the macro will null the pointer
NS_RELEASE2(DOMEvent, rc);
if (0 != rc) {
//Okay, so someone in the DOM loop (a listener, JS object) still has a ref to the DOM Event but
//the internal data hasn't been malloc'd. Force a copy of the data here so the DOM Event is still valid.
nsIPrivateDOMEvent *mPrivateEvent;
@ -943,22 +950,22 @@ nsresult nsDocument::RemoveEventListener(nsIDOMEventListener *aListener, const n
return NS_ERROR_FAILURE;
}
nsresult nsDocument::CaptureEvent(nsIDOMEventListener *aListener)
nsresult nsDocument::CaptureEvent(const nsString& aType)
{
nsIEventListenerManager *mManager;
if (NS_OK == GetListenerManager(&mManager)) {
mManager->CaptureEvent(aListener);
//mManager->CaptureEvent(aListener);
NS_RELEASE(mManager);
return NS_OK;
}
return NS_ERROR_FAILURE;
}
nsresult nsDocument::ReleaseEvent(nsIDOMEventListener *aListener)
nsresult nsDocument::ReleaseEvent(const nsString& aType)
{
if (nsnull != mListenerManager) {
mListenerManager->ReleaseEvent(aListener);
//mListenerManager->ReleaseEvent(aListener);
return NS_OK;
}
return NS_ERROR_FAILURE;
@ -1460,6 +1467,7 @@ nsIContent* nsDocument::GetNextContent(const nsIContent *aContent) const
nsIContent * old = result;
old->ChildAt(0, result);
NS_RELEASE(old);
result->ChildCount(n);
}
} else {
result = GetNextContent(parent);

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

@ -229,8 +229,10 @@ public:
NS_IMETHOD Equals(nsIDOMNode* aNode, PRBool aDeep, PRBool* aReturn);
// nsIDOMEventCapturer interface
NS_IMETHOD CaptureEvent(nsIDOMEventListener *aListener);
NS_IMETHOD ReleaseEvent(nsIDOMEventListener *aListener);
NS_IMETHOD CaptureEvent(const nsString& aType);
NS_IMETHOD ReleaseEvent(const nsString& aType);
// nsIDOMEventReceiver interface
NS_IMETHOD AddEventListener(nsIDOMEventListener *aListener, const nsIID& aIID);
NS_IMETHOD RemoveEventListener(nsIDOMEventListener *aListener, const nsIID& aIID);
NS_IMETHOD GetListenerManager(nsIEventListenerManager** aInstancePtrResult);

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

@ -1055,44 +1055,7 @@ nsGenericHTMLElement::SetDocument(nsIDocument* aDocument)
{
mDocument = aDocument;
// Once the element is added to the doc tree we need to check if
// event handler were registered on it. Unfortunately, this means
// doing a GetAttribute for every type of handler.
if ((nsnull != mDocument) && (nsnull != mAttributes)) {
nsHTMLValue val;
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::onclick, val))
AddScriptEventListener(nsHTMLAtoms::onclick, val, kIDOMMouseListenerIID);
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::ondblclick, val))
AddScriptEventListener(nsHTMLAtoms::onclick, val, kIDOMMouseListenerIID);
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::onmousedown, val))
AddScriptEventListener(nsHTMLAtoms::onmousedown, val, kIDOMMouseListenerIID);
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::onmouseup, val))
AddScriptEventListener(nsHTMLAtoms::onmouseup, val, kIDOMMouseListenerIID);
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::onmouseover, val))
AddScriptEventListener(nsHTMLAtoms::onmouseover, val, kIDOMMouseListenerIID);
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::onmouseout, val))
AddScriptEventListener(nsHTMLAtoms::onmouseout, val, kIDOMMouseListenerIID);
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::onkeydown, val))
AddScriptEventListener(nsHTMLAtoms::onkeydown, val, kIDOMKeyListenerIID);
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::onkeyup, val))
AddScriptEventListener(nsHTMLAtoms::onkeyup, val, kIDOMKeyListenerIID);
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::onkeypress, val))
AddScriptEventListener(nsHTMLAtoms::onkeypress, val, kIDOMKeyListenerIID);
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::onmousemove, val))
AddScriptEventListener(nsHTMLAtoms::onmousemove, val, kIDOMMouseMotionListenerIID);
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::onload, val))
AddScriptEventListener(nsHTMLAtoms::onload, val, kIDOMLoadListenerIID);
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::onunload, val))
AddScriptEventListener(nsHTMLAtoms::onunload, val, kIDOMLoadListenerIID);
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::onabort, val))
AddScriptEventListener(nsHTMLAtoms::onabort, val, kIDOMLoadListenerIID);
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::onerror, val))
AddScriptEventListener(nsHTMLAtoms::onerror, val, kIDOMLoadListenerIID);
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::onfocus, val))
AddScriptEventListener(nsHTMLAtoms::onfocus, val, kIDOMFocusListenerIID);
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::onblur, val))
AddScriptEventListener(nsHTMLAtoms::onblur, val, kIDOMFocusListenerIID);
nsIHTMLStyleSheet* sheet = GetAttrStyleSheet(mDocument);
if (nsnull != sheet) {
sheet->SetAttributesFor(mContent, mAttributes); // sync attributes with sheet
@ -1257,6 +1220,40 @@ nsGenericHTMLElement::SetAttribute(nsIAtom* aAttribute,
NS_RELEASE(css);
}
else {
// Check for event handlers
if (nsHTMLAtoms::onclick == aAttribute)
AddScriptEventListener(nsHTMLAtoms::onclick, aValue, kIDOMMouseListenerIID);
else if (nsHTMLAtoms::ondblclick == aAttribute)
AddScriptEventListener(nsHTMLAtoms::ondblclick, aValue, kIDOMMouseListenerIID);
else if (nsHTMLAtoms::onmousedown == aAttribute)
AddScriptEventListener(nsHTMLAtoms::onmousedown, aValue, kIDOMMouseListenerIID);
else if (nsHTMLAtoms::onmouseup == aAttribute)
AddScriptEventListener(nsHTMLAtoms::onmouseup, aValue, kIDOMMouseListenerIID);
else if (nsHTMLAtoms::onmouseover == aAttribute)
AddScriptEventListener(nsHTMLAtoms::onmouseover, aValue, kIDOMMouseListenerIID);
else if (nsHTMLAtoms::onmouseout == aAttribute)
AddScriptEventListener(nsHTMLAtoms::onmouseout, aValue, kIDOMMouseListenerIID);
else if (nsHTMLAtoms::onkeydown == aAttribute)
AddScriptEventListener(nsHTMLAtoms::onkeydown, aValue, kIDOMKeyListenerIID);
else if (nsHTMLAtoms::onkeyup == aAttribute)
AddScriptEventListener(nsHTMLAtoms::onkeyup, aValue, kIDOMKeyListenerIID);
else if (nsHTMLAtoms::onkeypress == aAttribute)
AddScriptEventListener(nsHTMLAtoms::onkeypress, aValue, kIDOMKeyListenerIID);
else if (nsHTMLAtoms::onmousemove == aAttribute)
AddScriptEventListener(nsHTMLAtoms::onmousemove, aValue, kIDOMMouseMotionListenerIID);
else if (nsHTMLAtoms::onload == aAttribute)
AddScriptEventListener(nsHTMLAtoms::onload, aValue, kIDOMLoadListenerIID);
else if (nsHTMLAtoms::onunload == aAttribute)
AddScriptEventListener(nsHTMLAtoms::onunload, aValue, kIDOMLoadListenerIID);
else if (nsHTMLAtoms::onabort == aAttribute)
AddScriptEventListener(nsHTMLAtoms::onabort, aValue, kIDOMLoadListenerIID);
else if (nsHTMLAtoms::onerror == aAttribute)
AddScriptEventListener(nsHTMLAtoms::onerror, aValue, kIDOMLoadListenerIID);
else if (nsHTMLAtoms::onfocus == aAttribute)
AddScriptEventListener(nsHTMLAtoms::onfocus, aValue, kIDOMFocusListenerIID);
else if (nsHTMLAtoms::onblur == aAttribute)
AddScriptEventListener(nsHTMLAtoms::onblur, aValue, kIDOMFocusListenerIID);
nsHTMLValue val;
if (NS_CONTENT_ATTR_NOT_THERE !=
mContent->StringToAttribute(aAttribute, aValue, val)) {
@ -2174,7 +2171,7 @@ nsGenericHTMLElement::Release()
nsresult
nsGenericHTMLElement::AddScriptEventListener(nsIAtom* aAttribute,
nsHTMLValue& aValue,
const nsString& aValue,
REFNSIID aIID)
{
nsresult ret = NS_OK;
@ -2193,9 +2190,7 @@ nsGenericHTMLElement::AddScriptEventListener(nsIAtom* aAttribute,
if (NS_OK == receiver->GetListenerManager(&manager)) {
nsIScriptObjectOwner *mObjectOwner;
if (NS_OK == global->QueryInterface(kIScriptObjectOwnerIID, (void**)&mObjectOwner)) {
nsString value;
aValue.GetStringValue(value);
ret = manager->AddScriptEventListener(context, mObjectOwner, aAttribute, value, aIID);
ret = manager->AddScriptEventListener(context, mObjectOwner, aAttribute, aValue, aIID);
NS_RELEASE(mObjectOwner);
}
NS_RELEASE(manager);
@ -2207,13 +2202,11 @@ nsGenericHTMLElement::AddScriptEventListener(nsIAtom* aAttribute,
else {
nsIEventListenerManager *manager;
if (NS_OK == GetListenerManager(&manager)) {
nsString value;
aValue.GetStringValue(value);
nsIScriptObjectOwner* owner;
if (NS_OK == mContent->QueryInterface(kIScriptObjectOwnerIID,
(void**) &owner)) {
ret = manager->AddScriptEventListener(context, owner,
aAttribute, value, aIID);
aAttribute, aValue, aIID);
NS_RELEASE(owner);
}
NS_RELEASE(manager);

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

@ -179,7 +179,7 @@ public:
nsresult RenderFrame();
nsresult AddScriptEventListener(nsIAtom* aAttribute,
nsHTMLValue& aValue,
const nsString& aValue,
REFNSIID aIID);
nsresult AttributeToString(nsIAtom* aAttribute,

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

@ -132,6 +132,8 @@ public:
NS_IMETHOD MoveTo(PRInt32 aX, PRInt32 aY);
NS_IMETHOD Show();
NS_IMETHOD Hide();
NS_IMETHOD SetFocus();
NS_IMETHOD RemoveFocus();
NS_IMETHOD Repaint(PRBool aForce);
NS_IMETHOD SetContentViewer(nsIContentViewer* aViewer);
NS_IMETHOD GetContentViewer(nsIContentViewer*& aResult);
@ -725,6 +727,34 @@ nsWebShell::Hide()
return NS_OK;
}
NS_IMETHODIMP
nsWebShell::SetFocus()
{
NS_PRECONDITION(nsnull != mWindow, "null window");
if (nsnull != mWindow) {
mWindow->SetFocus();
}
return NS_OK;
}
NS_IMETHODIMP
nsWebShell::RemoveFocus()
{
NS_PRECONDITION(nsnull != mWindow, "null window");
if (nsnull != mWindow) {
nsIWidget *parentWidget = mWindow->GetParent();
if (nsnull != parentWidget) {
parentWidget->SetFocus();
NS_RELEASE(parentWidget);
}
}
return NS_OK;
}
NS_IMETHODIMP
nsWebShell::Repaint(PRBool aForce)
{

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

@ -27,7 +27,7 @@
class nsIDOMNode;
#define NS_IDOMNAMEDNODEMAP_IID \
{ 0x6f7652e9, 0xee43, 0x11d1, \
{ 0x6f7652ea, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMNamedNodeMap : public nsISupports {

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

@ -29,7 +29,7 @@ class nsIDOMNode;
class nsIDOMNodeList;
#define NS_IDOMNODE_IID \
{ 0x6f7652ea, 0xee43, 0x11d1, \
{ 0x6f7652eb, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMNode : public nsISupports {

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

@ -27,7 +27,7 @@
class nsIDOMNode;
#define NS_IDOMNODELIST_IID \
{ 0x6f7652eb, 0xee43, 0x11d1, \
{ 0x6f7652ec, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMNodeList : public nsISupports {

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

@ -27,7 +27,7 @@
#define NS_IDOMPROCESSINGINSTRUCTION_IID \
{ 0x6f7652ec, 0xee43, 0x11d1, \
{ 0x6f7652ed, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMProcessingInstruction : public nsIDOMNode {

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

@ -28,7 +28,7 @@
class nsIDOMText;
#define NS_IDOMTEXT_IID \
{ 0x6f7652ed, 0xee43, 0x11d1, \
{ 0x6f7652ee, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMText : public nsIDOMData {

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

@ -27,7 +27,7 @@
class nsIDOMNode;
#define NS_IDOMEVENT_IID \
{ 0x6f76532c, 0xee43, 0x11d1, \
{ 0x6f76532d, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMEvent : public nsISupports {

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

@ -15,35 +15,39 @@
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
/* AUTO-GENERATED. DO NOT EDIT!!! */
#ifndef nsIDOMEventCapturer_h__
#define nsIDOMEventCapturer_h__
#include "nsISupports.h"
#include "nsString.h"
#include "nsIScriptContext.h"
#include "nsIDOMEventReceiver.h"
class nsIDOMEventListener;
class nsIDOMMouseListener;
class nsIDOMMouseMotionListener;
class nsIDOMKeyListener;
class nsIDOMFocusListener;
class nsIDOMLoadListener;
class nsIDOMDragListener;
class nsIEventListenerManager;
/*
* DOM event source class. Object that allow event registration and distribution
* from themselves implement this interface.
*/
#define NS_IDOMEVENTCAPTURER_IID \
{ /* a044aec0-df04-11d1-bd85-00805f8ae3f4 */ \
0xa044aec0, 0xdf04, 0x11d1, \
{0xbd, 0x85, 0x00, 0x80, 0x5f, 0x8a, 0xe3, 0xf4} }
{ 0x6f76532f, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMEventCapturer : public nsIDOMEventReceiver {
public:
NS_IMETHOD CaptureEvent(nsIDOMEventListener *aListener) = 0;
NS_IMETHOD ReleaseEvent(nsIDOMEventListener *aListener) = 0;
NS_IMETHOD CaptureEvent(const nsString& aType)=0;
NS_IMETHOD ReleaseEvent(const nsString& aType)=0;
};
#define NS_DECL_IDOMEVENTCAPTURER \
NS_IMETHOD CaptureEvent(const nsString& aType); \
NS_IMETHOD ReleaseEvent(const nsString& aType); \
#define NS_FORWARD_IDOMEVENTCAPTURER(_to) \
NS_IMETHOD CaptureEvent(const nsString& aType) { return _to##CaptureEvent(aType); } \
NS_IMETHOD ReleaseEvent(const nsString& aType) { return _to##ReleaseEvent(aType); } \
#endif // nsIDOMEventCapturer_h__

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

@ -26,7 +26,7 @@
#define NS_IDOMNSEVENT_IID \
{ 0x6f76532d, 0xee43, 0x11d1, \
{ 0x6f76532e, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMNSEvent : public nsISupports {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLANCHORELEMENT_IID \
{ 0x6f7652ee, 0xee43, 0x11d1, \
{ 0x6f7652ef, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLAnchorElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLAPPLETELEMENT_IID \
{ 0x6f7652ef, 0xee43, 0x11d1, \
{ 0x6f7652f0, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLAppletElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLAREAELEMENT_IID \
{ 0x6f7652f0, 0xee43, 0x11d1, \
{ 0x6f7652f1, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLAreaElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLBRELEMENT_IID \
{ 0x6f7652f4, 0xee43, 0x11d1, \
{ 0x6f7652f5, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLBRElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLBASEELEMENT_IID \
{ 0x6f7652f1, 0xee43, 0x11d1, \
{ 0x6f7652f2, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLBaseElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLBASEFONTELEMENT_IID \
{ 0x6f7652f2, 0xee43, 0x11d1, \
{ 0x6f7652f3, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLBaseFontElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLBODYELEMENT_IID \
{ 0x6f7652f3, 0xee43, 0x11d1, \
{ 0x6f7652f4, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLBodyElement : public nsIDOMHTMLElement {

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

@ -28,7 +28,7 @@
class nsIDOMHTMLFormElement;
#define NS_IDOMHTMLBUTTONELEMENT_IID \
{ 0x6f7652f5, 0xee43, 0x11d1, \
{ 0x6f7652f6, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLButtonElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
class nsIDOMNode;
#define NS_IDOMHTMLCOLLECTION_IID \
{ 0x6f7652f6, 0xee43, 0x11d1, \
{ 0x6f7652f7, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLCollection : public nsISupports {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLDLISTELEMENT_IID \
{ 0x6f7652fa, 0xee43, 0x11d1, \
{ 0x6f7652fb, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLDListElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLDELELEMENT_IID \
{ 0x6f7652f7, 0xee43, 0x11d1, \
{ 0x6f7652f8, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLDelElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLDIRECTORYELEMENT_IID \
{ 0x6f7652f8, 0xee43, 0x11d1, \
{ 0x6f7652f9, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLDirectoryElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLDIVELEMENT_IID \
{ 0x6f7652f9, 0xee43, 0x11d1, \
{ 0x6f7652fa, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLDivElement : public nsIDOMHTMLElement {

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

@ -32,7 +32,7 @@ class nsIDOMHTMLCollection;
class nsIDOMNodeList;
#define NS_IDOMHTMLDOCUMENT_IID \
{ 0x6f7652fb, 0xee43, 0x11d1, \
{ 0x6f7652fc, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLDocument : public nsIDOMDocument {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLELEMENT_IID \
{ 0x6f7652fc, 0xee43, 0x11d1, \
{ 0x6f7652fd, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLElement : public nsIDOMElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLFONTELEMENT_IID \
{ 0x6f7652fd, 0xee43, 0x11d1, \
{ 0x6f7652fe, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLFontElement : public nsIDOMHTMLElement {

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

@ -28,7 +28,7 @@
class nsIDOMHTMLCollection;
#define NS_IDOMHTMLFORMELEMENT_IID \
{ 0x6f7652fe, 0xee43, 0x11d1, \
{ 0x6f7652ff, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLFormElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLFRAMEELEMENT_IID \
{ 0x6f7652ff, 0xee43, 0x11d1, \
{ 0x6f765300, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLFrameElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLFRAMESETELEMENT_IID \
{ 0x6f765300, 0xee43, 0x11d1, \
{ 0x6f765301, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLFrameSetElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLHRELEMENT_IID \
{ 0x6f765303, 0xee43, 0x11d1, \
{ 0x6f765304, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLHRElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLHEADELEMENT_IID \
{ 0x6f765301, 0xee43, 0x11d1, \
{ 0x6f765302, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLHeadElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLHEADINGELEMENT_IID \
{ 0x6f765302, 0xee43, 0x11d1, \
{ 0x6f765303, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLHeadingElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLHTMLELEMENT_IID \
{ 0x6f765304, 0xee43, 0x11d1, \
{ 0x6f765305, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLHtmlElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLIFRAMEELEMENT_IID \
{ 0x6f765305, 0xee43, 0x11d1, \
{ 0x6f765306, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLIFrameElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLIMAGEELEMENT_IID \
{ 0x6f765306, 0xee43, 0x11d1, \
{ 0x6f765307, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLImageElement : public nsIDOMHTMLElement {

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

@ -28,7 +28,7 @@
class nsIDOMHTMLFormElement;
#define NS_IDOMHTMLINPUTELEMENT_IID \
{ 0x6f765307, 0xee43, 0x11d1, \
{ 0x6f765308, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLInputElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLINSELEMENT_IID \
{ 0x6f765308, 0xee43, 0x11d1, \
{ 0x6f765309, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLInsElement : public nsIDOMHTMLElement {

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

@ -28,7 +28,7 @@
class nsIDOMHTMLFormElement;
#define NS_IDOMHTMLISINDEXELEMENT_IID \
{ 0x6f765309, 0xee43, 0x11d1, \
{ 0x6f76530a, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLIsIndexElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLLIELEMENT_IID \
{ 0x6f76530c, 0xee43, 0x11d1, \
{ 0x6f76530d, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLLIElement : public nsIDOMHTMLElement {

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

@ -28,7 +28,7 @@
class nsIDOMHTMLFormElement;
#define NS_IDOMHTMLLABELELEMENT_IID \
{ 0x6f76530a, 0xee43, 0x11d1, \
{ 0x6f76530b, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLLabelElement : public nsIDOMHTMLElement {

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

@ -28,7 +28,7 @@
class nsIDOMHTMLFormElement;
#define NS_IDOMHTMLLEGENDELEMENT_IID \
{ 0x6f76530b, 0xee43, 0x11d1, \
{ 0x6f76530c, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLLegendElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLLINKELEMENT_IID \
{ 0x6f76530d, 0xee43, 0x11d1, \
{ 0x6f76530e, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLLinkElement : public nsIDOMHTMLElement {

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

@ -28,7 +28,7 @@
class nsIDOMHTMLCollection;
#define NS_IDOMHTMLMAPELEMENT_IID \
{ 0x6f76530e, 0xee43, 0x11d1, \
{ 0x6f76530f, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLMapElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLMENUELEMENT_IID \
{ 0x6f76530f, 0xee43, 0x11d1, \
{ 0x6f765310, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLMenuElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLMETAELEMENT_IID \
{ 0x6f765310, 0xee43, 0x11d1, \
{ 0x6f765311, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLMetaElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLMODELEMENT_IID \
{ 0x6f765311, 0xee43, 0x11d1, \
{ 0x6f765312, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLModElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLOLISTELEMENT_IID \
{ 0x6f765313, 0xee43, 0x11d1, \
{ 0x6f765314, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLOListElement : public nsIDOMHTMLElement {

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

@ -28,7 +28,7 @@
class nsIDOMHTMLFormElement;
#define NS_IDOMHTMLOBJECTELEMENT_IID \
{ 0x6f765312, 0xee43, 0x11d1, \
{ 0x6f765313, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLObjectElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLOPTGROUPELEMENT_IID \
{ 0x6f765314, 0xee43, 0x11d1, \
{ 0x6f765315, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLOptGroupElement : public nsIDOMHTMLElement {

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

@ -28,7 +28,7 @@
class nsIDOMHTMLFormElement;
#define NS_IDOMHTMLOPTIONELEMENT_IID \
{ 0x6f765315, 0xee43, 0x11d1, \
{ 0x6f765316, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLOptionElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLPARAGRAPHELEMENT_IID \
{ 0x6f765316, 0xee43, 0x11d1, \
{ 0x6f765317, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLParagraphElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLPARAMELEMENT_IID \
{ 0x6f765317, 0xee43, 0x11d1, \
{ 0x6f765318, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLParamElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLPREELEMENT_IID \
{ 0x6f765318, 0xee43, 0x11d1, \
{ 0x6f765319, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLPreElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLQUOTEELEMENT_IID \
{ 0x6f765319, 0xee43, 0x11d1, \
{ 0x6f76531a, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLQuoteElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLSCRIPTELEMENT_IID \
{ 0x6f76531a, 0xee43, 0x11d1, \
{ 0x6f76531b, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLScriptElement : public nsIDOMHTMLElement {

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

@ -30,7 +30,7 @@ class nsIDOMHTMLFormElement;
class nsIDOMHTMLCollection;
#define NS_IDOMHTMLSELECTELEMENT_IID \
{ 0x6f76531b, 0xee43, 0x11d1, \
{ 0x6f76531c, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLSelectElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLSTYLEELEMENT_IID \
{ 0x6f76531c, 0xee43, 0x11d1, \
{ 0x6f76531d, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLStyleElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLTABLECAPTIONELEMENT_IID \
{ 0x6f76531d, 0xee43, 0x11d1, \
{ 0x6f76531e, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLTableCaptionElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLTABLECELLELEMENT_IID \
{ 0x6f76531e, 0xee43, 0x11d1, \
{ 0x6f76531f, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLTableCellElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLTABLECOLELEMENT_IID \
{ 0x6f76531f, 0xee43, 0x11d1, \
{ 0x6f765320, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLTableColElement : public nsIDOMHTMLElement {

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

@ -31,7 +31,7 @@ class nsIDOMHTMLTableSectionElement;
class nsIDOMHTMLCollection;
#define NS_IDOMHTMLTABLEELEMENT_IID \
{ 0x6f765320, 0xee43, 0x11d1, \
{ 0x6f765321, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLTableElement : public nsIDOMHTMLElement {

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

@ -29,7 +29,7 @@ class nsIDOMHTMLElement;
class nsIDOMHTMLCollection;
#define NS_IDOMHTMLTABLEROWELEMENT_IID \
{ 0x6f765321, 0xee43, 0x11d1, \
{ 0x6f765322, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLTableRowElement : public nsIDOMHTMLElement {

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

@ -29,7 +29,7 @@ class nsIDOMHTMLElement;
class nsIDOMHTMLCollection;
#define NS_IDOMHTMLTABLESECTIONELEMENT_IID \
{ 0x6f765322, 0xee43, 0x11d1, \
{ 0x6f765323, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLTableSectionElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLTBODYELEMENT_IID \
{ 0x6f765323, 0xee43, 0x11d1, \
{ 0x6f765324, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLTbodyElement : public nsIDOMHTMLElement {

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

@ -28,7 +28,7 @@
class nsIDOMHTMLFormElement;
#define NS_IDOMHTMLTEXTAREAELEMENT_IID \
{ 0x6f765324, 0xee43, 0x11d1, \
{ 0x6f765325, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLTextAreaElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLTFOOTELEMENT_IID \
{ 0x6f765325, 0xee43, 0x11d1, \
{ 0x6f765326, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLTfootElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLTHEADELEMENT_IID \
{ 0x6f765326, 0xee43, 0x11d1, \
{ 0x6f765327, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLTheadElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLTITLEELEMENT_IID \
{ 0x6f765327, 0xee43, 0x11d1, \
{ 0x6f765328, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLTitleElement : public nsIDOMHTMLElement {

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

@ -27,7 +27,7 @@
#define NS_IDOMHTMLULISTELEMENT_IID \
{ 0x6f765328, 0xee43, 0x11d1, \
{ 0x6f765329, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMHTMLUListElement : public nsIDOMHTMLElement {

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

@ -26,7 +26,7 @@
#define NS_IDOMIMAGE_IID \
{ 0x6f765329, 0xee43, 0x11d1, \
{ 0x6f76532a, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMImage : public nsISupports {

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

@ -28,7 +28,7 @@ class nsIDOMElement;
class nsIDOMHTMLCollection;
#define NS_IDOMNSHTMLDOCUMENT_IID \
{ 0x6f76532a, 0xee43, 0x11d1, \
{ 0x6f76532b, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMNSHTMLDocument : public nsISupports {

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

@ -27,7 +27,7 @@
class nsIDOMElement;
#define NS_IDOMNSHTMLFORMELEMENT_IID \
{ 0x6f76532b, 0xee43, 0x11d1, \
{ 0x6f76532c, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMNSHTMLFormElement : public nsISupports {

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

@ -1,21 +1,21 @@
interface Window {
readonly attribute Window window;
readonly attribute Window window;
readonly attribute Window self;
readonly attribute Document document;
readonly attribute Navigator navigator;
readonly attribute Document document;
readonly attribute Navigator navigator;
readonly attribute Window parent;
readonly attribute Window top;
readonly attribute boolean closed;
readonly attribute WindowCollection frames;
attribute Window opener;
attribute wstring status;
attribute wstring defaultStatus;
attribute wstring name;
void dump(in wstring str);
void alert(in wstring str);
void focus();
void blur();
void close();
readonly attribute boolean closed;
readonly attribute WindowCollection frames;
attribute Window opener;
attribute wstring status;
attribute wstring defaultStatus;
attribute wstring name;
void dump(in wstring str);
void alert(in wstring str);
void focus();
void blur();
void close();
void clearTimeout(in long timerID);
void clearInterval(in long timerID);
@ -24,3 +24,7 @@
Window open(/* ... */);
};
interface EventCapturer : EventReceiver {
void captureEvent(in wstring type);
void releaseEvent(in wstring type);
};

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

@ -14,3 +14,8 @@
in Node value);
NodeList getElementsByTagName(in wstring tagname);
};
interface EventCapturer : EventReceiver {
void captureEvent(in wstring type);
void releaseEvent(in wstring type);
};

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

@ -10,4 +10,3 @@
NodeList getElementsByTagName(in wstring tagname);
void normalize();
};

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

@ -61,5 +61,7 @@ export:: $(GENXDIR) $(GENJSDIR) $(IDLSRCS)
$(IDLC) -d $(GENJSDIR) -j $(IDLSRCS)
install::
$(MAKE_INSTALL:/=\) $(GENXDIR)\nsIDOMEventCapturer.h $(XPCOM_DESTDIR)\..\coreEvents
$(RM) $(GENXDIR)\nsIDOMEventCapturer.h
$(MAKE_INSTALL:/=\) $(GENXDIR)\nsIDOM*.h $(XPCOM_DESTDIR)
$(MAKE_INSTALL:/=\) $(GENJSDIR)\nsJS*.cpp $(JSSTUB_DESTDIR)

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

@ -1,182 +1,182 @@
interface Event {
const int VK_CANCEL = 0x03;
const int VK_BACK = 0x08;
const int VK_TAB = 0x09;
const int VK_CLEAR = 0x0C;
const int VK_RETURN = 0x0D;
const int VK_SHIFT = 0x10;
const int VK_CONTROL = 0x11;
const int VK_ALT = 0x12;
const int VK_PAUSE = 0x13;
const int VK_CAPS_LOCK = 0x14;
const int VK_ESCAPE = 0x1B;
const int VK_SPACE = 0x20;
const int VK_PAGE_UP = 0x21;
const int VK_PAGE_DOWN = 0x22;
const int VK_END = 0x23;
const int VK_HOME = 0x24;
const int VK_LEFT = 0x25;
const int VK_UP = 0x26;
const int VK_RIGHT = 0x27;
const int VK_DOWN = 0x28;
const int VK_PRINTSCREEN = 0x2C;
const int VK_INSERT = 0x2D;
const int VK_DELETE = 0x2E;
const int VK_CANCEL = 0x03;
const int VK_BACK = 0x08;
const int VK_TAB = 0x09;
const int VK_CLEAR = 0x0C;
const int VK_RETURN = 0x0D;
const int VK_SHIFT = 0x10;
const int VK_CONTROL = 0x11;
const int VK_ALT = 0x12;
const int VK_PAUSE = 0x13;
const int VK_CAPS_LOCK = 0x14;
const int VK_ESCAPE = 0x1B;
const int VK_SPACE = 0x20;
const int VK_PAGE_UP = 0x21;
const int VK_PAGE_DOWN = 0x22;
const int VK_END = 0x23;
const int VK_HOME = 0x24;
const int VK_LEFT = 0x25;
const int VK_UP = 0x26;
const int VK_RIGHT = 0x27;
const int VK_DOWN = 0x28;
const int VK_PRINTSCREEN = 0x2C;
const int VK_INSERT = 0x2D;
const int VK_DELETE = 0x2E;
// VK_0 - VK_9 match their ascii values
const int VK_0 = 0x30;
const int VK_1 = 0x31;
const int VK_2 = 0x32;
const int VK_3 = 0x33;
const int VK_4 = 0x34;
const int VK_5 = 0x35;
const int VK_6 = 0x36;
const int VK_7 = 0x37;
const int VK_8 = 0x38;
const int VK_9 = 0x39;
// VK_0 - VK_9 match their ascii values
const int VK_0 = 0x30;
const int VK_1 = 0x31;
const int VK_2 = 0x32;
const int VK_3 = 0x33;
const int VK_4 = 0x34;
const int VK_5 = 0x35;
const int VK_6 = 0x36;
const int VK_7 = 0x37;
const int VK_8 = 0x38;
const int VK_9 = 0x39;
const int VK_SEMICOLON = 0x3B;
const int VK_EQUALS = 0x3D;
const int VK_SEMICOLON = 0x3B;
const int VK_EQUALS = 0x3D;
// VK_A - VK_Z match their ascii values
const int VK_A = 0x41;
const int VK_B = 0x42;
const int VK_C = 0x43;
const int VK_D = 0x44;
const int VK_E = 0x45;
const int VK_F = 0x46;
const int VK_G = 0x47;
const int VK_H = 0x48;
const int VK_I = 0x49;
const int VK_J = 0x4A;
const int VK_K = 0x4B;
const int VK_L = 0x4C;
const int VK_M = 0x4D;
const int VK_N = 0x4E;
const int VK_O = 0x4F;
const int VK_P = 0x50;
const int VK_Q = 0x51;
const int VK_R = 0x52;
const int VK_S = 0x53;
const int VK_T = 0x54;
const int VK_U = 0x55;
const int VK_V = 0x56;
const int VK_W = 0x57;
const int VK_X = 0x58;
const int VK_Y = 0x59;
const int VK_Z = 0x5A;
// VK_A - VK_Z match their ascii values
const int VK_A = 0x41;
const int VK_B = 0x42;
const int VK_C = 0x43;
const int VK_D = 0x44;
const int VK_E = 0x45;
const int VK_F = 0x46;
const int VK_G = 0x47;
const int VK_H = 0x48;
const int VK_I = 0x49;
const int VK_J = 0x4A;
const int VK_K = 0x4B;
const int VK_L = 0x4C;
const int VK_M = 0x4D;
const int VK_N = 0x4E;
const int VK_O = 0x4F;
const int VK_P = 0x50;
const int VK_Q = 0x51;
const int VK_R = 0x52;
const int VK_S = 0x53;
const int VK_T = 0x54;
const int VK_U = 0x55;
const int VK_V = 0x56;
const int VK_W = 0x57;
const int VK_X = 0x58;
const int VK_Y = 0x59;
const int VK_Z = 0x5A;
const int VK_NUMPAD0 = 0x60;
const int VK_NUMPAD1 = 0x61;
const int VK_NUMPAD2 = 0x62;
const int VK_NUMPAD3 = 0x63;
const int VK_NUMPAD4 = 0x64;
const int VK_NUMPAD5 = 0x65;
const int VK_NUMPAD6 = 0x66;
const int VK_NUMPAD7 = 0x67;
const int VK_NUMPAD8 = 0x68;
const int VK_NUMPAD9 = 0x69;
const int VK_MULTIPLY = 0x6A;
const int VK_ADD = 0x6B;
const int VK_SEPARATOR = 0x6C;
const int VK_SUBTRACT = 0x6D;
const int VK_DECIMAL = 0x6E;
const int VK_DIVIDE = 0x6F;
const int VK_F1 = 0x70;
const int VK_F2 = 0x71;
const int VK_F3 = 0x72;
const int VK_F4 = 0x73;
const int VK_F5 = 0x74;
const int VK_F6 = 0x75;
const int VK_F7 = 0x76;
const int VK_F8 = 0x77;
const int VK_F9 = 0x78;
const int VK_F10 = 0x79;
const int VK_F11 = 0x7A;
const int VK_F12 = 0x7B;
const int VK_F13 = 0x7C;
const int VK_F14 = 0x7D;
const int VK_F15 = 0x7E;
const int VK_F16 = 0x7F;
const int VK_F17 = 0x80;
const int VK_F18 = 0x81;
const int VK_F19 = 0x82;
const int VK_F20 = 0x83;
const int VK_F21 = 0x84;
const int VK_F22 = 0x85;
const int VK_F23 = 0x86;
const int VK_F24 = 0x87;
const int VK_NUMPAD0 = 0x60;
const int VK_NUMPAD1 = 0x61;
const int VK_NUMPAD2 = 0x62;
const int VK_NUMPAD3 = 0x63;
const int VK_NUMPAD4 = 0x64;
const int VK_NUMPAD5 = 0x65;
const int VK_NUMPAD6 = 0x66;
const int VK_NUMPAD7 = 0x67;
const int VK_NUMPAD8 = 0x68;
const int VK_NUMPAD9 = 0x69;
const int VK_MULTIPLY = 0x6A;
const int VK_ADD = 0x6B;
const int VK_SEPARATOR = 0x6C;
const int VK_SUBTRACT = 0x6D;
const int VK_DECIMAL = 0x6E;
const int VK_DIVIDE = 0x6F;
const int VK_F1 = 0x70;
const int VK_F2 = 0x71;
const int VK_F3 = 0x72;
const int VK_F4 = 0x73;
const int VK_F5 = 0x74;
const int VK_F6 = 0x75;
const int VK_F7 = 0x76;
const int VK_F8 = 0x77;
const int VK_F9 = 0x78;
const int VK_F10 = 0x79;
const int VK_F11 = 0x7A;
const int VK_F12 = 0x7B;
const int VK_F13 = 0x7C;
const int VK_F14 = 0x7D;
const int VK_F15 = 0x7E;
const int VK_F16 = 0x7F;
const int VK_F17 = 0x80;
const int VK_F18 = 0x81;
const int VK_F19 = 0x82;
const int VK_F20 = 0x83;
const int VK_F21 = 0x84;
const int VK_F22 = 0x85;
const int VK_F23 = 0x86;
const int VK_F24 = 0x87;
const int VK_NUM_LOCK = 0x90;
const int VK_SCROLL_LOCK = 0x91;
const int VK_NUM_LOCK = 0x90;
const int VK_SCROLL_LOCK = 0x91;
const int VK_COMMA = 0xBC;
const int VK_PERIOD = 0xBE;
const int VK_SLASH = 0xBF;
const int VK_BACK_QUOTE = 0xC0;
const int VK_OPEN_BRACKET = 0xDB;
const int VK_BACK_SLASH = 0xDC;
const int VK_CLOSE_BRACKET = 0xDD;
const int VK_QUOTE = 0xDE;
const int VK_COMMA = 0xBC;
const int VK_PERIOD = 0xBE;
const int VK_SLASH = 0xBF;
const int VK_BACK_QUOTE = 0xC0;
const int VK_OPEN_BRACKET = 0xDB;
const int VK_BACK_SLASH = 0xDC;
const int VK_CLOSE_BRACKET = 0xDD;
const int VK_QUOTE = 0xDE;
attribute wstring type;
attribute Node target;
attribute wstring type;
attribute Node target;
attribute int screenX;
attribute int screenY;
attribute int screenX;
attribute int screenY;
attribute int clientX;
attribute int clientY;
attribute boolean altKey;
attribute boolean ctrlKey;
attribute boolean shiftKey;
attribute boolean metaKey;
attribute int clientX;
attribute int clientY;
attribute boolean altKey;
attribute boolean ctrlKey;
attribute boolean shiftKey;
attribute boolean metaKey;
attribute boolean cancelBubble;
attribute boolean cancelBubble;
attribute unsigned long charCode;
attribute unsigned long keyCode;
attribute unsigned long button;
attribute unsigned long charCode;
attribute unsigned long keyCode;
attribute unsigned long button;
};
interface NSEvent {
const int EVENT_MOUSEDOWN = 0x00000001;
const int EVENT_MOUSEUP = 0x00000002;
const int EVENT_MOUSEOVER = 0x00000004;
const int EVENT_MOUSEOUT = 0x00000008;
const int EVENT_MOUSEMOVE = 0x00000010;
const int EVENT_MOUSEDRAG = 0x00000020;
const int EVENT_CLICK = 0x00000040;
const int EVENT_DBLCLICK = 0x00000080;
const int EVENT_KEYDOWN = 0x00000100;
const int EVENT_KEYUP = 0x00000200;
const int EVENT_KEYPRESS = 0x00000400;
const int EVENT_DRAGDROP = 0x00000800;
const int EVENT_FOCUS = 0x00001000;
const int EVENT_BLUR = 0x00002000;
const int EVENT_SELECT = 0x00004000;
const int EVENT_CHANGE = 0x00008000;
const int EVENT_RESET = 0x00010000;
const int EVENT_SUBMIT = 0x00020000;
const int EVENT_SCROLL = 0x00040000;
const int EVENT_LOAD = 0x00080000;
const int EVENT_UNLOAD = 0x00100000;
const int EVENT_XFER_DONE = 0x00200000;
const int EVENT_ABORT = 0x00400000;
const int EVENT_ERROR = 0x00800000;
const int EVENT_LOCATE = 0x01000000;
const int EVENT_MOVE = 0x02000000;
const int EVENT_RESIZE = 0x04000000;
const int EVENT_FORWARD = 0x08000000;
const int EVENT_HELP = 0x10000000;
const int EVENT_BACK = 0x20000000;
const int EVENT_MOUSEDOWN = 0x00000001;
const int EVENT_MOUSEUP = 0x00000002;
const int EVENT_MOUSEOVER = 0x00000004;
const int EVENT_MOUSEOUT = 0x00000008;
const int EVENT_MOUSEMOVE = 0x00000010;
const int EVENT_MOUSEDRAG = 0x00000020;
const int EVENT_CLICK = 0x00000040;
const int EVENT_DBLCLICK = 0x00000080;
const int EVENT_KEYDOWN = 0x00000100;
const int EVENT_KEYUP = 0x00000200;
const int EVENT_KEYPRESS = 0x00000400;
const int EVENT_DRAGDROP = 0x00000800;
const int EVENT_FOCUS = 0x00001000;
const int EVENT_BLUR = 0x00002000;
const int EVENT_SELECT = 0x00004000;
const int EVENT_CHANGE = 0x00008000;
const int EVENT_RESET = 0x00010000;
const int EVENT_SUBMIT = 0x00020000;
const int EVENT_SCROLL = 0x00040000;
const int EVENT_LOAD = 0x00080000;
const int EVENT_UNLOAD = 0x00100000;
const int EVENT_XFER_DONE = 0x00200000;
const int EVENT_ABORT = 0x00400000;
const int EVENT_ERROR = 0x00800000;
const int EVENT_LOCATE = 0x01000000;
const int EVENT_MOVE = 0x02000000;
const int EVENT_RESIZE = 0x04000000;
const int EVENT_FORWARD = 0x08000000;
const int EVENT_HELP = 0x10000000;
const int EVENT_BACK = 0x20000000;
const int EVENT_ALT_MASK = 0x00000001;
const int EVENT_CONTROL_MASK = 0x00000002;
const int EVENT_SHIFT_MASK = 0x00000004;
const int EVENT_META_MASK = 0x00000008;
const int EVENT_ALT_MASK = 0x00000001;
const int EVENT_CONTROL_MASK = 0x00000002;
const int EVENT_SHIFT_MASK = 0x00000004;
const int EVENT_META_MASK = 0x00000008;
attribute int layerX;
attribute int layerY;
attribute int layerX;
attribute int layerY;
};

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

@ -58,6 +58,8 @@ export:: $(GENXDIR) $(GENJSDIR) $(IDLSRCS)
$(PERL) $(GENIID) $(IIDDIRS)
install::
$(MAKE_INSTALL:/=\) $(GENXDIR)\nsIDOMEventCapturer.h $(XPCOM_DESTDIR)\coreEvents
$(RM) $(GENXDIR)\nsIDOMEventCapturer.h
$(MAKE_INSTALL:/=\) $(GENXDIR)\nsIDOM*.h $(XPCOM_DESTDIR)
$(MAKE_INSTALL:/=\) $(GENXDIR)\nsIDOM$(GLOBAL_IDLSRC:.idl=.h) $(XPCOM_DESTDIR)
$(MAKE_INSTALL:/=\) $(GENJSDIR)\nsJS*.cpp $(JSSTUB_DESTDIR)

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

@ -27,7 +27,7 @@
#define NS_IDOMLOCATION_IID \
{ 0x6f76532e, 0xee43, 0x11d1, \
{ 0x6f765330, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMLocation : public nsISupports {

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

@ -26,7 +26,7 @@
#define NS_IDOMNAVIGATOR_IID \
{ 0x6f76532f, 0xee43, 0x11d1, \
{ 0x6f765331, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMNavigator : public nsISupports {

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

@ -31,7 +31,7 @@ class nsIDOMWindowCollection;
class nsIDOMWindow;
#define NS_IDOMWINDOW_IID \
{ 0x6f765330, 0xee43, 0x11d1, \
{ 0x6f765332, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMWindow : public nsISupports {

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

@ -27,7 +27,7 @@
class nsIDOMWindow;
#define NS_IDOMWINDOWCOLLECTION_IID \
{ 0x6f765331, 0xee43, 0x11d1, \
{ 0x6f765333, 0xee43, 0x11d1, \
{ 0x9b, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
class nsIDOMWindowCollection : public nsISupports {

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

@ -469,12 +469,14 @@ GlobalWindowImpl::Alert(const nsString& aStr)
NS_IMETHODIMP
GlobalWindowImpl::Focus()
{
mWebShell->SetFocus();
return NS_OK;
}
NS_IMETHODIMP
GlobalWindowImpl::Blur()
{
mWebShell->RemoveFocus();
return NS_OK;
}
@ -1042,6 +1044,7 @@ GlobalWindowImpl::Open(JSContext *cx,
if (nsnull != newWindow) {
//How should we do default size/pos
newWindow->Hide();
newWindow->SetChrome(mChrome);
newWindow->SizeTo(mWidth ? mWidth : 620, mHeight ? mHeight : 400);
newWindow->MoveTo(mLeft, mTop);
@ -1395,7 +1398,11 @@ GlobalWindowImpl::HandleDOMEvent(nsIPresContext& aPresContext,
if (DOM_EVENT_INIT == aFlags) {
// We're leaving the DOM event loop so if we created a DOM event, release here.
if (nsnull != *aDOMEvent) {
if (0 != (*aDOMEvent)->Release()) {
nsrefcnt rc;
nsIDOMEvent* DOMEvent = *aDOMEvent;
// Release the copy since the macro will null the pointer
NS_RELEASE2(DOMEvent, rc);
if (0 != rc) {
//Okay, so someone in the DOM loop (a listener, JS object) still has a ref to the DOM Event but
//the internal data hasn't been malloc'd. Force a copy of the data here so the DOM Event is still valid.
nsIPrivateDOMEvent *mPrivateEvent;
@ -1435,12 +1442,12 @@ GlobalWindowImpl::RemoveEventListener(nsIDOMEventListener *aListener, const nsII
}
nsresult
GlobalWindowImpl::CaptureEvent(nsIDOMEventListener *aListener)
GlobalWindowImpl::CaptureEvent(const nsString& aType)
{
nsIEventListenerManager *mManager;
if (NS_OK == GetListenerManager(&mManager)) {
mManager->CaptureEvent(aListener);
//mManager->CaptureEvent(aListener);
NS_RELEASE(mManager);
return NS_OK;
}
@ -1448,10 +1455,10 @@ GlobalWindowImpl::CaptureEvent(nsIDOMEventListener *aListener)
}
nsresult
GlobalWindowImpl::ReleaseEvent(nsIDOMEventListener *aListener)
GlobalWindowImpl::ReleaseEvent(const nsString& aType)
{
if (nsnull != mListenerManager) {
mListenerManager->ReleaseEvent(aListener);
//mListenerManager->ReleaseEvent(aListener);
return NS_OK;
}
return NS_ERROR_FAILURE;

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

@ -101,8 +101,10 @@ public:
nsIDOMWindow** aReturn);
// nsIDOMEventCapturer interface
NS_IMETHOD CaptureEvent(nsIDOMEventListener *aListener);
NS_IMETHOD ReleaseEvent(nsIDOMEventListener *aListener);
NS_IMETHOD CaptureEvent(const nsString& aType);
NS_IMETHOD ReleaseEvent(const nsString& aType);
// nsIDOMEventReceiver interface
NS_IMETHOD AddEventListener(nsIDOMEventListener *aListener, const nsIID& aIID);
NS_IMETHOD RemoveEventListener(nsIDOMEventListener *aListener, const nsIID& aIID);
NS_IMETHOD GetListenerManager(nsIEventListenerManager** aInstancePtrResult);

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

@ -28,6 +28,7 @@
#include "nsIDOMNavigator.h"
#include "nsIDOMDocument.h"
#include "nsIDOMWindowCollection.h"
#include "nsIDOMEventCapturer.h"
#include "nsIDOMWindow.h"
@ -37,11 +38,13 @@ static NS_DEFINE_IID(kIScriptGlobalObjectIID, NS_ISCRIPTGLOBALOBJECT_IID);
static NS_DEFINE_IID(kINavigatorIID, NS_IDOMNAVIGATOR_IID);
static NS_DEFINE_IID(kIDocumentIID, NS_IDOMDOCUMENT_IID);
static NS_DEFINE_IID(kIWindowCollectionIID, NS_IDOMWINDOWCOLLECTION_IID);
static NS_DEFINE_IID(kIEventCapturerIID, NS_IDOMEVENTCAPTURER_IID);
static NS_DEFINE_IID(kIWindowIID, NS_IDOMWINDOW_IID);
NS_DEF_PTR(nsIDOMNavigator);
NS_DEF_PTR(nsIDOMDocument);
NS_DEF_PTR(nsIDOMWindowCollection);
NS_DEF_PTR(nsIDOMEventCapturer);
NS_DEF_PTR(nsIDOMWindow);
//
@ -906,6 +909,102 @@ WindowOpen(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
}
//
// Native method CaptureEvent
//
PR_STATIC_CALLBACK(JSBool)
EventCapturerCaptureEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
nsIDOMWindow *privateThis = (nsIDOMWindow*)JS_GetPrivate(cx, obj);
nsIDOMEventCapturer *nativeThis;
if (NS_OK != privateThis->QueryInterface(kIEventCapturerIID, (void **)nativeThis)) {
JS_ReportError(cx, "Object must be of type EventCapturer");
return JS_FALSE;
}
JSBool rBool = JS_FALSE;
nsAutoString b0;
*rval = JSVAL_NULL;
// If there's no private data, this must be the prototype, so ignore
if (nsnull == nativeThis) {
return JS_TRUE;
}
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
if (NS_OK != nativeThis->CaptureEvent(b0)) {
return JS_FALSE;
}
*rval = JSVAL_VOID;
}
else {
JS_ReportError(cx, "Function captureEvent requires 1 parameters");
return JS_FALSE;
}
return JS_TRUE;
}
//
// Native method ReleaseEvent
//
PR_STATIC_CALLBACK(JSBool)
EventCapturerReleaseEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
nsIDOMWindow *privateThis = (nsIDOMWindow*)JS_GetPrivate(cx, obj);
nsIDOMEventCapturer *nativeThis;
if (NS_OK != privateThis->QueryInterface(kIEventCapturerIID, (void **)nativeThis)) {
JS_ReportError(cx, "Object must be of type EventCapturer");
return JS_FALSE;
}
JSBool rBool = JS_FALSE;
nsAutoString b0;
*rval = JSVAL_NULL;
// If there's no private data, this must be the prototype, so ignore
if (nsnull == nativeThis) {
return JS_TRUE;
}
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
if (NS_OK != nativeThis->ReleaseEvent(b0)) {
return JS_FALSE;
}
*rval = JSVAL_VOID;
}
else {
JS_ReportError(cx, "Function releaseEvent requires 1 parameters");
return JS_FALSE;
}
return JS_TRUE;
}
/***********************************************************************/
//
// class for Window
@ -960,6 +1059,8 @@ static JSFunctionSpec WindowMethods[] =
{"setTimeout", WindowSetTimeout, 0},
{"setInterval", WindowSetInterval, 0},
{"open", WindowOpen, 0},
{"captureEvent", EventCapturerCaptureEvent, 1},
{"releaseEvent", EventCapturerReleaseEvent, 1},
{0}
};

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

@ -35,6 +35,7 @@
#include "nsIDOMDocumentType.h"
#include "nsIDOMDocumentFragment.h"
#include "nsIDOMComment.h"
#include "nsIDOMEventCapturer.h"
#include "nsIDOMNodeList.h"
@ -51,6 +52,7 @@ static NS_DEFINE_IID(kITextIID, NS_IDOMTEXT_IID);
static NS_DEFINE_IID(kIDocumentTypeIID, NS_IDOMDOCUMENTTYPE_IID);
static NS_DEFINE_IID(kIDocumentFragmentIID, NS_IDOMDOCUMENTFRAGMENT_IID);
static NS_DEFINE_IID(kICommentIID, NS_IDOMCOMMENT_IID);
static NS_DEFINE_IID(kIEventCapturerIID, NS_IDOMEVENTCAPTURER_IID);
static NS_DEFINE_IID(kINodeListIID, NS_IDOMNODELIST_IID);
NS_DEF_PTR(nsIDOMElement);
@ -63,6 +65,7 @@ NS_DEF_PTR(nsIDOMText);
NS_DEF_PTR(nsIDOMDocumentType);
NS_DEF_PTR(nsIDOMDocumentFragment);
NS_DEF_PTR(nsIDOMComment);
NS_DEF_PTR(nsIDOMEventCapturer);
NS_DEF_PTR(nsIDOMNodeList);
//
@ -772,6 +775,102 @@ DocumentGetElementsByTagName(JSContext *cx, JSObject *obj, uintN argc, jsval *ar
}
//
// Native method CaptureEvent
//
PR_STATIC_CALLBACK(JSBool)
EventCapturerCaptureEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
nsIDOMDocument *privateThis = (nsIDOMDocument*)JS_GetPrivate(cx, obj);
nsIDOMEventCapturer *nativeThis;
if (NS_OK != privateThis->QueryInterface(kIEventCapturerIID, (void **)nativeThis)) {
JS_ReportError(cx, "Object must be of type EventCapturer");
return JS_FALSE;
}
JSBool rBool = JS_FALSE;
nsAutoString b0;
*rval = JSVAL_NULL;
// If there's no private data, this must be the prototype, so ignore
if (nsnull == nativeThis) {
return JS_TRUE;
}
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
if (NS_OK != nativeThis->CaptureEvent(b0)) {
return JS_FALSE;
}
*rval = JSVAL_VOID;
}
else {
JS_ReportError(cx, "Function captureEvent requires 1 parameters");
return JS_FALSE;
}
return JS_TRUE;
}
//
// Native method ReleaseEvent
//
PR_STATIC_CALLBACK(JSBool)
EventCapturerReleaseEvent(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
nsIDOMDocument *privateThis = (nsIDOMDocument*)JS_GetPrivate(cx, obj);
nsIDOMEventCapturer *nativeThis;
if (NS_OK != privateThis->QueryInterface(kIEventCapturerIID, (void **)nativeThis)) {
JS_ReportError(cx, "Object must be of type EventCapturer");
return JS_FALSE;
}
JSBool rBool = JS_FALSE;
nsAutoString b0;
*rval = JSVAL_NULL;
// If there's no private data, this must be the prototype, so ignore
if (nsnull == nativeThis) {
return JS_TRUE;
}
if (argc >= 1) {
JSString *jsstring0 = JS_ValueToString(cx, argv[0]);
if (nsnull != jsstring0) {
b0.SetString(JS_GetStringChars(jsstring0));
}
else {
b0.SetString(""); // Should this really be null??
}
if (NS_OK != nativeThis->ReleaseEvent(b0)) {
return JS_FALSE;
}
*rval = JSVAL_VOID;
}
else {
JS_ReportError(cx, "Function releaseEvent requires 1 parameters");
return JS_FALSE;
}
return JS_TRUE;
}
/***********************************************************************/
//
// class for Document
@ -815,6 +914,8 @@ static JSFunctionSpec DocumentMethods[] =
{"createProcessingInstruction", DocumentCreateProcessingInstruction, 2},
{"createAttribute", DocumentCreateAttribute, 2},
{"getElementsByTagName", DocumentGetElementsByTagName, 1},
{"captureEvent", EventCapturerCaptureEvent, 1},
{"releaseEvent", EventCapturerReleaseEvent, 1},
{0}
};

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

@ -886,6 +886,9 @@ nsresult nsDocument::HandleDOMEvent(nsIPresContext& aPresContext,
}
//Capturing stage
/*if (mEventCapturer) {
mEventCapturer->HandleDOMEvent(aPresContext, aEvent, aDOMEvent, aFlags, aEventStatus);
}*/
//Local handling stage
if (nsnull != mListenerManager) {
@ -906,7 +909,11 @@ nsresult nsDocument::HandleDOMEvent(nsIPresContext& aPresContext,
if (DOM_EVENT_INIT == aFlags) {
// We're leaving the DOM event loop so if we created a DOM event, release here.
if (nsnull != *aDOMEvent) {
if (0 != (*aDOMEvent)->Release()) {
nsrefcnt rc;
nsIDOMEvent* DOMEvent = *aDOMEvent;
// Release the copy since the macro will null the pointer
NS_RELEASE2(DOMEvent, rc);
if (0 != rc) {
//Okay, so someone in the DOM loop (a listener, JS object) still has a ref to the DOM Event but
//the internal data hasn't been malloc'd. Force a copy of the data here so the DOM Event is still valid.
nsIPrivateDOMEvent *mPrivateEvent;
@ -943,22 +950,22 @@ nsresult nsDocument::RemoveEventListener(nsIDOMEventListener *aListener, const n
return NS_ERROR_FAILURE;
}
nsresult nsDocument::CaptureEvent(nsIDOMEventListener *aListener)
nsresult nsDocument::CaptureEvent(const nsString& aType)
{
nsIEventListenerManager *mManager;
if (NS_OK == GetListenerManager(&mManager)) {
mManager->CaptureEvent(aListener);
//mManager->CaptureEvent(aListener);
NS_RELEASE(mManager);
return NS_OK;
}
return NS_ERROR_FAILURE;
}
nsresult nsDocument::ReleaseEvent(nsIDOMEventListener *aListener)
nsresult nsDocument::ReleaseEvent(const nsString& aType)
{
if (nsnull != mListenerManager) {
mListenerManager->ReleaseEvent(aListener);
//mListenerManager->ReleaseEvent(aListener);
return NS_OK;
}
return NS_ERROR_FAILURE;
@ -1460,6 +1467,7 @@ nsIContent* nsDocument::GetNextContent(const nsIContent *aContent) const
nsIContent * old = result;
old->ChildAt(0, result);
NS_RELEASE(old);
result->ChildCount(n);
}
} else {
result = GetNextContent(parent);

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

@ -229,8 +229,10 @@ public:
NS_IMETHOD Equals(nsIDOMNode* aNode, PRBool aDeep, PRBool* aReturn);
// nsIDOMEventCapturer interface
NS_IMETHOD CaptureEvent(nsIDOMEventListener *aListener);
NS_IMETHOD ReleaseEvent(nsIDOMEventListener *aListener);
NS_IMETHOD CaptureEvent(const nsString& aType);
NS_IMETHOD ReleaseEvent(const nsString& aType);
// nsIDOMEventReceiver interface
NS_IMETHOD AddEventListener(nsIDOMEventListener *aListener, const nsIID& aIID);
NS_IMETHOD RemoveEventListener(nsIDOMEventListener *aListener, const nsIID& aIID);
NS_IMETHOD GetListenerManager(nsIEventListenerManager** aInstancePtrResult);

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

@ -680,8 +680,8 @@ nsresult nsHTMLContent::HandleDOMEvent(nsIPresContext& aPresContext,
PRUint32 aFlags,
nsEventStatus& aEventStatus)
{
nsresult mRet = NS_OK;
nsIDOMEvent* mDOMEvent = nsnull;
nsresult ret = NS_OK;
nsIDOMEvent* DOMEvent = nsnull;
if (DOM_EVENT_INIT == aFlags) {
nsIEventStateManager *mManager;
@ -690,38 +690,45 @@ nsresult nsHTMLContent::HandleDOMEvent(nsIPresContext& aPresContext,
NS_RELEASE(mManager);
}
aDOMEvent = &mDOMEvent;
aDOMEvent = &DOMEvent;
}
//Capturing stage
/*if (mDocument->GetEventCapturer) {
ret = mEventCapturer->HandleDOMEvent(aPresContext, aEvent, aDOMEvent, aFlags, aEventStatus);
}*/
//Local handling stage
if (nsnull != mListenerManager) {
mListenerManager->HandleEvent(aPresContext, aEvent, aDOMEvent, aEventStatus);
ret = mListenerManager->HandleEvent(aPresContext, aEvent, aDOMEvent, aEventStatus);
}
//Bubbling stage
if (DOM_EVENT_CAPTURE != aFlags && mParent != nsnull) {
mRet = mParent->HandleDOMEvent(aPresContext, aEvent, aDOMEvent, DOM_EVENT_BUBBLE, aEventStatus);
ret = mParent->HandleDOMEvent(aPresContext, aEvent, aDOMEvent, DOM_EVENT_BUBBLE, aEventStatus);
}
if (DOM_EVENT_INIT == aFlags) {
// We're leaving the DOM event loop so if we created a DOM event, release here.
if (nsnull != *aDOMEvent) {
if (0 != (*aDOMEvent)->Release()) {
nsrefcnt rc;
nsIDOMEvent* DOMEvent = *aDOMEvent;
// Release the copy since the macro will null the pointer
NS_RELEASE2(DOMEvent, rc);
if (0 != rc) {
//Okay, so someone in the DOM loop (a listener, JS object) still has a ref to the DOM Event but
//the internal data hasn't been malloc'd. Force a copy of the data here so the DOM Event is still valid.
nsIPrivateDOMEvent *mPrivateEvent;
if (NS_OK == (*aDOMEvent)->QueryInterface(kIPrivateDOMEventIID, (void**)&mPrivateEvent)) {
mPrivateEvent->DuplicatePrivateData();
NS_RELEASE(mPrivateEvent);
nsIPrivateDOMEvent *privateEvent;
if (NS_OK == (*aDOMEvent)->QueryInterface(kIPrivateDOMEventIID, (void**)&privateEvent)) {
privateEvent->DuplicatePrivateData();
NS_RELEASE(privateEvent);
}
}
}
aDOMEvent = nsnull;
}
return mRet;
return ret;
}
// XXX i18n: this is wrong (?) because we need to know the outgoing

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

@ -1055,44 +1055,7 @@ nsGenericHTMLElement::SetDocument(nsIDocument* aDocument)
{
mDocument = aDocument;
// Once the element is added to the doc tree we need to check if
// event handler were registered on it. Unfortunately, this means
// doing a GetAttribute for every type of handler.
if ((nsnull != mDocument) && (nsnull != mAttributes)) {
nsHTMLValue val;
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::onclick, val))
AddScriptEventListener(nsHTMLAtoms::onclick, val, kIDOMMouseListenerIID);
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::ondblclick, val))
AddScriptEventListener(nsHTMLAtoms::onclick, val, kIDOMMouseListenerIID);
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::onmousedown, val))
AddScriptEventListener(nsHTMLAtoms::onmousedown, val, kIDOMMouseListenerIID);
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::onmouseup, val))
AddScriptEventListener(nsHTMLAtoms::onmouseup, val, kIDOMMouseListenerIID);
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::onmouseover, val))
AddScriptEventListener(nsHTMLAtoms::onmouseover, val, kIDOMMouseListenerIID);
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::onmouseout, val))
AddScriptEventListener(nsHTMLAtoms::onmouseout, val, kIDOMMouseListenerIID);
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::onkeydown, val))
AddScriptEventListener(nsHTMLAtoms::onkeydown, val, kIDOMKeyListenerIID);
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::onkeyup, val))
AddScriptEventListener(nsHTMLAtoms::onkeyup, val, kIDOMKeyListenerIID);
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::onkeypress, val))
AddScriptEventListener(nsHTMLAtoms::onkeypress, val, kIDOMKeyListenerIID);
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::onmousemove, val))
AddScriptEventListener(nsHTMLAtoms::onmousemove, val, kIDOMMouseMotionListenerIID);
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::onload, val))
AddScriptEventListener(nsHTMLAtoms::onload, val, kIDOMLoadListenerIID);
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::onunload, val))
AddScriptEventListener(nsHTMLAtoms::onunload, val, kIDOMLoadListenerIID);
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::onabort, val))
AddScriptEventListener(nsHTMLAtoms::onabort, val, kIDOMLoadListenerIID);
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::onerror, val))
AddScriptEventListener(nsHTMLAtoms::onerror, val, kIDOMLoadListenerIID);
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::onfocus, val))
AddScriptEventListener(nsHTMLAtoms::onfocus, val, kIDOMFocusListenerIID);
if (NS_CONTENT_ATTR_HAS_VALUE == mAttributes->GetAttribute(nsHTMLAtoms::onblur, val))
AddScriptEventListener(nsHTMLAtoms::onblur, val, kIDOMFocusListenerIID);
nsIHTMLStyleSheet* sheet = GetAttrStyleSheet(mDocument);
if (nsnull != sheet) {
sheet->SetAttributesFor(mContent, mAttributes); // sync attributes with sheet
@ -1257,6 +1220,40 @@ nsGenericHTMLElement::SetAttribute(nsIAtom* aAttribute,
NS_RELEASE(css);
}
else {
// Check for event handlers
if (nsHTMLAtoms::onclick == aAttribute)
AddScriptEventListener(nsHTMLAtoms::onclick, aValue, kIDOMMouseListenerIID);
else if (nsHTMLAtoms::ondblclick == aAttribute)
AddScriptEventListener(nsHTMLAtoms::ondblclick, aValue, kIDOMMouseListenerIID);
else if (nsHTMLAtoms::onmousedown == aAttribute)
AddScriptEventListener(nsHTMLAtoms::onmousedown, aValue, kIDOMMouseListenerIID);
else if (nsHTMLAtoms::onmouseup == aAttribute)
AddScriptEventListener(nsHTMLAtoms::onmouseup, aValue, kIDOMMouseListenerIID);
else if (nsHTMLAtoms::onmouseover == aAttribute)
AddScriptEventListener(nsHTMLAtoms::onmouseover, aValue, kIDOMMouseListenerIID);
else if (nsHTMLAtoms::onmouseout == aAttribute)
AddScriptEventListener(nsHTMLAtoms::onmouseout, aValue, kIDOMMouseListenerIID);
else if (nsHTMLAtoms::onkeydown == aAttribute)
AddScriptEventListener(nsHTMLAtoms::onkeydown, aValue, kIDOMKeyListenerIID);
else if (nsHTMLAtoms::onkeyup == aAttribute)
AddScriptEventListener(nsHTMLAtoms::onkeyup, aValue, kIDOMKeyListenerIID);
else if (nsHTMLAtoms::onkeypress == aAttribute)
AddScriptEventListener(nsHTMLAtoms::onkeypress, aValue, kIDOMKeyListenerIID);
else if (nsHTMLAtoms::onmousemove == aAttribute)
AddScriptEventListener(nsHTMLAtoms::onmousemove, aValue, kIDOMMouseMotionListenerIID);
else if (nsHTMLAtoms::onload == aAttribute)
AddScriptEventListener(nsHTMLAtoms::onload, aValue, kIDOMLoadListenerIID);
else if (nsHTMLAtoms::onunload == aAttribute)
AddScriptEventListener(nsHTMLAtoms::onunload, aValue, kIDOMLoadListenerIID);
else if (nsHTMLAtoms::onabort == aAttribute)
AddScriptEventListener(nsHTMLAtoms::onabort, aValue, kIDOMLoadListenerIID);
else if (nsHTMLAtoms::onerror == aAttribute)
AddScriptEventListener(nsHTMLAtoms::onerror, aValue, kIDOMLoadListenerIID);
else if (nsHTMLAtoms::onfocus == aAttribute)
AddScriptEventListener(nsHTMLAtoms::onfocus, aValue, kIDOMFocusListenerIID);
else if (nsHTMLAtoms::onblur == aAttribute)
AddScriptEventListener(nsHTMLAtoms::onblur, aValue, kIDOMFocusListenerIID);
nsHTMLValue val;
if (NS_CONTENT_ATTR_NOT_THERE !=
mContent->StringToAttribute(aAttribute, aValue, val)) {
@ -2174,7 +2171,7 @@ nsGenericHTMLElement::Release()
nsresult
nsGenericHTMLElement::AddScriptEventListener(nsIAtom* aAttribute,
nsHTMLValue& aValue,
const nsString& aValue,
REFNSIID aIID)
{
nsresult ret = NS_OK;
@ -2193,9 +2190,7 @@ nsGenericHTMLElement::AddScriptEventListener(nsIAtom* aAttribute,
if (NS_OK == receiver->GetListenerManager(&manager)) {
nsIScriptObjectOwner *mObjectOwner;
if (NS_OK == global->QueryInterface(kIScriptObjectOwnerIID, (void**)&mObjectOwner)) {
nsString value;
aValue.GetStringValue(value);
ret = manager->AddScriptEventListener(context, mObjectOwner, aAttribute, value, aIID);
ret = manager->AddScriptEventListener(context, mObjectOwner, aAttribute, aValue, aIID);
NS_RELEASE(mObjectOwner);
}
NS_RELEASE(manager);
@ -2207,13 +2202,11 @@ nsGenericHTMLElement::AddScriptEventListener(nsIAtom* aAttribute,
else {
nsIEventListenerManager *manager;
if (NS_OK == GetListenerManager(&manager)) {
nsString value;
aValue.GetStringValue(value);
nsIScriptObjectOwner* owner;
if (NS_OK == mContent->QueryInterface(kIScriptObjectOwnerIID,
(void**) &owner)) {
ret = manager->AddScriptEventListener(context, owner,
aAttribute, value, aIID);
aAttribute, aValue, aIID);
NS_RELEASE(owner);
}
NS_RELEASE(manager);

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

@ -179,7 +179,7 @@ public:
nsresult RenderFrame();
nsresult AddScriptEventListener(nsIAtom* aAttribute,
nsHTMLValue& aValue,
const nsString& aValue,
REFNSIID aIID);
nsresult AttributeToString(nsIAtom* aAttribute,

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

@ -115,6 +115,9 @@ public:
NS_IMETHOD Hide() = 0;
NS_IMETHOD SetFocus() = 0;
NS_IMETHOD RemoveFocus() = 0;
NS_IMETHOD Repaint(PRBool aForce) = 0;
// SetContextView moved to bottom to keep branch/tip interfaces

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

@ -132,6 +132,8 @@ public:
NS_IMETHOD MoveTo(PRInt32 aX, PRInt32 aY);
NS_IMETHOD Show();
NS_IMETHOD Hide();
NS_IMETHOD SetFocus();
NS_IMETHOD RemoveFocus();
NS_IMETHOD Repaint(PRBool aForce);
NS_IMETHOD SetContentViewer(nsIContentViewer* aViewer);
NS_IMETHOD GetContentViewer(nsIContentViewer*& aResult);
@ -725,6 +727,34 @@ nsWebShell::Hide()
return NS_OK;
}
NS_IMETHODIMP
nsWebShell::SetFocus()
{
NS_PRECONDITION(nsnull != mWindow, "null window");
if (nsnull != mWindow) {
mWindow->SetFocus();
}
return NS_OK;
}
NS_IMETHODIMP
nsWebShell::RemoveFocus()
{
NS_PRECONDITION(nsnull != mWindow, "null window");
if (nsnull != mWindow) {
nsIWidget *parentWidget = mWindow->GetParent();
if (nsnull != parentWidget) {
parentWidget->SetFocus();
NS_RELEASE(parentWidget);
}
}
return NS_OK;
}
NS_IMETHODIMP
nsWebShell::Repaint(PRBool aForce)
{

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

@ -1059,56 +1059,62 @@ nsBrowserWindow::Layout(PRInt32 aWidth, PRInt32 aHeight)
txtHeight = 24;
}
nsRect rr(0, 0, aWidth, aHeight);
nsIWidget* locationWidget = nsnull;
if (NS_OK == mLocation->QueryInterface(kIWidgetIID,(void**)&locationWidget))
{
// position location bar (it's stretchy)
if (mLocation) {
if (mThrobber) {
locationWidget->Resize(2*BUTTON_WIDTH, 0,
aWidth - (2*BUTTON_WIDTH + THROBBER_WIDTH),
BUTTON_HEIGHT,
PR_TRUE);
if (mChromeMask & NS_CHROME_TOOL_BAR_ON) {
if (mThrobber) {
locationWidget->Resize(2*BUTTON_WIDTH, 0,
aWidth - (2*BUTTON_WIDTH + THROBBER_WIDTH),
BUTTON_HEIGHT,
PR_TRUE);
mThrobber->MoveTo(aWidth - THROBBER_WIDTH, 0);
}
else {
locationWidget->Resize(2*BUTTON_WIDTH, 0,
aWidth - 2*BUTTON_WIDTH,
BUTTON_HEIGHT,
PR_TRUE);
}
rr.y += BUTTON_HEIGHT;
rr.height -= BUTTON_HEIGHT;
locationWidget->Show(PR_TRUE);
}
else {
locationWidget->Resize(2*BUTTON_WIDTH, 0,
aWidth - 2*BUTTON_WIDTH,
BUTTON_HEIGHT,
PR_TRUE);
locationWidget->Show(PR_FALSE);
}
}
}
nsIWidget* statusWidget = nsnull;
if (mThrobber) {
mThrobber->MoveTo(aWidth - THROBBER_WIDTH, 0);
}
nsRect rr(0, 0, aWidth, aHeight);
if (mLocation) {
rr.y += BUTTON_HEIGHT;
rr.height -= BUTTON_HEIGHT;
}
nsIWidget* statusWidget = nsnull;
if (NS_OK == mStatus->QueryInterface(kIWidgetIID,(void**)&statusWidget))
{
if (mStatus) {
if (NS_OK == mStatus->QueryInterface(kIWidgetIID,(void**)&statusWidget))
{
if (mStatus) {
if (mChromeMask & NS_CHROME_STATUS_BAR_ON) {
statusWidget->Resize(0, aHeight - txtHeight,
aWidth, txtHeight,
PR_TRUE);
rr.height -= txtHeight;
statusWidget->Show(PR_TRUE);
}
else {
statusWidget->Show(PR_FALSE);
}
}
// inset the web widget
rr.x += WEBSHELL_LEFT_INSET;
rr.y += WEBSHELL_TOP_INSET;
rr.width -= WEBSHELL_LEFT_INSET + WEBSHELL_RIGHT_INSET;
rr.height -= WEBSHELL_TOP_INSET + WEBSHELL_BOTTOM_INSET;
mWebShell->SetBounds(rr.x, rr.y, rr.width, rr.height);
NS_RELEASE(locationWidget);
}
// inset the web widget
rr.x += WEBSHELL_LEFT_INSET;
rr.y += WEBSHELL_TOP_INSET;
rr.width -= WEBSHELL_LEFT_INSET + WEBSHELL_RIGHT_INSET;
rr.height -= WEBSHELL_TOP_INSET + WEBSHELL_BOTTOM_INSET;
mWebShell->SetBounds(rr.x, rr.y, rr.width, rr.height);
NS_IF_RELEASE(locationWidget);
}
NS_IMETHODIMP
@ -1183,8 +1189,11 @@ nsBrowserWindow::Close()
NS_IMETHODIMP
nsBrowserWindow::SetChrome(PRUint32 aChromeMask)
{
// XXX write me
mChromeMask = aChromeMask;
nsRect r;
mWindow->GetBounds(r);
Layout(r.width, r.height);
return NS_OK;
}

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

@ -130,7 +130,7 @@ nsresult nsGetCurrentNode(nsIDOMNode ** aNode)
}
/* If no node set, get first text node */
nsIDOMNode *mDocNode, *mFirstTextNode;
nsIDOMNode *mDocNode = nsnull, *mFirstTextNode;
if (NS_OK == kDomDoc->GetFirstChild(&mDocNode) &&
NS_OK == GetFirstTextNode(mDocNode, &mFirstTextNode)) {
@ -156,7 +156,7 @@ nsresult nsSetCurrentNode(nsIDOMNode * aNode)
nsresult nsAppendText(nsString *aStr)
{
nsIDOMNode *mNode;
nsIDOMNode *mNode = nsnull;
nsIDOMText *mText;
if (NS_OK == nsGetCurrentNode(&mNode) &&