Commit 54036bf6 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added IHTMLDOMNode implementation.

parent 3832eb7d
......@@ -12,6 +12,7 @@ C_SRCS = \
hlink.c \
htmldoc.c \
htmldoc3.c \
htmlnode.c \
main.c \
navigate.c \
nsembed.c \
......
......@@ -142,6 +142,7 @@ static ULONG WINAPI HTMLDocument_Release(IHTMLDocument2 *iface)
IOleDocumentView_SetInPlaceSite(DOCVIEW(This), NULL);
if(This->hwnd)
DestroyWindow(This->hwnd);
release_nodes(This);
if(This->nscontainer)
NSContainer_Release(This->nscontainer);
......@@ -982,6 +983,7 @@ HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject)
ret->lpHTMLDocument2Vtbl = &HTMLDocumentVtbl;
ret->ref = 0;
ret->nscontainer = NULL;
ret->nodes = NULL;
hres = IHTMLDocument_QueryInterface(HTMLDOC(ret), riid, ppvObject);
if(FAILED(hres)) {
......
/*
* Copyright 2005 Jacek Caban
* Copyright 2005-2006 Jacek Caban for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -40,7 +40,11 @@
#define NSAPI WINAPI
#define NS_ELEMENT_NODE 1
#define NS_DOCUMENT_NODE 9
typedef struct BindStatusCallback BindStatusCallback;
typedef struct HTMLDOMNode HTMLDOMNode;
typedef struct {
const IHTMLDocument2Vtbl *lpHTMLDocument2Vtbl;
......@@ -77,6 +81,8 @@ typedef struct {
BOOL container_locked;
BindStatusCallback *status_callback;
HTMLDOMNode *nodes;
} HTMLDocument;
struct NSContainer {
......@@ -102,6 +108,27 @@ struct NSContainer {
BOOL load_call; /* hack */
};
struct HTMLDOMNode {
const IHTMLDOMNodeVtbl *lpHTMLDOMNodeVtbl;
void (*destructor)(IUnknown*);
enum {
NT_UNKNOWN,
NT_HTMLELEM
} node_type;
union {
IUnknown *unk;
IHTMLElement *elem;
} impl;
nsIDOMNode *nsnode;
HTMLDocument *doc;
HTMLDOMNode *next;
};
#define HTMLDOC(x) ((IHTMLDocument2*) &(x)->lpHTMLDocument2Vtbl)
#define HTMLDOC3(x) ((IHTMLDocument3*) &(x)->lpHTMLDocument3Vtbl)
#define PERSIST(x) ((IPersist*) &(x)->lpPersistFileVtbl)
......@@ -129,6 +156,8 @@ struct NSContainer {
#define NSEMBWNDS(x) ((nsIEmbeddingSiteWindow*) &(x)->lpEmbeddingSiteWindowVtbl)
#define NSIFACEREQ(x) ((nsIInterfaceRequestor*) &(x)->lpInterfaceRequestorVtbl)
#define HTMLDOMNODE(x) ((IHTMLDOMNode*) &(x)->lpHTMLDOMNodeVtbl)
#define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl)))
HRESULT HTMLDocument_Create(IUnknown*,REFIID,void**);
......@@ -166,6 +195,9 @@ nsIInputStream *create_nsstream(const char*,PRInt32);
IHlink *Hlink_Create(void);
HTMLDOMNode *get_node(HTMLDocument*,nsIDOMNode*);
void release_nodes(HTMLDocument*);
DEFINE_GUID(CLSID_AboutProtocol, 0x3050F406, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
DEFINE_GUID(CLSID_JSProtocol, 0x3050F3B2, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
DEFINE_GUID(CLSID_MailtoProtocol, 0x3050F3DA, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
......
......@@ -54,6 +54,7 @@ typedef nsStringContainer nsAString;
interface nsIWebBrowserChrome;
interface nsILoadGroup;
interface nsIDOMNode;
[
object,
......@@ -74,7 +75,6 @@ typedef nsISupports nsISimpleEnumerator;
typedef nsISupports nsIWidget;
typedef nsISupports nsIProtocolHandler;
typedef nsISupports nsIDOMElement;
typedef nsISupports nsIDOMNode;
typedef nsISupports nsIDOMEventTarget;
typedef nsISupports nsIDOMAbstractView;
typedef nsISupports nsIStreamListener;
......@@ -85,6 +85,7 @@ typedef nsISupports nsIDOMWindowCollection;
typedef nsISupports nsISelection;
typedef nsISupports nsIPrompt;
typedef nsISupports nsIAuthPrompt;
typedef nsISupports nsIDOMNamedNodeMap;
[
object,
......@@ -301,6 +302,49 @@ interface nsIUploadChannel : nsISupports
[
object,
uuid(a6cf907d-15b3-11d2-932e-00805f8add32)
]
interface nsIDOMNodeList : nsISupports
{
nsresult Item(PRUint32 index, nsIDOMNode **_retval);
nsresult GetLength(PRUint32 *aLength);
}
[
object,
uuid(a6cf907c-15b3-11d2-932e-00805f8add32)
]
interface nsIDOMNode : nsISupports
{
nsresult GetNodeName(nsAString *aNodeName);
nsresult GetNodeValue(nsAString *aNodeValue);
nsresult SetNodeValue(const nsAString *aNodeValue);
nsresult GetNodeType(PRUint16 *aNodeType);
nsresult GetParentNode(nsIDOMNode **aParentNode);
nsresult GetChildNodes(nsIDOMNodeList **aChildNodes);
nsresult GetFirstChild(nsIDOMNode **aFirstChild);
nsresult GetLastChild(nsIDOMNode **aLastChild);
nsresult GetPreviousSibling(nsIDOMNode **aPreviousSibling);
nsresult GetNextSibling(nsIDOMNode **aNextSibling);
nsresult GetAttributes(nsIDOMNamedNodeMap **aAttributes);
nsresult GetOwnerDocument(nsIDOMDocument **aOwnerDocument);
nsresult InsertBefore(nsIDOMNode *newChild, nsIDOMNode *refChild, nsIDOMNode **_retval);
nsresult ReplaceChild(nsIDOMNode *newChild, nsIDOMNode *oldChild, nsIDOMNode **_retval);
nsresult RemoveChild(nsIDOMNode *oldChild, nsIDOMNode **_retval);
nsresult AppendChild(nsIDOMNode *newChild, nsIDOMNode **_retval);
nsresult HasChildNodes(PRBool *_retval);
nsresult CloneNode(PRBool deep, nsIDOMNode **_retval);
nsresult Normalize();
nsresult IsSupported(const nsAString *feature, const nsAString *version, PRBool *_retval);
nsresult GetNamespaceURI(nsAString *aNamespaceURI);
nsresult GetPrefix(nsAString *aPrefix);
nsresult SetPrefix(const nsAString *aPrefix);
nsresult GetLocalName(nsAString *aLocalName);
nsresult HasAttributes(PRBool *_retval);
}
[
object,
uuid(a6cf906b-15b3-11d2-932e-00805f8add32)
]
interface nsIDOMWindow : nsISupports
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment