[MSHTML]
authorAmine Khaldi <amine.khaldi@reactos.org>
Sat, 26 Apr 2014 18:30:09 +0000 (18:30 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Sat, 26 Apr 2014 18:30:09 +0000 (18:30 +0000)
* Sync with Wine 1.7.17.
CORE-8080

svn path=/trunk/; revision=63004

40 files changed:
reactos/boot/bootdata/packages/reactos.dff.in
reactos/dll/cpl/appwiz/addons.c
reactos/dll/win32/mshtml/CMakeLists.txt
reactos/dll/win32/mshtml/binding.h
reactos/dll/win32/mshtml/htmlanchor.c
reactos/dll/win32/mshtml/htmlbody.c
reactos/dll/win32/mshtml/htmldoc.c
reactos/dll/win32/mshtml/htmldoc3.c [deleted file]
reactos/dll/win32/mshtml/htmldoc5.c [deleted file]
reactos/dll/win32/mshtml/htmlelem.c
reactos/dll/win32/mshtml/htmlelem2.c
reactos/dll/win32/mshtml/htmlevent.c
reactos/dll/win32/mshtml/htmlevent.h
reactos/dll/win32/mshtml/htmlform.c
reactos/dll/win32/mshtml/htmlframebase.c
reactos/dll/win32/mshtml/htmlselect.c
reactos/dll/win32/mshtml/htmlstyle.c
reactos/dll/win32/mshtml/htmlstyle.h
reactos/dll/win32/mshtml/htmlstyle3.c
reactos/dll/win32/mshtml/htmlstylesheet.c
reactos/dll/win32/mshtml/htmltable.c
reactos/dll/win32/mshtml/htmltablerow.c
reactos/dll/win32/mshtml/htmlwindow.c
reactos/dll/win32/mshtml/main.c
reactos/dll/win32/mshtml/mshtml_classes.idl
reactos/dll/win32/mshtml/mshtml_private.h
reactos/dll/win32/mshtml/mutation.c
reactos/dll/win32/mshtml/navigate.c
reactos/dll/win32/mshtml/npplugin.c
reactos/dll/win32/mshtml/nsembed.c
reactos/dll/win32/mshtml/nsiface.idl
reactos/dll/win32/mshtml/nsio.c
reactos/dll/win32/mshtml/olecmd.c
reactos/dll/win32/mshtml/oleobj.c
reactos/dll/win32/mshtml/persist.c
reactos/dll/win32/mshtml/pluginhost.c
reactos/dll/win32/mshtml/script.c
reactos/include/psdk/mshtmdid.h
reactos/include/psdk/mshtml.idl
reactos/media/doc/README.WINE

index 2b8ff15..0986c54 100644 (file)
@@ -61,5 +61,5 @@ Signature = "$ReactOS$"
 "modules/optional/vmx_mode.dll"                       1  optional
 "modules/optional/vmx_svga.inf"                       6  optional
 "modules/optional/vmx_svga.sys"                       2  optional
-"modules/optional/wine_gecko-2.21-x86.msi"            4  optional
+"modules/optional/wine_gecko-2.24-x86.msi"            4  optional
 "boot/bootdata/bootcdregtest/AHKAppTests.cmd"         7  optional
index eca42a5..12b8472 100644 (file)
 
 #include <msi.h>
 
-#define GECKO_VERSION "2.21"
+#define GECKO_VERSION "2.24"
 
 #ifdef __i386__
 #define ARCH_STRING "x86"
-#define GECKO_SHA "a514fc4d53783a586c7880a676c415695fe934a3"
+#define GECKO_SHA "b4923c0565e6cbd20075a0d4119ce3b48424f962"
 #else
 #define ARCH_STRING ""
 #define GECKO_SHA "???"
@@ -60,7 +60,7 @@ static const addon_info_t *addon;
 
 static HWND install_dialog = NULL;
 
-static WCHAR GeckoUrl[] = L"http://dl.dropboxusercontent.com/u/743491/ReactOS/wine_gecko-2.21-x86.msi";
+static WCHAR GeckoUrl[] = L"http://dl.dropboxusercontent.com/u/743491/ReactOS/wine_gecko-2.24-x86.msi";
 
 /* SHA definitions are copied from advapi32. They aren't available in headers. */
 
index f286688..d0de62d 100644 (file)
@@ -21,8 +21,6 @@ list(APPEND SOURCE
     htmlcomment.c
     htmlcurstyle.c
     htmldoc.c
-    htmldoc3.c
-    htmldoc5.c
     htmlelem.c
     htmlelem2.c
     htmlelem3.c
index 392713b..63ac882 100644 (file)
@@ -49,6 +49,12 @@ typedef struct {
     struct list request_headers;
 } nsChannel;
 
+typedef struct {
+    WCHAR *headers;
+    HGLOBAL post_data;
+    ULONG post_data_len;
+} request_data_t;
+
 typedef struct BSCallbackVtbl BSCallbackVtbl;
 
 struct BSCallback {
@@ -61,9 +67,7 @@ struct BSCallback {
 
     LONG ref;
 
-    LPWSTR headers;
-    HGLOBAL post_data;
-    ULONG post_data_len;
+    request_data_t request_data;
     ULONG readed;
     DWORD bindf;
     BOOL bindinfo_ready;
@@ -102,6 +106,8 @@ typedef struct {
 #define BINDING_REPLACE      0x0002
 #define BINDING_FROMHIST     0x0004
 #define BINDING_REFRESH      0x0008
+#define BINDING_SUBMIT       0x0010
+#define BINDING_NOFRAG       0x0020
 
 HRESULT set_http_header(struct list*,const WCHAR*,int,const WCHAR*,int) DECLSPEC_HIDDEN;
 HRESULT create_redirect_nschannel(const WCHAR*,nsChannel*,nsChannel**) DECLSPEC_HIDDEN;
@@ -116,9 +122,10 @@ HRESULT super_navigate(HTMLOuterWindow*,IUri*,DWORD,const WCHAR*,BYTE*,DWORD) DE
 HRESULT load_uri(HTMLOuterWindow*,IUri*,DWORD) DECLSPEC_HIDDEN;
 HRESULT navigate_new_window(HTMLOuterWindow*,IUri*,const WCHAR*,IHTMLWindow2**) DECLSPEC_HIDDEN;
 HRESULT navigate_url(HTMLOuterWindow*,const WCHAR*,IUri*,DWORD) DECLSPEC_HIDDEN;
+HRESULT submit_form(HTMLOuterWindow*,IUri*,nsIInputStream*) DECLSPEC_HIDDEN;
 
 HRESULT create_channelbsc(IMoniker*,const WCHAR*,BYTE*,DWORD,BOOL,nsChannelBSC**) DECLSPEC_HIDDEN;
-HRESULT channelbsc_load_stream(HTMLInnerWindow*,IStream*) DECLSPEC_HIDDEN;
+HRESULT channelbsc_load_stream(HTMLInnerWindow*,IMoniker*,IStream*) DECLSPEC_HIDDEN;
 void channelbsc_set_channel(nsChannelBSC*,nsChannel*,nsIStreamListener*,nsISupports*) DECLSPEC_HIDDEN;
 IUri *nsuri_get_uri(nsWineURI*) DECLSPEC_HIDDEN;
 
index 4aee0f7..85332c0 100644 (file)
@@ -53,47 +53,81 @@ static HRESULT navigate_anchor_window(HTMLAnchorElement *This, const WCHAR *targ
     return hres;
 }
 
+HTMLOuterWindow *get_target_window(HTMLOuterWindow *window, nsAString *target_str, BOOL *use_new_window)
+{
+    HTMLOuterWindow *top_window, *ret_window;
+    const PRUnichar *target;
+    HRESULT hres;
+
+    static const WCHAR _parentW[] = {'_','p','a','r','e','n','t',0};
+    static const WCHAR _selfW[] = {'_','s','e','l','f',0};
+    static const WCHAR _topW[] = {'_','t','o','p',0};
+
+    *use_new_window = FALSE;
+
+    nsAString_GetData(target_str, &target);
+    TRACE("%s\n", debugstr_w(target));
+
+    if(!*target || !strcmpiW(target, _selfW)) {
+        IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface);
+        return window;
+    }
+
+    if(!strcmpiW(target, _topW)) {
+        get_top_window(window, &top_window);
+        IHTMLWindow2_AddRef(&top_window->base.IHTMLWindow2_iface);
+        return top_window;
+    }
+
+    if(!strcmpiW(target, _parentW)) {
+        if(!window->parent) {
+            WARN("Window has no parent\n");
+            return NULL;
+        }
+
+        IHTMLWindow2_AddRef(&window->parent->base.IHTMLWindow2_iface);
+        return window->parent;
+    }
+
+    get_top_window(window, &top_window);
+
+    hres = get_frame_by_name(top_window, target, TRUE, &ret_window);
+    if(FAILED(hres) || !ret_window) {
+        *use_new_window = TRUE;
+        return NULL;
+    }
+
+    IHTMLWindow2_AddRef(&ret_window->base.IHTMLWindow2_iface);
+    return ret_window;
+}
+
 static HRESULT navigate_anchor(HTMLAnchorElement *This)
 {
     nsAString href_str, target_str;
-    HTMLOuterWindow *window = NULL;
+    HTMLOuterWindow *window;
+    BOOL use_new_window;
     nsresult nsres;
     HRESULT hres = E_FAIL;
 
-    static const WCHAR _parentW[] = {'p','a','r','e','n','t',0};
-    static const WCHAR _selfW[] = {'_','s','e','l','f',0};
-    static const WCHAR _topW[] = {'_','t','o','p',0};
 
     nsAString_Init(&target_str, NULL);
     nsres = nsIDOMHTMLAnchorElement_GetTarget(This->nsanchor, &target_str);
-    if(NS_SUCCEEDED(nsres)) {
+    if(NS_FAILED(nsres))
+        return E_FAIL;
+
+    window = get_target_window(This->element.node.doc->basedoc.window, &target_str, &use_new_window);
+    if(!window && use_new_window) {
         const PRUnichar *target;
 
         nsAString_GetData(&target_str, &target);
-        TRACE("target %s\n", debugstr_w(target));
-        if(*target && strcmpiW(target, _selfW)) {
-            if(!strcmpiW(target, _topW)) {
-                TRACE("target _top\n");
-                get_top_window(This->element.node.doc->basedoc.window, &window);
-            }else if(!strcmpiW(target, _parentW)) {
-                FIXME("Navigating to target _parent is not implemented\n");
-                nsAString_Finish(&target_str);
-                return S_OK;
-            }else {
-                HTMLOuterWindow *top_window;
-
-                get_top_window(This->element.node.doc->basedoc.window, &top_window);
-
-                hres = get_frame_by_name(top_window, target, TRUE, &window);
-                if(FAILED(hres) || !window) {
-                    hres = navigate_anchor_window(This, target);
-                    nsAString_Finish(&target_str);
-                    return hres;
-                }
-            }
-        }
+        hres = navigate_anchor_window(This, target);
+        nsAString_Finish(&target_str);
+        return hres;
     }
+
     nsAString_Finish(&target_str);
+    if(!window)
+        return S_OK;
 
     nsAString_Init(&href_str, NULL);
     nsres = nsIDOMHTMLAnchorElement_GetHref(This->nsanchor, &href_str);
@@ -102,15 +136,14 @@ static HRESULT navigate_anchor(HTMLAnchorElement *This)
 
         nsAString_GetData(&href_str, &href);
         if(*href) {
-            if(!window)
-                window = This->element.node.doc->basedoc.window;
-            hres = navigate_url(window, href, window->uri, BINDING_NAVIGATED);
+            hres = navigate_url(window, href, window->uri_nofrag, BINDING_NAVIGATED);
         }else {
             TRACE("empty href\n");
             hres = S_OK;
         }
     }
     nsAString_Finish(&href_str);
+    IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface);
     return hres;
 }
 
index 69ea194..eb01b96 100644 (file)
@@ -108,7 +108,7 @@ static int loose_hex_to_rgb(const WCHAR *hex)
         | comp_value(hex+2*dpc, dpc);
 }
 
-static HRESULT nscolor_to_str(LPCWSTR color, BSTR *ret)
+HRESULT nscolor_to_str(LPCWSTR color, BSTR *ret)
 {
     unsigned int i;
     int rgb = -1;
@@ -139,7 +139,7 @@ static HRESULT nscolor_to_str(LPCWSTR color, BSTR *ret)
     return S_OK;
 }
 
-static BOOL variant_to_nscolor(const VARIANT *v, nsAString *nsstr)
+BOOL variant_to_nscolor(const VARIANT *v, nsAString *nsstr)
 {
     switch(V_VT(v)) {
     case VT_BSTR:
@@ -587,18 +587,71 @@ static HRESULT WINAPI HTMLBodyElement_get_onunload(IHTMLBodyElement *iface, VARI
     return E_NOTIMPL;
 }
 
+static const WCHAR autoW[] = {'a','u','t','o',0};
+static const WCHAR hiddenW[] = {'h','i','d','d','e','n',0};
+static const WCHAR scrollW[] = {'s','c','r','o','l','l',0};
+static const WCHAR visibleW[] = {'v','i','s','i','b','l','e',0};
+static const WCHAR yesW[] = {'y','e','s',0};
+static const WCHAR noW[] = {'n','o',0};
+
 static HRESULT WINAPI HTMLBodyElement_put_scroll(IHTMLBodyElement *iface, BSTR v)
 {
     HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
-    FIXME("(%p)->(%s)\n", This, debugstr_w(v));
-    return E_NOTIMPL;
+    static const WCHAR *val;
+
+    TRACE("(%p)->(%s)\n", This, debugstr_w(v));
+
+    /* Emulate with CSS visibility attribute */
+    if(!strcmpW(v, yesW)) {
+        val = scrollW;
+    }else if(!strcmpW(v, autoW)) {
+        val = visibleW;
+    }else if(!strcmpW(v, noW)) {
+        val = hiddenW;
+    }else {
+        WARN("Invalid argument %s\n", debugstr_w(v));
+        return E_INVALIDARG;
+    }
+
+    return set_elem_style(&This->textcont.element, STYLEID_OVERFLOW, val);
 }
 
 static HRESULT WINAPI HTMLBodyElement_get_scroll(IHTMLBodyElement *iface, BSTR *p)
 {
     HTMLBodyElement *This = impl_from_IHTMLBodyElement(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+    const WCHAR *ret = NULL;
+    BSTR overflow;
+    HRESULT hres;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    /* Emulate with CSS visibility attribute */
+    hres = get_elem_style(&This->textcont.element, STYLEID_OVERFLOW, &overflow);
+    if(FAILED(hres))
+        return hres;
+
+    if(!overflow || !*overflow) {
+        *p = NULL;
+        hres = S_OK;
+    }else if(!strcmpW(overflow, visibleW) || !strcmpW(overflow, autoW)) {
+        ret = autoW;
+    }else if(!strcmpW(overflow, scrollW)) {
+        ret = yesW;
+    }else if(!strcmpW(overflow, hiddenW)) {
+        ret = noW;
+    }else {
+        TRACE("Defaulting %s to NULL\n", debugstr_w(overflow));
+        *p = NULL;
+        hres = S_OK;
+    }
+
+    SysFreeString(overflow);
+    if(ret) {
+        *p = SysAllocString(ret);
+        hres = *p ? S_OK : E_OUTOFMEMORY;
+    }
+
+    return hres;
 }
 
 static HRESULT WINAPI HTMLBodyElement_put_onselect(IHTMLBodyElement *iface, VARIANT v)
index 6e1fc5d..a6516be 100644 (file)
 
 #include "mshtml_private.h"
 
+HRESULT get_doc_elem_by_id(HTMLDocumentNode *doc, const WCHAR *id, HTMLElement **ret)
+{
+    nsIDOMNodeList *nsnode_list;
+    nsIDOMElement *nselem;
+    nsIDOMNode *nsnode;
+    nsAString id_str;
+    nsresult nsres;
+    HRESULT hres;
+
+    if(!doc->nsdoc) {
+        WARN("NULL nsdoc\n");
+        return E_UNEXPECTED;
+    }
+
+    nsAString_InitDepend(&id_str, id);
+    /* get element by id attribute */
+    nsres = nsIDOMHTMLDocument_GetElementById(doc->nsdoc, &id_str, &nselem);
+    if(FAILED(nsres)) {
+        ERR("GetElementById failed: %08x\n", nsres);
+        nsAString_Finish(&id_str);
+        return E_FAIL;
+    }
+
+    /* get first element by name attribute */
+    nsres = nsIDOMHTMLDocument_GetElementsByName(doc->nsdoc, &id_str, &nsnode_list);
+    nsAString_Finish(&id_str);
+    if(FAILED(nsres)) {
+        ERR("getElementsByName failed: %08x\n", nsres);
+        if(nselem)
+            nsIDOMElement_Release(nselem);
+        return E_FAIL;
+    }
+
+    nsres = nsIDOMNodeList_Item(nsnode_list, 0, &nsnode);
+    nsIDOMNodeList_Release(nsnode_list);
+    assert(nsres == NS_OK);
+
+    if(nsnode && nselem) {
+        UINT16 pos;
+
+        nsres = nsIDOMNode_CompareDocumentPosition(nsnode, (nsIDOMNode*)nselem, &pos);
+        if(NS_FAILED(nsres)) {
+            FIXME("CompareDocumentPosition failed: 0x%08x\n", nsres);
+            nsIDOMNode_Release(nsnode);
+            nsIDOMElement_Release(nselem);
+            return E_FAIL;
+        }
+
+        TRACE("CompareDocumentPosition gave: 0x%x\n", pos);
+        if(!(pos & (DOCUMENT_POSITION_PRECEDING | DOCUMENT_POSITION_CONTAINS))) {
+            nsIDOMElement_Release(nselem);
+            nselem = NULL;
+        }
+    }
+
+    if(nsnode) {
+        if(!nselem) {
+            nsres = nsIDOMNode_QueryInterface(nsnode, &IID_nsIDOMElement, (void**)&nselem);
+            assert(nsres == NS_OK);
+        }
+        nsIDOMNode_Release(nsnode);
+    }
+
+    if(!nselem) {
+        *ret = NULL;
+        return S_OK;
+    }
+
+    hres = get_elem(doc, nselem, ret);
+    nsIDOMElement_Release(nselem);
+    return hres;
+}
+
 static inline HTMLDocument *impl_from_IHTMLDocument2(IHTMLDocument2 *iface)
 {
     return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument2_iface);
@@ -163,8 +236,35 @@ static HRESULT WINAPI HTMLDocument_get_body(IHTMLDocument2 *iface, IHTMLElement
 static HRESULT WINAPI HTMLDocument_get_activeElement(IHTMLDocument2 *iface, IHTMLElement **p)
 {
     HTMLDocument *This = impl_from_IHTMLDocument2(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+    nsIDOMElement *nselem;
+    HTMLElement *elem;
+    nsresult nsres;
+    HRESULT hres;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    if(!This->doc_node->nsdoc) {
+        *p = NULL;
+        return S_OK;
+    }
+
+    /*
+     * NOTE: Gecko may return an active element even if the document is not visible.
+     * IE returns NULL in this case.
+     */
+    nsres = nsIDOMHTMLDocument_GetActiveElement(This->doc_node->nsdoc, &nselem);
+    if(NS_FAILED(nsres)) {
+        ERR("GetActiveElement failed: %08x\n", nsres);
+        return E_FAIL;
+    }
+
+    hres = get_elem(This->doc_node, nselem, &elem);
+    nsIDOMElement_Release(nselem);
+    if(FAILED(hres))
+        return hres;
+
+    *p = &elem->IHTMLElement_iface;
+    return S_OK;
 }
 
 static HRESULT WINAPI HTMLDocument_get_images(IHTMLDocument2 *iface, IHTMLElementCollection **p)
@@ -437,7 +537,7 @@ static HRESULT WINAPI HTMLDocument_put_designMode(IHTMLDocument2 *iface, BSTR v)
 static HRESULT WINAPI HTMLDocument_get_designMode(IHTMLDocument2 *iface, BSTR *p)
 {
     HTMLDocument *This = impl_from_IHTMLDocument2(iface);
-    static WCHAR szOff[] = {'O','f','f',0};
+    static const WCHAR szOff[] = {'O','f','f',0};
     FIXME("(%p)->(%p) always returning Off\n", This, p);
 
     if(!p)
@@ -1633,12 +1733,2087 @@ static const IHTMLDocument2Vtbl HTMLDocumentVtbl = {
     HTMLDocument_createStyleSheet
 };
 
+static inline HTMLDocument *impl_from_IHTMLDocument3(IHTMLDocument3 *iface)
+{
+    return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument3_iface);
+}
+
+static HRESULT WINAPI HTMLDocument3_QueryInterface(IHTMLDocument3 *iface,
+                                                  REFIID riid, void **ppv)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    return htmldoc_query_interface(This, riid, ppv);
+}
+
+static ULONG WINAPI HTMLDocument3_AddRef(IHTMLDocument3 *iface)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    return htmldoc_addref(This);
+}
+
+static ULONG WINAPI HTMLDocument3_Release(IHTMLDocument3 *iface)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    return htmldoc_release(This);
+}
+
+static HRESULT WINAPI HTMLDocument3_GetTypeInfoCount(IHTMLDocument3 *iface, UINT *pctinfo)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
+}
+
+static HRESULT WINAPI HTMLDocument3_GetTypeInfo(IHTMLDocument3 *iface, UINT iTInfo,
+                                                LCID lcid, ITypeInfo **ppTInfo)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
+}
+
+static HRESULT WINAPI HTMLDocument3_GetIDsOfNames(IHTMLDocument3 *iface, REFIID riid,
+                                                LPOLESTR *rgszNames, UINT cNames,
+                                                LCID lcid, DISPID *rgDispId)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
+            rgDispId);
+}
+
+static HRESULT WINAPI HTMLDocument3_Invoke(IHTMLDocument3 *iface, DISPID dispIdMember,
+                            REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
+                            VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
+            pDispParams, pVarResult, pExcepInfo, puArgErr);
+}
+
+static HRESULT WINAPI HTMLDocument3_releaseCapture(IHTMLDocument3 *iface)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    FIXME("(%p)\n", This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument3_recalc(IHTMLDocument3 *iface, VARIANT_BOOL fForce)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    FIXME("(%p)->(%x)\n", This, fForce);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument3_createTextNode(IHTMLDocument3 *iface, BSTR text,
+                                                   IHTMLDOMNode **newTextNode)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    nsIDOMText *nstext;
+    HTMLDOMNode *node;
+    nsAString text_str;
+    nsresult nsres;
+    HRESULT hres;
+
+    TRACE("(%p)->(%s %p)\n", This, debugstr_w(text), newTextNode);
+
+    if(!This->doc_node->nsdoc) {
+        WARN("NULL nsdoc\n");
+        return E_UNEXPECTED;
+    }
+
+    nsAString_InitDepend(&text_str, text);
+    nsres = nsIDOMHTMLDocument_CreateTextNode(This->doc_node->nsdoc, &text_str, &nstext);
+    nsAString_Finish(&text_str);
+    if(NS_FAILED(nsres)) {
+        ERR("CreateTextNode failed: %08x\n", nsres);
+        return E_FAIL;
+    }
+
+    hres = HTMLDOMTextNode_Create(This->doc_node, (nsIDOMNode*)nstext, &node);
+    nsIDOMText_Release(nstext);
+    if(FAILED(hres))
+        return hres;
+
+    *newTextNode = &node->IHTMLDOMNode_iface;
+    return S_OK;
+}
+
+static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, IHTMLElement **p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    nsIDOMElement *nselem = NULL;
+    HTMLDOMNode *node;
+    nsresult nsres;
+    HRESULT hres;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    if(This->window->readystate == READYSTATE_UNINITIALIZED) {
+        *p = NULL;
+        return S_OK;
+    }
+
+    if(!This->doc_node->nsdoc) {
+        WARN("NULL nsdoc\n");
+        return E_UNEXPECTED;
+    }
+
+    nsres = nsIDOMHTMLDocument_GetDocumentElement(This->doc_node->nsdoc, &nselem);
+    if(NS_FAILED(nsres)) {
+        ERR("GetDocumentElement failed: %08x\n", nsres);
+        return E_FAIL;
+    }
+
+    if(!nselem) {
+        *p = NULL;
+        return S_OK;
+    }
+
+    hres = get_node(This->doc_node, (nsIDOMNode *)nselem, TRUE, &node);
+    nsIDOMElement_Release(nselem);
+    if(FAILED(hres))
+        return hres;
+
+    hres = IHTMLDOMNode_QueryInterface(&node->IHTMLDOMNode_iface, &IID_IHTMLElement, (void**)p);
+    node_release(node);
+    return hres;
+}
+
+static HRESULT WINAPI HTMLDocument3_uniqueID(IHTMLDocument3 *iface, BSTR *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument3_attachEvent(IHTMLDocument3 *iface, BSTR event,
+                                                IDispatch* pDisp, VARIANT_BOOL *pfResult)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+
+    TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult);
+
+    return attach_event(&This->doc_node->node.event_target, This, event, pDisp, pfResult);
+}
+
+static HRESULT WINAPI HTMLDocument3_detachEvent(IHTMLDocument3 *iface, BSTR event,
+                                                IDispatch *pDisp)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+
+    TRACE("(%p)->(%s %p)\n", This, debugstr_w(event), pDisp);
+
+    return detach_event(This->doc_node->node.event_target, This, event, pDisp);
+}
+
+static HRESULT WINAPI HTMLDocument3_put_onrowsdelete(IHTMLDocument3 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    FIXME("(%p)->()\n", This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument3_get_onrowsdelete(IHTMLDocument3 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument3_put_onrowsinserted(IHTMLDocument3 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    FIXME("(%p)->()\n", This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument3_get_onrowsinserted(IHTMLDocument3 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument3_put_oncellchange(IHTMLDocument3 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    FIXME("(%p)->()\n", This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument3_get_oncellchange(IHTMLDocument3 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument3_put_ondatasetchanged(IHTMLDocument3 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    FIXME("(%p)->()\n", This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument3_get_ondatasetchanged(IHTMLDocument3 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument3_put_ondataavailable(IHTMLDocument3 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    FIXME("(%p)->()\n", This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument3_get_ondataavailable(IHTMLDocument3 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument3_put_ondatasetcomplete(IHTMLDocument3 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    FIXME("(%p)->()\n", This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument3_get_ondatasetcomplete(IHTMLDocument3 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument3_put_onpropertychange(IHTMLDocument3 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    FIXME("(%p)->()\n", This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument3_get_onpropertychange(IHTMLDocument3 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument3_put_dir(IHTMLDocument3 *iface, BSTR v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_w(v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument3_get_dir(IHTMLDocument3 *iface, BSTR *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument3_put_oncontextmenu(IHTMLDocument3 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+
+    TRACE("(%p)->()\n", This);
+
+    return set_doc_event(This, EVENTID_CONTEXTMENU, &v);
+}
+
+static HRESULT WINAPI HTMLDocument3_get_oncontextmenu(IHTMLDocument3 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    return get_doc_event(This, EVENTID_CONTEXTMENU, p);
+}
+
+static HRESULT WINAPI HTMLDocument3_put_onstop(IHTMLDocument3 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    FIXME("(%p)->()\n", This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument3_get_onstop(IHTMLDocument3 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument3_createDocumentFragment(IHTMLDocument3 *iface,
+                                                           IHTMLDocument2 **ppNewDoc)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    nsIDOMDocumentFragment *doc_frag;
+    HTMLDocumentNode *docnode;
+    nsresult nsres;
+    HRESULT hres;
+
+    TRACE("(%p)->(%p)\n", This, ppNewDoc);
+
+    if(!This->doc_node->nsdoc) {
+        FIXME("NULL nsdoc\n");
+        return E_NOTIMPL;
+    }
+
+    nsres = nsIDOMHTMLDocument_CreateDocumentFragment(This->doc_node->nsdoc, &doc_frag);
+    if(NS_FAILED(nsres)) {
+        ERR("CreateDocumentFragment failed: %08x\n", nsres);
+        return E_FAIL;
+    }
+
+    hres = create_document_fragment((nsIDOMNode*)doc_frag, This->doc_node, &docnode);
+    nsIDOMDocumentFragment_Release(doc_frag);
+    if(FAILED(hres))
+        return hres;
+
+    *ppNewDoc = &docnode->basedoc.IHTMLDocument2_iface;
+    return S_OK;
+}
+
+static HRESULT WINAPI HTMLDocument3_get_parentDocument(IHTMLDocument3 *iface,
+                                                       IHTMLDocument2 **p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument3_put_enableDownload(IHTMLDocument3 *iface,
+                                                       VARIANT_BOOL v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    FIXME("(%p)->(%x)\n", This, v);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument3_get_enableDownload(IHTMLDocument3 *iface,
+                                                       VARIANT_BOOL *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument3_put_baseUrl(IHTMLDocument3 *iface, BSTR v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_w(v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument3_get_baseUrl(IHTMLDocument3 *iface, BSTR *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument3_get_childNodes(IHTMLDocument3 *iface, IDispatch **p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    return IHTMLDOMNode_get_childNodes(&This->doc_node->node.IHTMLDOMNode_iface, p);
+}
+
+static HRESULT WINAPI HTMLDocument3_put_inheritStyleSheets(IHTMLDocument3 *iface,
+                                                           VARIANT_BOOL v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    FIXME("(%p)->()\n", This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument3_get_inheritStyleSheets(IHTMLDocument3 *iface,
+                                                           VARIANT_BOOL *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument3_put_onbeforeeditfocus(IHTMLDocument3 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    FIXME("(%p)->()\n", This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument3_get_onbeforeeditfocus(IHTMLDocument3 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument3_getElementsByName(IHTMLDocument3 *iface, BSTR v,
+                                                      IHTMLElementCollection **ppelColl)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    nsIDOMNodeList *node_list;
+    nsAString selector_str;
+    WCHAR *selector;
+    nsresult nsres;
+
+    static const WCHAR formatW[] = {'*','[','i','d','=','%','s',']',',','*','[','n','a','m','e','=','%','s',']',0};
+
+    TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), ppelColl);
+
+    if(!This->doc_node || !This->doc_node->nsdoc) {
+        /* We should probably return an empty collection. */
+        FIXME("No nsdoc\n");
+        return E_NOTIMPL;
+    }
+
+    selector = heap_alloc(2*SysStringLen(v)*sizeof(WCHAR) + sizeof(formatW));
+    if(!selector)
+        return E_OUTOFMEMORY;
+    sprintfW(selector, formatW, v, v);
+
+    /*
+     * NOTE: IE getElementsByName implementation differs from Gecko. It searches both name and id attributes.
+     * That's why we use CSS selector instead. We should also use name only when it applies to given element
+     * types and search should be case insensitive. Those are currently not supported properly.
+     */
+    nsAString_InitDepend(&selector_str, selector);
+    nsres = nsIDOMNodeSelector_QuerySelectorAll(This->doc_node->nsnode_selector, &selector_str, &node_list);
+    nsAString_Finish(&selector_str);
+    heap_free(selector);
+    if(NS_FAILED(nsres)) {
+        ERR("QuerySelectorAll failed: %08x\n", nsres);
+        return E_FAIL;
+    }
+
+    *ppelColl = create_collection_from_nodelist(This->doc_node, node_list);
+    nsIDOMNodeList_Release(node_list);
+    return S_OK;
+}
+
+
+static HRESULT WINAPI HTMLDocument3_getElementById(IHTMLDocument3 *iface, BSTR v,
+                                                   IHTMLElement **pel)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    HTMLElement *elem;
+    HRESULT hres;
+
+    TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pel);
+
+    hres = get_doc_elem_by_id(This->doc_node, v, &elem);
+    if(FAILED(hres) || !elem) {
+        *pel = NULL;
+        return hres;
+    }
+
+    *pel = &elem->IHTMLElement_iface;
+    return S_OK;
+}
+
+
+static HRESULT WINAPI HTMLDocument3_getElementsByTagName(IHTMLDocument3 *iface, BSTR v,
+                                                         IHTMLElementCollection **pelColl)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
+    nsIDOMNodeList *nslist;
+    nsAString id_str;
+    nsresult nsres;
+
+    TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pelColl);
+
+    if(!This->doc_node->nsdoc) {
+        WARN("NULL nsdoc\n");
+        return E_UNEXPECTED;
+    }
+
+    nsAString_InitDepend(&id_str, v);
+    nsres = nsIDOMHTMLDocument_GetElementsByTagName(This->doc_node->nsdoc, &id_str, &nslist);
+    nsAString_Finish(&id_str);
+    if(FAILED(nsres)) {
+        ERR("GetElementByName failed: %08x\n", nsres);
+        return E_FAIL;
+    }
+
+    *pelColl = create_collection_from_nodelist(This->doc_node, nslist);
+    nsIDOMNodeList_Release(nslist);
+
+    return S_OK;
+}
+
+static const IHTMLDocument3Vtbl HTMLDocument3Vtbl = {
+    HTMLDocument3_QueryInterface,
+    HTMLDocument3_AddRef,
+    HTMLDocument3_Release,
+    HTMLDocument3_GetTypeInfoCount,
+    HTMLDocument3_GetTypeInfo,
+    HTMLDocument3_GetIDsOfNames,
+    HTMLDocument3_Invoke,
+    HTMLDocument3_releaseCapture,
+    HTMLDocument3_recalc,
+    HTMLDocument3_createTextNode,
+    HTMLDocument3_get_documentElement,
+    HTMLDocument3_uniqueID,
+    HTMLDocument3_attachEvent,
+    HTMLDocument3_detachEvent,
+    HTMLDocument3_put_onrowsdelete,
+    HTMLDocument3_get_onrowsdelete,
+    HTMLDocument3_put_onrowsinserted,
+    HTMLDocument3_get_onrowsinserted,
+    HTMLDocument3_put_oncellchange,
+    HTMLDocument3_get_oncellchange,
+    HTMLDocument3_put_ondatasetchanged,
+    HTMLDocument3_get_ondatasetchanged,
+    HTMLDocument3_put_ondataavailable,
+    HTMLDocument3_get_ondataavailable,
+    HTMLDocument3_put_ondatasetcomplete,
+    HTMLDocument3_get_ondatasetcomplete,
+    HTMLDocument3_put_onpropertychange,
+    HTMLDocument3_get_onpropertychange,
+    HTMLDocument3_put_dir,
+    HTMLDocument3_get_dir,
+    HTMLDocument3_put_oncontextmenu,
+    HTMLDocument3_get_oncontextmenu,
+    HTMLDocument3_put_onstop,
+    HTMLDocument3_get_onstop,
+    HTMLDocument3_createDocumentFragment,
+    HTMLDocument3_get_parentDocument,
+    HTMLDocument3_put_enableDownload,
+    HTMLDocument3_get_enableDownload,
+    HTMLDocument3_put_baseUrl,
+    HTMLDocument3_get_baseUrl,
+    HTMLDocument3_get_childNodes,
+    HTMLDocument3_put_inheritStyleSheets,
+    HTMLDocument3_get_inheritStyleSheets,
+    HTMLDocument3_put_onbeforeeditfocus,
+    HTMLDocument3_get_onbeforeeditfocus,
+    HTMLDocument3_getElementsByName,
+    HTMLDocument3_getElementById,
+    HTMLDocument3_getElementsByTagName
+};
+
+static inline HTMLDocument *impl_from_IHTMLDocument4(IHTMLDocument4 *iface)
+{
+    return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument4_iface);
+}
+
+static HRESULT WINAPI HTMLDocument4_QueryInterface(IHTMLDocument4 *iface,
+                                                   REFIID riid, void **ppv)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
+    return htmldoc_query_interface(This, riid, ppv);
+}
+
+static ULONG WINAPI HTMLDocument4_AddRef(IHTMLDocument4 *iface)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
+    return htmldoc_addref(This);
+}
+
+static ULONG WINAPI HTMLDocument4_Release(IHTMLDocument4 *iface)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
+    return htmldoc_release(This);
+}
+
+static HRESULT WINAPI HTMLDocument4_GetTypeInfoCount(IHTMLDocument4 *iface, UINT *pctinfo)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
+    return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
+}
+
+static HRESULT WINAPI HTMLDocument4_GetTypeInfo(IHTMLDocument4 *iface, UINT iTInfo,
+                                                LCID lcid, ITypeInfo **ppTInfo)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
+    return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
+}
+
+static HRESULT WINAPI HTMLDocument4_GetIDsOfNames(IHTMLDocument4 *iface, REFIID riid,
+                                                LPOLESTR *rgszNames, UINT cNames,
+                                                LCID lcid, DISPID *rgDispId)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
+    return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
+            rgDispId);
+}
+
+static HRESULT WINAPI HTMLDocument4_Invoke(IHTMLDocument4 *iface, DISPID dispIdMember,
+                            REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
+                            VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
+    return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
+            pDispParams, pVarResult, pExcepInfo, puArgErr);
+}
+
+static HRESULT WINAPI HTMLDocument4_focus(IHTMLDocument4 *iface)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
+    nsIDOMHTMLElement *nsbody;
+    nsresult nsres;
+
+    TRACE("(%p)->()\n", This);
+
+    nsres = nsIDOMHTMLDocument_GetBody(This->doc_node->nsdoc, &nsbody);
+    if(NS_FAILED(nsres) || !nsbody) {
+        ERR("GetBody failed: %08x\n", nsres);
+        return E_FAIL;
+    }
+
+    nsres = nsIDOMHTMLElement_Focus(nsbody);
+    nsIDOMHTMLElement_Release(nsbody);
+    if(NS_FAILED(nsres)) {
+        ERR("Focus failed: %08x\n", nsres);
+        return E_FAIL;
+    }
+
+    return S_OK;
+}
+
+static HRESULT WINAPI HTMLDocument4_hasFocus(IHTMLDocument4 *iface, VARIANT_BOOL *pfFocus)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
+    FIXME("(%p)->(%p)\n", This, pfFocus);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument4_put_onselectionchange(IHTMLDocument4 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument4_get_onselectionchange(IHTMLDocument4 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument4_get_namespace(IHTMLDocument4 *iface, IDispatch **p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument4_createDocumentFromUrl(IHTMLDocument4 *iface, BSTR bstrUrl,
+        BSTR bstrOptions, IHTMLDocument2 **newDoc)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
+    FIXME("(%p)->(%s %s %p)\n", This, debugstr_w(bstrUrl), debugstr_w(bstrOptions), newDoc);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument4_put_media(IHTMLDocument4 *iface, BSTR v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_w(v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument4_get_media(IHTMLDocument4 *iface, BSTR *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument4_createEventObject(IHTMLDocument4 *iface,
+        VARIANT *pvarEventObject, IHTMLEventObj **ppEventObj)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
+
+    TRACE("(%p)->(%s %p)\n", This, debugstr_variant(pvarEventObject), ppEventObj);
+
+    if(pvarEventObject && V_VT(pvarEventObject) != VT_ERROR && V_VT(pvarEventObject) != VT_EMPTY) {
+        FIXME("unsupported pvarEventObject %s\n", debugstr_variant(pvarEventObject));
+        return E_NOTIMPL;
+    }
+
+    return create_event_obj(ppEventObj);
+}
+
+static HRESULT WINAPI HTMLDocument4_fireEvent(IHTMLDocument4 *iface, BSTR bstrEventName,
+        VARIANT *pvarEventObject, VARIANT_BOOL *pfCanceled)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
+
+    TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(bstrEventName), pvarEventObject, pfCanceled);
+
+    return dispatch_event(&This->doc_node->node, bstrEventName, pvarEventObject, pfCanceled);
+}
+
+static HRESULT WINAPI HTMLDocument4_createRenderStyle(IHTMLDocument4 *iface, BSTR v,
+        IHTMLRenderStyle **ppIHTMLRenderStyle)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
+    FIXME("(%p)->(%s %p)\n", This, debugstr_w(v), ppIHTMLRenderStyle);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument4_put_oncontrolselect(IHTMLDocument4 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument4_get_oncontrolselect(IHTMLDocument4 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument4_get_URLEncoded(IHTMLDocument4 *iface, BSTR *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static const IHTMLDocument4Vtbl HTMLDocument4Vtbl = {
+    HTMLDocument4_QueryInterface,
+    HTMLDocument4_AddRef,
+    HTMLDocument4_Release,
+    HTMLDocument4_GetTypeInfoCount,
+    HTMLDocument4_GetTypeInfo,
+    HTMLDocument4_GetIDsOfNames,
+    HTMLDocument4_Invoke,
+    HTMLDocument4_focus,
+    HTMLDocument4_hasFocus,
+    HTMLDocument4_put_onselectionchange,
+    HTMLDocument4_get_onselectionchange,
+    HTMLDocument4_get_namespace,
+    HTMLDocument4_createDocumentFromUrl,
+    HTMLDocument4_put_media,
+    HTMLDocument4_get_media,
+    HTMLDocument4_createEventObject,
+    HTMLDocument4_fireEvent,
+    HTMLDocument4_createRenderStyle,
+    HTMLDocument4_put_oncontrolselect,
+    HTMLDocument4_get_oncontrolselect,
+    HTMLDocument4_get_URLEncoded
+};
+
+static inline HTMLDocument *impl_from_IHTMLDocument5(IHTMLDocument5 *iface)
+{
+    return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument5_iface);
+}
+
+static HRESULT WINAPI HTMLDocument5_QueryInterface(IHTMLDocument5 *iface,
+        REFIID riid, void **ppv)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
+    return htmldoc_query_interface(This, riid, ppv);
+}
+
+static ULONG WINAPI HTMLDocument5_AddRef(IHTMLDocument5 *iface)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
+    return htmldoc_addref(This);
+}
+
+static ULONG WINAPI HTMLDocument5_Release(IHTMLDocument5 *iface)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
+    return htmldoc_release(This);
+}
+
+static HRESULT WINAPI HTMLDocument5_GetTypeInfoCount(IHTMLDocument5 *iface, UINT *pctinfo)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
+    return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
+}
+
+static HRESULT WINAPI HTMLDocument5_GetTypeInfo(IHTMLDocument5 *iface, UINT iTInfo,
+        LCID lcid, ITypeInfo **ppTInfo)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
+    return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
+}
+
+static HRESULT WINAPI HTMLDocument5_GetIDsOfNames(IHTMLDocument5 *iface, REFIID riid,
+        LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
+    return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
+            rgDispId);
+}
+
+static HRESULT WINAPI HTMLDocument5_Invoke(IHTMLDocument5 *iface, DISPID dispIdMember,
+                            REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
+                            VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
+    return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
+            pDispParams, pVarResult, pExcepInfo, puArgErr);
+}
+
+static HRESULT WINAPI HTMLDocument5_put_onmousewheel(IHTMLDocument5 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument5_get_onmousewheel(IHTMLDocument5 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument5_get_doctype(IHTMLDocument5 *iface, IHTMLDOMNode **p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument5_get_implementation(IHTMLDocument5 *iface, IHTMLDOMImplementation **p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument5_createAttribute(IHTMLDocument5 *iface, BSTR bstrattrName,
+        IHTMLDOMAttribute **ppattribute)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
+    HTMLDOMAttribute *attr;
+    HRESULT hres;
+
+    TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrattrName), ppattribute);
+
+    hres = HTMLDOMAttribute_Create(bstrattrName, NULL, 0, &attr);
+    if(FAILED(hres))
+        return hres;
+
+    *ppattribute = &attr->IHTMLDOMAttribute_iface;
+    return S_OK;
+}
+
+static HRESULT WINAPI HTMLDocument5_createComment(IHTMLDocument5 *iface, BSTR bstrdata,
+        IHTMLDOMNode **ppRetNode)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
+    nsIDOMComment *nscomment;
+    HTMLElement *elem;
+    nsAString str;
+    nsresult nsres;
+    HRESULT hres;
+
+    TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrdata), ppRetNode);
+
+    if(!This->doc_node->nsdoc) {
+        WARN("NULL nsdoc\n");
+        return E_UNEXPECTED;
+    }
+
+    nsAString_InitDepend(&str, bstrdata);
+    nsres = nsIDOMHTMLDocument_CreateComment(This->doc_node->nsdoc, &str, &nscomment);
+    nsAString_Finish(&str);
+    if(NS_FAILED(nsres)) {
+        ERR("CreateTextNode failed: %08x\n", nsres);
+        return E_FAIL;
+    }
+
+    hres = HTMLCommentElement_Create(This->doc_node, (nsIDOMNode*)nscomment, &elem);
+    nsIDOMComment_Release(nscomment);
+    if(FAILED(hres))
+        return hres;
+
+    *ppRetNode = &elem->node.IHTMLDOMNode_iface;
+    return S_OK;
+}
+
+static HRESULT WINAPI HTMLDocument5_put_onfocusin(IHTMLDocument5 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument5_get_onfocusin(IHTMLDocument5 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument5_put_onfocusout(IHTMLDocument5 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument5_get_onfocusout(IHTMLDocument5 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument5_put_onactivate(IHTMLDocument5 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument5_get_onactivate(IHTMLDocument5 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument5_put_ondeactivate(IHTMLDocument5 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument5_get_ondeactivate(IHTMLDocument5 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument5_put_onbeforeactivate(IHTMLDocument5 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument5_get_onbeforeactivate(IHTMLDocument5 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument5_put_onbeforedeactivate(IHTMLDocument5 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument5_get_onbeforedeactivate(IHTMLDocument5 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument5_get_compatMode(IHTMLDocument5 *iface, BSTR *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
+    nsAString mode_str;
+    const PRUnichar *mode;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    if(!This->doc_node->nsdoc) {
+        WARN("NULL nsdoc\n");
+        return E_UNEXPECTED;
+    }
+
+    nsAString_Init(&mode_str, NULL);
+    nsIDOMHTMLDocument_GetCompatMode(This->doc_node->nsdoc, &mode_str);
+
+    nsAString_GetData(&mode_str, &mode);
+    *p = SysAllocString(mode);
+    nsAString_Finish(&mode_str);
+
+    return S_OK;
+}
+
+static const IHTMLDocument5Vtbl HTMLDocument5Vtbl = {
+    HTMLDocument5_QueryInterface,
+    HTMLDocument5_AddRef,
+    HTMLDocument5_Release,
+    HTMLDocument5_GetTypeInfoCount,
+    HTMLDocument5_GetTypeInfo,
+    HTMLDocument5_GetIDsOfNames,
+    HTMLDocument5_Invoke,
+    HTMLDocument5_put_onmousewheel,
+    HTMLDocument5_get_onmousewheel,
+    HTMLDocument5_get_doctype,
+    HTMLDocument5_get_implementation,
+    HTMLDocument5_createAttribute,
+    HTMLDocument5_createComment,
+    HTMLDocument5_put_onfocusin,
+    HTMLDocument5_get_onfocusin,
+    HTMLDocument5_put_onfocusout,
+    HTMLDocument5_get_onfocusout,
+    HTMLDocument5_put_onactivate,
+    HTMLDocument5_get_onactivate,
+    HTMLDocument5_put_ondeactivate,
+    HTMLDocument5_get_ondeactivate,
+    HTMLDocument5_put_onbeforeactivate,
+    HTMLDocument5_get_onbeforeactivate,
+    HTMLDocument5_put_onbeforedeactivate,
+    HTMLDocument5_get_onbeforedeactivate,
+    HTMLDocument5_get_compatMode
+};
+
+static inline HTMLDocument *impl_from_IHTMLDocument6(IHTMLDocument6 *iface)
+{
+    return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument6_iface);
+}
+
+static HRESULT WINAPI HTMLDocument6_QueryInterface(IHTMLDocument6 *iface,
+        REFIID riid, void **ppv)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument6(iface);
+    return htmldoc_query_interface(This, riid, ppv);
+}
+
+static ULONG WINAPI HTMLDocument6_AddRef(IHTMLDocument6 *iface)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument6(iface);
+    return htmldoc_addref(This);
+}
+
+static ULONG WINAPI HTMLDocument6_Release(IHTMLDocument6 *iface)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument6(iface);
+    return htmldoc_release(This);
+}
+
+static HRESULT WINAPI HTMLDocument6_GetTypeInfoCount(IHTMLDocument6 *iface, UINT *pctinfo)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument6(iface);
+    return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
+}
+
+static HRESULT WINAPI HTMLDocument6_GetTypeInfo(IHTMLDocument6 *iface, UINT iTInfo,
+        LCID lcid, ITypeInfo **ppTInfo)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument6(iface);
+    return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
+}
+
+static HRESULT WINAPI HTMLDocument6_GetIDsOfNames(IHTMLDocument6 *iface, REFIID riid,
+        LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument6(iface);
+    return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
+            rgDispId);
+}
+
+static HRESULT WINAPI HTMLDocument6_Invoke(IHTMLDocument6 *iface, DISPID dispIdMember,
+                            REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
+                            VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument6(iface);
+    return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
+            pDispParams, pVarResult, pExcepInfo, puArgErr);
+}
+
+static HRESULT WINAPI HTMLDocument6_get_compatible(IHTMLDocument6 *iface,
+        IHTMLDocumentCompatibleInfoCollection **p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument6(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument6_get_documentMode(IHTMLDocument6 *iface,
+        VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument6(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument6_get_onstorage(IHTMLDocument6 *iface,
+        VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument6(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument6_put_onstorage(IHTMLDocument6 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument6(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument6_get_onstoragecommit(IHTMLDocument6 *iface,
+        VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument6(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument6_put_onstoragecommit(IHTMLDocument6 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument6(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument6_getElementById(IHTMLDocument6 *iface,
+        BSTR bstrId, IHTMLElement2 **p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument6(iface);
+    FIXME("(%p)->(%s %p)\n", This, debugstr_w(bstrId), p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument6_updateSettings(IHTMLDocument6 *iface)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument6(iface);
+    FIXME("(%p)->()\n", This);
+    return E_NOTIMPL;
+}
+
+static const IHTMLDocument6Vtbl HTMLDocument6Vtbl = {
+    HTMLDocument6_QueryInterface,
+    HTMLDocument6_AddRef,
+    HTMLDocument6_Release,
+    HTMLDocument6_GetTypeInfoCount,
+    HTMLDocument6_GetTypeInfo,
+    HTMLDocument6_GetIDsOfNames,
+    HTMLDocument6_Invoke,
+    HTMLDocument6_get_compatible,
+    HTMLDocument6_get_documentMode,
+    HTMLDocument6_put_onstorage,
+    HTMLDocument6_get_onstorage,
+    HTMLDocument6_put_onstoragecommit,
+    HTMLDocument6_get_onstoragecommit,
+    HTMLDocument6_getElementById,
+    HTMLDocument6_updateSettings
+};
+
+static inline HTMLDocument *impl_from_IHTMLDocument7(IHTMLDocument7 *iface)
+{
+    return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument7_iface);
+}
+
+static HRESULT WINAPI HTMLDocument7_QueryInterface(IHTMLDocument7 *iface, REFIID riid, void **ppv)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    return htmldoc_query_interface(This, riid, ppv);
+}
+
+static ULONG WINAPI HTMLDocument7_AddRef(IHTMLDocument7 *iface)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    return htmldoc_addref(This);
+}
+
+static ULONG WINAPI HTMLDocument7_Release(IHTMLDocument7 *iface)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    return htmldoc_release(This);
+}
+
+static HRESULT WINAPI HTMLDocument7_GetTypeInfoCount(IHTMLDocument7 *iface, UINT *pctinfo)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
+}
+
+static HRESULT WINAPI HTMLDocument7_GetTypeInfo(IHTMLDocument7 *iface, UINT iTInfo,
+        LCID lcid, ITypeInfo **ppTInfo)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
+}
+
+static HRESULT WINAPI HTMLDocument7_GetIDsOfNames(IHTMLDocument7 *iface, REFIID riid,
+        LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
+            rgDispId);
+}
+
+static HRESULT WINAPI HTMLDocument7_Invoke(IHTMLDocument7 *iface, DISPID dispIdMember,
+                            REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
+                            VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
+            pDispParams, pVarResult, pExcepInfo, puArgErr);
+}
+
+static HRESULT WINAPI HTMLDocument7_get_defaultView(IHTMLDocument7 *iface, IHTMLWindow2 **p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_createCDATASection(IHTMLDocument7 *iface, BSTR text, IHTMLDOMNode **newCDATASectionNode)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, newCDATASectionNode);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_getSelection(IHTMLDocument7 *iface, IHTMLSelection **ppIHTMLSelection)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, ppIHTMLSelection);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_getElementsByTagNameNS(IHTMLDocument7 *iface, VARIANT *pvarNS,
+        BSTR bstrLocalName, IHTMLElementCollection **pelColl)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s %s %p)\n", This, debugstr_variant(pvarNS), debugstr_w(bstrLocalName), pelColl);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_createElementNS(IHTMLDocument7 *iface, VARIANT *pvarNS, BSTR bstrTag, IHTMLElement **newElem)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s %s %p)\n", This, debugstr_variant(pvarNS), debugstr_w(bstrTag), newElem);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_createAttributeNS(IHTMLDocument7 *iface, VARIANT *pvarNS,
+        BSTR bstrAttrName, IHTMLDOMAttribute **ppAttribute)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s %s %p)\n", This, debugstr_variant(pvarNS), debugstr_w(bstrAttrName), ppAttribute);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_onmsthumbnailclick(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_onmsthumbnailclick(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_characterSet(IHTMLDocument7 *iface, BSTR *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_createElement(IHTMLDocument7 *iface, BSTR bstrTag, IHTMLElement **newElem)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s %p)\n", This, debugstr_w(bstrTag), newElem);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_createAttribute(IHTMLDocument7 *iface, BSTR bstrAttrName, IHTMLDOMAttribute **ppAttribute)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s %p)\n", This, debugstr_w(bstrAttrName), ppAttribute);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_getElementByClassName(IHTMLDocument7 *iface, BSTR v, IHTMLElementCollection **pel)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s %p)\n", This, debugstr_w(v), pel);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_createProcessingInstruction(IHTMLDocument7 *iface, BSTR target,
+        BSTR data, IDOMProcessingInstruction **newProcessingInstruction)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s %s %p)\n", This, debugstr_w(target), debugstr_w(data), newProcessingInstruction);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_adoptNode(IHTMLDocument7 *iface, IHTMLDOMNode *pNodeSource, IHTMLDOMNode3 **ppNodeDest)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p %p)\n", This, pNodeSource, ppNodeDest);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_onmssitemodejumplistitemremoved(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_onmssitemodejumplistitemremoved(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_all(IHTMLDocument7 *iface, IHTMLElementCollection **p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_inputEncoding(IHTMLDocument7 *iface, BSTR *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_xmlEncoding(IHTMLDocument7 *iface, BSTR *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_xmlStandalone(IHTMLDocument7 *iface, VARIANT_BOOL v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%x)\n", This, v);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_xmlStandalone(IHTMLDocument7 *iface, VARIANT_BOOL *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_xmlVersion(IHTMLDocument7 *iface, BSTR v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_w(v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_xmlVersion(IHTMLDocument7 *iface, BSTR *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_hasAttributes(IHTMLDocument7 *iface, VARIANT_BOOL *pfHasAttributes)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, pfHasAttributes);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_onabort(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_onabort(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_onblur(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_onblur(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_oncanplay(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_oncanplay(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_oncanplaythrough(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_oncanplaythrough(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_onchange(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_onchange(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_ondrag(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_ondrag(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_ondragend(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_ondragend(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_ondragenter(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_ondragenter(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_ondragleave(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_ondragleave(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_ondragover(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_ondragover(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_ondrop(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_ondrop(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_ondurationchange(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_ondurationchange(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_onemptied(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_onemptied(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_onended(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_onended(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_onerror(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_onerror(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_onfocus(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_onfocus(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_oninput(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_oninput(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_onload(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_onload(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_onloadeddata(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_onloadeddata(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_onloadedmetadata(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_onloadedmetadata(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_onloadstart(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_onloadstart(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_onpause(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_onpause(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_onplay(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_onplay(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_onplaying(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_onplaying(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_onprogress(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_onprogress(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_onratechange(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_onratechange(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_onreset(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_onreset(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_onscroll(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_onscroll(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_onseekend(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_onseekend(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_onseeking(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_onseeking(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_onselect(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_onselect(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_onstalled(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_onstalled(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_onsubmit(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_onsubmit(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_onsuspend(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_onsuspend(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_ontimeupdate(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_ontimeupdate(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_onvolumechange(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_onvolumechange(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_onwaiting(IHTMLDocument7 *iface, VARIANT v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_onwaiting(IHTMLDocument7 *iface, VARIANT *p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_normalize(IHTMLDocument7 *iface)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)\n", This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_importNode(IHTMLDocument7 *iface, IHTMLDOMNode *pNodeSource,
+        VARIANT_BOOL fDeep, IHTMLDOMNode3 **ppNodeDest)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p %x %p)\n", This, pNodeSource, fDeep, ppNodeDest);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_parentWindow(IHTMLDocument7 *iface, IHTMLWindow2 **p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_put_body(IHTMLDocument7 *iface, IHTMLElement *v)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, v);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_body(IHTMLDocument7 *iface, IHTMLElement **p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLDocument7_get_head(IHTMLDocument7 *iface, IHTMLElement **p)
+{
+    HTMLDocument *This = impl_from_IHTMLDocument7(iface);
+    FIXME("(%p)->(%p)\n", This, p);
+    return E_NOTIMPL;
+}
+
+static const IHTMLDocument7Vtbl HTMLDocument7Vtbl = {
+    HTMLDocument7_QueryInterface,
+    HTMLDocument7_AddRef,
+    HTMLDocument7_Release,
+    HTMLDocument7_GetTypeInfoCount,
+    HTMLDocument7_GetTypeInfo,
+    HTMLDocument7_GetIDsOfNames,
+    HTMLDocument7_Invoke,
+    HTMLDocument7_get_defaultView,
+    HTMLDocument7_createCDATASection,
+    HTMLDocument7_getSelection,
+    HTMLDocument7_getElementsByTagNameNS,
+    HTMLDocument7_createElementNS,
+    HTMLDocument7_createAttributeNS,
+    HTMLDocument7_put_onmsthumbnailclick,
+    HTMLDocument7_get_onmsthumbnailclick,
+    HTMLDocument7_get_characterSet,
+    HTMLDocument7_createElement,
+    HTMLDocument7_createAttribute,
+    HTMLDocument7_getElementByClassName,
+    HTMLDocument7_createProcessingInstruction,
+    HTMLDocument7_adoptNode,
+    HTMLDocument7_put_onmssitemodejumplistitemremoved,
+    HTMLDocument7_get_onmssitemodejumplistitemremoved,
+    HTMLDocument7_get_all,
+    HTMLDocument7_get_inputEncoding,
+    HTMLDocument7_get_xmlEncoding,
+    HTMLDocument7_put_xmlStandalone,
+    HTMLDocument7_get_xmlStandalone,
+    HTMLDocument7_put_xmlVersion,
+    HTMLDocument7_get_xmlVersion,
+    HTMLDocument7_hasAttributes,
+    HTMLDocument7_put_onabort,
+    HTMLDocument7_get_onabort,
+    HTMLDocument7_put_onblur,
+    HTMLDocument7_get_onblur,
+    HTMLDocument7_put_oncanplay,
+    HTMLDocument7_get_oncanplay,
+    HTMLDocument7_put_oncanplaythrough,
+    HTMLDocument7_get_oncanplaythrough,
+    HTMLDocument7_put_onchange,
+    HTMLDocument7_get_onchange,
+    HTMLDocument7_put_ondrag,
+    HTMLDocument7_get_ondrag,
+    HTMLDocument7_put_ondragend,
+    HTMLDocument7_get_ondragend,
+    HTMLDocument7_put_ondragenter,
+    HTMLDocument7_get_ondragenter,
+    HTMLDocument7_put_ondragleave,
+    HTMLDocument7_get_ondragleave,
+    HTMLDocument7_put_ondragover,
+    HTMLDocument7_get_ondragover,
+    HTMLDocument7_put_ondrop,
+    HTMLDocument7_get_ondrop,
+    HTMLDocument7_put_ondurationchange,
+    HTMLDocument7_get_ondurationchange,
+    HTMLDocument7_put_onemptied,
+    HTMLDocument7_get_onemptied,
+    HTMLDocument7_put_onended,
+    HTMLDocument7_get_onended,
+    HTMLDocument7_put_onerror,
+    HTMLDocument7_get_onerror,
+    HTMLDocument7_put_onfocus,
+    HTMLDocument7_get_onfocus,
+    HTMLDocument7_put_oninput,
+    HTMLDocument7_get_oninput,
+    HTMLDocument7_put_onload,
+    HTMLDocument7_get_onload,
+    HTMLDocument7_put_onloadeddata,
+    HTMLDocument7_get_onloadeddata,
+    HTMLDocument7_put_onloadedmetadata,
+    HTMLDocument7_get_onloadedmetadata,
+    HTMLDocument7_put_onloadstart,
+    HTMLDocument7_get_onloadstart,
+    HTMLDocument7_put_onpause,
+    HTMLDocument7_get_onpause,
+    HTMLDocument7_put_onplay,
+    HTMLDocument7_get_onplay,
+    HTMLDocument7_put_onplaying,
+    HTMLDocument7_get_onplaying,
+    HTMLDocument7_put_onprogress,
+    HTMLDocument7_get_onprogress,
+    HTMLDocument7_put_onratechange,
+    HTMLDocument7_get_onratechange,
+    HTMLDocument7_put_onreset,
+    HTMLDocument7_get_onreset,
+    HTMLDocument7_put_onscroll,
+    HTMLDocument7_get_onscroll,
+    HTMLDocument7_put_onseekend,
+    HTMLDocument7_get_onseekend,
+    HTMLDocument7_put_onseeking,
+    HTMLDocument7_get_onseeking,
+    HTMLDocument7_put_onselect,
+    HTMLDocument7_get_onselect,
+    HTMLDocument7_put_onstalled,
+    HTMLDocument7_get_onstalled,
+    HTMLDocument7_put_onsubmit,
+    HTMLDocument7_get_onsubmit,
+    HTMLDocument7_put_onsuspend,
+    HTMLDocument7_get_onsuspend,
+    HTMLDocument7_put_ontimeupdate,
+    HTMLDocument7_get_ontimeupdate,
+    HTMLDocument7_put_onvolumechange,
+    HTMLDocument7_get_onvolumechange,
+    HTMLDocument7_put_onwaiting,
+    HTMLDocument7_get_onwaiting,
+    HTMLDocument7_normalize,
+    HTMLDocument7_importNode,
+    HTMLDocument7_get_parentWindow,
+    HTMLDocument7_put_body,
+    HTMLDocument7_get_body,
+    HTMLDocument7_get_head
+};
+
 static void HTMLDocument_on_advise(IUnknown *iface, cp_static_data_t *cp)
 {
     HTMLDocument *This = impl_from_IHTMLDocument2((IHTMLDocument2*)iface);
 
     if(This->window)
-        update_cp_events(This->window->base.inner_window, &This->doc_node->node.event_target, cp, This->doc_node->node.nsnode);
+        update_cp_events(This->window->base.inner_window, &This->doc_node->node.event_target, cp);
 }
 
 static inline HTMLDocument *impl_from_ISupportErrorInfo(ISupportErrorInfo *iface)
@@ -1965,6 +4140,9 @@ static BOOL htmldoc_qi(HTMLDocument *This, REFIID riid, void **ppv)
     }else if(IsEqualGUID(&IID_IHTMLDocument6, riid)) {
         TRACE("(%p)->(IID_IHTMLDocument6, %p)\n", This, ppv);
         *ppv = &This->IHTMLDocument6_iface;
+    }else if(IsEqualGUID(&IID_IHTMLDocument7, riid)) {
+        TRACE("(%p)->(IID_IHTMLDocument7, %p)\n", This, ppv);
+        *ppv = &This->IHTMLDocument7_iface;
     }else if(IsEqualGUID(&IID_IPersist, riid)) {
         TRACE("(%p)->(IID_IPersist, %p)\n", This, ppv);
         *ppv = &This->IPersistFile_iface;
@@ -2086,6 +4264,11 @@ static const cpc_entry_t HTMLDocument_cpc[] = {
 static void init_doc(HTMLDocument *doc, IUnknown *unk_impl, IDispatchEx *dispex)
 {
     doc->IHTMLDocument2_iface.lpVtbl = &HTMLDocumentVtbl;
+    doc->IHTMLDocument3_iface.lpVtbl = &HTMLDocument3Vtbl;
+    doc->IHTMLDocument4_iface.lpVtbl = &HTMLDocument4Vtbl;
+    doc->IHTMLDocument5_iface.lpVtbl = &HTMLDocument5Vtbl;
+    doc->IHTMLDocument6_iface.lpVtbl = &HTMLDocument6Vtbl;
+    doc->IHTMLDocument7_iface.lpVtbl = &HTMLDocument7Vtbl;
     doc->IDispatchEx_iface.lpVtbl = &DocDispatchExVtbl;
     doc->ISupportErrorInfo_iface.lpVtbl = &SupportErrorInfoVtbl;
     doc->IProvideClassInfo_iface.lpVtbl = &ProvideClassInfoVtbl;
@@ -2094,8 +4277,6 @@ static void init_doc(HTMLDocument *doc, IUnknown *unk_impl, IDispatchEx *dispex)
     doc->dispex = dispex;
     doc->task_magic = get_task_target_magic();
 
-    HTMLDocument_HTMLDocument3_Init(doc);
-    HTMLDocument_HTMLDocument5_Init(doc);
     HTMLDocument_Persist_Init(doc);
     HTMLDocument_OleCmd_Init(doc);
     HTMLDocument_OleObj_Init(doc);
diff --git a/reactos/dll/win32/mshtml/htmldoc3.c b/reactos/dll/win32/mshtml/htmldoc3.c
deleted file mode 100644 (file)
index 01661f7..0000000
+++ /dev/null
@@ -1,837 +0,0 @@
-/*
- * Copyright 2005 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
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "mshtml_private.h"
-
-HRESULT get_doc_elem_by_id(HTMLDocumentNode *doc, const WCHAR *id, HTMLElement **ret)
-{
-    nsIDOMNodeList *nsnode_list;
-    nsIDOMElement *nselem;
-    nsIDOMNode *nsnode;
-    nsAString id_str;
-    nsresult nsres;
-    HRESULT hres;
-
-    if(!doc->nsdoc) {
-        WARN("NULL nsdoc\n");
-        return E_UNEXPECTED;
-    }
-
-    nsAString_InitDepend(&id_str, id);
-    /* get element by id attribute */
-    nsres = nsIDOMHTMLDocument_GetElementById(doc->nsdoc, &id_str, &nselem);
-    if(FAILED(nsres)) {
-        ERR("GetElementById failed: %08x\n", nsres);
-        nsAString_Finish(&id_str);
-        return E_FAIL;
-    }
-
-    /* get first element by name attribute */
-    nsres = nsIDOMHTMLDocument_GetElementsByName(doc->nsdoc, &id_str, &nsnode_list);
-    nsAString_Finish(&id_str);
-    if(FAILED(nsres)) {
-        ERR("getElementsByName failed: %08x\n", nsres);
-        if(nselem)
-            nsIDOMElement_Release(nselem);
-        return E_FAIL;
-    }
-
-    nsres = nsIDOMNodeList_Item(nsnode_list, 0, &nsnode);
-    nsIDOMNodeList_Release(nsnode_list);
-    assert(nsres == NS_OK);
-
-    if(nsnode && nselem) {
-        UINT16 pos;
-
-        nsres = nsIDOMNode_CompareDocumentPosition(nsnode, (nsIDOMNode*)nselem, &pos);
-        if(NS_FAILED(nsres)) {
-            FIXME("CompareDocumentPosition failed: 0x%08x\n", nsres);
-            nsIDOMNode_Release(nsnode);
-            nsIDOMElement_Release(nselem);
-            return E_FAIL;
-        }
-
-        TRACE("CompareDocumentPosition gave: 0x%x\n", pos);
-        if(!(pos & (DOCUMENT_POSITION_PRECEDING | DOCUMENT_POSITION_CONTAINS))) {
-            nsIDOMElement_Release(nselem);
-            nselem = NULL;
-        }
-    }
-
-    if(nsnode) {
-        if(!nselem) {
-            nsres = nsIDOMNode_QueryInterface(nsnode, &IID_nsIDOMElement, (void**)&nselem);
-            assert(nsres == NS_OK);
-        }
-        nsIDOMNode_Release(nsnode);
-    }
-
-    if(!nselem) {
-        *ret = NULL;
-        return S_OK;
-    }
-
-    hres = get_elem(doc, nselem, ret);
-    nsIDOMElement_Release(nselem);
-    return hres;
-}
-
-static inline HTMLDocument *impl_from_IHTMLDocument3(IHTMLDocument3 *iface)
-{
-    return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument3_iface);
-}
-
-static HRESULT WINAPI HTMLDocument3_QueryInterface(IHTMLDocument3 *iface,
-                                                  REFIID riid, void **ppv)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    return htmldoc_query_interface(This, riid, ppv);
-}
-
-static ULONG WINAPI HTMLDocument3_AddRef(IHTMLDocument3 *iface)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    return htmldoc_addref(This);
-}
-
-static ULONG WINAPI HTMLDocument3_Release(IHTMLDocument3 *iface)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    return htmldoc_release(This);
-}
-
-static HRESULT WINAPI HTMLDocument3_GetTypeInfoCount(IHTMLDocument3 *iface, UINT *pctinfo)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
-}
-
-static HRESULT WINAPI HTMLDocument3_GetTypeInfo(IHTMLDocument3 *iface, UINT iTInfo,
-                                                LCID lcid, ITypeInfo **ppTInfo)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
-}
-
-static HRESULT WINAPI HTMLDocument3_GetIDsOfNames(IHTMLDocument3 *iface, REFIID riid,
-                                                LPOLESTR *rgszNames, UINT cNames,
-                                                LCID lcid, DISPID *rgDispId)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
-            rgDispId);
-}
-
-static HRESULT WINAPI HTMLDocument3_Invoke(IHTMLDocument3 *iface, DISPID dispIdMember,
-                            REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
-                            VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
-            pDispParams, pVarResult, pExcepInfo, puArgErr);
-}
-
-static HRESULT WINAPI HTMLDocument3_releaseCapture(IHTMLDocument3 *iface)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    FIXME("(%p)\n", This);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument3_recalc(IHTMLDocument3 *iface, VARIANT_BOOL fForce)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    FIXME("(%p)->(%x)\n", This, fForce);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument3_createTextNode(IHTMLDocument3 *iface, BSTR text,
-                                                   IHTMLDOMNode **newTextNode)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    nsIDOMText *nstext;
-    HTMLDOMNode *node;
-    nsAString text_str;
-    nsresult nsres;
-    HRESULT hres;
-
-    TRACE("(%p)->(%s %p)\n", This, debugstr_w(text), newTextNode);
-
-    if(!This->doc_node->nsdoc) {
-        WARN("NULL nsdoc\n");
-        return E_UNEXPECTED;
-    }
-
-    nsAString_InitDepend(&text_str, text);
-    nsres = nsIDOMHTMLDocument_CreateTextNode(This->doc_node->nsdoc, &text_str, &nstext);
-    nsAString_Finish(&text_str);
-    if(NS_FAILED(nsres)) {
-        ERR("CreateTextNode failed: %08x\n", nsres);
-        return E_FAIL;
-    }
-
-    hres = HTMLDOMTextNode_Create(This->doc_node, (nsIDOMNode*)nstext, &node);
-    nsIDOMText_Release(nstext);
-    if(FAILED(hres))
-        return hres;
-
-    *newTextNode = &node->IHTMLDOMNode_iface;
-    return S_OK;
-}
-
-static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, IHTMLElement **p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    nsIDOMElement *nselem = NULL;
-    HTMLDOMNode *node;
-    nsresult nsres;
-    HRESULT hres;
-
-    TRACE("(%p)->(%p)\n", This, p);
-
-    if(This->window->readystate == READYSTATE_UNINITIALIZED) {
-        *p = NULL;
-        return S_OK;
-    }
-
-    if(!This->doc_node->nsdoc) {
-        WARN("NULL nsdoc\n");
-        return E_UNEXPECTED;
-    }
-
-    nsres = nsIDOMHTMLDocument_GetDocumentElement(This->doc_node->nsdoc, &nselem);
-    if(NS_FAILED(nsres)) {
-        ERR("GetDocumentElement failed: %08x\n", nsres);
-        return E_FAIL;
-    }
-
-    if(!nselem) {
-        *p = NULL;
-        return S_OK;
-    }
-
-    hres = get_node(This->doc_node, (nsIDOMNode *)nselem, TRUE, &node);
-    nsIDOMElement_Release(nselem);
-    if(FAILED(hres))
-        return hres;
-
-    hres = IHTMLDOMNode_QueryInterface(&node->IHTMLDOMNode_iface, &IID_IHTMLElement, (void**)p);
-    node_release(node);
-    return hres;
-}
-
-static HRESULT WINAPI HTMLDocument3_uniqueID(IHTMLDocument3 *iface, BSTR *p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument3_attachEvent(IHTMLDocument3 *iface, BSTR event,
-                                                IDispatch* pDisp, VARIANT_BOOL *pfResult)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-
-    TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult);
-
-    return attach_event(&This->doc_node->node.event_target, This->doc_node->node.nsnode, This, event, pDisp, pfResult);
-}
-
-static HRESULT WINAPI HTMLDocument3_detachEvent(IHTMLDocument3 *iface, BSTR event,
-                                                IDispatch *pDisp)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-
-    TRACE("(%p)->(%s %p)\n", This, debugstr_w(event), pDisp);
-
-    return detach_event(This->doc_node->node.event_target, This, event, pDisp);
-}
-
-static HRESULT WINAPI HTMLDocument3_put_onrowsdelete(IHTMLDocument3 *iface, VARIANT v)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    FIXME("(%p)->()\n", This);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument3_get_onrowsdelete(IHTMLDocument3 *iface, VARIANT *p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument3_put_onrowsinserted(IHTMLDocument3 *iface, VARIANT v)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    FIXME("(%p)->()\n", This);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument3_get_onrowsinserted(IHTMLDocument3 *iface, VARIANT *p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument3_put_oncellchange(IHTMLDocument3 *iface, VARIANT v)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    FIXME("(%p)->()\n", This);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument3_get_oncellchange(IHTMLDocument3 *iface, VARIANT *p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument3_put_ondatasetchanged(IHTMLDocument3 *iface, VARIANT v)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    FIXME("(%p)->()\n", This);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument3_get_ondatasetchanged(IHTMLDocument3 *iface, VARIANT *p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument3_put_ondataavailable(IHTMLDocument3 *iface, VARIANT v)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    FIXME("(%p)->()\n", This);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument3_get_ondataavailable(IHTMLDocument3 *iface, VARIANT *p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument3_put_ondatasetcomplete(IHTMLDocument3 *iface, VARIANT v)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    FIXME("(%p)->()\n", This);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument3_get_ondatasetcomplete(IHTMLDocument3 *iface, VARIANT *p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument3_put_onpropertychange(IHTMLDocument3 *iface, VARIANT v)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    FIXME("(%p)->()\n", This);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument3_get_onpropertychange(IHTMLDocument3 *iface, VARIANT *p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument3_put_dir(IHTMLDocument3 *iface, BSTR v)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    FIXME("(%p)->(%s)\n", This, debugstr_w(v));
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument3_get_dir(IHTMLDocument3 *iface, BSTR *p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument3_put_oncontextmenu(IHTMLDocument3 *iface, VARIANT v)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-
-    TRACE("(%p)->()\n", This);
-
-    return set_doc_event(This, EVENTID_CONTEXTMENU, &v);
-}
-
-static HRESULT WINAPI HTMLDocument3_get_oncontextmenu(IHTMLDocument3 *iface, VARIANT *p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-
-    TRACE("(%p)->(%p)\n", This, p);
-
-    return get_doc_event(This, EVENTID_CONTEXTMENU, p);
-}
-
-static HRESULT WINAPI HTMLDocument3_put_onstop(IHTMLDocument3 *iface, VARIANT v)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    FIXME("(%p)->()\n", This);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument3_get_onstop(IHTMLDocument3 *iface, VARIANT *p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument3_createDocumentFragment(IHTMLDocument3 *iface,
-                                                           IHTMLDocument2 **ppNewDoc)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    nsIDOMDocumentFragment *doc_frag;
-    HTMLDocumentNode *docnode;
-    nsresult nsres;
-    HRESULT hres;
-
-    TRACE("(%p)->(%p)\n", This, ppNewDoc);
-
-    if(!This->doc_node->nsdoc) {
-        FIXME("NULL nsdoc\n");
-        return E_NOTIMPL;
-    }
-
-    nsres = nsIDOMHTMLDocument_CreateDocumentFragment(This->doc_node->nsdoc, &doc_frag);
-    if(NS_FAILED(nsres)) {
-        ERR("CreateDocumentFragment failed: %08x\n", nsres);
-        return E_FAIL;
-    }
-
-    hres = create_document_fragment((nsIDOMNode*)doc_frag, This->doc_node, &docnode);
-    nsIDOMDocumentFragment_Release(doc_frag);
-    if(FAILED(hres))
-        return hres;
-
-    *ppNewDoc = &docnode->basedoc.IHTMLDocument2_iface;
-    return S_OK;
-}
-
-static HRESULT WINAPI HTMLDocument3_get_parentDocument(IHTMLDocument3 *iface,
-                                                       IHTMLDocument2 **p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument3_put_enableDownload(IHTMLDocument3 *iface,
-                                                       VARIANT_BOOL v)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    FIXME("(%p)->(%x)\n", This, v);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument3_get_enableDownload(IHTMLDocument3 *iface,
-                                                       VARIANT_BOOL *p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument3_put_baseUrl(IHTMLDocument3 *iface, BSTR v)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    FIXME("(%p)->(%s)\n", This, debugstr_w(v));
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument3_get_baseUrl(IHTMLDocument3 *iface, BSTR *p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument3_get_childNodes(IHTMLDocument3 *iface, IDispatch **p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-
-    TRACE("(%p)->(%p)\n", This, p);
-
-    return IHTMLDOMNode_get_childNodes(&This->doc_node->node.IHTMLDOMNode_iface, p);
-}
-
-static HRESULT WINAPI HTMLDocument3_put_inheritStyleSheets(IHTMLDocument3 *iface,
-                                                           VARIANT_BOOL v)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    FIXME("(%p)->()\n", This);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument3_get_inheritStyleSheets(IHTMLDocument3 *iface,
-                                                           VARIANT_BOOL *p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument3_put_onbeforeeditfocus(IHTMLDocument3 *iface, VARIANT v)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    FIXME("(%p)->()\n", This);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument3_get_onbeforeeditfocus(IHTMLDocument3 *iface, VARIANT *p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument3_getElementsByName(IHTMLDocument3 *iface, BSTR v,
-                                                      IHTMLElementCollection **ppelColl)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    FIXME("(%p)->(%s %p)\n", This, debugstr_w(v), ppelColl);
-    return E_NOTIMPL;
-}
-
-
-static HRESULT WINAPI HTMLDocument3_getElementById(IHTMLDocument3 *iface, BSTR v,
-                                                   IHTMLElement **pel)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    HTMLElement *elem;
-    HRESULT hres;
-
-    TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pel);
-
-    hres = get_doc_elem_by_id(This->doc_node, v, &elem);
-    if(FAILED(hres) || !elem) {
-        *pel = NULL;
-        return hres;
-    }
-
-    *pel = &elem->IHTMLElement_iface;
-    return S_OK;
-}
-
-
-static HRESULT WINAPI HTMLDocument3_getElementsByTagName(IHTMLDocument3 *iface, BSTR v,
-                                                         IHTMLElementCollection **pelColl)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument3(iface);
-    nsIDOMNodeList *nslist;
-    nsAString id_str;
-    nsresult nsres;
-
-    TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pelColl);
-
-    if(!This->doc_node->nsdoc) {
-        WARN("NULL nsdoc\n");
-        return E_UNEXPECTED;
-    }
-
-    nsAString_InitDepend(&id_str, v);
-    nsres = nsIDOMHTMLDocument_GetElementsByTagName(This->doc_node->nsdoc, &id_str, &nslist);
-    nsAString_Finish(&id_str);
-    if(FAILED(nsres)) {
-        ERR("GetElementByName failed: %08x\n", nsres);
-        return E_FAIL;
-    }
-
-    *pelColl = create_collection_from_nodelist(This->doc_node, nslist);
-    nsIDOMNodeList_Release(nslist);
-
-    return S_OK;
-}
-
-static const IHTMLDocument3Vtbl HTMLDocument3Vtbl = {
-    HTMLDocument3_QueryInterface,
-    HTMLDocument3_AddRef,
-    HTMLDocument3_Release,
-    HTMLDocument3_GetTypeInfoCount,
-    HTMLDocument3_GetTypeInfo,
-    HTMLDocument3_GetIDsOfNames,
-    HTMLDocument3_Invoke,
-    HTMLDocument3_releaseCapture,
-    HTMLDocument3_recalc,
-    HTMLDocument3_createTextNode,
-    HTMLDocument3_get_documentElement,
-    HTMLDocument3_uniqueID,
-    HTMLDocument3_attachEvent,
-    HTMLDocument3_detachEvent,
-    HTMLDocument3_put_onrowsdelete,
-    HTMLDocument3_get_onrowsdelete,
-    HTMLDocument3_put_onrowsinserted,
-    HTMLDocument3_get_onrowsinserted,
-    HTMLDocument3_put_oncellchange,
-    HTMLDocument3_get_oncellchange,
-    HTMLDocument3_put_ondatasetchanged,
-    HTMLDocument3_get_ondatasetchanged,
-    HTMLDocument3_put_ondataavailable,
-    HTMLDocument3_get_ondataavailable,
-    HTMLDocument3_put_ondatasetcomplete,
-    HTMLDocument3_get_ondatasetcomplete,
-    HTMLDocument3_put_onpropertychange,
-    HTMLDocument3_get_onpropertychange,
-    HTMLDocument3_put_dir,
-    HTMLDocument3_get_dir,
-    HTMLDocument3_put_oncontextmenu,
-    HTMLDocument3_get_oncontextmenu,
-    HTMLDocument3_put_onstop,
-    HTMLDocument3_get_onstop,
-    HTMLDocument3_createDocumentFragment,
-    HTMLDocument3_get_parentDocument,
-    HTMLDocument3_put_enableDownload,
-    HTMLDocument3_get_enableDownload,
-    HTMLDocument3_put_baseUrl,
-    HTMLDocument3_get_baseUrl,
-    HTMLDocument3_get_childNodes,
-    HTMLDocument3_put_inheritStyleSheets,
-    HTMLDocument3_get_inheritStyleSheets,
-    HTMLDocument3_put_onbeforeeditfocus,
-    HTMLDocument3_get_onbeforeeditfocus,
-    HTMLDocument3_getElementsByName,
-    HTMLDocument3_getElementById,
-    HTMLDocument3_getElementsByTagName
-};
-
-static inline HTMLDocument *impl_from_IHTMLDocument4(IHTMLDocument4 *iface)
-{
-    return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument4_iface);
-}
-
-static HRESULT WINAPI HTMLDocument4_QueryInterface(IHTMLDocument4 *iface,
-                                                   REFIID riid, void **ppv)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
-    return htmldoc_query_interface(This, riid, ppv);
-}
-
-static ULONG WINAPI HTMLDocument4_AddRef(IHTMLDocument4 *iface)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
-    return htmldoc_addref(This);
-}
-
-static ULONG WINAPI HTMLDocument4_Release(IHTMLDocument4 *iface)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
-    return htmldoc_release(This);
-}
-
-static HRESULT WINAPI HTMLDocument4_GetTypeInfoCount(IHTMLDocument4 *iface, UINT *pctinfo)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
-    return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
-}
-
-static HRESULT WINAPI HTMLDocument4_GetTypeInfo(IHTMLDocument4 *iface, UINT iTInfo,
-                                                LCID lcid, ITypeInfo **ppTInfo)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
-    return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
-}
-
-static HRESULT WINAPI HTMLDocument4_GetIDsOfNames(IHTMLDocument4 *iface, REFIID riid,
-                                                LPOLESTR *rgszNames, UINT cNames,
-                                                LCID lcid, DISPID *rgDispId)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
-    return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
-            rgDispId);
-}
-
-static HRESULT WINAPI HTMLDocument4_Invoke(IHTMLDocument4 *iface, DISPID dispIdMember,
-                            REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
-                            VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
-    return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
-            pDispParams, pVarResult, pExcepInfo, puArgErr);
-}
-
-static HRESULT WINAPI HTMLDocument4_focus(IHTMLDocument4 *iface)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
-    nsIDOMHTMLElement *nsbody;
-    nsresult nsres;
-
-    TRACE("(%p)->()\n", This);
-
-    nsres = nsIDOMHTMLDocument_GetBody(This->doc_node->nsdoc, &nsbody);
-    if(NS_FAILED(nsres) || !nsbody) {
-        ERR("GetBody failed: %08x\n", nsres);
-        return E_FAIL;
-    }
-
-    nsres = nsIDOMHTMLElement_Focus(nsbody);
-    nsIDOMHTMLElement_Release(nsbody);
-    if(NS_FAILED(nsres)) {
-        ERR("Focus failed: %08x\n", nsres);
-        return E_FAIL;
-    }
-
-    return S_OK;
-}
-
-static HRESULT WINAPI HTMLDocument4_hasFocus(IHTMLDocument4 *iface, VARIANT_BOOL *pfFocus)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
-    FIXME("(%p)->(%p)\n", This, pfFocus);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument4_put_onselectionchange(IHTMLDocument4 *iface, VARIANT v)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
-    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument4_get_onselectionchange(IHTMLDocument4 *iface, VARIANT *p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument4_get_namespace(IHTMLDocument4 *iface, IDispatch **p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument4_createDocumentFromUrl(IHTMLDocument4 *iface, BSTR bstrUrl,
-        BSTR bstrOptions, IHTMLDocument2 **newDoc)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
-    FIXME("(%p)->(%s %s %p)\n", This, debugstr_w(bstrUrl), debugstr_w(bstrOptions), newDoc);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument4_put_media(IHTMLDocument4 *iface, BSTR v)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
-    FIXME("(%p)->(%s)\n", This, debugstr_w(v));
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument4_get_media(IHTMLDocument4 *iface, BSTR *p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument4_createEventObject(IHTMLDocument4 *iface,
-        VARIANT *pvarEventObject, IHTMLEventObj **ppEventObj)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
-
-    TRACE("(%p)->(%s %p)\n", This, debugstr_variant(pvarEventObject), ppEventObj);
-
-    if(pvarEventObject && V_VT(pvarEventObject) != VT_ERROR && V_VT(pvarEventObject) != VT_EMPTY) {
-        FIXME("unsupported pvarEventObject %s\n", debugstr_variant(pvarEventObject));
-        return E_NOTIMPL;
-    }
-
-    return create_event_obj(ppEventObj);
-}
-
-static HRESULT WINAPI HTMLDocument4_fireEvent(IHTMLDocument4 *iface, BSTR bstrEventName,
-        VARIANT *pvarEventObject, VARIANT_BOOL *pfCanceled)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
-
-    TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(bstrEventName), pvarEventObject, pfCanceled);
-
-    return dispatch_event(&This->doc_node->node, bstrEventName, pvarEventObject, pfCanceled);
-}
-
-static HRESULT WINAPI HTMLDocument4_createRenderStyle(IHTMLDocument4 *iface, BSTR v,
-        IHTMLRenderStyle **ppIHTMLRenderStyle)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
-    FIXME("(%p)->(%s %p)\n", This, debugstr_w(v), ppIHTMLRenderStyle);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument4_put_oncontrolselect(IHTMLDocument4 *iface, VARIANT v)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
-    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument4_get_oncontrolselect(IHTMLDocument4 *iface, VARIANT *p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument4_get_URLEncoded(IHTMLDocument4 *iface, BSTR *p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument4(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static const IHTMLDocument4Vtbl HTMLDocument4Vtbl = {
-    HTMLDocument4_QueryInterface,
-    HTMLDocument4_AddRef,
-    HTMLDocument4_Release,
-    HTMLDocument4_GetTypeInfoCount,
-    HTMLDocument4_GetTypeInfo,
-    HTMLDocument4_GetIDsOfNames,
-    HTMLDocument4_Invoke,
-    HTMLDocument4_focus,
-    HTMLDocument4_hasFocus,
-    HTMLDocument4_put_onselectionchange,
-    HTMLDocument4_get_onselectionchange,
-    HTMLDocument4_get_namespace,
-    HTMLDocument4_createDocumentFromUrl,
-    HTMLDocument4_put_media,
-    HTMLDocument4_get_media,
-    HTMLDocument4_createEventObject,
-    HTMLDocument4_fireEvent,
-    HTMLDocument4_createRenderStyle,
-    HTMLDocument4_put_oncontrolselect,
-    HTMLDocument4_get_oncontrolselect,
-    HTMLDocument4_get_URLEncoded
-};
-
-void HTMLDocument_HTMLDocument3_Init(HTMLDocument *This)
-{
-    This->IHTMLDocument3_iface.lpVtbl = &HTMLDocument3Vtbl;
-    This->IHTMLDocument4_iface.lpVtbl = &HTMLDocument4Vtbl;
-}
diff --git a/reactos/dll/win32/mshtml/htmldoc5.c b/reactos/dll/win32/mshtml/htmldoc5.c
deleted file mode 100644 (file)
index 71b8cb8..0000000
+++ /dev/null
@@ -1,427 +0,0 @@
-/*
- * Copyright 2007 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
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
-
-#include "mshtml_private.h"
-
-static inline HTMLDocument *impl_from_IHTMLDocument5(IHTMLDocument5 *iface)
-{
-    return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument5_iface);
-}
-
-static HRESULT WINAPI HTMLDocument5_QueryInterface(IHTMLDocument5 *iface,
-        REFIID riid, void **ppv)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
-    return htmldoc_query_interface(This, riid, ppv);
-}
-
-static ULONG WINAPI HTMLDocument5_AddRef(IHTMLDocument5 *iface)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
-    return htmldoc_addref(This);
-}
-
-static ULONG WINAPI HTMLDocument5_Release(IHTMLDocument5 *iface)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
-    return htmldoc_release(This);
-}
-
-static HRESULT WINAPI HTMLDocument5_GetTypeInfoCount(IHTMLDocument5 *iface, UINT *pctinfo)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
-    return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
-}
-
-static HRESULT WINAPI HTMLDocument5_GetTypeInfo(IHTMLDocument5 *iface, UINT iTInfo,
-        LCID lcid, ITypeInfo **ppTInfo)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
-    return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
-}
-
-static HRESULT WINAPI HTMLDocument5_GetIDsOfNames(IHTMLDocument5 *iface, REFIID riid,
-        LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
-    return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
-            rgDispId);
-}
-
-static HRESULT WINAPI HTMLDocument5_Invoke(IHTMLDocument5 *iface, DISPID dispIdMember,
-                            REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
-                            VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
-    return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
-            pDispParams, pVarResult, pExcepInfo, puArgErr);
-}
-
-static HRESULT WINAPI HTMLDocument5_put_onmousewheel(IHTMLDocument5 *iface, VARIANT v)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
-    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument5_get_onmousewheel(IHTMLDocument5 *iface, VARIANT *p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument5_get_doctype(IHTMLDocument5 *iface, IHTMLDOMNode **p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument5_get_implementation(IHTMLDocument5 *iface, IHTMLDOMImplementation **p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument5_createAttribute(IHTMLDocument5 *iface, BSTR bstrattrName,
-        IHTMLDOMAttribute **ppattribute)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
-    HTMLDOMAttribute *attr;
-    HRESULT hres;
-
-    TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrattrName), ppattribute);
-
-    hres = HTMLDOMAttribute_Create(bstrattrName, NULL, 0, &attr);
-    if(FAILED(hres))
-        return hres;
-
-    *ppattribute = &attr->IHTMLDOMAttribute_iface;
-    return S_OK;
-}
-
-static HRESULT WINAPI HTMLDocument5_createComment(IHTMLDocument5 *iface, BSTR bstrdata,
-        IHTMLDOMNode **ppRetNode)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
-    nsIDOMComment *nscomment;
-    HTMLElement *elem;
-    nsAString str;
-    nsresult nsres;
-    HRESULT hres;
-
-    TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrdata), ppRetNode);
-
-    if(!This->doc_node->nsdoc) {
-        WARN("NULL nsdoc\n");
-        return E_UNEXPECTED;
-    }
-
-    nsAString_InitDepend(&str, bstrdata);
-    nsres = nsIDOMHTMLDocument_CreateComment(This->doc_node->nsdoc, &str, &nscomment);
-    nsAString_Finish(&str);
-    if(NS_FAILED(nsres)) {
-        ERR("CreateTextNode failed: %08x\n", nsres);
-        return E_FAIL;
-    }
-
-    hres = HTMLCommentElement_Create(This->doc_node, (nsIDOMNode*)nscomment, &elem);
-    nsIDOMComment_Release(nscomment);
-    if(FAILED(hres))
-        return hres;
-
-    *ppRetNode = &elem->node.IHTMLDOMNode_iface;
-    return S_OK;
-}
-
-static HRESULT WINAPI HTMLDocument5_put_onfocusin(IHTMLDocument5 *iface, VARIANT v)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
-    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument5_get_onfocusin(IHTMLDocument5 *iface, VARIANT *p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument5_put_onfocusout(IHTMLDocument5 *iface, VARIANT v)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
-    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument5_get_onfocusout(IHTMLDocument5 *iface, VARIANT *p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument5_put_onactivate(IHTMLDocument5 *iface, VARIANT v)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
-    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument5_get_onactivate(IHTMLDocument5 *iface, VARIANT *p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument5_put_ondeactivate(IHTMLDocument5 *iface, VARIANT v)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
-    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument5_get_ondeactivate(IHTMLDocument5 *iface, VARIANT *p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument5_put_onbeforeactivate(IHTMLDocument5 *iface, VARIANT v)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
-    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument5_get_onbeforeactivate(IHTMLDocument5 *iface, VARIANT *p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument5_put_onbeforedeactivate(IHTMLDocument5 *iface, VARIANT v)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
-    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument5_get_onbeforedeactivate(IHTMLDocument5 *iface, VARIANT *p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument5_get_compatMode(IHTMLDocument5 *iface, BSTR *p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument5(iface);
-    nsAString mode_str;
-    const PRUnichar *mode;
-
-    TRACE("(%p)->(%p)\n", This, p);
-
-    if(!This->doc_node->nsdoc) {
-        WARN("NULL nsdoc\n");
-        return E_UNEXPECTED;
-    }
-
-    nsAString_Init(&mode_str, NULL);
-    nsIDOMHTMLDocument_GetCompatMode(This->doc_node->nsdoc, &mode_str);
-
-    nsAString_GetData(&mode_str, &mode);
-    *p = SysAllocString(mode);
-    nsAString_Finish(&mode_str);
-
-    return S_OK;
-}
-
-static const IHTMLDocument5Vtbl HTMLDocument5Vtbl = {
-    HTMLDocument5_QueryInterface,
-    HTMLDocument5_AddRef,
-    HTMLDocument5_Release,
-    HTMLDocument5_GetTypeInfoCount,
-    HTMLDocument5_GetTypeInfo,
-    HTMLDocument5_GetIDsOfNames,
-    HTMLDocument5_Invoke,
-    HTMLDocument5_put_onmousewheel,
-    HTMLDocument5_get_onmousewheel,
-    HTMLDocument5_get_doctype,
-    HTMLDocument5_get_implementation,
-    HTMLDocument5_createAttribute,
-    HTMLDocument5_createComment,
-    HTMLDocument5_put_onfocusin,
-    HTMLDocument5_get_onfocusin,
-    HTMLDocument5_put_onfocusout,
-    HTMLDocument5_get_onfocusout,
-    HTMLDocument5_put_onactivate,
-    HTMLDocument5_get_onactivate,
-    HTMLDocument5_put_ondeactivate,
-    HTMLDocument5_get_ondeactivate,
-    HTMLDocument5_put_onbeforeactivate,
-    HTMLDocument5_get_onbeforeactivate,
-    HTMLDocument5_put_onbeforedeactivate,
-    HTMLDocument5_get_onbeforedeactivate,
-    HTMLDocument5_get_compatMode
-};
-
-static inline HTMLDocument *impl_from_IHTMLDocument6(IHTMLDocument6 *iface)
-{
-    return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument6_iface);
-}
-
-static HRESULT WINAPI HTMLDocument6_QueryInterface(IHTMLDocument6 *iface,
-        REFIID riid, void **ppv)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument6(iface);
-    return htmldoc_query_interface(This, riid, ppv);
-}
-
-static ULONG WINAPI HTMLDocument6_AddRef(IHTMLDocument6 *iface)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument6(iface);
-    return htmldoc_addref(This);
-}
-
-static ULONG WINAPI HTMLDocument6_Release(IHTMLDocument6 *iface)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument6(iface);
-    return htmldoc_release(This);
-}
-
-static HRESULT WINAPI HTMLDocument6_GetTypeInfoCount(IHTMLDocument6 *iface, UINT *pctinfo)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument6(iface);
-    return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo);
-}
-
-static HRESULT WINAPI HTMLDocument6_GetTypeInfo(IHTMLDocument6 *iface, UINT iTInfo,
-        LCID lcid, ITypeInfo **ppTInfo)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument6(iface);
-    return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo);
-}
-
-static HRESULT WINAPI HTMLDocument6_GetIDsOfNames(IHTMLDocument6 *iface, REFIID riid,
-        LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument6(iface);
-    return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid,
-            rgDispId);
-}
-
-static HRESULT WINAPI HTMLDocument6_Invoke(IHTMLDocument6 *iface, DISPID dispIdMember,
-                            REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
-                            VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument6(iface);
-    return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags,
-            pDispParams, pVarResult, pExcepInfo, puArgErr);
-}
-
-static HRESULT WINAPI HTMLDocument6_get_compatible(IHTMLDocument6 *iface,
-        IHTMLDocumentCompatibleInfoCollection **p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument6(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument6_get_documentMode(IHTMLDocument6 *iface,
-        VARIANT *p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument6(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument6_get_onstorage(IHTMLDocument6 *iface,
-        VARIANT *p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument6(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument6_put_onstorage(IHTMLDocument6 *iface, VARIANT v)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument6(iface);
-    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument6_get_onstoragecommit(IHTMLDocument6 *iface,
-        VARIANT *p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument6(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument6_put_onstoragecommit(IHTMLDocument6 *iface, VARIANT v)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument6(iface);
-    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument6_getElementById(IHTMLDocument6 *iface,
-        BSTR bstrId, IHTMLElement2 **p)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument6(iface);
-    FIXME("(%p)->(%s %p)\n", This, debugstr_w(bstrId), p);
-    return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLDocument6_updateSettings(IHTMLDocument6 *iface)
-{
-    HTMLDocument *This = impl_from_IHTMLDocument6(iface);
-    FIXME("(%p)->()\n", This);
-    return E_NOTIMPL;
-}
-
-static const IHTMLDocument6Vtbl HTMLDocument6Vtbl = {
-    HTMLDocument6_QueryInterface,
-    HTMLDocument6_AddRef,
-    HTMLDocument6_Release,
-    HTMLDocument6_GetTypeInfoCount,
-    HTMLDocument6_GetTypeInfo,
-    HTMLDocument6_GetIDsOfNames,
-    HTMLDocument6_Invoke,
-    HTMLDocument6_get_compatible,
-    HTMLDocument6_get_documentMode,
-    HTMLDocument6_put_onstorage,
-    HTMLDocument6_get_onstorage,
-    HTMLDocument6_put_onstoragecommit,
-    HTMLDocument6_get_onstoragecommit,
-    HTMLDocument6_getElementById,
-    HTMLDocument6_updateSettings
-};
-
-void HTMLDocument_HTMLDocument5_Init(HTMLDocument *This)
-{
-    This->IHTMLDocument5_iface.lpVtbl = &HTMLDocument5Vtbl;
-    This->IHTMLDocument6_iface.lpVtbl = &HTMLDocument6Vtbl;
-}
index f0287d2..88b5ebf 100644 (file)
@@ -1710,8 +1710,8 @@ static HRESULT HTMLElement_invoke(DispatchEx *dispex, DISPID id, LCID lcid,
 static HRESULT HTMLElement_populate_props(DispatchEx *dispex)
 {
     HTMLElement *This = impl_from_DispatchEx(dispex);
-    nsIDOMNamedNodeMap *attrs;
-    nsIDOMNode *node;
+    nsIDOMMozNamedAttrMap *attrs;
+    nsIDOMAttr *attr;
     nsAString nsstr;
     const PRUnichar *str;
     BSTR name;
@@ -1729,40 +1729,40 @@ static HRESULT HTMLElement_populate_props(DispatchEx *dispex)
     if(NS_FAILED(nsres))
         return E_FAIL;
 
-    nsres = nsIDOMNamedNodeMap_GetLength(attrs, &len);
+    nsres = nsIDOMMozNamedAttrMap_GetLength(attrs, &len);
     if(NS_FAILED(nsres)) {
-        nsIDOMNamedNodeMap_Release(attrs);
+        nsIDOMMozNamedAttrMap_Release(attrs);
         return E_FAIL;
     }
 
     nsAString_Init(&nsstr, NULL);
     for(i=0; i<len; i++) {
-        nsres = nsIDOMNamedNodeMap_Item(attrs, i, &node);
+        nsres = nsIDOMMozNamedAttrMap_Item(attrs, i, &attr);
         if(NS_FAILED(nsres))
             continue;
 
-        nsres = nsIDOMNode_GetNodeName(node, &nsstr);
+        nsres = nsIDOMAttr_GetNodeName(attr, &nsstr);
         if(NS_FAILED(nsres)) {
-            nsIDOMNode_Release(node);
+            nsIDOMAttr_Release(attr);
             continue;
         }
 
         nsAString_GetData(&nsstr, &str);
         name = SysAllocString(str);
         if(!name) {
-            nsIDOMNode_Release(node);
+            nsIDOMAttr_Release(attr);
             continue;
         }
 
         hres = IDispatchEx_GetDispID(&dispex->IDispatchEx_iface, name, fdexNameCaseInsensitive, &id);
         if(hres != DISP_E_UNKNOWNNAME) {
-            nsIDOMNode_Release(node);
+            nsIDOMAttr_Release(attr);
             SysFreeString(name);
             continue;
         }
 
-        nsres = nsIDOMNode_GetNodeValue(node, &nsstr);
-        nsIDOMNode_Release(node);
+        nsres = nsIDOMAttr_GetNodeValue(attr, &nsstr);
+        nsIDOMAttr_Release(attr);
         if(NS_FAILED(nsres)) {
             SysFreeString(name);
             continue;
@@ -1785,7 +1785,7 @@ static HRESULT HTMLElement_populate_props(DispatchEx *dispex)
     }
     nsAString_Finish(&nsstr);
 
-    nsIDOMNamedNodeMap_Release(attrs);
+    nsIDOMMozNamedAttrMap_Release(attrs);
     return S_OK;
 }
 
index cd5f3d4..b2cf30f 100644 (file)
@@ -847,7 +847,7 @@ static HRESULT WINAPI HTMLElement2_attachEvent(IHTMLElement2 *iface, BSTR event,
 
     TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult);
 
-    return attach_event(get_node_event_target(&This->node), This->node.nsnode, &This->node.doc->basedoc, event, pDisp, pfResult);
+    return attach_event(get_node_event_target(&This->node), &This->node.doc->basedoc, event, pDisp, pfResult);
 }
 
 static HRESULT WINAPI HTMLElement2_detachEvent(IHTMLElement2 *iface, BSTR event, IDispatch *pDisp)
index 4ed833b..b6278cd 100644 (file)
@@ -25,7 +25,6 @@ typedef struct {
 } handler_vector_t;
 
 struct event_target_t {
-    DWORD node_handlers_mask;
     handler_vector_t *event_table[EVENTID_LAST];
 };
 
@@ -142,13 +141,13 @@ typedef struct {
 #define EVENT_DEFAULTLISTENER    0x0001
 #define EVENT_BUBBLE             0x0002
 #define EVENT_FORWARDBODY        0x0004
-#define EVENT_NODEHANDLER        0x0008
+#define EVENT_BIND_TO_BODY       0x0008
 #define EVENT_CANCELABLE         0x0010
 #define EVENT_HASDEFAULTHANDLERS 0x0020
 
 static const event_info_t event_info[] = {
     {abortW,             onabortW,             EVENTT_NONE,   DISPID_EVMETH_ONABORT,
-        EVENT_NODEHANDLER},
+        EVENT_BIND_TO_BODY},
     {beforeunloadW,      onbeforeunloadW,      EVENTT_NONE,   DISPID_EVMETH_ONBEFOREUNLOAD,
         EVENT_DEFAULTLISTENER|EVENT_FORWARDBODY},
     {blurW,              onblurW,              EVENTT_HTML,   DISPID_EVMETH_ONBLUR,
@@ -168,7 +167,7 @@ static const event_info_t event_info[] = {
     {dragstartW,         ondragstartW,         EVENTT_MOUSE,  DISPID_EVMETH_ONDRAGSTART,
         EVENT_CANCELABLE},
     {errorW,             onerrorW,             EVENTT_NONE,   DISPID_EVMETH_ONERROR,
-        EVENT_NODEHANDLER},
+        EVENT_BIND_TO_BODY},
     {focusW,             onfocusW,             EVENTT_HTML,   DISPID_EVMETH_ONFOCUS,
         EVENT_DEFAULTLISTENER},
     {helpW,              onhelpW,              EVENTT_KEY,    DISPID_EVMETH_ONHELP,
@@ -180,7 +179,7 @@ static const event_info_t event_info[] = {
     {keyupW,             onkeyupW,             EVENTT_KEY,    DISPID_EVMETH_ONKEYUP,
         EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
     {loadW,              onloadW,              EVENTT_HTML,   DISPID_EVMETH_ONLOAD,
-        EVENT_NODEHANDLER},
+        EVENT_BIND_TO_BODY},
     {mousedownW,         onmousedownW,         EVENTT_MOUSE,  DISPID_EVMETH_ONMOUSEDOWN,
         EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
     {mousemoveW,         onmousemoveW,         EVENTT_MOUSE,  DISPID_EVMETH_ONMOUSEMOVE,
@@ -205,8 +204,6 @@ static const event_info_t event_info[] = {
         EVENT_DEFAULTLISTENER|EVENT_BUBBLE|EVENT_CANCELABLE}
 };
 
-static const eventid_t node_handled_list[] = { EVENTID_ABORT, EVENTID_ERROR, EVENTID_LOAD };
-
 eventid_t str_to_eid(LPCWSTR str)
 {
     int i;
@@ -232,19 +229,6 @@ static eventid_t attr_to_eid(LPCWSTR str)
     return EVENTID_LAST;
 }
 
-static DWORD get_node_handler_mask(eventid_t eid)
-{
-    DWORD i;
-
-    for(i=0; i<sizeof(node_handled_list)/sizeof(*node_handled_list); i++) {
-        if(node_handled_list[i] == eid)
-            return 1 << i;
-    }
-
-    ERR("Invalid eid %d\n", eid);
-    return ~0;
-}
-
 typedef struct {
     DispatchEx dispex;
     IHTMLEventObj IHTMLEventObj_iface;
@@ -605,20 +589,48 @@ static HRESULT WINAPI HTMLEventObj_get_reason(IHTMLEventObj *iface, LONG *p)
 static HRESULT WINAPI HTMLEventObj_get_x(IHTMLEventObj *iface, LONG *p)
 {
     HTMLEventObj *This = impl_from_IHTMLEventObj(iface);
+    LONG x = 0;
 
-    FIXME("(%p)->(%p)\n", This, p);
+    TRACE("(%p)->(%p)\n", This, p);
 
-    *p = -1;
+    if(This->nsevent) {
+        nsIDOMUIEvent *ui_event;
+        nsresult nsres;
+
+        nsres = nsIDOMEvent_QueryInterface(This->nsevent, &IID_nsIDOMUIEvent, (void**)&ui_event);
+        if(NS_SUCCEEDED(nsres)) {
+            /* NOTE: pageX is not exactly right here. */
+            nsres = nsIDOMUIEvent_GetPageX(ui_event, &x);
+            assert(nsres == NS_OK);
+            nsIDOMUIEvent_Release(ui_event);
+        }
+    }
+
+    *p = x;
     return S_OK;
 }
 
 static HRESULT WINAPI HTMLEventObj_get_y(IHTMLEventObj *iface, LONG *p)
 {
     HTMLEventObj *This = impl_from_IHTMLEventObj(iface);
+    LONG y = 0;
 
-    FIXME("(%p)->(%p)\n", This, p);
+    TRACE("(%p)->(%p)\n", This, p);
+
+    if(This->nsevent) {
+        nsIDOMUIEvent *ui_event;
+        nsresult nsres;
+
+        nsres = nsIDOMEvent_QueryInterface(This->nsevent, &IID_nsIDOMUIEvent, (void**)&ui_event);
+        if(NS_SUCCEEDED(nsres)) {
+            /* NOTE: pageY is not exactly right here. */
+            nsres = nsIDOMUIEvent_GetPageY(ui_event, &y);
+            assert(nsres == NS_OK);
+            nsIDOMUIEvent_Release(ui_event);
+        }
+    }
 
-    *p = -1;
+    *p = y;
     return S_OK;
 }
 
@@ -1292,31 +1304,33 @@ static BOOL alloc_handler_vector(event_target_t *event_target, eventid_t eid, in
     return TRUE;
 }
 
-static HRESULT ensure_nsevent_handler(HTMLDocumentNode *doc, event_target_t *event_target, nsIDOMNode *nsnode, eventid_t eid)
+static HRESULT ensure_nsevent_handler(HTMLDocumentNode *doc, event_target_t *event_target, eventid_t eid)
 {
-    if(!doc->nsdoc)
-        return S_OK;
+    nsIDOMNode *nsnode = NULL;
 
-    if(event_info[eid].flags & EVENT_NODEHANDLER) {
-        DWORD mask;
+    TRACE("%s\n", debugstr_w(event_info[eid].name));
 
-        mask = get_node_handler_mask(eid);
-        if(event_target->node_handlers_mask & mask)
-            return S_OK;
-
-        add_nsevent_listener(doc, nsnode, event_info[eid].name);
-        event_target->node_handlers_mask |= mask;
+    if(!doc->nsdoc || doc->event_vector[eid] || !(event_info[eid].flags & (EVENT_DEFAULTLISTENER|EVENT_BIND_TO_BODY)))
         return S_OK;
-    }
 
-    if(!(event_info[eid].flags & EVENT_DEFAULTLISTENER))
-        return S_OK;
+    if(event_info[eid].flags & EVENT_BIND_TO_BODY) {
+        nsIDOMHTMLElement *nsbody;
+        nsresult nsres;
 
-    if(!doc->event_vector[eid]) {
-        doc->event_vector[eid] = TRUE;
-        add_nsevent_listener(doc, NULL, event_info[eid].name);
+        nsres = nsIDOMHTMLDocument_GetBody(doc->nsdoc, &nsbody);
+        if(NS_SUCCEEDED(nsres) && nsbody) {
+            nsnode = (nsIDOMNode*)nsbody;
+        }else {
+            ERR("GetBody failed: %08x\n", nsres);
+            return E_UNEXPECTED;
+        }
     }
 
+    doc->event_vector[eid] = TRUE;
+    add_nsevent_listener(doc, nsnode, event_info[eid].name);
+
+    if(nsnode)
+        nsIDOMNode_Release(nsnode);
     return S_OK;
 }
 
@@ -1347,7 +1361,7 @@ static HRESULT remove_event_handler(event_target_t **event_target, eventid_t eid
     return S_OK;
 }
 
-static HRESULT set_event_handler_disp(event_target_t **event_target_ptr, nsIDOMNode *nsnode, HTMLDocumentNode *doc,
+static HRESULT set_event_handler_disp(event_target_t **event_target_ptr, HTMLDocumentNode *doc,
         eventid_t eid, IDispatch *disp)
 {
     event_target_t *event_target;
@@ -1368,17 +1382,17 @@ static HRESULT set_event_handler_disp(event_target_t **event_target_ptr, nsIDOMN
     event_target->event_table[eid]->handler_prop = disp;
     IDispatch_AddRef(disp);
 
-    return ensure_nsevent_handler(doc, event_target, nsnode, eid);
+    return ensure_nsevent_handler(doc, event_target, eid);
 }
 
-HRESULT set_event_handler(event_target_t **event_target, nsIDOMNode *nsnode, HTMLDocumentNode *doc, eventid_t eid, VARIANT *var)
+HRESULT set_event_handler(event_target_t **event_target, HTMLDocumentNode *doc, eventid_t eid, VARIANT *var)
 {
     switch(V_VT(var)) {
     case VT_NULL:
         return remove_event_handler(event_target, eid);
 
     case VT_DISPATCH:
-        return set_event_handler_disp(event_target, nsnode, doc, eid, V_DISPATCH(var));
+        return set_event_handler_disp(event_target, doc, eid, V_DISPATCH(var));
 
     default:
         FIXME("not handler %s\n", debugstr_variant(var));
@@ -1403,7 +1417,7 @@ HRESULT get_event_handler(event_target_t **event_target, eventid_t eid, VARIANT
     return S_OK;
 }
 
-HRESULT attach_event(event_target_t **event_target_ptr, nsIDOMNode *nsnode, HTMLDocument *doc, BSTR name,
+HRESULT attach_event(event_target_t **event_target_ptr, HTMLDocument *doc, BSTR name,
         IDispatch *disp, VARIANT_BOOL *res)
 {
     event_target_t *event_target;
@@ -1434,7 +1448,7 @@ HRESULT attach_event(event_target_t **event_target_ptr, nsIDOMNode *nsnode, HTML
     event_target->event_table[eid]->handlers[i] = disp;
 
     *res = VARIANT_TRUE;
-    return ensure_nsevent_handler(doc->doc_node, event_target, nsnode, eid);
+    return ensure_nsevent_handler(doc->doc_node, event_target, eid);
 }
 
 HRESULT detach_event(event_target_t *event_target, HTMLDocument *doc, BSTR name, IDispatch *disp)
@@ -1465,11 +1479,11 @@ HRESULT detach_event(event_target_t *event_target, HTMLDocument *doc, BSTR name,
     return S_OK;
 }
 
-void bind_elem_event(HTMLDocumentNode *doc, HTMLElement *elem, const WCHAR *event, IDispatch *disp)
+void bind_node_event(HTMLDocumentNode *doc, event_target_t **event_target, HTMLDOMNode *node, const WCHAR *event, IDispatch *disp)
 {
     eventid_t eid;
 
-    TRACE("(%p %p %s %p)\n", doc, elem, debugstr_w(event), disp);
+    TRACE("(%p %p %p %s %p)\n", doc, event_target, node, debugstr_w(event), disp);
 
     eid = attr_to_eid(event);
     if(eid == EVENTID_LAST) {
@@ -1477,10 +1491,10 @@ void bind_elem_event(HTMLDocumentNode *doc, HTMLElement *elem, const WCHAR *even
         return;
     }
 
-    set_event_handler_disp(&elem->node.event_target, elem->node.nsnode, doc, eid, disp);
+    set_event_handler_disp(event_target, doc, eid, disp);
 }
 
-void update_cp_events(HTMLInnerWindow *window, event_target_t **event_target_ptr, cp_static_data_t *cp, nsIDOMNode *nsnode)
+void update_cp_events(HTMLInnerWindow *window, event_target_t **event_target_ptr, cp_static_data_t *cp)
 {
     event_target_t *event_target;
     int i;
@@ -1491,7 +1505,7 @@ void update_cp_events(HTMLInnerWindow *window, event_target_t **event_target_ptr
 
     for(i=0; i < EVENTID_LAST; i++) {
         if((event_info[i].flags & EVENT_DEFAULTLISTENER) && is_cp_event(cp, event_info[i].dispid))
-            ensure_nsevent_handler(window->doc, event_target, nsnode, i);
+            ensure_nsevent_handler(window->doc, event_target, i);
     }
 }
 
@@ -1522,7 +1536,7 @@ void check_event_attr(HTMLDocumentNode *doc, nsIDOMElement *nselem)
             if(disp) {
                 hres = get_node(doc, (nsIDOMNode*)nselem, TRUE, &node);
                 if(SUCCEEDED(hres)) {
-                    set_event_handler_disp(get_node_event_target(node), node->nsnode, node->doc, i, disp);
+                    set_event_handler_disp(get_node_event_target(node), node->doc, i, disp);
                     node_release(node);
                 }
                 IDispatch_Release(disp);
@@ -1547,7 +1561,7 @@ HRESULT doc_init_events(HTMLDocumentNode *doc)
 
     for(i=0; i < EVENTID_LAST; i++) {
         if(event_info[i].flags & EVENT_HASDEFAULTHANDLERS) {
-            hres = ensure_nsevent_handler(doc, NULL, NULL, i);
+            hres = ensure_nsevent_handler(doc, NULL, i);
             if(FAILED(hres))
                 return hres;
         }
index ca39038..528eded 100644 (file)
@@ -51,18 +51,18 @@ typedef enum {
 eventid_t str_to_eid(LPCWSTR) DECLSPEC_HIDDEN;
 void check_event_attr(HTMLDocumentNode*,nsIDOMElement*) DECLSPEC_HIDDEN;
 void release_event_target(event_target_t*) DECLSPEC_HIDDEN;
-                              void fire_event(HTMLDocumentNode*,eventid_t,BOOL,nsIDOMNode*,nsIDOMEvent*,IDispatch*) DECLSPEC_HIDDEN;
-HRESULT set_event_handler(event_target_t**,nsIDOMNode*,HTMLDocumentNode*,eventid_t,VARIANT*) DECLSPEC_HIDDEN;
+void fire_event(HTMLDocumentNode*,eventid_t,BOOL,nsIDOMNode*,nsIDOMEvent*,IDispatch*) DECLSPEC_HIDDEN;
+HRESULT set_event_handler(event_target_t**,HTMLDocumentNode*,eventid_t,VARIANT*) DECLSPEC_HIDDEN;
 HRESULT get_event_handler(event_target_t**,eventid_t,VARIANT*) DECLSPEC_HIDDEN;
-HRESULT attach_event(event_target_t**,nsIDOMNode*,HTMLDocument*,BSTR,IDispatch*,VARIANT_BOOL*) DECLSPEC_HIDDEN;
+HRESULT attach_event(event_target_t**,HTMLDocument*,BSTR,IDispatch*,VARIANT_BOOL*) DECLSPEC_HIDDEN;
 HRESULT detach_event(event_target_t*,HTMLDocument*,BSTR,IDispatch*) DECLSPEC_HIDDEN;
 HRESULT dispatch_event(HTMLDOMNode*,const WCHAR*,VARIANT*,VARIANT_BOOL*) DECLSPEC_HIDDEN;
 HRESULT call_fire_event(HTMLDOMNode*,eventid_t) DECLSPEC_HIDDEN;
-void update_cp_events(HTMLInnerWindow*,event_target_t**,cp_static_data_t*,nsIDOMNode*) DECLSPEC_HIDDEN;
+void update_cp_events(HTMLInnerWindow*,event_target_t**,cp_static_data_t*) DECLSPEC_HIDDEN;
 HRESULT doc_init_events(HTMLDocumentNode*) DECLSPEC_HIDDEN;
 void detach_events(HTMLDocumentNode *doc) DECLSPEC_HIDDEN;
 HRESULT create_event_obj(IHTMLEventObj**) DECLSPEC_HIDDEN;
-void bind_elem_event(HTMLDocumentNode*,HTMLElement*,const WCHAR*,IDispatch*) DECLSPEC_HIDDEN;
+void bind_node_event(HTMLDocumentNode*,event_target_t**,HTMLDOMNode*,const WCHAR*,IDispatch*) DECLSPEC_HIDDEN;
 
 void init_nsevents(HTMLDocumentNode*) DECLSPEC_HIDDEN;
 void release_nsevents(HTMLDocumentNode*) DECLSPEC_HIDDEN;
@@ -76,7 +76,7 @@ static inline event_target_t **get_node_event_target(HTMLDOMNode *node)
 
 static inline HRESULT set_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *var)
 {
-    return set_event_handler(get_node_event_target(node), node->nsnode, node->doc, eid, var);
+    return set_event_handler(get_node_event_target(node), node->doc, eid, var);
 }
 
 static inline HRESULT get_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *var)
index 0a0ed68..7eba35c 100644 (file)
@@ -346,17 +346,75 @@ static HRESULT WINAPI HTMLFormElement_get_onreset(IHTMLFormElement *iface, VARIA
 static HRESULT WINAPI HTMLFormElement_submit(IHTMLFormElement *iface)
 {
     HTMLFormElement *This = impl_from_IHTMLFormElement(iface);
+    HTMLOuterWindow *window = NULL, *this_window = NULL;
+    nsIInputStream *post_stream;
+    nsAString action_uri_str, target_str;
+    IUri *uri;
     nsresult nsres;
+    HRESULT hres;
 
     TRACE("(%p)->()\n", This);
 
-    nsres = nsIDOMHTMLFormElement_Submit(This->nsform);
-    if(NS_FAILED(nsres)) {
-        ERR("Submit failed: %08x\n", nsres);
-        return E_FAIL;
+    if(This->element.node.doc) {
+        HTMLDocumentNode *doc = This->element.node.doc;
+        if(doc->window && doc->window->base.outer_window)
+            this_window = doc->window->base.outer_window;
+    }
+    if(!this_window) {
+        TRACE("No outer window\n");
+        return S_OK;
     }
 
-    return S_OK;
+    nsAString_Init(&target_str, NULL);
+    nsres = nsIDOMHTMLFormElement_GetTarget(This->nsform, &target_str);
+    if(NS_SUCCEEDED(nsres)) {
+        BOOL use_new_window;
+        window = get_target_window(this_window, &target_str, &use_new_window);
+        if(use_new_window)
+            FIXME("submit to new window is not supported\n");
+    }
+    nsAString_Finish(&target_str);
+    if(!window)
+        return S_OK;
+
+    /*
+     * FIXME: We currently don't use our submit implementation for sub-windows because
+     * load_nsuri can't support post data. We should fix it.
+     */
+    if(!window->doc_obj || window->doc_obj->basedoc.window != window) {
+        nsres = nsIDOMHTMLFormElement_Submit(This->nsform);
+        IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface);
+        if(NS_FAILED(nsres)) {
+            ERR("Submit failed: %08x\n", nsres);
+            return E_FAIL;
+        }
+
+        return S_OK;
+    }
+
+    nsAString_Init(&action_uri_str, NULL);
+    nsres = nsIDOMHTMLFormElement_GetFormData(This->nsform, NULL, &action_uri_str, &post_stream);
+    if(NS_SUCCEEDED(nsres)) {
+        const PRUnichar *action_uri;
+
+        nsAString_GetData(&action_uri_str, &action_uri);
+        hres = create_uri(action_uri, 0, &uri);
+    }else {
+        ERR("GetFormData failed: %08x\n", nsres);
+        hres = E_FAIL;
+    }
+    nsAString_Finish(&action_uri_str);
+    if(SUCCEEDED(hres)) {
+        window->readystate_locked++;
+        hres = submit_form(window, uri, post_stream);
+        window->readystate_locked--;
+        IUri_Release(uri);
+    }
+
+    IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface);
+    if(post_stream)
+        nsIInputStream_Release(post_stream);
+    return hres;
 }
 
 static HRESULT WINAPI HTMLFormElement_reset(IHTMLFormElement *iface)
index c034f83..90caceb 100644 (file)
@@ -578,15 +578,19 @@ static HRESULT WINAPI HTMLFrameBase2_get_contentWindow(IHTMLFrameBase2 *iface, I
 static HRESULT WINAPI HTMLFrameBase2_put_onload(IHTMLFrameBase2 *iface, VARIANT v)
 {
     HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
-    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
-    return E_NOTIMPL;
+
+    TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
+
+    return set_node_event(&This->element.node, EVENTID_LOAD, &v);
 }
 
 static HRESULT WINAPI HTMLFrameBase2_get_onload(IHTMLFrameBase2 *iface, VARIANT *p)
 {
     HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    return get_node_event(&This->element.node, EVENTID_LOAD, p);
 }
 
 static HRESULT WINAPI HTMLFrameBase2_put_onreadystatechange(IHTMLFrameBase2 *iface, VARIANT v)
index 20cfb1c..3acc2f7 100644 (file)
@@ -141,15 +141,28 @@ static HRESULT WINAPI HTMLSelectElement_get_size(IHTMLSelectElement *iface, LONG
 static HRESULT WINAPI HTMLSelectElement_put_multiple(IHTMLSelectElement *iface, VARIANT_BOOL v)
 {
     HTMLSelectElement *This = impl_from_IHTMLSelectElement(iface);
-    FIXME("(%p)->(%x)\n", This, v);
-    return E_NOTIMPL;
+    nsresult nsres;
+
+    TRACE("(%p)->(%x)\n", This, v);
+
+    nsres = nsIDOMHTMLSelectElement_SetMultiple(This->nsselect, !!v);
+    assert(nsres == NS_OK);
+    return S_OK;
 }
 
 static HRESULT WINAPI HTMLSelectElement_get_multiple(IHTMLSelectElement *iface, VARIANT_BOOL *p)
 {
     HTMLSelectElement *This = impl_from_IHTMLSelectElement(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+    cpp_bool val;
+    nsresult nsres;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    nsres = nsIDOMHTMLSelectElement_GetMultiple(This->nsselect, &val);
+    assert(nsres == NS_OK);
+
+    *p = val ? VARIANT_TRUE : VARIANT_FALSE;
+    return S_OK;
 }
 
 static HRESULT WINAPI HTMLSelectElement_put_name(IHTMLSelectElement *iface, BSTR v)
index 374d5bc..c838a42 100644 (file)
@@ -74,6 +74,9 @@ static const WCHAR attrBorderWidth[] =
     {'b','o','r','d','e','r','-','w','i','d','t','h',0};
 static const WCHAR attrBottom[] =
     {'b','o','t','t','o','m',0};
+/* FIXME: Use unprefixed version (requires Gecko changes). */
+static const WCHAR attrBoxSizing[] =
+    {'-','m','o','z','-','b','o','x','-','s','i','z','i','n','g',0};
 static const WCHAR attrClear[] =
     {'c','l','e','a','r',0};
 static const WCHAR attrClip[] =
@@ -106,6 +109,8 @@ static const WCHAR attrLetterSpacing[] =
     {'l','e','t','t','e','r','-','s','p','a','c','i','n','g',0};
 static const WCHAR attrLineHeight[] =
     {'l','i','n','e','-','h','e','i','g','h','t',0};
+static const WCHAR attrListStyleType[] =
+    {'l','i','s','t','-','s','t','y','l','e','-','t','y','p','e',0};
 static const WCHAR attrMargin[] =
     {'m','a','r','g','i','n',0};
 static const WCHAR attrMarginBottom[] =
@@ -118,6 +123,8 @@ static const WCHAR attrMarginTop[] =
     {'m','a','r','g','i','n','-','t','o','p',0};
 static const WCHAR attrMinHeight[] =
     {'m','i','n','-','h','e','i','g','h','t',0};
+static const WCHAR attrOutline[] =
+    {'o','u','t','l','i','n','e',0};
 static const WCHAR attrOverflow[] =
     {'o','v','e','r','f','l','o','w',0};
 static const WCHAR attrOverflowX[] =
@@ -202,6 +209,7 @@ static const style_tbl_entry_t style_tbl[] = {
     {attrBorderTopWidth,       DISPID_IHTMLSTYLE_BORDERTOPWIDTH},
     {attrBorderWidth,          DISPID_IHTMLSTYLE_BORDERWIDTH},
     {attrBottom,               DISPID_IHTMLSTYLE2_BOTTOM},
+    {attrBoxSizing,            DISPID_IHTMLSTYLE6_BOXSIZING},
     {attrClear,                DISPID_IHTMLSTYLE_CLEAR},
     {attrClip,                 DISPID_IHTMLSTYLE_CLIP},
     {attrColor,                DISPID_IHTMLSTYLE_COLOR},
@@ -218,12 +226,14 @@ static const style_tbl_entry_t style_tbl[] = {
     {attrLeft,                 DISPID_IHTMLSTYLE_LEFT},
     {attrLetterSpacing,        DISPID_IHTMLSTYLE_LETTERSPACING},
     {attrLineHeight,           DISPID_IHTMLSTYLE_LINEHEIGHT},
+    {attrListStyleType,        DISPID_IHTMLSTYLE_LISTSTYLETYPE},
     {attrMargin,               DISPID_IHTMLSTYLE_MARGIN},
     {attrMarginBottom,         DISPID_IHTMLSTYLE_MARGINBOTTOM},
     {attrMarginLeft,           DISPID_IHTMLSTYLE_MARGINLEFT},
     {attrMarginRight,          DISPID_IHTMLSTYLE_MARGINRIGHT},
     {attrMarginTop,            DISPID_IHTMLSTYLE_MARGINTOP},
     {attrMinHeight,            DISPID_IHTMLSTYLE4_MINHEIGHT},
+    {attrOutline,              DISPID_IHTMLSTYLE6_OUTLINE},
     {attrOverflow,             DISPID_IHTMLSTYLE_OVERFLOW},
     {attrOverflowX,            DISPID_IHTMLSTYLE2_OVERFLOWX},
     {attrOverflowY,            DISPID_IHTMLSTYLE2_OVERFLOWY},
@@ -447,7 +457,7 @@ static HRESULT nsstyle_to_bstr(const WCHAR *val, DWORD flags, BSTR *p)
     DWORD len;
 
     if(!*val) {
-        *p = NULL;
+        *p = (flags & ATTR_NO_NULL) ? SysAllocStringLen(NULL, 0) : NULL;
         return S_OK;
     }
 
@@ -2144,15 +2154,19 @@ static HRESULT WINAPI HTMLStyle_get_visibility(IHTMLStyle *iface, BSTR *p)
 static HRESULT WINAPI HTMLStyle_put_listStyleType(IHTMLStyle *iface, BSTR v)
 {
     HTMLStyle *This = impl_from_IHTMLStyle(iface);
-    FIXME("(%p)->(%s)\n", This, debugstr_w(v));
-    return E_NOTIMPL;
+
+    TRACE("(%p)->(%s)\n", This, debugstr_w(v));
+
+    return set_style_attr(This, STYLEID_LISTSTYLETYPE, v, 0);
 }
 
 static HRESULT WINAPI HTMLStyle_get_listStyleType(IHTMLStyle *iface, BSTR *p)
 {
     HTMLStyle *This = impl_from_IHTMLStyle(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    return get_style_attr(This, STYLEID_LISTSTYLETYPE, p);
 }
 
 static HRESULT WINAPI HTMLStyle_put_listStylePosition(IHTMLStyle *iface, BSTR v)
@@ -3091,11 +3105,9 @@ static dispex_static_data_t HTMLStyle_dispex = {
     HTMLStyle_iface_tids
 };
 
-HRESULT HTMLStyle_Create(HTMLElement *elem, HTMLStyle **ret)
+static HRESULT get_style_from_elem(HTMLElement *elem, nsIDOMCSSStyleDeclaration **ret)
 {
     nsIDOMElementCSSInlineStyle *nselemstyle;
-    nsIDOMCSSStyleDeclaration *nsstyle;
-    HTMLStyle *style;
     nsresult nsres;
 
     if(!elem->nselem) {
@@ -3107,13 +3119,26 @@ HRESULT HTMLStyle_Create(HTMLElement *elem, HTMLStyle **ret)
             (void**)&nselemstyle);
     assert(nsres == NS_OK);
 
-    nsres = nsIDOMElementCSSInlineStyle_GetStyle(nselemstyle, &nsstyle);
+    nsres = nsIDOMElementCSSInlineStyle_GetStyle(nselemstyle, ret);
     nsIDOMElementCSSInlineStyle_Release(nselemstyle);
     if(NS_FAILED(nsres)) {
         ERR("GetStyle failed: %08x\n", nsres);
         return E_FAIL;
     }
 
+    return S_OK;
+}
+
+HRESULT HTMLStyle_Create(HTMLElement *elem, HTMLStyle **ret)
+{
+    nsIDOMCSSStyleDeclaration *nsstyle;
+    HTMLStyle *style;
+    HRESULT hres;
+
+    hres = get_style_from_elem(elem, &nsstyle);
+    if(FAILED(hres))
+        return hres;
+
     style = heap_alloc_zero(sizeof(HTMLStyle));
     if(!style) {
         nsIDOMCSSStyleDeclaration_Release(nsstyle);
@@ -3134,3 +3159,31 @@ HRESULT HTMLStyle_Create(HTMLElement *elem, HTMLStyle **ret)
     *ret = style;
     return S_OK;
 }
+
+HRESULT get_elem_style(HTMLElement *elem, styleid_t styleid, BSTR *ret)
+{
+    nsIDOMCSSStyleDeclaration *style;
+    HRESULT hres;
+
+    hres = get_style_from_elem(elem, &style);
+    if(FAILED(hres))
+        return hres;
+
+    hres = get_nsstyle_attr(style, styleid, ret, 0);
+    nsIDOMCSSStyleDeclaration_Release(style);
+    return hres;
+}
+
+HRESULT set_elem_style(HTMLElement *elem, styleid_t styleid, const WCHAR *val)
+{
+    nsIDOMCSSStyleDeclaration *style;
+    HRESULT hres;
+
+    hres = get_style_from_elem(elem, &style);
+    if(FAILED(hres))
+        return hres;
+
+    hres = set_nsstyle_attr(style, styleid, val, 0);
+    nsIDOMCSSStyleDeclaration_Release(style);
+    return hres;
+}
index 4f2e5ab..030d8a1 100644 (file)
@@ -61,6 +61,7 @@ typedef enum {
     STYLEID_BORDER_TOP_WIDTH,
     STYLEID_BORDER_WIDTH,
     STYLEID_BOTTOM,
+    STYLEID_BOX_SIZING,
     STYLEID_CLEAR,
     STYLEID_CLIP,
     STYLEID_COLOR,
@@ -77,12 +78,14 @@ typedef enum {
     STYLEID_LEFT,
     STYLEID_LETTER_SPACING,
     STYLEID_LINE_HEIGHT,
+    STYLEID_LISTSTYLETYPE,
     STYLEID_MARGIN,
     STYLEID_MARGIN_BOTTOM,
     STYLEID_MARGIN_LEFT,
     STYLEID_MARGIN_RIGHT,
     STYLEID_MARGIN_TOP,
     STYLEID_MIN_HEIGHT,
+    STYLEID_OUTLINE,
     STYLEID_OVERFLOW,
     STYLEID_OVERFLOW_X,
     STYLEID_OVERFLOW_Y,
@@ -118,8 +121,12 @@ HRESULT set_nsstyle_attr(nsIDOMCSSStyleDeclaration*,styleid_t,LPCWSTR,DWORD) DEC
 HRESULT set_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *value, DWORD flags) DECLSPEC_HIDDEN;
 HRESULT get_nsstyle_attr_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *p, DWORD flags) DECLSPEC_HIDDEN;
 
+HRESULT get_elem_style(HTMLElement*,styleid_t,BSTR*) DECLSPEC_HIDDEN;
+HRESULT set_elem_style(HTMLElement*,styleid_t,const WCHAR*) DECLSPEC_HIDDEN;
+
 #define ATTR_FIX_PX         0x0001
 #define ATTR_FIX_URL        0x0002
 #define ATTR_STR_TO_INT     0x0004
 #define ATTR_HEX_INT        0x0008
 #define ATTR_REMOVE_COMMA   0x0010
+#define ATTR_NO_NULL        0x0020
index 5eacf7f..7e6bbc6 100644 (file)
@@ -688,15 +688,19 @@ static HRESULT WINAPI HTMLStyle6_get_counterReset(IHTMLStyle6 *iface, BSTR *p)
 static HRESULT WINAPI HTMLStyle6_put_outline(IHTMLStyle6 *iface, BSTR v)
 {
     HTMLStyle *This = impl_from_IHTMLStyle6(iface);
-    FIXME("(%p)->(%s)\n", This, debugstr_w(v));
-    return E_NOTIMPL;
+
+    TRACE("(%p)->(%s)\n", This, debugstr_w(v));
+
+    return set_nsstyle_attr(This->nsstyle, STYLEID_OUTLINE, v, 0);
 }
 
 static HRESULT WINAPI HTMLStyle6_get_outline(IHTMLStyle6 *iface, BSTR *p)
 {
     HTMLStyle *This = impl_from_IHTMLStyle6(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    return get_nsstyle_attr(This->nsstyle, STYLEID_OUTLINE, p, ATTR_NO_NULL);
 }
 
 static HRESULT WINAPI HTMLStyle6_put_outlineWidth(IHTMLStyle6 *iface, VARIANT v)
@@ -744,15 +748,19 @@ static HRESULT WINAPI HTMLStyle6_get_outlineColor(IHTMLStyle6 *iface, VARIANT *p
 static HRESULT WINAPI HTMLStyle6_put_boxSizing(IHTMLStyle6 *iface, BSTR v)
 {
     HTMLStyle *This = impl_from_IHTMLStyle6(iface);
-    FIXME("(%p)->(%s)\n", This, debugstr_w(v));
-    return E_NOTIMPL;
+
+    TRACE("(%p)->(%s)\n", This, debugstr_w(v));
+
+    return set_nsstyle_attr(This->nsstyle, STYLEID_BOX_SIZING, v, 0);
 }
 
 static HRESULT WINAPI HTMLStyle6_get_boxSizing(IHTMLStyle6 *iface, BSTR *p)
 {
     HTMLStyle *This = impl_from_IHTMLStyle6(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    return get_nsstyle_attr(This->nsstyle, STYLEID_BOX_SIZING, p, 0);
 }
 
 static HRESULT WINAPI HTMLStyle6_put_boxSpacing(IHTMLStyle6 *iface, BSTR v)
index 4ade7c7..526168f 100644 (file)
@@ -539,8 +539,14 @@ static HRESULT WINAPI HTMLStyleSheet_put_href(IHTMLStyleSheet *iface, BSTR v)
 static HRESULT WINAPI HTMLStyleSheet_get_href(IHTMLStyleSheet *iface, BSTR *p)
 {
     HTMLStyleSheet *This = impl_from_IHTMLStyleSheet(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+    nsAString href_str;
+    nsresult nsres;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    nsAString_Init(&href_str, NULL);
+    nsres = nsIDOMCSSStyleSheet_GetHref(This->nsstylesheet, &href_str);
+    return return_nsstr(nsres, &href_str, p);
 }
 
 static HRESULT WINAPI HTMLStyleSheet_get_type(IHTMLStyleSheet *iface, BSTR *p)
index 04bc2ab..a1eb77f 100644 (file)
@@ -232,15 +232,48 @@ static HRESULT WINAPI HTMLTable_get_background(IHTMLTable *iface, BSTR *p)
 static HRESULT WINAPI HTMLTable_put_bgColor(IHTMLTable *iface, VARIANT v)
 {
     HTMLTable *This = impl_from_IHTMLTable(iface);
-    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
-    return E_NOTIMPL;
+    nsAString val;
+    nsresult nsres;
+
+    TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
+
+    nsAString_InitDepend(&val, V_BSTR(&v));
+    variant_to_nscolor(&v, &val);
+    nsres = nsIDOMHTMLTableElement_SetBgColor(This->nstable, &val);
+    nsAString_Finish(&val);
+
+    if (NS_FAILED(nsres)){
+        ERR("Set BgColor(%s) failed!\n", debugstr_variant(&v));
+        return E_FAIL;
+    }
+
+    return S_OK;
 }
 
 static HRESULT WINAPI HTMLTable_get_bgColor(IHTMLTable *iface, VARIANT *p)
 {
     HTMLTable *This = impl_from_IHTMLTable(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+    nsAString strColor;
+    nsresult nsres;
+    HRESULT hres;
+    const PRUnichar *color;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    nsAString_Init(&strColor, NULL);
+    nsres = nsIDOMHTMLTableElement_GetBgColor(This->nstable, &strColor);
+
+    if(NS_SUCCEEDED(nsres)) {
+       nsAString_GetData(&strColor, &color);
+       V_VT(p) = VT_BSTR;
+       hres = nscolor_to_str(color, &V_BSTR(p));
+    }else {
+       ERR("SetBgColor failed: %08x\n", nsres);
+       hres = E_FAIL;
+    }
+
+    nsAString_Finish(&strColor);
+    return hres;
 }
 
 static HRESULT WINAPI HTMLTable_put_borderColor(IHTMLTable *iface, VARIANT v)
@@ -288,15 +321,34 @@ static HRESULT WINAPI HTMLTable_get_borderColorDark(IHTMLTable *iface, VARIANT *
 static HRESULT WINAPI HTMLTable_put_align(IHTMLTable *iface, BSTR v)
 {
     HTMLTable *This = impl_from_IHTMLTable(iface);
-    FIXME("(%p)->(%s)\n", This, debugstr_w(v));
-    return E_NOTIMPL;
+    nsAString val;
+    nsresult nsres;
+
+    TRACE("(%p)->(%s)\n", This, debugstr_w(v));
+
+    nsAString_InitDepend(&val, v);
+
+    nsres = nsIDOMHTMLTableElement_SetAlign(This->nstable, &val);
+    nsAString_Finish(&val);
+    if (NS_FAILED(nsres)){
+        ERR("Set Align(%s) failed!\n", debugstr_w(v));
+        return E_FAIL;
+    }
+    return S_OK;
 }
 
 static HRESULT WINAPI HTMLTable_get_align(IHTMLTable *iface, BSTR *p)
 {
     HTMLTable *This = impl_from_IHTMLTable(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+    nsAString val;
+    nsresult nsres;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    nsAString_Init(&val, NULL);
+    nsres = nsIDOMHTMLTableElement_GetAlign(This->nstable, &val);
+
+    return return_nsstr(nsres, &val, p);
 }
 
 static HRESULT WINAPI HTMLTable_refresh(IHTMLTable *iface)
index 07268e1..0d053fa 100644 (file)
@@ -88,43 +88,116 @@ static HRESULT WINAPI HTMLTableRow_Invoke(IHTMLTableRow *iface, DISPID dispIdMem
 static HRESULT WINAPI HTMLTableRow_put_align(IHTMLTableRow *iface, BSTR v)
 {
     HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
-    FIXME("(%p)->(%s)\n", This, debugstr_w(v));
-    return E_NOTIMPL;
+    nsAString val;
+    nsresult nsres;
+
+    TRACE("(%p)->(%s)\n", This, debugstr_w(v));
+
+    nsAString_InitDepend(&val, v);
+
+    nsres = nsIDOMHTMLTableRowElement_SetAlign(This->nsrow, &val);
+    nsAString_Finish(&val);
+    if (NS_FAILED(nsres)){
+        ERR("Set Align(%s) failed!\n", debugstr_w(v));
+        return E_FAIL;
+    }
+    return S_OK;
 }
 
 static HRESULT WINAPI HTMLTableRow_get_align(IHTMLTableRow *iface, BSTR *p)
 {
     HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+    nsAString val;
+    nsresult nsres;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    nsAString_Init(&val, NULL);
+    nsres = nsIDOMHTMLTableRowElement_GetAlign(This->nsrow, &val);
+
+    return return_nsstr(nsres, &val, p);
 }
 
 static HRESULT WINAPI HTMLTableRow_put_vAlign(IHTMLTableRow *iface, BSTR v)
 {
     HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
-    FIXME("(%p)->(%s)\n", This, debugstr_w(v));
-    return E_NOTIMPL;
+    nsAString val;
+    nsresult nsres;
+
+    TRACE("(%p)->(%s)\n", This, debugstr_w(v));
+
+    nsAString_InitDepend(&val, v);
+
+    nsres = nsIDOMHTMLTableRowElement_SetVAlign(This->nsrow, &val);
+    nsAString_Finish(&val);
+
+    if (NS_FAILED(nsres)){
+        ERR("Set VAlign(%s) failed!\n", debugstr_w(v));
+        return E_FAIL;
+    }
+
+    return S_OK;
 }
 
 static HRESULT WINAPI HTMLTableRow_get_vAlign(IHTMLTableRow *iface, BSTR *p)
 {
     HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+    nsAString val;
+    nsresult nsres;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    nsAString_Init(&val, NULL);
+    nsres = nsIDOMHTMLTableRowElement_GetVAlign(This->nsrow, &val);
+
+    return return_nsstr(nsres, &val, p);
 }
 
 static HRESULT WINAPI HTMLTableRow_put_bgColor(IHTMLTableRow *iface, VARIANT v)
 {
     HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
-    FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
-    return E_NOTIMPL;
+    nsAString val;
+    nsresult nsres;
+
+    TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
+
+    nsAString_InitDepend(&val, V_BSTR(&v));
+    variant_to_nscolor(&v, &val);
+    nsres = nsIDOMHTMLTableRowElement_SetBgColor(This->nsrow, &val);
+    nsAString_Finish(&val);
+
+    if (NS_FAILED(nsres)){
+        ERR("Set BgColor(%s) failed!\n", debugstr_variant(&v));
+        return E_FAIL;
+    }
+
+    return S_OK;
 }
 
 static HRESULT WINAPI HTMLTableRow_get_bgColor(IHTMLTableRow *iface, VARIANT *p)
 {
     HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+    nsAString strColor;
+    nsresult nsres;
+    HRESULT hres;
+    const PRUnichar *color;
+
+    TRACE("(%p)->(%p)\n", This, p);
+
+    nsAString_Init(&strColor, NULL);
+    nsres = nsIDOMHTMLTableRowElement_GetBgColor(This->nsrow, &strColor);
+
+    if(NS_SUCCEEDED(nsres)) {
+       nsAString_GetData(&strColor, &color);
+       V_VT(p) = VT_BSTR;
+       hres = nscolor_to_str(color, &V_BSTR(p));
+    }else {
+       ERR("SetBgColor failed: %08x\n", nsres);
+       hres = E_FAIL;
+    }
+
+    nsAString_Finish(&strColor);
+    return hres;
 }
 
 static HRESULT WINAPI HTMLTableRow_put_borderColor(IHTMLTableRow *iface, VARIANT v)
@@ -172,15 +245,29 @@ static HRESULT WINAPI HTMLTableRow_get_borderColorDark(IHTMLTableRow *iface, VAR
 static HRESULT WINAPI HTMLTableRow_get_rowIndex(IHTMLTableRow *iface, LONG *p)
 {
     HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+    nsresult nsres;
+
+    TRACE("(%p)->(%p)\n", This, p);
+    nsres = nsIDOMHTMLTableRowElement_GetRowIndex(This->nsrow, p);
+    if(NS_FAILED(nsres)) {
+        ERR("Get rowIndex failed: %08x\n", nsres);
+        return E_FAIL;
+    }
+    return S_OK;
 }
 
-static HRESULT WINAPI HTMLTableRow_get_selectionRowIndex(IHTMLTableRow *iface, LONG *p)
+static HRESULT WINAPI HTMLTableRow_get_sectionRowIndex(IHTMLTableRow *iface, LONG *p)
 {
     HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+    nsresult nsres;
+
+    TRACE("(%p)->(%p)\n", This, p);
+    nsres = nsIDOMHTMLTableRowElement_GetSectionRowIndex(This->nsrow, p);
+    if(NS_FAILED(nsres)) {
+        ERR("Get selectionRowIndex failed: %08x\n", nsres);
+        return E_FAIL;
+    }
+    return S_OK;
 }
 
 static HRESULT WINAPI HTMLTableRow_get_cells(IHTMLTableRow *iface, IHTMLElementCollection **p)
@@ -238,7 +325,7 @@ static const IHTMLTableRowVtbl HTMLTableRowVtbl = {
     HTMLTableRow_put_borderColorDark,
     HTMLTableRow_get_borderColorDark,
     HTMLTableRow_get_rowIndex,
-    HTMLTableRow_get_selectionRowIndex,
+    HTMLTableRow_get_sectionRowIndex,
     HTMLTableRow_get_cells,
     HTMLTableRow_insertCell,
     HTMLTableRow_deleteCell
index 00919bf..4493437 100644 (file)
@@ -71,7 +71,7 @@ static inline HRESULT set_window_event(HTMLWindow *window, eventid_t eid, VARIAN
         return E_FAIL;
     }
 
-    return set_event_handler(&window->inner_window->doc->body_event_target, NULL, window->inner_window->doc, eid, var);
+    return set_event_handler(&window->inner_window->doc->body_event_target, window->inner_window->doc, eid, var);
 }
 
 static inline HRESULT get_window_event(HTMLWindow *window, eventid_t eid, VARIANT *var)
@@ -91,8 +91,12 @@ static void detach_inner_window(HTMLInnerWindow *window)
     if(outer_window && outer_window->doc_obj && outer_window == outer_window->doc_obj->basedoc.window)
         window->doc->basedoc.cp_container.forward_container = NULL;
 
-    if(window->doc)
+    if(window->doc) {
         detach_events(window->doc);
+        while(!list_empty(&window->doc->plugin_hosts))
+            detach_plugin_host(LIST_ENTRY(list_head(&window->doc->plugin_hosts), PluginHost, entry));
+    }
+
     abort_window_bindings(window);
     remove_target_tasks(window->task_magic);
     release_script_hosts(window);
@@ -1589,7 +1593,7 @@ static HRESULT WINAPI HTMLWindow3_attachEvent(IHTMLWindow3 *iface, BSTR event, I
         return E_FAIL;
     }
 
-    return attach_event(&window->doc->body_event_target, NULL, &window->doc->basedoc, event, pDisp, pfResult);
+    return attach_event(&window->doc->body_event_target, &window->doc->basedoc, event, pDisp, pfResult);
 }
 
 static HRESULT WINAPI HTMLWindow3_detachEvent(IHTMLWindow3 *iface, BSTR event, IDispatch *pDisp)
@@ -2156,7 +2160,7 @@ static HRESULT WINAPI HTMLPrivateWindow_SuperNavigate(IHTMLPrivateWindow *iface,
         headers = V_BSTR(headers_var);
     }
 
-    hres = super_navigate(window, uri, BINDING_NAVIGATED, headers, post_data, post_data_size);
+    hres = super_navigate(window, uri, BINDING_NAVIGATED|BINDING_NOFRAG, headers, post_data, post_data_size);
     IUri_Release(uri);
     if(post_data)
         SafeArrayUnaccessData(V_ARRAY(post_data_var));
index b2696a0..f22c63c 100644 (file)
@@ -443,6 +443,8 @@ static HRESULT register_server(BOOL do_register)
 
     hres = pRegInstall(hInst, do_register ? "RegisterDll" : "UnregisterDll", &strtable);
 
+    FreeLibrary(hAdvpack);
+
     for(i=0; i < sizeof(pse)/sizeof(pse[0]); i++)
         heap_free(pse[i].pszValue);
 
index 9766031..b84a50f 100644 (file)
@@ -18,6 +18,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#pragma makedep register
+
 [
     helpstring("Microsoft HTML About Pluggable Protocol"),
     threading(apartment),
index e07c1c1..d5beb25 100644 (file)
@@ -407,7 +407,10 @@ struct HTMLOuterWindow {
     nsIDOMWindow *nswindow;
     HTMLOuterWindow *parent;
     HTMLFrameBase *frame_element;
+
     READYSTATE readystate;
+    BOOL readystate_locked;
+    unsigned readystate_pending;
 
     HTMLInnerWindow *pending_window;
     IMoniker *mon;
@@ -507,6 +510,7 @@ struct HTMLDocument {
     IHTMLDocument4              IHTMLDocument4_iface;
     IHTMLDocument5              IHTMLDocument5_iface;
     IHTMLDocument6              IHTMLDocument6_iface;
+    IHTMLDocument7              IHTMLDocument7_iface;
     IPersistMoniker             IPersistMoniker_iface;
     IPersistFile                IPersistFile_iface;
     IPersistHistory             IPersistHistory_iface;
@@ -779,8 +783,6 @@ HRESULT create_history(HTMLInnerWindow*,OmHistory**) DECLSPEC_HIDDEN;
 
 HRESULT create_storage(IHTMLStorage**) DECLSPEC_HIDDEN;
 
-void HTMLDocument_HTMLDocument3_Init(HTMLDocument*) DECLSPEC_HIDDEN;
-void HTMLDocument_HTMLDocument5_Init(HTMLDocument*) DECLSPEC_HIDDEN;
 void HTMLDocument_Persist_Init(HTMLDocument*) DECLSPEC_HIDDEN;
 void HTMLDocument_OleCmd_Init(HTMLDocument*) DECLSPEC_HIDDEN;
 void HTMLDocument_OleObj_Init(HTMLDocument*) DECLSPEC_HIDDEN;
@@ -854,6 +856,7 @@ void get_editor_controller(NSContainer*) DECLSPEC_HIDDEN;
 nsresult get_nsinterface(nsISupports*,REFIID,void**) DECLSPEC_HIDDEN;
 nsIWritableVariant *create_nsvariant(void) DECLSPEC_HIDDEN;
 nsresult create_nsfile(const PRUnichar*,nsIFile**) DECLSPEC_HIDDEN;
+char *get_nscategory_entry(const char*,const char*) DECLSPEC_HIDDEN;
 
 HRESULT create_pending_window(HTMLOuterWindow*,nsChannelBSC*) DECLSPEC_HIDDEN;
 HRESULT start_binding(HTMLInnerWindow*,BSCallback*,IBindCtx*) DECLSPEC_HIDDEN;
@@ -881,6 +884,10 @@ HRESULT create_element(HTMLDocumentNode*,const WCHAR*,HTMLElement**) DECLSPEC_HI
 
 HRESULT HTMLDOMTextNode_Create(HTMLDocumentNode*,nsIDOMNode*,HTMLDOMNode**) DECLSPEC_HIDDEN;
 
+BOOL variant_to_nscolor(const VARIANT *v, nsAString *nsstr) DECLSPEC_HIDDEN;
+HRESULT nscolor_to_str(LPCWSTR color, BSTR *ret) DECLSPEC_HIDDEN;
+
+
 struct HTMLAttributeCollection {
     DispatchEx dispex;
     IHTMLAttributeCollection IHTMLAttributeCollection_iface;
@@ -962,6 +969,7 @@ HTMLElement *unsafe_impl_from_IHTMLElement(IHTMLElement*) DECLSPEC_HIDDEN;
 HRESULT search_window_props(HTMLInnerWindow*,BSTR,DWORD,DISPID*) DECLSPEC_HIDDEN;
 HRESULT get_frame_by_name(HTMLOuterWindow*,const WCHAR*,BOOL,HTMLOuterWindow**) DECLSPEC_HIDDEN;
 HRESULT get_doc_elem_by_id(HTMLDocumentNode*,const WCHAR*,HTMLElement**) DECLSPEC_HIDDEN;
+HTMLOuterWindow *get_target_window(HTMLOuterWindow*,nsAString*,BOOL*) DECLSPEC_HIDDEN;
 
 HRESULT wrap_iface(IUnknown*,IUnknown*,IUnknown**) DECLSPEC_HIDDEN;
 
@@ -986,6 +994,7 @@ void do_ns_command(HTMLDocument*,const char*,nsICommandParams*) DECLSPEC_HIDDEN;
 
 void update_doc(HTMLDocument*,DWORD) DECLSPEC_HIDDEN;
 void update_title(HTMLDocumentObj*) DECLSPEC_HIDDEN;
+void set_document_navigation(HTMLDocumentObj*,BOOL) DECLSPEC_HIDDEN;
 
 HRESULT do_query_service(IUnknown*,REFGUID,REFIID,void**) DECLSPEC_HIDDEN;
 
index 0b5be21..dfdc326 100644 (file)
@@ -621,7 +621,7 @@ static void NSAPI nsDocumentObserver_BindToDocument(nsIDocumentObserver *iface,
     nsIDOMElement *nselem;
     nsresult nsres;
 
-    TRACE("(%p)\n", This);
+    TRACE("(%p)->(%p %p)\n", This, aDocument, aContent);
 
     nsres = nsIContent_QueryInterface(aContent, &IID_nsIDOMElement, (void**)&nselem);
     if(NS_SUCCEEDED(nsres)) {
index 127451a..3f278fa 100644 (file)
@@ -161,7 +161,7 @@ static nsresult NSAPI nsInputStream_ReadSegments(nsIInputStream *iface,
 
     nsres = aWriter(&This->nsIInputStream_iface, aClousure, This->buf, 0, aCount, &written);
     if(NS_FAILED(nsres))
-        TRACE("aWritter failed: %08x\n", nsres);
+        TRACE("aWriter failed: %08x\n", nsres);
     else if(written != This->buf_size)
         FIXME("written %d != buf_size %d\n", written, This->buf_size);
 
@@ -204,6 +204,13 @@ static nsProtocolStream *create_nsprotocol_stream(void)
     return ret;
 }
 
+static void release_request_data(request_data_t *request_data)
+{
+    heap_free(request_data->headers);
+    if(request_data->post_data)
+        GlobalFree(request_data->post_data);
+}
+
 static inline BSCallback *impl_from_IBindStatusCallback(IBindStatusCallback *iface)
 {
     return CONTAINING_RECORD(iface, BSCallback, IBindStatusCallback_iface);
@@ -262,15 +269,13 @@ static ULONG WINAPI BindStatusCallback_Release(IBindStatusCallback *iface)
     TRACE("(%p) ref = %d\n", This, ref);
 
     if(!ref) {
-        if(This->post_data)
-            GlobalFree(This->post_data);
+        release_request_data(&This->request_data);
         if(This->mon)
             IMoniker_Release(This->mon);
         if(This->binding)
             IBinding_Release(This->binding);
         list_remove(&This->entry);
         list_init(&This->entry);
-        heap_free(This->headers);
 
         This->vtbl->destroy(This);
     }
@@ -336,6 +341,11 @@ static HRESULT WINAPI BindStatusCallback_OnStopBinding(IBindStatusCallback *ifac
         This->binding = NULL;
     }
 
+    if(This->mon) {
+        IMoniker_Release(This->mon);
+        This->mon = NULL;
+    }
+
     list_remove(&This->entry);
     list_init(&This->entry);
     This->window = NULL;
@@ -367,15 +377,15 @@ static HRESULT WINAPI BindStatusCallback_GetBindInfo(IBindStatusCallback *iface,
     memset(pbindinfo, 0, size);
     pbindinfo->cbSize = size;
 
-    pbindinfo->cbstgmedData = This->post_data_len;
+    pbindinfo->cbstgmedData = This->request_data.post_data_len;
     pbindinfo->dwCodePage = CP_UTF8;
     pbindinfo->dwOptions = 0x80000;
 
-    if(This->post_data) {
+    if(This->request_data.post_data_len) {
         pbindinfo->dwBindVerb = BINDVERB_POST;
 
         pbindinfo->stgmedData.tymed = TYMED_HGLOBAL;
-        pbindinfo->stgmedData.u.hGlobal = This->post_data;
+        pbindinfo->stgmedData.u.hGlobal = This->request_data.post_data;
         pbindinfo->stgmedData.pUnkForRelease = (IUnknown*)&This->IBindStatusCallback_iface;
         IBindStatusCallback_AddRef(&This->IBindStatusCallback_iface);
     }
@@ -454,14 +464,14 @@ static HRESULT WINAPI HttpNegotiate_BeginningTransaction(IHttpNegotiate2 *iface,
     if(hres != S_FALSE)
         return hres;
 
-    if(This->headers) {
+    if(This->request_data.headers) {
         DWORD size;
 
-        size = (strlenW(This->headers)+1)*sizeof(WCHAR);
+        size = (strlenW(This->request_data.headers)+1)*sizeof(WCHAR);
         *pszAdditionalHeaders = CoTaskMemAlloc(size);
         if(!*pszAdditionalHeaders)
             return E_OUTOFMEMORY;
-        memcpy(*pszAdditionalHeaders, This->headers, size);
+        memcpy(*pszAdditionalHeaders, This->request_data.headers, size);
     }
 
     return S_OK;
@@ -799,9 +809,6 @@ HRESULT start_binding(HTMLInnerWindow *inner_window, BSCallback *bscallback, IBi
     if(str)
         IStream_Release(str);
 
-    IMoniker_Release(bscallback->mon);
-    bscallback->mon = NULL;
-
     return S_OK;
 }
 
@@ -975,7 +982,8 @@ HRESULT bind_mon_to_wstr(HTMLInnerWindow *window, IMoniker *mon, WCHAR **ret)
     return S_OK;
 }
 
-static HRESULT read_post_data_stream(nsChannelBSC *This, nsChannel *nschannel)
+static HRESULT read_post_data_stream(nsIInputStream *stream, BOOL contains_headers, struct list *headers_list,
+        request_data_t *request_data)
 {
     UINT64 available = 0;
     UINT32 data_len = 0;
@@ -983,24 +991,24 @@ static HRESULT read_post_data_stream(nsChannelBSC *This, nsChannel *nschannel)
     nsresult nsres;
     HRESULT hres = S_OK;
 
-    if(!nschannel->post_data_stream)
+    if(!stream)
         return S_OK;
 
-    nsres =  nsIInputStream_Available(nschannel->post_data_stream, &available);
+    nsres =  nsIInputStream_Available(stream, &available);
     if(NS_FAILED(nsres))
         return E_FAIL;
 
-    post_data = data = GlobalAlloc(0, available);
+    post_data = data = GlobalAlloc(0, available+1);
     if(!data)
         return E_OUTOFMEMORY;
 
-    nsres = nsIInputStream_Read(nschannel->post_data_stream, data, available, &data_len);
+    nsres = nsIInputStream_Read(stream, data, available, &data_len);
     if(NS_FAILED(nsres)) {
         GlobalFree(data);
         return E_FAIL;
     }
 
-    if(nschannel->post_data_contains_headers) {
+    if(contains_headers) {
         if(data_len >= 2 && data[0] == '\r' && data[1] == '\n') {
             post_data = data+2;
             data_len -= 2;
@@ -1012,21 +1020,23 @@ static HRESULT read_post_data_stream(nsChannelBSC *This, nsChannel *nschannel)
             post_data += data_len;
             for(ptr = data; ptr+4 < data+data_len; ptr++) {
                 if(!memcmp(ptr, "\r\n\r\n", 4)) {
-                    post_data = ptr+4;
+                    ptr += 2;
+                    post_data = ptr+2;
                     break;
                 }
             }
 
             data_len -= post_data-data;
 
-            size = MultiByteToWideChar(CP_ACP, 0, data, post_data-data, NULL, 0);
+            size = MultiByteToWideChar(CP_ACP, 0, data, ptr-data, NULL, 0);
             headers = heap_alloc((size+1)*sizeof(WCHAR));
             if(headers) {
-                MultiByteToWideChar(CP_ACP, 0, data, post_data-data, headers, size);
+                MultiByteToWideChar(CP_ACP, 0, data, ptr-data, headers, size);
                 headers[size] = 0;
-                hres = parse_headers(headers , &nschannel->request_headers);
+                if(headers_list)
+                    hres = parse_headers(headers, headers_list);
                 if(SUCCEEDED(hres))
-                    This->bsc.headers = headers;
+                    request_data->headers = headers;
                 else
                     heap_free(headers);
             }else {
@@ -1046,7 +1056,7 @@ static HRESULT read_post_data_stream(nsChannelBSC *This, nsChannel *nschannel)
     }else if(post_data != data) {
         char *new_data;
 
-        new_data = GlobalAlloc(0, data_len);
+        new_data = GlobalAlloc(0, data_len+1);
         if(new_data)
             memcpy(new_data, post_data, data_len);
         GlobalFree(data);
@@ -1055,9 +1065,10 @@ static HRESULT read_post_data_stream(nsChannelBSC *This, nsChannel *nschannel)
         post_data = new_data;
     }
 
-    This->bsc.post_data = post_data;
-    This->bsc.post_data_len = data_len;
-    TRACE("post_data = %s\n", debugstr_a(This->bsc.post_data));
+    post_data[data_len] = 0;
+    request_data->post_data = post_data;
+    request_data->post_data_len = data_len;
+    TRACE("post_data = %s\n", debugstr_an(request_data->post_data, request_data->post_data_len));
     return S_OK;
 }
 
@@ -1135,6 +1146,9 @@ static HRESULT read_stream_data(nsChannelBSC *This, IStream *stream)
         }
     }
 
+    if(!This->nschannel)
+        return S_OK;
+
     if(!This->nslistener) {
         BYTE buf[1024];
 
@@ -1370,10 +1384,12 @@ static HRESULT nsChannelBSC_start_binding(BSCallback *bsc)
 static HRESULT nsChannelBSC_init_bindinfo(BSCallback *bsc)
 {
     nsChannelBSC *This = nsChannelBSC_from_BSCallback(bsc);
+    nsChannel *nschannel = This->nschannel;
     HRESULT hres;
 
-    if(This->nschannel && This->nschannel->post_data_stream) {
-        hres = read_post_data_stream(This, This->nschannel);
+    if(nschannel && nschannel->post_data_stream) {
+        hres = read_post_data_stream(nschannel->post_data_stream, nschannel->post_data_contains_headers,
+                &nschannel->request_headers, &This->bsc.request_data);
         if(FAILED(hres))
             return hres;
     }
@@ -1518,7 +1534,7 @@ static HRESULT nsChannelBSC_stop_binding(BSCallback *bsc, HRESULT result)
     if(result != E_ABORT) {
         if(FAILED(result))
             handle_navigation_error(This, result);
-        else if(This->is_doc_channel) {
+        else if(This->is_doc_channel && This->nschannel) {
             result = async_stop_request(This);
             if(SUCCEEDED(result))
                 return S_OK;
@@ -1578,12 +1594,121 @@ static HRESULT handle_redirect(nsChannelBSC *This, const WCHAR *new_url)
     return hres;
 }
 
+static BOOL is_supported_doc_mime(const WCHAR *mime)
+{
+    char *nscat, *mimea;
+    BOOL ret;
+
+    mimea = heap_strdupWtoA(mime);
+    if(!mimea)
+        return FALSE;
+
+    nscat = get_nscategory_entry("Gecko-Content-Viewers", mimea);
+
+    ret = nscat != NULL && !strcmp(nscat, "@mozilla.org/content/document-loader-factory;1");
+
+    heap_free(mimea);
+    nsfree(nscat);
+    return ret;
+}
+
+static IUri *get_moniker_uri(IMoniker *mon)
+{
+    IUriContainer *uri_container;
+    IUri *ret = NULL;
+    HRESULT hres;
+
+    hres = IMoniker_QueryInterface(mon, &IID_IUriContainer, (void**)&uri_container);
+    if(SUCCEEDED(hres)) {
+        hres = IUriContainer_GetIUri(uri_container, &ret);
+        IUriContainer_Release(uri_container);
+        if(FAILED(hres))
+            return NULL;
+    }else {
+        FIXME("No IUriContainer\n");
+    }
+
+    return ret;
+}
+
+static void handle_extern_mime_navigation(nsChannelBSC *This)
+{
+    IWebBrowserPriv2IE9 *webbrowser_priv;
+    IOleCommandTarget *cmdtrg;
+    HTMLDocumentObj *doc_obj;
+    IBindCtx *bind_ctx;
+    IUri *uri;
+    VARIANT flags;
+    HRESULT hres;
+
+    if(!This->bsc.window || !This->bsc.window->base.outer_window || !This->bsc.window->base.outer_window->doc_obj)
+        return;
+
+    doc_obj = This->bsc.window->base.outer_window->doc_obj;
+
+    hres = IOleClientSite_QueryInterface(doc_obj->client, &IID_IOleCommandTarget, (void**)&cmdtrg);
+    if(SUCCEEDED(hres)) {
+        IOleCommandTarget_Exec(cmdtrg, &CGID_ShellDocView, 62, 0, NULL, NULL);
+        IOleCommandTarget_Release(cmdtrg);
+    }
+
+    set_document_navigation(doc_obj, FALSE);
+
+    if(!doc_obj->webbrowser) {
+        FIXME("unimplemented in non-webbrowser mode\n");
+        return;
+    }
+
+    uri = get_moniker_uri(This->bsc.mon);
+    if(!uri)
+        return;
+
+    hres = CreateBindCtx(0, &bind_ctx);
+    if(FAILED(hres)) {
+        IUri_Release(uri);
+        return;
+    }
+
+    V_VT(&flags) = VT_I4;
+    V_I4(&flags) = navHyperlink;
+
+    hres = IUnknown_QueryInterface(doc_obj->webbrowser, &IID_IWebBrowserPriv2IE8, (void**)&webbrowser_priv);
+    if(SUCCEEDED(hres)) {
+        hres = IWebBrowserPriv2IE9_NavigateWithBindCtx2(webbrowser_priv, uri, &flags, NULL, NULL, NULL, bind_ctx, NULL, 0);
+        IWebBrowserPriv2IE9_Release(webbrowser_priv);
+    }else {
+        IWebBrowserPriv *webbrowser_priv_old;
+        VARIANT uriv;
+
+        hres = IUnknown_QueryInterface(doc_obj->webbrowser, &IID_IWebBrowserPriv, (void**)&webbrowser_priv_old);
+        if(SUCCEEDED(hres)) {
+            V_VT(&uriv) = VT_BSTR;
+            IUri_GetDisplayUri(uri, &V_BSTR(&uriv));
+
+            hres = IWebBrowserPriv_NavigateWithBindCtx(webbrowser_priv_old, &uriv, &flags, NULL, NULL, NULL, bind_ctx, NULL);
+
+            SysFreeString(V_BSTR(&uriv));
+            IWebBrowserPriv_Release(webbrowser_priv_old);
+        }
+    }
+
+    IUri_Release(uri);
+}
+
 static HRESULT nsChannelBSC_on_progress(BSCallback *bsc, ULONG status_code, LPCWSTR status_text)
 {
     nsChannelBSC *This = nsChannelBSC_from_BSCallback(bsc);
 
     switch(status_code) {
     case BINDSTATUS_MIMETYPEAVAILABLE:
+        if(This->is_doc_channel && !is_supported_doc_mime(status_text)) {
+            FIXME("External MIME: %s\n", debugstr_w(status_text));
+
+            handle_extern_mime_navigation(This);
+
+            This->nschannel = NULL;
+        }
+
         if(!This->nschannel)
             return S_OK;
 
@@ -1707,32 +1832,38 @@ HRESULT create_channelbsc(IMoniker *mon, const WCHAR *headers, BYTE *post_data,
         BOOL is_doc_binding, nsChannelBSC **retval)
 {
     nsChannelBSC *ret;
+    DWORD bindf;
 
     ret = heap_alloc_zero(sizeof(*ret));
     if(!ret)
         return E_OUTOFMEMORY;
 
-    init_bscallback(&ret->bsc, &nsChannelBSCVtbl, mon, BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA);
+    bindf = BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE | BINDF_PULLDATA;
+    if(post_data_size)
+        bindf |= BINDF_FORMS_SUBMIT | BINDF_PRAGMA_NO_CACHE | BINDF_HYPERLINK | BINDF_GETNEWESTVERSION;
+
+    init_bscallback(&ret->bsc, &nsChannelBSCVtbl, mon, bindf);
     ret->is_doc_channel = is_doc_binding;
 
     if(headers) {
-        ret->bsc.headers = heap_strdupW(headers);
-        if(!ret->bsc.headers) {
+        ret->bsc.request_data.headers = heap_strdupW(headers);
+        if(!ret->bsc.request_data.headers) {
             IBindStatusCallback_Release(&ret->bsc.IBindStatusCallback_iface);
             return E_OUTOFMEMORY;
         }
     }
 
     if(post_data) {
-        ret->bsc.post_data = GlobalAlloc(0, post_data_size);
-        if(!ret->bsc.post_data) {
-            heap_free(ret->bsc.headers);
+        ret->bsc.request_data.post_data = GlobalAlloc(0, post_data_size+1);
+        if(!ret->bsc.request_data.post_data) {
+            release_request_data(&ret->bsc.request_data);
             IBindStatusCallback_Release(&ret->bsc.IBindStatusCallback_iface);
             return E_OUTOFMEMORY;
         }
 
-        memcpy(ret->bsc.post_data, post_data, post_data_size);
-        ret->bsc.post_data_len = post_data_size;
+        memcpy(ret->bsc.request_data.post_data, post_data, post_data_size);
+        ((BYTE*)ret->bsc.request_data.post_data)[post_data_size] = 0;
+        ret->bsc.request_data.post_data_len = post_data_size;
     }
 
     TRACE("created %p\n", ret);
@@ -1815,7 +1946,7 @@ void abort_window_bindings(HTMLInnerWindow *window)
     }
 }
 
-HRESULT channelbsc_load_stream(HTMLInnerWindow *pending_window, IStream *stream)
+HRESULT channelbsc_load_stream(HTMLInnerWindow *pending_window, IMoniker *mon, IStream *stream)
 {
     nsChannelBSC *bscallback = pending_window->bscallback;
     HRESULT hres = S_OK;
@@ -1829,6 +1960,8 @@ HRESULT channelbsc_load_stream(HTMLInnerWindow *pending_window, IStream *stream)
     if(!bscallback->nschannel->content_type)
         return E_OUTOFMEMORY;
 
+    set_current_mon(pending_window->base.outer_window, mon, 0);
+
     bscallback->bsc.window = pending_window;
     if(stream)
         hres = read_stream_data(bscallback, stream);
@@ -1854,12 +1987,12 @@ void channelbsc_set_channel(nsChannelBSC *This, nsChannel *channel, nsIStreamLis
         This->nscontext = context;
     }
 
-    if(This->bsc.headers) {
+    if(This->bsc.request_data.headers) {
         HRESULT hres;
 
-        hres = parse_headers(This->bsc.headers, &channel->request_headers);
-        heap_free(This->bsc.headers);
-        This->bsc.headers = NULL;
+        hres = parse_headers(This->bsc.request_data.headers, &channel->request_headers);
+        heap_free(This->bsc.request_data.headers);
+        This->bsc.request_data.headers = NULL;
         if(FAILED(hres))
             WARN("parse_headers failed: %08x\n", hres);
     }
@@ -2053,7 +2186,7 @@ HRESULT super_navigate(HTMLOuterWindow *window, IUri *uri, DWORD flags, const WC
         }
     }
 
-    if(!(flags & BINDING_REFRESH) && window->uri_nofrag && !post_data_size) {
+    if(!(flags & BINDING_NOFRAG) && window->uri_nofrag && !post_data_size) {
         BOOL eq;
 
         hres = IUri_IsEqual(uri_nofrag, window->uri_nofrag, &eq);
@@ -2081,7 +2214,32 @@ HRESULT super_navigate(HTMLOuterWindow *window, IUri *uri, DWORD flags, const WC
     prepare_for_binding(&window->doc_obj->basedoc, mon, flags);
 
     hres = IUri_GetScheme(uri, &scheme);
-    if(SUCCEEDED(hres) && scheme != URL_SCHEME_JAVASCRIPT) {
+    if(SUCCEEDED(hres) && scheme == URL_SCHEME_JAVASCRIPT) {
+        navigate_javascript_task_t *task;
+
+        IBindStatusCallback_Release(&bsc->bsc.IBindStatusCallback_iface);
+        IMoniker_Release(mon);
+
+        task = heap_alloc(sizeof(*task));
+        if(!task)
+            return E_OUTOFMEMORY;
+
+        /* Why silently? */
+        window->readystate = READYSTATE_COMPLETE;
+        if(!(flags & BINDING_FROMHIST))
+            call_docview_84(window->doc_obj);
+
+        IUri_AddRef(uri);
+        task->window = window;
+        task->uri = uri;
+        hres = push_task(&task->header, navigate_javascript_proc, navigate_javascript_task_destr, window->task_magic);
+    }else if(flags & BINDING_SUBMIT) {
+        hres = set_moniker(window, mon, uri, NULL, bsc, TRUE);
+        if(SUCCEEDED(hres))
+            hres = start_binding(window->pending_window, &bsc->bsc, NULL);
+        IBindStatusCallback_Release(&bsc->bsc.IBindStatusCallback_iface);
+        IMoniker_Release(mon);
+    }else {
         navigate_task_t *task;
 
         task = heap_alloc(sizeof(*task));
@@ -2104,25 +2262,6 @@ HRESULT super_navigate(HTMLOuterWindow *window, IUri *uri, DWORD flags, const WC
         IUri_AddRef(uri);
         task->uri = uri;
         hres = push_task(&task->header, navigate_proc, navigate_task_destr, window->task_magic);
-    }else {
-        navigate_javascript_task_t *task;
-
-        IBindStatusCallback_Release(&bsc->bsc.IBindStatusCallback_iface);
-        IMoniker_Release(mon);
-
-        task = heap_alloc(sizeof(*task));
-        if(!task)
-            return E_OUTOFMEMORY;
-
-        /* Why silently? */
-        window->readystate = READYSTATE_COMPLETE;
-        if(!(flags & BINDING_FROMHIST))
-            call_docview_84(window->doc_obj);
-
-        IUri_AddRef(uri);
-        task->window = window;
-        task->uri = uri;
-        hres = push_task(&task->header, navigate_javascript_proc, navigate_javascript_task_destr, window->task_magic);
     }
 
     return hres;
@@ -2207,7 +2346,8 @@ HRESULT hlink_frame_navigate(HTMLDocument *doc, LPCWSTR url, nsChannel *nschanne
     }
 
     if(nschannel)
-        read_post_data_stream(callback, nschannel);
+        read_post_data_stream(nschannel->post_data_stream, nschannel->post_data_contains_headers,
+                &nschannel->request_headers, &callback->bsc.request_data);
 
     hres = CreateAsyncBindCtx(0, &callback->bsc.IBindStatusCallback_iface, NULL, &bindctx);
     if(SUCCEEDED(hres))
@@ -2238,7 +2378,8 @@ HRESULT hlink_frame_navigate(HTMLDocument *doc, LPCWSTR url, nsChannel *nschanne
     return hres;
 }
 
-static HRESULT navigate_uri(HTMLOuterWindow *window, IUri *uri, const WCHAR *display_uri, DWORD flags)
+static HRESULT navigate_uri(HTMLOuterWindow *window, IUri *uri, const WCHAR *display_uri, const request_data_t *request_data,
+        DWORD flags)
 {
     nsWineURI *nsuri;
     HRESULT hres;
@@ -2246,18 +2387,22 @@ static HRESULT navigate_uri(HTMLOuterWindow *window, IUri *uri, const WCHAR *dis
     TRACE("%s\n", debugstr_w(display_uri));
 
     if(window->doc_obj && window->doc_obj->webbrowser && window == window->doc_obj->basedoc.window) {
+        DWORD post_data_len = request_data ? request_data->post_data_len : 0;
+        void *post_data = post_data_len ? request_data->post_data : NULL;
+        const WCHAR *headers = request_data ? request_data->headers : NULL;
+
         if(!(flags & BINDING_REFRESH)) {
             BOOL cancel = FALSE;
 
             hres = IDocObjectService_FireBeforeNavigate2(window->doc_obj->doc_object_service, NULL, display_uri, 0x40,
-                    NULL, NULL, 0, NULL, TRUE, &cancel);
+                    NULL, post_data, post_data_len ? post_data_len+1 : 0, headers, TRUE, &cancel);
             if(SUCCEEDED(hres) && cancel) {
                 TRACE("Navigation canceled\n");
                 return S_OK;
             }
         }
 
-        return super_navigate(window, uri, flags, NULL, NULL, 0);
+        return super_navigate(window, uri, flags, headers, post_data, post_data_len);
     }
 
     if(window->doc_obj && window == window->doc_obj->basedoc.window) {
@@ -2291,31 +2436,21 @@ HRESULT load_uri(HTMLOuterWindow *window, IUri *uri, DWORD flags)
     if(FAILED(hres))
         return hres;
 
-    hres = navigate_uri(window, uri, display_uri, flags);
+    hres = navigate_uri(window, uri, display_uri, NULL, flags);
     SysFreeString(display_uri);
     return hres;
 }
 
-HRESULT navigate_url(HTMLOuterWindow *window, const WCHAR *new_url, IUri *base_uri, DWORD flags)
+static HRESULT translate_uri(HTMLOuterWindow *window, IUri *orig_uri, BSTR *ret_display_uri, IUri **ret_uri)
 {
+    IUri *uri = NULL;
     BSTR display_uri;
-    IUri *uri;
     HRESULT hres;
 
-    if(new_url && base_uri)
-        hres = CoInternetCombineUrlEx(base_uri, new_url, URL_ESCAPE_SPACES_ONLY|URL_DONT_ESCAPE_EXTRA_INFO,
-                &uri, 0);
-    else
-        hres = create_uri(new_url, 0, &uri);
+    hres = IUri_GetDisplayUri(orig_uri, &display_uri);
     if(FAILED(hres))
         return hres;
 
-    hres = IUri_GetDisplayUri(uri, &display_uri);
-    if(FAILED(hres)) {
-        IUri_Release(uri);
-        return hres;
-    }
-
     if(window->doc_obj && window->doc_obj->hostui) {
         OLECHAR *translated_url = NULL;
 
@@ -2324,7 +2459,6 @@ HRESULT navigate_url(HTMLOuterWindow *window, const WCHAR *new_url, IUri *base_u
         if(hres == S_OK) {
             TRACE("%08x %s -> %s\n", hres, debugstr_w(display_uri), debugstr_w(translated_url));
             SysFreeString(display_uri);
-            IUri_Release(uri);
             hres = create_uri(translated_url, 0, &uri);
             CoTaskMemFree(translated_url);
             if(FAILED(hres))
@@ -2338,8 +2472,57 @@ HRESULT navigate_url(HTMLOuterWindow *window, const WCHAR *new_url, IUri *base_u
         }
     }
 
-    hres = navigate_uri(window, uri, display_uri, flags);
+    if(!uri) {
+        IUri_AddRef(orig_uri);
+        uri = orig_uri;
+    }
+
+    *ret_display_uri = display_uri;
+    *ret_uri = uri;
+    return S_OK;
+}
+
+HRESULT submit_form(HTMLOuterWindow *window, IUri *submit_uri, nsIInputStream *post_stream)
+{
+    request_data_t request_data = {NULL};
+    BSTR display_uri;
+    IUri *uri;
+    HRESULT hres;
+
+    hres = read_post_data_stream(post_stream, TRUE, NULL, &request_data);
+    if(FAILED(hres))
+        return hres;
+
+    hres = translate_uri(window, submit_uri, &display_uri, &uri);
+    if(SUCCEEDED(hres)) {
+        hres = navigate_uri(window, uri, display_uri, &request_data, BINDING_NAVIGATED|BINDING_SUBMIT);
+        IUri_Release(uri);
+        SysFreeString(display_uri);
+    }
+    release_request_data(&request_data);
+    return hres;
+}
+
+HRESULT navigate_url(HTMLOuterWindow *window, const WCHAR *new_url, IUri *base_uri, DWORD flags)
+{
+    IUri *uri, *nav_uri;
+    BSTR display_uri;
+    HRESULT hres;
+
+    if(new_url && base_uri)
+        hres = CoInternetCombineUrlEx(base_uri, new_url, URL_ESCAPE_SPACES_ONLY|URL_DONT_ESCAPE_EXTRA_INFO,
+                &nav_uri, 0);
+    else
+        hres = create_uri(new_url, 0, &nav_uri);
+    if(FAILED(hres))
+        return hres;
+
+    hres = translate_uri(window, nav_uri, &display_uri, &uri);
+    IUri_Release(nav_uri);
+    if(FAILED(hres))
+        return hres;
 
+    hres = navigate_uri(window, uri, display_uri, NULL, flags);
     IUri_Release(uri);
     SysFreeString(display_uri);
     return hres;
index e4c777a..5e7a16b 100644 (file)
@@ -292,7 +292,7 @@ static BOOL get_elem_clsid(nsIDOMElement *elem, CLSID *clsid)
         ERR("GetAttribute failed: %08x\n", nsres);
     }
 
-    nsAString_Finish(&attr_str);
+    nsAString_Finish(&val_str);
     return ret;
 }
 
@@ -540,7 +540,7 @@ static void check_codebase(HTMLInnerWindow *window, nsIDOMElement *nselem)
         ERR("GetAttribute failed: %08x\n", nsres);
     }
 
-    nsAString_Finish(&attr_str);
+    nsAString_Finish(&val_str);
     if(!uri)
         return;
 
@@ -618,6 +618,7 @@ static IUnknown *create_activex_object(HTMLInnerWindow *window, nsIDOMElement *n
     }
 
     hres = IClassFactory_CreateInstance(cf, NULL, &IID_IUnknown, (void**)&obj);
+    IClassFactory_Release(cf);
     if(FAILED(hres))
         return NULL;
 
@@ -654,7 +655,6 @@ static NPError CDECL NPP_New(NPMIMEType pluginType, NPP instance, UINT16 mode, I
         HRESULT hres;
 
         hres = create_plugin_host(window->doc, nselem, obj, &clsid, &host);
-        nsIDOMElement_Release(nselem);
         IUnknown_Release(obj);
         if(SUCCEEDED(hres))
             instance->pdata = host;
index f9652e9..b8de1a4 100644 (file)
@@ -31,6 +31,7 @@ WINE_DECLARE_DEBUG_CHANNEL(gecko);
 #define NS_EDITORCONTROLLER_CONTRACTID "@mozilla.org/editor/editorcontroller;1"
 #define NS_PREFERENCES_CONTRACTID "@mozilla.org/preferences;1"
 #define NS_VARIANT_CONTRACTID "@mozilla.org/variant;1"
+#define NS_CATEGORYMANAGER_CONTRACTID "@mozilla.org/categorymanager;1"
 
 #define PR_UINT32_MAX 0xffffffff
 
@@ -56,6 +57,7 @@ static HINSTANCE xul_handle = NULL;
 
 static nsIServiceManager *pServMgr = NULL;
 static nsIComponentManager *pCompMgr = NULL;
+static nsICategoryManager *cat_mgr;
 static nsIMemory *nsmem = NULL;
 static nsIFile *profile_directory, *plugin_directory;
 
@@ -471,7 +473,7 @@ static BOOL load_xul(const PRUnichar *gre_path)
     }
 
 #define NS_DLSYM(func) \
-    func = (void *)GetProcAddress(xul_handle, #func "_P"); \
+    func = (void *)GetProcAddress(xul_handle, #func); \
     if(!func) \
         ERR("Could not GetProcAddress(" #func ") failed\n")
 
@@ -710,6 +712,11 @@ static BOOL init_xpcom(const PRUnichar *gre_path)
     if(NS_FAILED(nsres))
         ERR("Could not get nsIMemory: %08x\n", nsres);
 
+    nsres = nsIServiceManager_GetServiceByContractID(pServMgr, NS_CATEGORYMANAGER_CONTRACTID,
+            &IID_nsICategoryManager, (void**)&cat_mgr);
+    if(NS_FAILED(nsres))
+        ERR("Could not get category manager service: %08x\n", nsres);
+
     if(registrar) {
         register_nsservice(registrar, pServMgr);
         nsIComponentRegistrar_Release(registrar);
@@ -890,6 +897,15 @@ nsIWritableVariant *create_nsvariant(void)
     return ret;
 }
 
+char *get_nscategory_entry(const char *category, const char *entry)
+{
+    char *ret = NULL;
+    nsresult nsres;
+
+    nsres = nsICategoryManager_GetCategoryEntry(cat_mgr, category, entry, &ret);
+    return NS_SUCCEEDED(nsres) ? ret : NULL;
+}
+
 nsresult get_nsinterface(nsISupports *iface, REFIID riid, void **ppv)
 {
     nsIInterfaceRequestor *iface_req;
@@ -1082,6 +1098,9 @@ void close_gecko(void)
     if(pServMgr)
         nsIServiceManager_Release(pServMgr);
 
+    if(cat_mgr)
+        nsICategoryManager_Release(cat_mgr);
+
     if(nsmem)
         nsIMemory_Release(nsmem);
 
index fcdf6f1..c0959f5 100644 (file)
@@ -23,7 +23,7 @@
  * compatible with XPCOM, usable in C code.
  */
 
-cpp_quote("#define GECKO_VERSION \"2.21\"")
+cpp_quote("#define GECKO_VERSION \"2.24\"")
 cpp_quote("#define GECKO_VERSION_STRING \"Wine Gecko \" GECKO_VERSION")
 
 import "wtypes.idl";
@@ -86,6 +86,7 @@ typedef nsStringContainer nsAString;
 interface nsIWebBrowserChrome;
 interface nsILoadGroup;
 interface nsIDOMNode;
+interface nsIDOMAttr;
 interface nsIDOMDocument;
 interface nsIDOMEvent;
 interface nsIEditor;
@@ -124,7 +125,6 @@ interface nsISupports
 /* Currently we don't need a full declaration of these interfaces */
 typedef nsISupports nsISHistory;
 typedef nsISupports nsIWidget;
-typedef nsISupports nsIDOMBarProp;
 typedef nsISupports nsIPrompt;
 typedef nsISupports nsIAuthPrompt;
 typedef nsISupports nsIDOMDocumentType;
@@ -622,7 +622,7 @@ interface nsIHttpChannel : nsIChannel
 
 [
     object,
-    uuid(74d13d41-85cd-490f-9942-300d0c01c726),
+    uuid(2cd7f6a6-63f3-4bd6-a0f5-6e3d6dcff81b),
     local
 ]
 interface nsIHttpChannelInternal : nsISupports
@@ -831,24 +831,24 @@ interface nsIDOMHTMLCollection : nsISupports
 
 [
     object,
-    uuid(a6cf907b-15b3-11d2-932e-00805f8add32),
+    uuid(cb5564cd-26ec-418f-a6d6-1d57cd2c971c),
     local
 ]
-interface nsIDOMNamedNodeMap : nsISupports
+interface nsIDOMMozNamedAttrMap : nsISupports
 {
-    nsresult GetNamedItem(const nsAString *name, nsIDOMNode **_retval);
-    nsresult SetNamedItem(nsIDOMNode *arg, nsIDOMNode **_retval);
-    nsresult RemoveNamedItem(const nsAString *name, nsIDOMNode **_retval);
-    nsresult Item(uint32_t index, nsIDOMNode **_retval);
+    nsresult GetNamedItem(const nsAString *name, nsIDOMAttr **_retval);
+    nsresult SetNamedItem(nsIDOMAttr *arg, nsIDOMAttr **_retval);
+    nsresult RemoveNamedItem(const nsAString *name, nsIDOMAttr **_retval);
+    nsresult Item(uint32_t index, nsIDOMAttr **_retval);
     nsresult GetLength(uint32_t *aLength);
-    nsresult GetNamedItemNS(const nsAString *namespaceURI, const nsAString *localName, nsIDOMNode **_retval);
-    nsresult SetNamedItemNS(nsIDOMNode *arg, nsIDOMNode **_retval);
-    nsresult RemoveNamedItemNS(const nsAString *namespaceURI, const nsAString *localName, nsIDOMNode **_retval);
+    nsresult GetNamedItemNS(const nsAString *namespaceURI, const nsAString *localName, nsIDOMAttr **_retval);
+    nsresult SetNamedItemNS(nsIDOMAttr *arg, nsIDOMAttr **_retval);
+    nsresult RemoveNamedItemNS(const nsAString *namespaceURI, const nsAString *localName, nsIDOMAttr **_retval);
 }
 
 [
     object,
-    uuid(5e9bcec9-5928-4f77-8a9c-424ef01c20e1),
+    uuid(56545150-a001-484e-9ed4-cb319eebd7b3),
     local
 ]
 interface nsIDOMNode : nsISupports
@@ -888,7 +888,6 @@ interface nsIDOMNode : nsISupports
     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);
@@ -897,7 +896,6 @@ interface nsIDOMNode : nsISupports
     nsresult HasChildNodes(bool *_retval);
     nsresult CloneNode(bool deep, uint8_t _argc, nsIDOMNode **_retval);
     nsresult Normalize();
-    nsresult IsSupported(const nsAString *feature, const nsAString *version, bool *_retval);
     nsresult GetNamespaceURI(nsAString *aNamespaceURI);
     nsresult GetPrefix(nsAString *aPrefix);
     nsresult GetLocalName(nsAString *aLocalName);
@@ -920,7 +918,7 @@ interface nsIDOMNode : nsISupports
 
 [
     object,
-    uuid(03da4bc9-1b9a-41dc-a1a4-32414d48d704),
+    uuid(a974a4d3-2ff1-445b-8b8e-0aada5d4eedc),
     local
 ]
 interface nsIDOMAttr : nsIDOMNode
@@ -950,13 +948,14 @@ interface nsIDOMClientRect : nsISupports
 
 [
     object,
-    uuid(8f972a47-1f20-4906-b59d-19310349a2c2),
+    uuid(43d985da-b7ee-4d1f-a26f-348ccd9506f3),
     local
 ]
 interface nsIDOMElement : nsIDOMNode
 {
     nsresult GetTagName(nsAString *aTagName);
     nsresult GetClassList(nsISupports **aClassList);
+    nsresult GetAttributes(nsIDOMMozNamedAttrMap **aAttributes);
     nsresult GetAttribute(const nsAString *name, nsAString *_retval);
     nsresult GetAttributeNS(const nsAString *namespaceURI, const nsAString *localName, nsAString *_retval);
     nsresult SetAttribute(const nsAString *name, const nsAString *value);
@@ -979,6 +978,7 @@ interface nsIDOMElement : nsIDOMNode
     nsresult GetPreviousElementSibling(nsIDOMElement **aPreviousElementSibling);
     nsresult GetNextElementSibling(nsIDOMElement **aNextElementSibling);
     nsresult GetChildElementCount(uint32_t *aChildElementCount);
+    nsresult Remove();
     nsresult GetOnmouseenter(JSContext *cx, jsval *aOnmouseenter);
     nsresult SetOnmouseenter(JSContext *cx, const jsval *aOnmouseenter);
     nsresult GetOnmouseleave(JSContext *cx, jsval *aOnmouseleave);
@@ -1018,7 +1018,7 @@ cpp_quote("#undef GetClassName")
 
 [
     object,
-    uuid(9a677a5b-e6f7-4e2e-9ef9-22c2ac9967b3),
+    uuid(e29ddc73-ac40-40fe-8bbd-14bf2d52c53a),
     local
 ]
 interface nsIDOMHTMLElement : nsIDOMElement
@@ -1080,7 +1080,7 @@ interface nsIDOMHTMLElement : nsIDOMElement
 
 [
     object,
-    uuid(8b38545f-7fa5-47d5-a902-c8ea8e78fb0d),
+    uuid(889602bb-4681-4b01-8582-4fad1fbb8325),
     local
 ]
 interface nsIDOMHTMLHeadElement : nsIDOMHTMLElement
@@ -1089,7 +1089,7 @@ interface nsIDOMHTMLHeadElement : nsIDOMHTMLElement
 
 [
     object,
-    uuid(cb75c251-afc7-444f-b2d6-b9635555f3ed),
+    uuid(84f72a38-1873-46f8-937c-1df22d7e7cae),
     local
 ]
 interface nsIDOMCharacterData : nsIDOMNode
@@ -1102,11 +1102,12 @@ interface nsIDOMCharacterData : nsIDOMNode
     nsresult InsertData(uint32_t offset, const nsAString *arg);
     nsresult DeleteData(uint32_t offset, uint32_t count);
     nsresult ReplaceData(uint32_t offset, uint32_t count, const nsAString *arg);
+    nsresult Remove();
 }
 
 [
     object,
-    uuid(437ed60c-febd-4bd0-892f-cf358adc3c96),
+    uuid(d14d13b4-21d5-49e2-8d59-76a24156db54),
     local
 ]
 interface nsIDOMText : nsIDOMCharacterData
@@ -1117,7 +1118,7 @@ interface nsIDOMText : nsIDOMCharacterData
 
 [
     object,
-    uuid(cea49a35-dac9-4c4d-9830-4660abb3b6bc),
+    uuid(e702a5d2-3aa8-4788-b048-2d3b3e6d16f2),
     local
 ]
 interface nsIDOMComment : nsIDOMCharacterData
@@ -1126,7 +1127,7 @@ interface nsIDOMComment : nsIDOMCharacterData
 
 [
     object,
-    uuid(4a15eb0c-d5bc-4902-9d50-21b12cab47e7),
+    uuid(33127aed-9d6a-4b0d-95aa-0529f51bcb9c),
     local
 ]
 interface nsIDOMDocumentFragment : nsIDOMNode
@@ -1135,7 +1136,7 @@ interface nsIDOMDocumentFragment : nsIDOMNode
 
 [
     object,
-    uuid(9b93f82b-9691-4021-8f45-1bf505db77ba),
+    uuid(75996de6-6b0f-43e5-ae79-c98fa669da9a),
     local
 ]
 interface nsIDOMDocument : nsIDOMNode
@@ -1215,7 +1216,7 @@ interface nsIDOMDocument : nsIDOMNode
 
 [
     object,
-    uuid(3f8666a9-76f0-4733-ae11-4aea8753062d),
+    uuid(fd76e045-8d97-4a97-ad75-eac5ae2f3ea4),
     local
 ]
 interface nsIDOMHTMLDocument : nsIDOMDocument
@@ -1359,7 +1360,7 @@ interface nsIDOMWindowCollection : nsISupports
 
 [
     object,
-    uuid(39cb59d4-fba9-48a9-b70b-570a7ec2ebfa),
+    uuid(be62660a-e3f6-409c-a4a9-378364a9526f),
     local
 ]
 interface nsIDOMWindow : nsISupports
@@ -1371,12 +1372,12 @@ interface nsIDOMWindow : nsISupports
     nsresult SetName(const nsAString *aName);
     nsresult GetLocation(nsIDOMLocation **aLocation);
     nsresult GetHistory(nsIDOMHistory **aHistory);
-    nsresult GetLocationbar(nsIDOMBarProp **aLocationbar);
-    nsresult GetMenubar(nsIDOMBarProp **aMenubar);
-    nsresult GetPersonalbar(nsIDOMBarProp **aPersonalbar);
-    nsresult GetScrollbars(nsIDOMBarProp **aScrollbars);
-    nsresult GetStatusbar(nsIDOMBarProp **aStatusbar);
-    nsresult GetToolbar(nsIDOMBarProp **aToolbar);
+    nsresult GetLocationbar(nsISupports **aLocationbar);
+    nsresult GetMenubar(nsISupports **aMenubar);
+    nsresult GetPersonalbar(nsISupports **aPersonalbar);
+    nsresult GetScrollbars(nsISupports **aScrollbars);
+    nsresult GetStatusbar(nsISupports **aStatusbar);
+    nsresult GetToolbar(nsISupports **aToolbar);
     nsresult GetStatus(nsAString *aStatus);
     nsresult SetStatus(const nsAString *aStatus);
     nsresult Close();
@@ -1398,7 +1399,7 @@ interface nsIDOMWindow : nsISupports
     nsresult Confirm(const nsAString *text, bool *_retval);
     nsresult Prompt(const nsAString *aMessage, const nsAString *aInitial, nsAString *_retval);
     nsresult Print();
-    nsresult ShowModalDialog(const nsAString *aURI, nsIVariant *aArgs, const nsAString *aOptions, nsIVariant **_retval);
+    nsresult ShowModalDialog(const nsAString *aURI, nsIVariant *aArgs, const nsAString *aOptions, uint8_t _argc, nsIVariant **_retval);
     nsresult PostMessageMoz(const long /*jsval*/ *message, const nsAString *targetOrigin, const /*JS::Value*/ void *transfer, JSContext *cx);
     nsresult Atob(const nsAString *aAsciiString, nsAString *_retval);
     nsresult Btoa(const nsAString *aBase64Data, nsAString *_retval);
@@ -1441,8 +1442,6 @@ interface nsIDOMWindow : nsISupports
     nsresult GetCrypto(nsIDOMCrypto **aCrypto);
     nsresult GetPkcs11(nsIDOMPkcs11 **aPkcs11);
     nsresult GetControllers(nsIControllers **aControllers);
-    nsresult GetDefaultStatus(nsAString *aDefaultStatus);
-    nsresult SetDefaultStatus(const nsAString *aDefaultStatus);
     nsresult GetMozInnerScreenX(float *aMozInnerScreenX);
     nsresult GetMozInnerScreenY(float *aMozInnerScreenY);
     nsresult GetDevicePixelRatio(float *aDevicePixelRatio);
@@ -1465,8 +1464,10 @@ interface nsIDOMWindow : nsISupports
             bool searchInFrames, bool showDialog, bool *_retval);
     nsresult GetMozPaintCount(uint64_t *aMozPaintCount);
     nsresult MozRequestAnimationFrame(nsIFrameRequestCallback *aCallback, int32_t *_retval);
+    nsresult RequestAnimationFrame(void /*const JS::Value*/ *aCallback, JSContext* cx, int32_t *_retval);
     nsresult MozCancelAnimationFrame(int32_t aHandle);
     nsresult MozCancelRequestAnimationFrame(int32_t aHandle);
+    nsresult CancelAnimationFrame(int32_t aHandle);
     nsresult GetMozAnimationStartTime(int64_t *aMozAnimationStartTime);
     nsresult GetOnafterprint(JSContext *cx, jsval *aOnafterprint);
     nsresult SetOnafterprint(JSContext *cx, const jsval *aOnafterprint);
@@ -1510,7 +1511,7 @@ interface nsIDOMWindow : nsISupports
 
 [
     object,
-    uuid(d8f00c8b-d317-4df2-a9bf-4a1e6f19f945),
+    uuid(8b29a62f-b448-49f3-9242-241d5cf94ea9),
     local
 ]
 interface nsIDOMHTMLBodyElement : nsIDOMHTMLElement
@@ -1555,7 +1556,7 @@ interface nsIDOMHTMLBodyElement : nsIDOMHTMLElement
 
 [
     object,
-    uuid(59c0dc07-d784-410b-8b5e-c26baf7cb8a6),
+    uuid(5e49bff8-fb61-41e3-b6a9-2017865a6d74),
     local
 ]
 interface nsIDOMHTMLFormElement : nsIDOMHTMLElement
@@ -1583,11 +1584,12 @@ interface nsIDOMHTMLFormElement : nsIDOMHTMLElement
     nsresult Submit();
     nsresult Reset();
     nsresult CheckValidity(bool *_retval);
+    nsresult GetFormData(nsIDOMHTMLElement *aOriginatingElement, nsAString *aActionURI, nsIInputStream **aPostDataStream);
 }
 
 [
     object,
-    uuid(83984fd0-b0b2-11e1-afa6-0800200c9a66),
+    uuid(d57537ed-39d0-46ea-8516-0ce0a5bfb805),
     local
 ]
 interface nsIDOMHTMLInputElement : nsIDOMHTMLElement
@@ -1622,8 +1624,8 @@ interface nsIDOMHTMLInputElement : nsIDOMHTMLElement
     nsresult SetHeight(uint32_t aHeight);
     nsresult GetIndeterminate(bool *aIndeterminate);
     nsresult SetIndeterminate(bool aIndeterminate);
-    nsresult GetInputmode(nsAString *aInputmode);
-    nsresult SetInputmode(const nsAString *aInputmode);
+    nsresult GetInputMode(nsAString *aInputMode);
+    nsresult SetInputMode(const nsAString *aInputMode);
     nsresult GetList(nsIDOMHTMLElement **aList);
     nsresult GetMax(nsAString *aMax);
     nsresult SetMax(const nsAString *aMax);
@@ -1661,8 +1663,6 @@ interface nsIDOMHTMLInputElement : nsIDOMHTMLElement
     nsresult SetValue(const nsAString *aValue);
     nsresult GetValueAsNumber(double *aValueAsNumber);
     nsresult SetValueAsNumber(double aValueAsNumber);
-    nsresult GetValueAsDate(JSContext* cx, /*JS::Value*/ void *aValueAsDate);
-    nsresult SetValueAsDate(JSContext* cx, const /*JS::Value*/ void *aValueAsDate);
     nsresult StepDown(int32_t n, uint8_t _argc);
     nsresult StepUp(int32_t n, uint8_t _argc);
     nsresult GetWillValidate(bool *aWillValidate);
@@ -1689,7 +1689,7 @@ interface nsIDOMHTMLInputElement : nsIDOMHTMLElement
 
 [
     object,
-    uuid(68a5d794-39bf-4b00-aefe-754b9e8f7ec6),
+    uuid(09017cf4-0004-4c27-a340-7f5d2fe282e3),
     local
 ]
 interface nsIDOMHTMLOptionElement : nsIDOMHTMLElement
@@ -1712,7 +1712,7 @@ interface nsIDOMHTMLOptionElement : nsIDOMHTMLElement
 
 [
     object,
-    uuid(8e40d4d7-c204-4192-802a-0b5602e9c669),
+    uuid(5564816e-2ab5-46ee-95a4-8f4688bdb449),
     local
 ]
 interface nsIDOMHTMLButtonElement : nsIDOMHTMLElement
@@ -1768,7 +1768,7 @@ interface nsIDOMHTMLOptionsCollection : nsISupports
 
 [
     object,
-    uuid(e85194cf-56e6-44a6-92d9-0096c9d2536e),
+    uuid(8af2123f-c83a-430a-a739-d103a8eaba52),
     local
 ]
 interface nsIDOMHTMLSelectElement : nsIDOMHTMLElement
@@ -1807,7 +1807,7 @@ interface nsIDOMHTMLSelectElement : nsIDOMHTMLElement
 
 [
     object,
-    uuid(2a395065-2d92-48c1-ac00-643de9ca681b),
+    uuid(b7e1b86f-c98e-4658-81ce-ac29962f854a),
     local
 ]
 interface nsIDOMHTMLTextAreaElement : nsIDOMHTMLElement
@@ -1857,7 +1857,7 @@ interface nsIDOMHTMLTextAreaElement : nsIDOMHTMLElement
 
 [
     object,
-    uuid(e2f548f6-9955-4820-a9e6-3a9fd43c7111),
+    uuid(8783371a-6185-4176-9ed9-f781c75bf48a),
     local
 ]
 interface nsIDOMHTMLScriptElement : nsIDOMHTMLElement
@@ -1884,7 +1884,7 @@ interface nsIDOMHTMLScriptElement : nsIDOMHTMLElement
 
 [
     object,
-    uuid(76cf0381-19fd-442d-bb18-c794fd8b5c25),
+    uuid(98c38ca0-5e3a-4c71-90a4-69d12a3c8d16),
     local
 ]
 interface nsIDOMHTMLImageElement : nsIDOMHTMLElement
@@ -1926,7 +1926,7 @@ interface nsIDOMHTMLImageElement : nsIDOMHTMLElement
 
 [
     object,
-    uuid(1339c36e-23ad-4047-a04c-1702e27c7c83),
+    uuid(76ec122a-db6d-4b3f-8a24-15faf117f695),
     local
 ]
 interface nsIDOMHTMLAnchorElement : nsIDOMHTMLElement
@@ -1976,7 +1976,7 @@ interface nsIDOMHTMLAnchorElement : nsIDOMHTMLElement
 
 [
     object,
-    uuid(5b639ece-7b49-4507-9d38-550beb71955b),
+    uuid(ad43cb9b-3253-446d-8ba9-50ee50ff017e),
     local
 ]
 interface nsIDOMHTMLLinkElement : nsIDOMHTMLElement
@@ -2005,7 +2005,7 @@ interface nsIDOMHTMLLinkElement : nsIDOMHTMLElement
 
 [
     object,
-    uuid(ae50de74-bc26-402e-85dc-a980f506b655),
+    uuid(1a7bf1f1-5d6c-4200-9ceb-455874322315),
     local
 ]
 interface nsIDOMHTMLTableElement : nsIDOMHTMLElement
@@ -2048,7 +2048,7 @@ interface nsIDOMHTMLTableElement : nsIDOMHTMLElement
 
 [
     object,
-    uuid(0ac4a382-4f97-4143-a3b3-de0a54978c67),
+    uuid(02094366-0d3d-47e3-949c-89113a9bcc15),
     local
 ]
 interface nsIDOMHTMLTableRowElement : nsIDOMHTMLElement
@@ -2072,7 +2072,7 @@ interface nsIDOMHTMLTableRowElement : nsIDOMHTMLElement
 
 [
     object,
-    uuid(a7bd1e34-3969-47ae-8c1d-2970132ba925),
+    uuid(21ffbe98-51f5-499e-8d6f-612ae798c1e1),
     local
 ]
 interface nsIDOMHTMLIFrameElement : nsIDOMHTMLElement
@@ -2101,13 +2101,13 @@ interface nsIDOMHTMLIFrameElement : nsIDOMHTMLElement
     nsresult GetContentWindow(nsIDOMWindow **aContentWindow);
     nsresult GetSandbox(nsAString *aSandbox);
     nsresult SetSandbox(const nsAString *aSandbox);
-    nsresult GetAllowFullScreen(bool *aAllowFullScreen);
-    nsresult SetAllowFullScreen(bool aAllowFullScreen);
+    nsresult GetAllowFullscreen(bool *aAllowFullscreen);
+    nsresult SetAllowFullscreen(bool aAllowFullscreen);
 }
 
 [
     object,
-    uuid(2aa7855a-0667-47c3-af1e-9101002816c1),
+    uuid(1a79af54-dbbb-4532-be48-944f3995e7e9),
     local
 ]
 interface nsIDOMHTMLFrameElement : nsIDOMHTMLElement
@@ -2134,7 +2134,7 @@ interface nsIDOMHTMLFrameElement : nsIDOMHTMLElement
 
 [
     object,
-    uuid(a70595dd-68a5-41f5-ab52-73a47d98bd78),
+    uuid(bed8f222-c4dd-41ba-9ec6-dfae0ec8def8),
     local
 ]
 interface nsIDOMHTMLObjectElement : nsIDOMHTMLElement
@@ -2182,7 +2182,7 @@ interface nsIDOMHTMLObjectElement : nsIDOMHTMLElement
 
 [
     object,
-    uuid(1fbec0f8-c7cF-4dc8-84be-247985a65e07),
+    uuid(f85e1b05-6dc4-442d-bea8-7cf551f9bc9f),
     local
 ]
 interface nsIDOMHTMLParamElement : nsIDOMHTMLElement
@@ -2199,7 +2199,7 @@ interface nsIDOMHTMLParamElement : nsIDOMHTMLElement
 
 [
     object,
-    uuid(f9db1001-faae-46e1-b85f-0a0afb80c5b2),
+    uuid(e81273e1-d440-4dd3-9073-8199f7a9525e),
     local
 ]
 interface nsIDOMHTMLStyleElement : nsIDOMHTMLElement
@@ -2368,7 +2368,7 @@ interface nsIWebNavigation : nsISupports
 
 [
     object,
-    uuid(570f39d0-efd0-11d3-b093-00a024ffc08c),
+    uuid(1c3437b0-9e2c-11e2-9e96-0800200c9a66),
     local
 ]
 interface nsIWebProgress : nsISupports
@@ -2376,12 +2376,14 @@ interface nsIWebProgress : nsISupports
     nsresult AddProgressListener(nsIWebProgressListener *aListener, uint32_t aNotifyMask);
     nsresult RemoveProgressListener(nsIWebProgressListener *aListener);
     nsresult GetDOMWindow(nsIDOMWindow **aDOMWindow);
+    nsresult GetDOMWindowID(uint64_t *aDOMWindowID);
+    nsresult GetIsTopLevel(bool *aIsTopLevel);
     nsresult GetIsLoadingDocument(bool *aIsLoadingDocument);
 }
 
 [
     object,
-    uuid(a65cfa37-b381-4fe9-81b7-db08853f54ad),
+    uuid(1bcfc611-8941-4c39-9e06-7116e564a1ce),
     local
 ]
 interface nsIPrintSettings : nsISupports
@@ -2502,6 +2504,10 @@ interface nsIPrintSettings : nsISupports
     nsresult SetOutputFormat(int16_t aOutputFormat);
     nsresult GetPrintPageDelay(int32_t *aPrintPageDelay);
     nsresult SetPrintPageDelay(int32_t aPrintPageDelay);
+    nsresult GetResolution(int32_t *aResolution) = 0;
+    nsresult SetResolution(int32_t aResolution) = 0;
+    nsresult GetDuplex(int32_t *aDuplex);
+    nsresult SetDuplex(int32_t aDuplex);
     nsresult GetIsInitializedFromPrinter(bool *aIsInitializedFromPrinter);
     nsresult SetIsInitializedFromPrinter(bool aIsInitializedFromPrinter);
     nsresult GetIsInitializedFromPrefs(bool *aIsInitializedFromPrefs);
@@ -2833,7 +2839,7 @@ interface nsIDOMEventListener : nsISupports
 
 [
     object,
-    uuid(8e375931-298d-4d0a-9cb4-5668f0cdc5a8),
+    uuid(31e92e56-4d23-4a4a-9cfe-a6d12cf434bc),
     local
 ]
 interface nsIDOMEventTarget : nsISupports
@@ -2849,7 +2855,7 @@ interface nsIDOMEventTarget : nsISupports
 
 [
     object,
-    uuid(c939eab8-1345-4344-875b-e0f2d8d89171),
+    uuid(02d54f52-a1f5-4ad2-b560-36f14012935e),
     local
 ]
 interface nsIDOMEvent : nsISupports
@@ -2868,8 +2874,6 @@ interface nsIDOMEvent : nsISupports
     nsresult StopImmediatePropagation();
     nsresult GetOriginalTarget(nsIDOMEventTarget **aOriginalTarget);
     nsresult GetExplicitOriginalTarget(nsIDOMEventTarget * *aExplicitOriginalTarget);
-    nsresult PreventBubble();
-    nsresult PreventCapture();
     nsresult GetPreventDefault(bool *_retval);
     nsresult GetIsTrusted(bool *aIsTrusted);
     nsresult DuplicatePrivateData();
@@ -2879,11 +2883,13 @@ interface nsIDOMEvent : nsISupports
     void SetTrusted(bool aTrusted);
     void Serialize(/*IPC::Message*/ void *aMsg, bool aSerializeInterfaceType);
     bool Deserialize(const /*IPC::Message*/ void *aMsg, void **aIter);
+    void SetOwner(void /*mozilla::dom::EventTarget*/ *aOwner);
+    void /*nsDOMEvent*/ *InternalDOMEvent();
 }
 
 [
     object,
-    uuid(16b3bdcc-75d4-11e2-8a20-aaff78957a39),
+    uuid(cbe333d7-5b2c-4a9b-b99b-e6e388afa62b),
     local
 ]
 interface nsIDOMWindowUtils : nsISupports
@@ -2903,6 +2909,7 @@ interface nsIDOMWindowUtils : nsISupports
     nsresult GetResolution(float *aXResolution, float *aYResolution);
     nsresult GetIsFirstPaint(bool *aIsFirstPaint);
     nsresult SetIsFirstPaint(bool aIsFirstPaint);
+    nsresult GetPresShellId(uint32_t *aPresShellId);
     nsresult SendMouseEvent(const nsAString *aType, float aX, float aY, int32_t aButton, int32_t aClickCount,
            int32_t aModifiers, bool aIgnoreRootScrollFrame, float aPressure, uint16_t aInputSourceArg, bool *_retval);
     nsresult SendTouchEvent(const nsAString *aType, uint32_t *aIdentifiers, int32_t *aXs, int32_t *aYs,
@@ -2937,7 +2944,8 @@ interface nsIDOMWindowUtils : nsISupports
     nsresult ClearMozAfterPaintEvents();
     nsresult DisableNonTestMouseEvents(bool aDisable);
     nsresult GetScrollXY(bool aFlushLayout, int32_t *aScrollX, int32_t *aScrollY);
-    nsresult GetScrollbarWidth(bool aFlushLayout, int32_t *_retval);
+    nsresult GetScrollbarSize(bool aFlushLayout, int32_t *aWidth, int32_t *aHeight);
+    nsresult GetBoundsWithoutFlushing(nsIDOMElement *aElement, nsIDOMClientRect **_retval);
     nsresult GetRootBounds(nsIDOMClientRect **_retval);
     nsresult GetIMEIsOpen(bool *aIMEIsOpen);
     nsresult GetIMEStatus(uint32_t *aIMEStatus);
@@ -2971,6 +2979,7 @@ interface nsIDOMWindowUtils : nsISupports
     nsresult SuspendTimeouts();
     nsresult ResumeTimeouts();
     nsresult GetLayerManagerType(nsAString *aLayerManagerType);
+    nsresult GetLayerManagerRemote(bool *aLayerManagerRemote);
     nsresult StartFrameTimeRecording(uint32_t *startIndex);
     nsresult StopFrameTimeRecording(uint32_t startIndex, float **paintTimes, uint32_t *frameCount, float **frameIntervals);
     nsresult BeginTabSwitch();
@@ -2980,6 +2989,7 @@ interface nsIDOMWindowUtils : nsISupports
            void /*gfxContext*/ *aThebesContext);
     nsresult AdvanceTimeAndRefresh(int64_t aMilliseconds);
     nsresult RestoreNormalRefresh();
+    nsresult GetIsTestControllingRefreshes(bool *aIsTestControllingRefreshes);
     nsresult ComputeAnimationDistance(nsIDOMElement *element, const nsAString *property, const nsAString *value1,
            const nsAString *value2, double *_retval);
     nsresult WrapDOMFile(nsIFile *aFile, nsIDOMFile **_retval);
@@ -3005,12 +3015,19 @@ interface nsIDOMWindowUtils : nsISupports
     nsresult GetPaintingSuppressed(bool *aPaintingSuppressed);
     nsresult GetPlugins(JSContext *cx, /*JS::Value*/ void *aPlugins);
     nsresult SetScrollPositionClampingScrollPortSize(float aWidth, float aHeight);
+    nsresult SetContentDocumentFixedPositionMargins(float aTop, float aRight, float aBottom, float aLeft);
     nsresult PreventFurtherDialogs();
     nsresult LoadSheet(nsIURI *sheetURI, uint32_t type);
     nsresult RemoveSheet(nsIURI *sheetURI, uint32_t type);
     nsresult GetIsHandlingUserInput(bool *aIsHandlingUserInput);
     nsresult AllowScriptsToClose();
+    nsresult GetIsParentWindowMainWidgetVisible(bool *aIsParentWindowMainWidgetVisible);
     nsresult IsNodeDisabledForEvents(nsIDOMNode *aNode, bool *_retval);
+    nsresult GetPaintFlashing(bool *aPaintFlashing);
+    nsresult SetPaintFlashing(bool aPaintFlashing);
+    nsresult RunInStableState(nsIRunnable *runnable);
+    nsresult RunBeforeNextEvent(nsIRunnable *runnable);
+    nsresult GetOMTAOrComputedStyle(nsIDOMNode *aNode, const nsAString *aProperty, nsAString *_retval);
 }
 
 cpp_quote("#define CONTEXT_NONE              0x00")
@@ -3091,7 +3108,7 @@ interface nsIDOMMouseEvent : nsIDOMUIEvent
 
 [
     object,
-    uuid(ffbe684c-ca90-4b58-aa8c-9727f997f86d),
+    uuid(91a3d7f2-223b-4e09-a566-634e7ee0a31d),
     local
 ]
 interface nsIDOMKeyEvent : nsIDOMUIEvent
@@ -3108,6 +3125,7 @@ interface nsIDOMKeyEvent : nsIDOMUIEvent
             uint32_t charCodeArg);
     nsresult GetModifierState(const nsAString *keyArg, bool *_retval);
     nsresult GetLocation(uint32_t *aLocation);
+    nsresult GetKey(nsAString *aKey);
 }
 
 [
@@ -3261,6 +3279,22 @@ interface nsICommandManager : nsISupports
             nsIDOMWindow *aTargetWindow);
 }
 
+[
+    object,
+    uuid(3275b2cd-af6d-429a-80d7-f0c5120342ac),
+    local
+]
+interface nsICategoryManager : nsISupports
+{
+    nsresult GetCategoryEntry(const char *aCategory, const char *aEntry, char **_retval);
+    nsresult AddCategoryEntry(const char *aCategory, const char *aEntry, const char *aValue, bool aPersist,
+            bool aReplace, char **_retval);
+    nsresult DeleteCategoryEntry(const char *aCategory, const char *aEntry, bool aPersist);
+    nsresult DeleteCategory(const char *aCategory);
+    nsresult EnumerateCategory(const char *aCategory, nsISimpleEnumerator **_retval);
+    nsresult EnumerateCategories(nsISimpleEnumerator **_retval);
+}
+
 [
     object,
     uuid(47b82b60-a36f-4167-8072-6f421151ed50),
@@ -3297,7 +3331,7 @@ interface nsIContent : nsISupports
 
 [
     object,
-    uuid(4e6f7d97-091e-4eda-b7d6-feb0b8012a93),
+    uuid(62cca591-a030-4117-9b80-dcd366bbb509),
     local
 ]
 interface nsIDocument : nsISupports
@@ -3503,13 +3537,13 @@ interface nsIDocShellTreeNode : nsISupports
 
 [
     object,
-    uuid(09b54ec1-d98a-49a9-bc95-3219e8b55089),
+    uuid(e35bbb39-985b-4d62-81da-73c330222e5f),
     local
 ]
 interface nsIDocShellTreeItem : nsIDocShellTreeNode
 {
-    nsresult GetName(PRUnichar **aName);
-    nsresult SetName(const PRUnichar *aName);
+    nsresult GetName(nsAString *aName);
+    nsresult SetName(const nsAString *aName);
     nsresult NameEquals(const PRUnichar *name, bool *_retval);
     nsresult GetItemType(int32_t *aItemType);
     nsresult SetItemType(int32_t aItemType);
@@ -3524,7 +3558,7 @@ interface nsIDocShellTreeItem : nsIDocShellTreeNode
 
 [
     object,
-    uuid(e8f6f3e5-8cee-4be3-8d56-5ed617305bf8),
+    uuid(f453d2ee-bac7-46f9-a553-df918f0cc0d0),
     local
 ]
 interface nsIDocShell : nsIDocShellTreeItem
@@ -3558,6 +3592,8 @@ interface nsIDocShell : nsIDocShellTreeItem
     nsresult SetAllowSubframes(bool aAllowSubframes);
     nsresult GetAllowImages(bool *aAllowImages);
     nsresult SetAllowImages(bool aAllowImages);
+    nsresult GetAllowMedia(bool *aAllowMedia);
+    nsresult SetAllowMedia(bool aAllowMedia);
     nsresult GetAllowDNSPrefetch(bool *aAllowDNSPrefetch);
     nsresult SetAllowDNSPrefetch(bool aAllowDNSPrefetch);
     nsresult GetAllowWindowControl(bool *aAllowWindowControl);
@@ -3597,8 +3633,6 @@ interface nsIDocShell : nsIDocShellTreeItem
     nsresult GetSessionStorageForPrincipal(nsIPrincipal *principal, const nsAString *documentURI,
             bool create, nsIDOMStorage **_retval);
     nsresult AddSessionStorage(nsIPrincipal *principal, nsIDOMStorage *storage);
-    nsresult CloneSessionStoragesTo(nsIDocShell *docShell);
-    nsresult ClearSessionStorages();
     nsresult GetCurrentDocumentChannel(nsIChannel **aCurrentDocumentChannel);
     nsresult SetChildOffset(uint32_t offset);
     nsresult GetIsInUnload(bool *aIsInUnload);
@@ -3620,6 +3654,7 @@ interface nsIDocShell : nsIDocShellTreeItem
     nsresult CreateAboutBlankContentViewer(nsIPrincipal *aPrincipal);
     nsresult GetCharset(char **aCharset);
     nsresult SetCharset(const char * aCharset);
+    nsresult GatherCharsetMenuTelemetry();
     nsresult GetForcedCharset(nsIAtom **aForcedCharset);
     nsresult SetForcedCharset(nsIAtom *aForcedCharset);
     nsresult GetParentCharset(nsIAtom **aParentCharset);
@@ -3627,6 +3662,9 @@ interface nsIDocShell : nsIDocShellTreeItem
     nsresult GetParentCharsetSource(int32_t *aParentCharsetSource);
     nsresult SetParentCharsetSource(int32_t aParentCharsetSource);
     nsresult AddWeakPrivacyTransitionObserver(nsIPrivacyTransitionObserver *obs);
+    nsresult AddWeakReflowObserver(nsISupports /*nsIReflowObserver*/ *obs);
+    nsresult RemoveWeakReflowObserver(nsISupports /*nsIReflowObserver*/ *obs);
+    nsresult NotifyReflowObservers(bool interruptible, int /*DOMHighResTimeStamp*/ start, int /*DOMHighResTimeStamp*/ end);
     nsresult GetIsBrowserElement(bool *aIsBrowserElement);
     nsresult GetIsApp(bool *aIsApp);
     nsresult GetIsBrowserOrApp(bool *aIsBrowserOrApp);
@@ -3653,6 +3691,55 @@ interface nsIDocShell : nsIDocShellTreeItem
     nsresult GetEditable(bool *aEditable);
     nsresult GetHasEditingSession(bool *aHasEditingSession);
     nsresult MakeEditable(bool inWaitForUriLoad);
+    nsresult GetChildSHEntry(int32_t aChildOffset, nsISHEntry **_retval);
+    nsresult AddChildSHEntry(nsISHEntry *aCloneReference, nsISHEntry *aHistoryEntry, int32_t aChildOffset, uint32_t aLoadType, bool aCloneChildren);
+    nsresult GetUseGlobalHistory(bool *aUseGlobalHistory);
+    nsresult SetUseGlobalHistory(bool aUseGlobalHistory);
+    nsresult RemoveFromSessionHistory();
+    nsresult GetCreatedDynamically(bool *aCreatedDynamically);
+    nsresult SetCreatedDynamically(bool aCreatedDynamically);
+    nsresult GetCurrentSHEntry(nsISHEntry **aEntry, bool *_retval);
+}
+
+[
+    object,
+    uuid(02d37b31-e654-4b74-9bc3-14dfe0020bb3),
+    local
+]
+interface nsIMarkupDocumentViewer : nsISupports
+{
+    nsresult ScrollToNode(nsIDOMNode *node);
+    nsresult GetTextZoom(float *aTextZoom);
+    nsresult SetTextZoom(float aTextZoom);
+    nsresult GetFullZoom(float *aFullZoom);
+    nsresult SetFullZoom(float aFullZoom);
+    nsresult GetAuthorStyleDisabled(bool *aAuthorStyleDisabled);
+    nsresult SetAuthorStyleDisabled(bool aAuthorStyleDisabled);
+    nsresult GetDefaultCharacterSet(nsACString *aDefaultCharacterSet);
+    nsresult SetDefaultCharacterSet(const nsACString *aDefaultCharacterSet);
+    nsresult GetForceCharacterSet(nsACString *aForceCharacterSet);
+    nsresult SetForceCharacterSet(const nsACString *aForceCharacterSet);
+    nsresult GetHintCharacterSet(nsACString *aHintCharacterSet);
+    nsresult SetHintCharacterSet(const nsACString *aHintCharacterSet);
+    nsresult GetHintCharacterSetSource(int32_t *aHintCharacterSetSource);
+    nsresult SetHintCharacterSetSource(int32_t aHintCharacterSetSource);
+    nsresult GetPrevDocCharacterSet(nsACString *aPrevDocCharacterSet);
+    nsresult SetPrevDocCharacterSet(const nsACString *aPrevDocCharacterSet);
+    nsresult GetContentSize(int32_t *width, int32_t *height);
+    nsresult GetBidiTextDirection(uint8_t *aBidiTextDirection);
+    nsresult SetBidiTextDirection(uint8_t aBidiTextDirection);
+    nsresult GetBidiTextType(uint8_t *aBidiTextType);
+    nsresult SetBidiTextType(uint8_t aBidiTextType);
+    nsresult GetBidiNumeral(uint8_t *aBidiNumeral);
+    nsresult SetBidiNumeral(uint8_t aBidiNumeral);
+    nsresult GetBidiSupport(uint8_t *aBidiSupport);
+    nsresult SetBidiSupport(uint8_t aBidiSupport);
+    nsresult GetBidiOptions(uint32_t *aBidiOptions);
+    nsresult SetBidiOptions(uint32_t aBidiOptions);
+    nsresult GetMinFontSize(int32_t *aMinFontSize);
+    nsresult SetMinFontSize(int32_t aMinFontSize);
+    nsresult AppendSubtree(void /* nsTArray<nsCOMPtr<nsIMarkupDocumentViewer>> */ *array);
+    nsresult ChangeMaxLineBoxWidth(int32_t maxLineBoxWidth);
 }
 
 [
index b035037..e507aec 100644 (file)
@@ -120,6 +120,23 @@ static BOOL compare_ignoring_frag(IUri *uri1, IUri *uri2)
     return ret;
 }
 
+static HRESULT combine_url(IUri *base_uri, const WCHAR *rel_url, IUri **ret)
+{
+    IUri *uri_nofrag;
+    HRESULT hres;
+
+    uri_nofrag = get_uri_nofrag(base_uri);
+    if(!uri_nofrag)
+        return E_FAIL;
+
+    hres = CoInternetCombineUrlEx(uri_nofrag, rel_url, URL_ESCAPE_SPACES_ONLY|URL_DONT_ESCAPE_EXTRA_INFO,
+                ret, 0);
+    IUri_Release(uri_nofrag);
+    if(FAILED(hres))
+        WARN("CoInternetCombineUrlEx failed: %08x\n", hres);
+    return hres;
+}
+
 static nsresult create_nsuri(IUri*,HTMLOuterWindow*,NSContainer*,const char*,nsWineURI**);
 
 static const char *debugstr_nsacstr(const nsACString *nsstr)
@@ -1480,9 +1497,6 @@ static nsresult NSAPI nsUploadChannel_SetUploadStream(nsIUploadChannel *iface,
         }
     }
 
-    if(This->post_data_stream)
-        nsIInputStream_Release(This->post_data_stream);
-
     if(aContentLength != -1)
         FIXME("Unsupported acontentLength = %s\n", wine_dbgstr_longlong(aContentLength));
 
@@ -2386,12 +2400,10 @@ static nsresult NSAPI nsURI_Resolve(nsIFileURL *iface, const nsACString *aRelati
     if(!path)
         return NS_ERROR_OUT_OF_MEMORY;
 
-    hres = CoInternetCombineUrlEx(This->uri, path, URL_ESCAPE_SPACES_ONLY|URL_DONT_ESCAPE_EXTRA_INFO, &new_uri, 0);
+    hres = combine_url(This->uri, path, &new_uri);
     heap_free(path);
-    if(FAILED(hres)) {
-        ERR("CoIntenetCombineUrlEx failed: %08x\n", hres);
+    if(FAILED(hres))
         return NS_ERROR_FAILURE;
-    }
 
     hres = IUri_GetDisplayUri(new_uri, &ret);
     IUri_Release(new_uri);
@@ -3296,10 +3308,7 @@ static nsresult NSAPI nsIOService_NewURI(nsIIOService *iface, const nsACString *
     MultiByteToWideChar(CP_ACP, 0, spec, -1, new_spec, sizeof(new_spec)/sizeof(WCHAR));
 
     if(base_wine_uri) {
-        hres = CoInternetCombineUrlEx(base_wine_uri->uri, new_spec, URL_ESCAPE_SPACES_ONLY|URL_DONT_ESCAPE_EXTRA_INFO,
-                &urlmon_uri, 0);
-        if(FAILED(hres))
-            WARN("CoInternetCombineUrlEx failed: %08x\n", hres);
+        hres = combine_url(base_wine_uri->uri, new_spec, &urlmon_uri);
     }else {
         hres = create_uri(new_spec, 0, &urlmon_uri);
         if(FAILED(hres))
index 0a409c8..97a50c4 100644 (file)
@@ -388,7 +388,7 @@ static void refresh_proc(task_t *_task)
         IOleCommandTarget_Exec(window->doc_obj->client_cmdtrg, &CGID_ShellDocView, 37, 0, &var, NULL);
     }
 
-    load_uri(task->window, task->window->uri, BINDING_REFRESH);
+    load_uri(task->window, task->window->uri, BINDING_REFRESH|BINDING_NOFRAG);
 }
 
 static void refresh_destr(task_t *_task)
index 5851abd..23b3784 100644 (file)
@@ -190,6 +190,68 @@ void call_docview_84(HTMLDocumentObj *doc)
         FIXME("handle result\n");
 }
 
+void set_document_navigation(HTMLDocumentObj *doc, BOOL doc_can_navigate)
+{
+    VARIANT var;
+
+    if(!doc->client_cmdtrg)
+        return;
+
+    if(doc_can_navigate) {
+        V_VT(&var) = VT_UNKNOWN;
+        V_UNKNOWN(&var) = (IUnknown*)&doc->basedoc.window->base.IHTMLWindow2_iface;
+    }
+
+    IOleCommandTarget_Exec(doc->client_cmdtrg, &CGID_DocHostCmdPriv, DOCHOST_DOCCANNAVIGATE, 0,
+            doc_can_navigate ? &var : NULL, NULL);
+}
+
+static void load_settings(HTMLDocumentObj *doc)
+{
+    nsIMarkupDocumentViewer *markup_document_viewer;
+    nsIContentViewer *content_viewer;
+    nsIDocShell *doc_shell;
+    HKEY settings_key;
+    DWORD val, size;
+    LONG res;
+    nsresult nsres;
+
+    static const WCHAR ie_keyW[] = {
+        'S','O','F','T','W','A','R','E','\\',
+        'M','i','c','r','o','s','o','f','t','\\',
+        'I','n','t','e','r','n','e','t',' ','E','x','p','l','o','r','e','r',0};
+    static const WCHAR zoomW[] = {'Z','o','o','m',0};
+    static const WCHAR zoom_factorW[] = {'Z','o','o','m','F','a','c','t','o','r',0};
+
+    res = RegOpenKeyW(HKEY_CURRENT_USER, ie_keyW, &settings_key);
+    if(res != ERROR_SUCCESS)
+        return;
+
+    size = sizeof(val);
+    res = RegGetValueW(settings_key, zoomW, zoom_factorW, RRF_RT_REG_DWORD, NULL, &val, &size);
+    RegCloseKey(settings_key);
+    if(res != ERROR_SUCCESS)
+        return;
+
+    TRACE("Setting ZoomFactor to %u\n", val);
+
+    nsres = get_nsinterface((nsISupports*)doc->nscontainer->navigation, &IID_nsIDocShell, (void**)&doc_shell);
+    assert(nsres == NS_OK);
+
+    nsres = nsIDocShell_GetContentViewer(doc_shell, &content_viewer);
+    assert(nsres == NS_OK && content_viewer);
+
+    nsres = nsISupports_QueryInterface(content_viewer, &IID_nsIMarkupDocumentViewer, (void**)&markup_document_viewer);
+    nsISupports_Release(content_viewer);
+    assert(nsres == NS_OK);
+
+    nsres = nsIMarkupDocumentViewer_SetFullZoom(markup_document_viewer, (float)val/100000);
+    if(NS_FAILED(nsres))
+        ERR("SetFullZoom failed: %08x\n", nsres);
+
+    nsIDocShell_Release(doc_shell);
+}
+
 static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite *pClientSite)
 {
     HTMLDocument *This = impl_from_IOleObject(iface);
@@ -283,7 +345,7 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
             if(hres == S_OK && key_path) {
                 if(key_path[0]) {
                     /* FIXME: use key_path */
-                    TRACE("key_path = %s\n", debugstr_w(key_path));
+                    FIXME("key_path = %s\n", debugstr_w(key_path));
                 }
                 CoTaskMemFree(key_path);
             }
@@ -295,7 +357,7 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
                 if(hres == S_OK && override_key_path && override_key_path[0]) {
                     if(override_key_path[0]) {
                         /*FIXME: use override_key_path */
-                        TRACE("override_key_path = %s\n", debugstr_w(override_key_path));
+                        FIXME("override_key_path = %s\n", debugstr_w(override_key_path));
                     }
                     CoTaskMemFree(override_key_path);
                 }
@@ -306,6 +368,8 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
         }
     }
 
+    load_settings(This->doc_obj);
+
     /* Native calls here GetWindow. What is it for?
      * We don't have anything to do with it here (yet). */
     hres = IOleClientSite_QueryInterface(pClientSite, &IID_IOleWindow, (void**)&ole_window);
@@ -339,9 +403,7 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
             IDocObjectService *doc_object_service;
             IWebBrowser2 *wb;
 
-            V_VT(&var) = VT_UNKNOWN;
-            V_UNKNOWN(&var) = (IUnknown*)&This->window->base.IHTMLWindow2_iface;
-            IOleCommandTarget_Exec(cmdtrg, &CGID_DocHostCmdPriv, DOCHOST_DOCCANNAVIGATE, 0, &var, NULL);
+            set_document_navigation(This->doc_obj, TRUE);
 
             if(browser_service) {
                 hres = IBrowserService_QueryInterface(browser_service,
index df91824..fa4f307 100644 (file)
@@ -411,9 +411,9 @@ HRESULT set_moniker(HTMLOuterWindow *window, IMoniker *mon, IUri *nav_uri, IBind
     return S_OK;
 }
 
-void set_ready_state(HTMLOuterWindow *window, READYSTATE readystate)
+static void notif_readystate(HTMLOuterWindow *window)
 {
-    window->readystate = readystate;
+    window->readystate_pending = FALSE;
 
     if(window->doc_obj && window->doc_obj->basedoc.window == window)
         call_property_onchanged(&window->doc_obj->basedoc.cp_container, DISPID_READYSTATE);
@@ -426,6 +426,52 @@ void set_ready_state(HTMLOuterWindow *window, READYSTATE readystate)
                    TRUE, window->frame_element->element.node.nsnode, NULL, NULL);
 }
 
+typedef struct {
+    task_t header;
+    HTMLOuterWindow *window;
+} readystate_task_t;
+
+static void notif_readystate_proc(task_t *_task)
+{
+    readystate_task_t *task = (readystate_task_t*)_task;
+    notif_readystate(task->window);
+}
+
+static void notif_readystate_destr(task_t *_task)
+{
+    readystate_task_t *task = (readystate_task_t*)_task;
+    IHTMLWindow2_Release(&task->window->base.IHTMLWindow2_iface);
+}
+
+void set_ready_state(HTMLOuterWindow *window, READYSTATE readystate)
+{
+    READYSTATE prev_state = window->readystate;
+
+    window->readystate = readystate;
+
+    if(window->readystate_locked) {
+        readystate_task_t *task;
+        HRESULT hres;
+
+        if(window->readystate_pending || prev_state == readystate)
+            return;
+
+        task = heap_alloc(sizeof(*task));
+        if(!task)
+            return;
+
+        IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface);
+        task->window = window;
+
+        hres = push_task(&task->header, notif_readystate_proc, notif_readystate_destr, window->task_magic);
+        if(SUCCEEDED(hres))
+            window->readystate_pending = TRUE;
+        return;
+    }
+
+    notif_readystate(window);
+}
+
 static HRESULT get_doc_string(HTMLDocumentNode *This, char **str)
 {
     nsIDOMNode *nsnode;
@@ -817,11 +863,12 @@ static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, LPSTREAM
 
     prepare_for_binding(This, mon, FALSE);
     hres = set_moniker(This->window, mon, NULL, NULL, NULL, TRUE);
-    IMoniker_Release(mon);
     if(FAILED(hres))
         return hres;
 
-    return channelbsc_load_stream(This->window->pending_window, pStm);
+    hres = channelbsc_load_stream(This->window->pending_window, mon, pStm);
+    IMoniker_Release(mon);
+    return hres;
 }
 
 static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, LPSTREAM pStm,
@@ -874,11 +921,12 @@ static HRESULT WINAPI PersistStreamInit_InitNew(IPersistStreamInit *iface)
 
     prepare_for_binding(This, mon, FALSE);
     hres = set_moniker(This->window, mon, NULL, NULL, NULL, FALSE);
-    IMoniker_Release(mon);
     if(FAILED(hres))
         return hres;
 
-    return channelbsc_load_stream(This->window->pending_window, NULL);
+    hres = channelbsc_load_stream(This->window->pending_window, mon, NULL);
+    IMoniker_Release(mon);
+    return hres;
 }
 
 static const IPersistStreamInitVtbl PersistStreamInitVtbl = {
index 02838ce..86a51c1 100644 (file)
@@ -874,6 +874,29 @@ static ULONG WINAPI PHClientSite_AddRef(IOleClientSite *iface)
     return ref;
 }
 
+static void release_plugin_ifaces(PluginHost *This)
+{
+    if(This->disp) {
+        IDispatch_Release(This->disp);
+        This->disp = NULL;
+    }
+
+    if(This->ip_object) {
+        IOleInPlaceObject_Release(This->ip_object);
+        This->ip_object = NULL;
+    }
+
+    if(This->plugin_unk) {
+        IUnknown *unk = This->plugin_unk;
+        LONG ref;
+
+        This->plugin_unk = NULL;
+        ref = IUnknown_Release(unk);
+
+        TRACE("plugin ref = %d\n", ref);
+    }
+}
+
 static ULONG WINAPI PHClientSite_Release(IOleClientSite *iface)
 {
     PluginHost *This = impl_from_IOleClientSite(iface);
@@ -882,10 +905,7 @@ static ULONG WINAPI PHClientSite_Release(IOleClientSite *iface)
     TRACE("(%p) ref=%d\n", This, ref);
 
     if(!ref) {
-        if(This->disp)
-            IDispatch_Release(This->disp);
-        if(This->ip_object)
-            IOleInPlaceObject_Release(This->ip_object);
+        release_plugin_ifaces(This);
         if(This->sink) {
             This->sink->host = NULL;
             IDispatch_Release(&This->sink->IDispatch_iface);
@@ -894,8 +914,6 @@ static ULONG WINAPI PHClientSite_Release(IOleClientSite *iface)
         list_remove(&This->entry);
         if(This->element)
             This->element->plugin_host = NULL;
-        if(This->plugin_unk)
-            IUnknown_Release(This->plugin_unk);
         heap_free(This);
     }
 
@@ -1668,6 +1686,8 @@ void detach_plugin_host(PluginHost *host)
         host->sink = NULL;
     }
 
+    release_plugin_ifaces(host);
+
     if(host->element) {
         host->element->plugin_host = NULL;
         host->element = NULL;
index 7df602b..0a92def 100644 (file)
@@ -796,11 +796,13 @@ static BOOL get_guid_from_type(LPCWSTR type, GUID *guid)
 {
     const WCHAR text_javascriptW[] =
         {'t','e','x','t','/','j','a','v','a','s','c','r','i','p','t',0};
+    const WCHAR text_jscriptW[] =
+        {'t','e','x','t','/','j','s','c','r','i','p','t',0};
     const WCHAR text_vbscriptW[] =
         {'t','e','x','t','/','v','b','s','c','r','i','p','t',0};
 
     /* FIXME: Handle more types */
-    if(!strcmpiW(type, text_javascriptW)) {
+    if(!strcmpiW(type, text_javascriptW) || !strcmpiW(type, text_jscriptW)) {
         *guid = CLSID_JScript;
     }else if(!strcmpiW(type, text_vbscriptW)) {
         *guid = CLSID_VBScript;
@@ -1026,11 +1028,12 @@ IDispatch *get_script_disp(ScriptHost *script_host)
     return disp;
 }
 
-static HTMLElement *find_event_target(HTMLDocumentNode *doc, HTMLScriptElement *script_elem)
+static event_target_t **find_event_target(HTMLDocumentNode *doc, HTMLScriptElement *script_elem, HTMLDOMNode **ret_target_node)
 {
+    HTMLDOMNode *target_node = NULL;
+    event_target_t **target = NULL;
     const PRUnichar *target_id;
     nsAString target_id_str;
-    HTMLElement *elem;
     nsresult nsres;
     HRESULT hres;
 
@@ -1043,17 +1046,27 @@ static HTMLElement *find_event_target(HTMLDocumentNode *doc, HTMLScriptElement *
     }
 
     nsAString_GetData(&target_id_str, &target_id);
-    if(!*target_id || !strcmpW(target_id, documentW) || !strcmpW(target_id, windowW)) {
-        FIXME("for %s not supported\n", debugstr_w(target_id));
-        elem = NULL;
+    if(!*target_id) {
+        FIXME("Empty for attribute\n");
+    }else if(!strcmpW(target_id, documentW)) {
+        target = &doc->node.event_target;
+        target_node = &doc->node;
+        IHTMLDOMNode_AddRef(&target_node->IHTMLDOMNode_iface);
+    }else if(!strcmpW(target_id, windowW)) {
+        target = &doc->body_event_target;
     }else {
-        hres = get_doc_elem_by_id(doc, target_id, &elem);
-        if(FAILED(hres))
-            elem = NULL;
+        HTMLElement *target_elem;
+
+        hres = get_doc_elem_by_id(doc, target_id, &target_elem);
+        if(SUCCEEDED(hres) && target_elem) {
+            target_node = &target_elem->node;
+            target = &target_elem->node.event_target;
+        }
     }
     nsAString_Finish(&target_id_str);
 
-    return elem;
+    *ret_target_node = target_node;
+    return target;
 }
 
 static BOOL parse_event_str(WCHAR *event, const WCHAR **args)
@@ -1148,8 +1161,9 @@ void bind_event_scripts(HTMLDocumentNode *doc)
     HTMLPluginContainer *plugin_container;
     nsIDOMHTMLScriptElement *nsscript;
     HTMLScriptElement *script_elem;
-    HTMLElement *event_target;
+    event_target_t **event_target;
     nsIDOMNodeList *node_list;
+    HTMLDOMNode *target_node;
     nsIDOMNode *script_node;
     nsAString selector_str;
     IDispatch *event_disp;
@@ -1196,17 +1210,21 @@ void bind_event_scripts(HTMLDocumentNode *doc)
 
         event_disp = parse_event_elem(doc, script_elem, &event);
         if(event_disp) {
-            event_target = find_event_target(doc, script_elem);
+            event_target = find_event_target(doc, script_elem, &target_node);
             if(event_target) {
-                hres = IHTMLElement_QueryInterface(&event_target->IHTMLElement_iface, &IID_HTMLPluginContainer,
-                        (void**)&plugin_container);
+                if(target_node)
+                    hres = IHTMLDOMNode_QueryInterface(&target_node->IHTMLDOMNode_iface, &IID_HTMLPluginContainer,
+                            (void**)&plugin_container);
+                else
+                    hres = E_NOINTERFACE;
 
                 if(SUCCEEDED(hres))
                     bind_activex_event(doc, plugin_container, event, event_disp);
                 else
-                    bind_elem_event(doc, event_target, event, event_disp);
+                    bind_node_event(doc, event_target, target_node, event, event_disp);
 
-                IHTMLElement_Release(&event_target->IHTMLElement_iface);
+                if(target_node)
+                    IHTMLDOMNode_Release(&target_node->IHTMLDOMNode_iface);
             }
 
             heap_free(event);
index e57a3f8..e65a049 100644 (file)
 #define DISPID_RULESAPPLIED_COLLECTION            DISPID_NORMAL_FIRST
 #define DISPID_STYLESHEETRULESAPPLIED_COLLECTION  DISPID_NORMAL_FIRST
 #define DISPID_PROCESSINGINSTRUCTION              DISPID_NORMAL_FIRST
+#define DISPID_HTMLSELECTION    DISPID_NORMAL_FIRST
+#define DISPID_DOMRANGE         DISPID_NORMAL_FIRST
 
 #define DISPID_DOMEVENT                           DISPID_NORMAL_FIRST
 #define DISPID_DOMUIEVENT                         (DISPID_DOMEVENT+25)
 #define DISPID_IE8_OBJECTMAX   (DISPID_STYLE-1)
 #define DISPID_IE8_OBJECT      DISPID_IE8_OBJECTBASE
 
+#define DISPID_IE9_ELEMENTBASE  (DISPID_IE8_ELEMENTMAX  + 10)
+#define DISPID_IE9_ELEMENTMAX   (DISPID_IE9_ELEMENTBASE + 35)
+#define DISPID_IE9_ELEMENT      DISPID_IE9_ELEMENTBASE
+
 #define DISPID_COLLECTION      (DISPID_NORMAL_FIRST+500)
 #define DISPID_OPTIONS_COL     (DISPID_NORMAL_FIRST+500)
 #define DISPID_IMG             (DISPID_IMGBASE+1000)
 #define DISPID_IHTMLDOCUMENT6_IE8_GETELEMENTBYID  DISPID_OMDOCUMENT+105
 #define DISPID_IHTMLDOCUMENT6_UPDATESETTINGS      DISPID_OMDOCUMENT+106
 
+/* IHTMLDocument7 */
+#define DISPID_IHTMLDOCUMENT7_DEFAULTVIEW                      DISPID_OMDOCUMENT+110
+#define DISPID_IHTMLDOCUMENT7_CREATECDATASECTION               DISPID_OMDOCUMENT+123
+#define DISPID_IHTMLDOCUMENT7_GETSELECTION                     DISPID_OMDOCUMENT+112
+#define DISPID_IHTMLDOCUMENT7_GETELEMENTSBYTAGNAMENS           DISPID_OMDOCUMENT+113
+#define DISPID_IHTMLDOCUMENT7_CREATEELEMENTNS                  DISPID_OMDOCUMENT+114
+#define DISPID_IHTMLDOCUMENT7_CREATEATTRIBUTENS                DISPID_OMDOCUMENT+115
+#define DISPID_IHTMLDOCUMENT7_ONMSTHUMBNAILCLICK               DISPID_EVPROP_ONMSTHUMBNAILCLICK
+#define DISPID_IHTMLDOCUMENT7_CHARACTERSET                     DISPID_OMDOCUMENT+117
+#define DISPID_IHTMLDOCUMENT7_IE9_CREATEELEMENT                DISPID_OMDOCUMENT+118
+#define DISPID_IHTMLDOCUMENT7_IE9_CREATEATTRIBUTE              DISPID_OMDOCUMENT+119
+#define DISPID_IHTMLDOCUMENT7_GETELEMENTSBYCLASSNAME           DISPID_OMDOCUMENT+120
+#define DISPID_IHTMLDOCUMENT7_CREATEPROCESSINGINSTRUCTION      DISPID_OMDOCUMENT+124
+#define DISPID_IHTMLDOCUMENT7_ADOPTNODE                        DISPID_OMDOCUMENT+125
+#define DISPID_IHTMLDOCUMENT7_ONMSSITEMODEJUMPLISTITEMREMOVED  DISPID_EVPROP_ONMSSITEMODEJUMPLISTITEMREMOVED
+#define DISPID_IHTMLDOCUMENT7_IE9_ALL                          DISPID_OMDOCUMENT+126
+#define DISPID_IHTMLDOCUMENT7_INPUTENCODING                    DISPID_OMDOCUMENT+127
+#define DISPID_IHTMLDOCUMENT7_XMLENCODING                      DISPID_OMDOCUMENT+128
+#define DISPID_IHTMLDOCUMENT7_XMLSTANDALONE                    DISPID_OMDOCUMENT+129
+#define DISPID_IHTMLDOCUMENT7_XMLVERSION                       DISPID_OMDOCUMENT+130
+#define DISPID_IHTMLDOCUMENT7_HASATTRIBUTES                    DISPID_OMDOCUMENT+132
+#define DISPID_IHTMLDOCUMENT7_ONABORT                          DISPID_EVPROP_ONABORT
+#define DISPID_IHTMLDOCUMENT7_ONBLUR                           DISPID_EVPROP_ONBLUR
+#define DISPID_IHTMLDOCUMENT7_ONCANPLAY                        DISPID_EVPROP_CANPLAY
+#define DISPID_IHTMLDOCUMENT7_ONCANPLAYTHROUGH                 DISPID_EVPROP_CANPLAYTHROUGH
+#define DISPID_IHTMLDOCUMENT7_ONCHANGE                         DISPID_EVPROP_ONCHANGE
+#define DISPID_IHTMLDOCUMENT7_ONDRAG                           DISPID_EVPROP_ONDRAG
+#define DISPID_IHTMLDOCUMENT7_ONDRAGEND                        DISPID_EVPROP_ONDRAGEND
+#define DISPID_IHTMLDOCUMENT7_ONDRAGENTER                      DISPID_EVPROP_ONDRAGENTER
+#define DISPID_IHTMLDOCUMENT7_ONDRAGLEAVE                      DISPID_EVPROP_ONDRAGLEAVE
+#define DISPID_IHTMLDOCUMENT7_ONDRAGOVER                       DISPID_EVPROP_ONDRAGOVER
+#define DISPID_IHTMLDOCUMENT7_ONDROP                           DISPID_EVPROP_ONDROP
+#define DISPID_IHTMLDOCUMENT7_ONDURATIONCHANGE                 DISPID_EVPROP_DURATIONCHANGE
+#define DISPID_IHTMLDOCUMENT7_ONEMPTIED                        DISPID_EVPROP_EMPTIED
+#define DISPID_IHTMLDOCUMENT7_ONENDED                          DISPID_EVPROP_ENDED
+#define DISPID_IHTMLDOCUMENT7_ONERROR                          DISPID_EVPROP_ONERROR
+#define DISPID_IHTMLDOCUMENT7_ONFOCUS                          DISPID_EVPROP_ONFOCUS
+#define DISPID_IHTMLDOCUMENT7_ONINPUT                          DISPID_EVPROP_INPUT
+#define DISPID_IHTMLDOCUMENT7_ONLOAD                           DISPID_EVPROP_ONLOAD
+#define DISPID_IHTMLDOCUMENT7_ONLOADEDDATA                     DISPID_EVPROP_LOADEDDATA
+#define DISPID_IHTMLDOCUMENT7_ONLOADEDMETADATA                 DISPID_EVPROP_LOADEDMETADATA
+#define DISPID_IHTMLDOCUMENT7_ONLOADSTART                      DISPID_EVPROP_LOADSTART
+#define DISPID_IHTMLDOCUMENT7_ONPAUSE                          DISPID_EVPROP_PAUSE
+#define DISPID_IHTMLDOCUMENT7_ONPLAY                           DISPID_EVPROP_PLAY
+#define DISPID_IHTMLDOCUMENT7_ONPLAYING                        DISPID_EVPROP_PLAYING
+#define DISPID_IHTMLDOCUMENT7_ONPROGRESS                       DISPID_EVPROP_PROGRESS
+#define DISPID_IHTMLDOCUMENT7_ONRATECHANGE                     DISPID_EVPROP_RATECHANGE
+#define DISPID_IHTMLDOCUMENT7_ONRESET                          DISPID_EVPROP_ONRESET
+#define DISPID_IHTMLDOCUMENT7_ONSCROLL                         DISPID_EVPROP_ONSCROLL
+#define DISPID_IHTMLDOCUMENT7_ONSEEKED                         DISPID_EVPROP_SEEKED
+#define DISPID_IHTMLDOCUMENT7_ONSEEKING                        DISPID_EVPROP_SEEKING
+#define DISPID_IHTMLDOCUMENT7_ONSELECT                         DISPID_EVPROP_ONSELECT
+#define DISPID_IHTMLDOCUMENT7_ONSTALLED                        DISPID_EVPROP_STALLED
+#define DISPID_IHTMLDOCUMENT7_ONSUBMIT                         DISPID_EVPROP_ONSUBMIT
+#define DISPID_IHTMLDOCUMENT7_ONSUSPEND                        DISPID_EVPROP_SUSPEND
+#define DISPID_IHTMLDOCUMENT7_ONTIMEUPDATE                     DISPID_EVPROP_TIMEUPDATE
+#define DISPID_IHTMLDOCUMENT7_ONVOLUMECHANGE                   DISPID_EVPROP_VOLUMECHANGE
+#define DISPID_IHTMLDOCUMENT7_ONWAITING                        DISPID_EVPROP_WAITING
+#define DISPID_IHTMLDOCUMENT7_NORMALIZE                        DISPID_OMDOCUMENT+134
+#define DISPID_IHTMLDOCUMENT7_IMPORTNODE                       DISPID_OMDOCUMENT+135
+#define DISPID_IHTMLDOCUMENT7_IE9_PARENTWINDOW                 DISPID_OMDOCUMENT+136
+#define DISPID_IHTMLDOCUMENT7_IE9_BODY                         DISPID_OMDOCUMENT+137
+#define DISPID_IHTMLDOCUMENT7_HEAD                             DISPID_OMDOCUMENT+138
+
 /* DWebBridgeEvents */
 #define DISPID_DWEBBRIDGEEVENTS_ONSCRIPTLETEVENT   1
 #define DISPID_DWEBBRIDGEEVENTS_ONREADYSTATECHANGE DISPID_HTMLDOCUMENTEVENTS_ONREADYSTATECHANGE
 #define DISPID_IHTMLSELECTIONOBJECT_CLEAR         (DISPID_SELECTOBJ+3)
 #define DISPID_IHTMLSELECTIONOBJECT_TYPE          (DISPID_SELECTOBJ+4)
 
+/* IHTMLSelection */
+#define DISPID_IHTMLSELECTION_ANCHORNODE          DISPID_HTMLSELECTION+1
+#define DISPID_IHTMLSELECTION_ANCHOROFFSET        DISPID_HTMLSELECTION+2
+#define DISPID_IHTMLSELECTION_FOCUSNODE           DISPID_HTMLSELECTION+3
+#define DISPID_IHTMLSELECTION_FOCUSOFFSET         DISPID_HTMLSELECTION+4
+#define DISPID_IHTMLSELECTION_ISCOLLAPSED         DISPID_HTMLSELECTION+5
+#define DISPID_IHTMLSELECTION_COLLAPSE            DISPID_HTMLSELECTION+6
+#define DISPID_IHTMLSELECTION_COLLAPSETOSTART     DISPID_HTMLSELECTION+7
+#define DISPID_IHTMLSELECTION_COLLAPSETOEND       DISPID_HTMLSELECTION+8
+#define DISPID_IHTMLSELECTION_SELECTALLCHILDREN   DISPID_HTMLSELECTION+9
+#define DISPID_IHTMLSELECTION_DELETEFROMDOCUMENT  DISPID_HTMLSELECTION+10
+#define DISPID_IHTMLSELECTION_RANGECOUNT          DISPID_HTMLSELECTION+11
+#define DISPID_IHTMLSELECTION_GETRANGEAT          DISPID_HTMLSELECTION+12
+#define DISPID_IHTMLSELECTION_ADDRANGE            DISPID_HTMLSELECTION+13
+#define DISPID_IHTMLSELECTION_REMOVERANGE         DISPID_HTMLSELECTION+14
+#define DISPID_IHTMLSELECTION_REMOVEALLRANGES     DISPID_HTMLSELECTION+15
+#define DISPID_IHTMLSELECTION_TOSTRING            DISPID_HTMLSELECTION+16
+
 /* IHTMLFramesCollection2 */
 #define DISPID_IHTMLFRAMESCOLLECTION2_ITEM     0
 #define DISPID_IHTMLFRAMESCOLLECTION2_LENGTH   1001
 #define DISPID_IHTMLDOMNODE_PREVIOUSSIBLING    DISPID_ELEMENT+78
 #define DISPID_IHTMLDOMNODE_NEXTSIBLING        DISPID_ELEMENT+79
 
+/* IHTMLDOMNode3 */
+#define DISPID_IHTMLDOMNODE3_PREFIX                   DISPID_ELEMENT+120
+#define DISPID_IHTMLDOMNODE3_LOCALNAME                DISPID_ELEMENT+118
+#define DISPID_IHTMLDOMNODE3_NAMESPACEURI             DISPID_ELEMENT+119
+#define DISPID_IHTMLDOMNODE3_TEXTCONTENT              DISPID_ELEMENT+127
+#define DISPID_IHTMLDOMNODE3_ISEQUALNODE              DISPID_ELEMENT+121
+#define DISPID_IHTMLDOMNODE3_LOOKUPNAMESPACEURI       DISPID_ELEMENT+122
+#define DISPID_IHTMLDOMNODE3_LOOKUPPREFIX             DISPID_ELEMENT+123
+#define DISPID_IHTMLDOMNODE3_ISDEFAULTNAMESPACE       DISPID_ELEMENT+124
+#define DISPID_IHTMLDOMNODE3_IE9_APPENDCHILD          DISPID_IE9_ELEMENT+18
+#define DISPID_IHTMLDOMNODE3_IE9_INSERTBEFORE         DISPID_IE9_ELEMENT+19
+#define DISPID_IHTMLDOMNODE3_IE9_REMOVECHILD          DISPID_IE9_ELEMENT+20
+#define DISPID_IHTMLDOMNODE3_IE9_REPLACECHILD         DISPID_IE9_ELEMENT+21
+#define DISPID_IHTMLDOMNODE3_ISSAMENODE               DISPID_ELEMENT+125
+#define DISPID_IHTMLDOMNODE3_COMPAREDOCUMENTPOSITION  DISPID_ELEMENT+126
+#define DISPID_IHTMLDOMNODE3_ISSUPPORTED              DISPID_IE9_ELEMENT+27
+
 /* IHTMLLinkElement */
 #define DISPID_IHTMLLINKELEMENT_HREF                DISPID_HEDELEMS+5
 #define DISPID_IHTMLLINKELEMENT_REL                 DISPID_HEDELEMS+6
 #define DISPID_IHTMLTEXTAREAELEMENT_WRAP             DISPID_RICHTEXT+3
 #define DISPID_IHTMLTEXTAREAELEMENT_CREATETEXTRANGE  DISPID_RICHTEXT+6
 
+/* IHTMLDOMRange */
+#define DISPID_IHTMLDOMRANGE_STARTCONTAINER           DISPID_DOMRANGE+1
+#define DISPID_IHTMLDOMRANGE_STARTOFFSET              DISPID_DOMRANGE+2
+#define DISPID_IHTMLDOMRANGE_ENDCONTAINER             DISPID_DOMRANGE+3
+#define DISPID_IHTMLDOMRANGE_ENDOFFSET                DISPID_DOMRANGE+4
+#define DISPID_IHTMLDOMRANGE_COLLAPSED                DISPID_DOMRANGE+5
+#define DISPID_IHTMLDOMRANGE_COMMONANCESTORCONTAINER  DISPID_DOMRANGE+6
+#define DISPID_IHTMLDOMRANGE_SETSTART                 DISPID_DOMRANGE+7
+#define DISPID_IHTMLDOMRANGE_SETEND                   DISPID_DOMRANGE+8
+#define DISPID_IHTMLDOMRANGE_SETSTARTBEFORE           DISPID_DOMRANGE+9
+#define DISPID_IHTMLDOMRANGE_SETSTARTAFTER            DISPID_DOMRANGE+10
+#define DISPID_IHTMLDOMRANGE_SETENDBEFORE             DISPID_DOMRANGE+11
+#define DISPID_IHTMLDOMRANGE_SETENDAFTER              DISPID_DOMRANGE+12
+#define DISPID_IHTMLDOMRANGE_COLLAPSE                 DISPID_DOMRANGE+13
+#define DISPID_IHTMLDOMRANGE_SELECTNODE               DISPID_DOMRANGE+14
+#define DISPID_IHTMLDOMRANGE_SELECTNODECONTENTS       DISPID_DOMRANGE+15
+#define DISPID_IHTMLDOMRANGE_COMPAREBOUNDARYPOINTS    DISPID_DOMRANGE+16
+#define DISPID_IHTMLDOMRANGE_DELETECONTENTS           DISPID_DOMRANGE+17
+#define DISPID_IHTMLDOMRANGE_EXTRACTCONTENTS          DISPID_DOMRANGE+18
+#define DISPID_IHTMLDOMRANGE_CLONECONTENTS            DISPID_DOMRANGE+19
+#define DISPID_IHTMLDOMRANGE_INSERTNODE               DISPID_DOMRANGE+20
+#define DISPID_IHTMLDOMRANGE_SURROUNDCONTENTS         DISPID_DOMRANGE+21
+#define DISPID_IHTMLDOMRANGE_CLONERANGE               DISPID_DOMRANGE+22
+#define DISPID_IHTMLDOMRANGE_TOSTRING                 DISPID_DOMRANGE+23
+#define DISPID_IHTMLDOMRANGE_DETACH                   DISPID_DOMRANGE+24
+#define DISPID_IHTMLDOMRANGE_GETCLIENTRECTS           DISPID_DOMRANGE+25
+#define DISPID_IHTMLDOMRANGE_GETBOUNDINGCLIENTRECT    DISPID_DOMRANGE+26
+
 /* IHTMLButtonElement */
 #define DISPID_IHTMLBUTTONELEMENT_TYPE             DISPID_INPUT
 #define DISPID_IHTMLBUTTONELEMENT_VALUE            DISPID_A_VALUE
 #define DISPID_IHTMLCONTROLELEMENT_CLIENTTOP       (DISPID_SITE+21)
 #define DISPID_IHTMLCONTROLELEMENT_CLIENTLEFT      (DISPID_SITE+22)
 
+/* IDOMProcessingInstruction */
+#define DISPID_IDOMPROCESSINGINSTRUCTION_TARGET  DISPID_PROCESSINGINSTRUCTION
+#define DISPID_IDOMPROCESSINGINSTRUCTION_DATA    DISPID_PROCESSINGINSTRUCTION+1
+
 #endif /* __MSHTMDID_H__ */
index 8bed5e7..0c5a874 100644 (file)
 #include <mshtmcid.h>
 #include <olectl.h>
 
-#if defined(_MSC_VER) && (__midl >= 501)
-midl_pragma warning(disable: 2362)
-#endif
-
 import "ocidl.idl";
 import "dimm.idl";
 import "shtypes.idl";
@@ -3881,6 +3877,94 @@ interface IHTMLDOMNode2 : IDispatch
     WINE_IHTMLDOMNODE_DISPINTERFACE_DECL;       \
     WINE_IHTMLDOMNODE2_DISPINTERFACE_DECL
 
+/*****************************************************************************
+ *    IHTMLDOMNode3 interface
+ */
+[
+    odl,
+    oleautomation,
+    dual,
+    uuid(305106e0-98b5-11cf-bb82-00aa00bdce0b)
+]
+interface IHTMLDOMNode3 : IDispatch
+{
+    [propput, id(DISPID_IHTMLDOMNODE3_PREFIX)]
+    HRESULT prefix([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOMNODE3_PREFIX)]
+    HRESULT prefix([out, retval] VARIANT *p);
+
+    [propget, id(DISPID_IHTMLDOMNODE3_LOCALNAME)]
+    HRESULT localName([out, retval] VARIANT *p);
+
+    [propget, id(DISPID_IHTMLDOMNODE3_NAMESPACEURI)]
+    HRESULT namespaceURI([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOMNODE3_TEXTCONTENT)]
+    HRESULT textContent([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOMNODE3_TEXTCONTENT)]
+    HRESULT textContent([out, retval] VARIANT *p);
+
+    [id(DISPID_IHTMLDOMNODE3_ISEQUALNODE)]
+    HRESULT isEqualNode(
+        [in] IHTMLDOMNode3 *otherNode,
+        [out, retval] VARIANT_BOOL *isEqual);
+
+    [id(DISPID_IHTMLDOMNODE3_LOOKUPNAMESPACEURI)]
+    HRESULT lookupNamespaceURI(
+        [in] VARIANT *pvarPrefix,
+        [out, retval] VARIANT *pvarNamespaceURI);
+
+    [id(DISPID_IHTMLDOMNODE3_LOOKUPPREFIX)]
+    HRESULT lookupPrefix(
+       [in] VARIANT *pvarNamespaceURI,
+       [out, retval] VARIANT *pvarPrefix);
+
+    [id(DISPID_IHTMLDOMNODE3_ISDEFAULTNAMESPACE)]
+    HRESULT isDefaultNamespace(
+        [in] VARIANT *pvarNamespace,
+        [out, retval] VARIANT_BOOL *pfDefaultNamespace);
+
+    [id(DISPID_IHTMLDOMNODE3_IE9_APPENDCHILD)]
+    HRESULT appendChild(
+        [in] IHTMLDOMNode *newChild,
+        [out, retval] IHTMLDOMNode **node);
+
+    [id(DISPID_IHTMLDOMNODE3_IE9_INSERTBEFORE)]
+    HRESULT insertBefore(
+        [in] IHTMLDOMNode *newChild,
+        [in, optional] VARIANT refChild,
+        [out, retval] IHTMLDOMNode **node);
+
+    [id(DISPID_IHTMLDOMNODE3_IE9_REMOVECHILD)]
+    HRESULT removeChild(
+        [in] IHTMLDOMNode *oldChild,
+        [out, retval] IHTMLDOMNode **node);
+
+    [id(DISPID_IHTMLDOMNODE3_IE9_REPLACECHILD)]
+    HRESULT replaceChild(
+        [in] IHTMLDOMNode *newChild,
+        [in] IHTMLDOMNode *oldChild,
+        [out, retval] IHTMLDOMNode **node);
+
+    [id(DISPID_IHTMLDOMNODE3_ISSAMENODE)]
+    HRESULT isSameNode(
+        [in] IHTMLDOMNode3 *otherNode,
+        [out, retval] VARIANT_BOOL *isSame);
+
+    [id(DISPID_IHTMLDOMNODE3_COMPAREDOCUMENTPOSITION)]
+    HRESULT compareDocumentPosition(
+        [in] IHTMLDOMNode *otherNode,
+        [out, retval] USHORT *flags);
+
+    [id(DISPID_IHTMLDOMNODE3_ISSUPPORTED)]
+    HRESULT isSupported(
+        [in] BSTR feature,
+        [in] VARIANT version,
+        [out, retval] VARIANT_BOOL *pfisSupported);
+}
+
 /*****************************************************************************
  *    IHTMLDOMAttribute interface
  */
@@ -7154,6 +7238,103 @@ interface IHTMLTxtRange : IDispatch
         [retval, out] VARIANT_BOOL *pfRet);
 }
 
+/*****************************************************************************
+ *    IHTMLDOMRange interface
+ */
+[
+    odl,
+    oleautomation,
+    dual,
+    uuid(305104ae-98b5-11cf-bb82-00aa00bdce0b)
+]
+interface IHTMLDOMRange : IDispatch
+{
+    [propget, id(DISPID_IHTMLDOMRANGE_STARTCONTAINER)]
+    HRESULT startContainer([out, retval] IHTMLDOMNode **p);
+
+    [propget, id(DISPID_IHTMLDOMRANGE_STARTOFFSET)]
+    HRESULT startOffset([out, retval] long *p);
+
+    [propget, id(DISPID_IHTMLDOMRANGE_ENDCONTAINER)]
+    HRESULT endContainer([out, retval] IHTMLDOMNode **p);
+
+    [propget, id(DISPID_IHTMLDOMRANGE_ENDOFFSET)]
+    HRESULT endOffset([out, retval] long *p);
+
+    [propget, id(DISPID_IHTMLDOMRANGE_COLLAPSED)]
+    HRESULT collapsed([out, retval] VARIANT_BOOL *p);
+
+    [propget, id(DISPID_IHTMLDOMRANGE_COMMONANCESTORCONTAINER)]
+    HRESULT commonAncestorContainer([out, retval] IHTMLDOMNode **p);
+
+    [id(DISPID_IHTMLDOMRANGE_SETSTART)]
+    HRESULT setStart(
+        [in] IDispatch *refNode,
+        [in] long offset);
+
+    [id(DISPID_IHTMLDOMRANGE_SETEND)] HRESULT
+    setEnd(
+        [in] IDispatch *refNode,
+        [in] long offset);
+
+    [id(DISPID_IHTMLDOMRANGE_SETSTARTBEFORE)]
+    HRESULT setStartBefore([in] IDispatch* refNode);
+
+    [id(DISPID_IHTMLDOMRANGE_SETSTARTAFTER)]
+    HRESULT setStartAfter([in] IDispatch *refNode);
+
+    [id(DISPID_IHTMLDOMRANGE_SETENDBEFORE)]
+    HRESULT setEndBefore([in] IDispatch *refNode);
+
+    [id(DISPID_IHTMLDOMRANGE_SETENDAFTER)]
+    HRESULT setEndAfter([in] IDispatch *refNode);
+
+    [id(DISPID_IHTMLDOMRANGE_COLLAPSE)]
+    HRESULT collapse([in] VARIANT_BOOL toStart);
+
+    [id(DISPID_IHTMLDOMRANGE_SELECTNODE)]
+    HRESULT selectNode([in] IDispatch *refNode);
+
+    [id(DISPID_IHTMLDOMRANGE_SELECTNODECONTENTS)]
+    HRESULT selectNodeContents([in] IDispatch *refNode);
+
+    [id(DISPID_IHTMLDOMRANGE_COMPAREBOUNDARYPOINTS)]
+    HRESULT compareBoundaryPoints(
+        [in] short how,
+        [in] IDispatch *sourceRange,
+        [out, retval] long *compareResult);
+
+    [id(DISPID_IHTMLDOMRANGE_DELETECONTENTS)]
+    HRESULT deleteContents();
+
+    [id(DISPID_IHTMLDOMRANGE_EXTRACTCONTENTS)]
+    HRESULT extractContents([out, retval] IDispatch **ppDocumentFragment);
+
+    [id(DISPID_IHTMLDOMRANGE_CLONECONTENTS)]
+    HRESULT cloneContents([out, retval] IDispatch **ppDocumentFragment);
+
+    [id(DISPID_IHTMLDOMRANGE_INSERTNODE)]
+    HRESULT insertNode([in] IDispatch *newNode);
+
+    [id(DISPID_IHTMLDOMRANGE_SURROUNDCONTENTS)]
+    HRESULT surroundContents([in] IDispatch *newParent);
+
+    [id(DISPID_IHTMLDOMRANGE_CLONERANGE)]
+    HRESULT cloneRange([out, retval] IHTMLDOMRange **ppClonedRange);
+
+    [id(DISPID_IHTMLDOMRANGE_TOSTRING)]
+    HRESULT toString([out, retval] BSTR *pRangeString);
+
+    [id(DISPID_IHTMLDOMRANGE_DETACH)]
+    HRESULT detach();
+
+    [id(DISPID_IHTMLDOMRANGE_GETCLIENTRECTS)]
+    HRESULT getClientRects([out, retval] IHTMLRectCollection **ppRectCol);
+
+    [id(DISPID_IHTMLDOMRANGE_GETBOUNDINGCLIENTRECT)]
+    HRESULT getBoundingClientRect([out, retval] IHTMLRect **ppRect);
+}
+
 [
     noncreatable,
     uuid(3050f37f-98b5-11cf-bb82-00aa00bdce0b)
@@ -9312,6 +9493,70 @@ interface IHTMLSelectionObject : IDispatch
     HRESULT type([retval, out] BSTR *p);
 }
 
+/*****************************************************************************
+ *    IHTMLSelection interface
+ */
+[
+    odl,
+    oleautomation,
+    dual,
+    uuid(305104b6-98b5-11cf-bb82-00aa00bdce0b)
+]
+interface IHTMLSelection : IDispatch
+{
+    [propget, id(DISPID_IHTMLSELECTION_ANCHORNODE)]
+    HRESULT anchorNode([out, retval] IHTMLDOMNode **p);
+
+    [propget, id(DISPID_IHTMLSELECTION_ANCHOROFFSET)]
+    HRESULT anchorOffset([out, retval] long *p);
+
+    [propget, id(DISPID_IHTMLSELECTION_FOCUSNODE)]
+    HRESULT focusNode([out, retval] IHTMLDOMNode **p);
+
+    [propget, id(DISPID_IHTMLSELECTION_FOCUSOFFSET)]
+    HRESULT focusOffset([out, retval] long *p);
+
+    [propget, id(DISPID_IHTMLSELECTION_ISCOLLAPSED)]
+    HRESULT isCollapsed([out, retval] VARIANT_BOOL *p);
+
+    [id(DISPID_IHTMLSELECTION_COLLAPSE)]
+    HRESULT collapse(
+        [in] IDispatch *parentNode,
+        [in] long offfset);
+
+    [id(DISPID_IHTMLSELECTION_COLLAPSETOSTART)]
+    HRESULT collapseToStart();
+
+    [id(DISPID_IHTMLSELECTION_COLLAPSETOEND)]
+    HRESULT collapseToEnd();
+
+    [id(DISPID_IHTMLSELECTION_SELECTALLCHILDREN)]
+    HRESULT selectAllChildren([in] IDispatch *parentNode);
+
+    [id(DISPID_IHTMLSELECTION_DELETEFROMDOCUMENT)]
+    HRESULT deleteFromDocument();
+
+    [propget, id(DISPID_IHTMLSELECTION_RANGECOUNT)]
+    HRESULT rangeCount([out, retval] long *p);
+
+    [id(DISPID_IHTMLSELECTION_GETRANGEAT)]
+    HRESULT getRangeAt(
+        [in] long index,
+        [out, retval] IHTMLDOMRange **ppRange);
+
+    [id(DISPID_IHTMLSELECTION_ADDRANGE)]
+    HRESULT addRange([in] IDispatch *range);
+
+    [id(DISPID_IHTMLSELECTION_REMOVERANGE)]
+    HRESULT removeRange([in] IDispatch *range);
+
+    [id(DISPID_IHTMLSELECTION_REMOVEALLRANGES)]
+    HRESULT removeAllRanges();
+
+    [id(DISPID_IHTMLSELECTION_TOSTRING)]
+    HRESULT toString([out, retval] BSTR *pSelectionString);
+}
+
 /*****************************************************************************
  *    IHTMLOptionElement interface
  */
@@ -13341,6 +13586,27 @@ methods:
     void onselect([in] IHTMLEventObj* pEvtObj);
 }
 
+/*****************************************************************************
+ *    IDOMProcessingInstruction interface
+ */
+[
+    odl,
+    oleautomation,
+    dual,
+    uuid(30510742-98b5-11cf-bb82-00aa00bdce0b)
+]
+interface IDOMProcessingInstruction : IDispatch
+{
+    [propget, id(DISPID_IDOMPROCESSINGINSTRUCTION_TARGET)]
+    HRESULT target([out, retval] BSTR *p);
+
+    [propput, id(DISPID_IDOMPROCESSINGINSTRUCTION_DATA)]
+    HRESULT data([in] BSTR v);
+
+    [propget, id(DISPID_IDOMPROCESSINGINSTRUCTION_DATA)]
+    HRESULT data([out, retval] BSTR *p);
+}
+
 /*****************************************************************************
  *    IHTMLDocument interface
  */
@@ -14046,6 +14312,355 @@ interface IHTMLDocument6 : IDispatch
     HRESULT updateSettings();
 }
 
+/*****************************************************************************
+ *    IHTMLDocument7 interface
+ */
+[
+    odl,
+    oleautomation,
+    dual,
+    uuid(305104b8-98b5-11cf-bb82-00aa00bdce0b)
+]
+interface IHTMLDocument7 : IDispatch
+{
+    [propget, id(DISPID_IHTMLDOCUMENT7_DEFAULTVIEW)]
+    HRESULT defaultView([out, retval] IHTMLWindow2 **p);
+
+    [id(DISPID_IHTMLDOCUMENT7_CREATECDATASECTION)]
+    HRESULT createCDATASection(
+        [in] BSTR text,
+        [out, retval] IHTMLDOMNode **newCDATASectionNode);
+
+    [id(DISPID_IHTMLDOCUMENT7_GETSELECTION)]
+    HRESULT getSelection([out, retval] IHTMLSelection **ppIHTMLSelection);
+
+    [id(DISPID_IHTMLDOCUMENT7_GETELEMENTSBYTAGNAMENS)]
+    HRESULT getElementsByTagNameNS(
+        [in] VARIANT *pvarNS,
+        [in] BSTR bstrLocalName,
+        [out, retval] IHTMLElementCollection **pelColl);
+
+    [id(DISPID_IHTMLDOCUMENT7_CREATEELEMENTNS)]
+    HRESULT createElementNS(
+        [in] VARIANT *pvarNS,
+        [in] BSTR bstrTag,
+        [out, retval] IHTMLElement **newElem);
+
+    [id(DISPID_IHTMLDOCUMENT7_CREATEATTRIBUTENS)]
+    HRESULT createAttributeNS(
+        [in] VARIANT *pvarNS,
+        [in] BSTR bstrAttrName,
+        [out, retval] IHTMLDOMAttribute **ppAttribute);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONMSTHUMBNAILCLICK), displaybind, bindable]
+    HRESULT onmsthumbnailclick([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONMSTHUMBNAILCLICK), displaybind, bindable]
+    HRESULT onmsthumbnailclick([out, retval] VARIANT *p);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_CHARACTERSET)]
+    HRESULT characterSet([out, retval] BSTR *p);
+
+    [id(DISPID_IHTMLDOCUMENT7_IE9_CREATEELEMENT)]
+    HRESULT createElement(
+        [in] BSTR bstrTag,
+        [out, retval] IHTMLElement **newElem);
+
+    [id(DISPID_IHTMLDOCUMENT7_IE9_CREATEATTRIBUTE)]
+    HRESULT createAttribute(
+        [in] BSTR bstrAttrName,
+        [out, retval] IHTMLDOMAttribute **ppAttribute);
+
+    [id(DISPID_IHTMLDOCUMENT7_GETELEMENTSBYCLASSNAME)]
+    HRESULT getElementsByClassName(
+        [in] BSTR v,
+        [out, retval] IHTMLElementCollection **pel);
+
+    [id(DISPID_IHTMLDOCUMENT7_CREATEPROCESSINGINSTRUCTION)]
+    HRESULT createProcessingInstruction(
+        [in] BSTR bstrTarget,
+        [in] BSTR bstrData,
+        [out, retval] IDOMProcessingInstruction **newProcessingInstruction);
+
+    [id(DISPID_IHTMLDOCUMENT7_ADOPTNODE)]
+    HRESULT adoptNode(
+        [in] IHTMLDOMNode *pNodeSource,
+        [out, retval] IHTMLDOMNode3 **ppNodeDest);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONMSSITEMODEJUMPLISTITEMREMOVED), displaybind, bindable]
+    HRESULT onmssitemodejumplistitemremoved([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONMSSITEMODEJUMPLISTITEMREMOVED), displaybind, bindable]
+    HRESULT onmssitemodejumplistitemremoved([out, retval] VARIANT *p);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_IE9_ALL)]
+    HRESULT all([out, retval] IHTMLElementCollection **p);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_INPUTENCODING)]
+    HRESULT inputEncoding([out, retval] BSTR *p);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_XMLENCODING)]
+    HRESULT xmlEncoding([out, retval] BSTR *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_XMLSTANDALONE)]
+    HRESULT xmlStandalone([in] VARIANT_BOOL v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_XMLSTANDALONE)]
+    HRESULT xmlStandalone([out, retval] VARIANT_BOOL *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_XMLVERSION)]
+    HRESULT xmlVersion([in] BSTR v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_XMLVERSION)]
+    HRESULT xmlVersion([out, retval] BSTR *p);
+
+    [id(DISPID_IHTMLDOCUMENT7_HASATTRIBUTES)]
+    HRESULT hasAttributes([out, retval] VARIANT_BOOL *pfHasAttributes);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONABORT), displaybind, bindable]
+    HRESULT onabort([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONABORT), displaybind, bindable]
+    HRESULT onabort([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONBLUR), displaybind, bindable]
+    HRESULT onblur([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONBLUR), displaybind, bindable]
+    HRESULT onblur([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONCANPLAY), displaybind, bindable]
+    HRESULT oncanplay([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONCANPLAY), displaybind, bindable]
+    HRESULT oncanplay([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONCANPLAYTHROUGH), displaybind, bindable]
+    HRESULT oncanplaythrough([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONCANPLAYTHROUGH), displaybind, bindable]
+    HRESULT oncanplaythrough([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONCHANGE), displaybind, bindable]
+    HRESULT onchange([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONCHANGE), displaybind, bindable]
+    HRESULT onchange([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONDRAG), displaybind, bindable]
+    HRESULT ondrag([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONDRAG), displaybind, bindable]
+    HRESULT ondrag([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONDRAGEND), displaybind, bindable]
+    HRESULT ondragend([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONDRAGEND), displaybind, bindable]
+    HRESULT ondragend([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONDRAGENTER), displaybind, bindable]
+    HRESULT ondragenter([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONDRAGENTER), displaybind, bindable]
+    HRESULT ondragenter([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONDRAGLEAVE), displaybind, bindable]
+    HRESULT ondragleave([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONDRAGLEAVE), displaybind, bindable]
+    HRESULT ondragleave([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONDRAGOVER), displaybind, bindable]
+    HRESULT ondragover([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONDRAGOVER), displaybind, bindable]
+    HRESULT ondragover([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONDROP), displaybind, bindable]
+    HRESULT ondrop([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONDROP), displaybind, bindable]
+    HRESULT ondrop([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONDURATIONCHANGE), displaybind, bindable]
+    HRESULT ondurationchange([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONDURATIONCHANGE), displaybind, bindable]
+    HRESULT ondurationchange([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONEMPTIED), displaybind, bindable]
+    HRESULT onemptied([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONEMPTIED), displaybind, bindable]
+    HRESULT onemptied([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONENDED), displaybind, bindable]
+    HRESULT onended([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONENDED), displaybind, bindable]
+    HRESULT onended([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONERROR), displaybind, bindable]
+    HRESULT onerror([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONERROR), displaybind, bindable]
+    HRESULT onerror([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONFOCUS), displaybind, bindable]
+    HRESULT onfocus([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONFOCUS), displaybind, bindable]
+    HRESULT onfocus([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONINPUT), displaybind, bindable]
+    HRESULT oninput([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONINPUT), displaybind, bindable]
+    HRESULT oninput([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONLOAD), displaybind, bindable]
+    HRESULT onload([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONLOAD), displaybind, bindable]
+    HRESULT onload([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONLOADEDDATA), displaybind, bindable]
+    HRESULT onloadeddata([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONLOADEDDATA), displaybind, bindable]
+    HRESULT onloadeddata([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONLOADEDMETADATA), displaybind, bindable]
+    HRESULT onloadedmetadata([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONLOADEDMETADATA), displaybind, bindable]
+    HRESULT onloadedmetadata([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONLOADSTART), displaybind, bindable]
+    HRESULT onloadstart([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONLOADSTART), displaybind, bindable]
+    HRESULT onloadstart([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONPAUSE), displaybind, bindable]
+    HRESULT onpause([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONPAUSE), displaybind, bindable]
+    HRESULT onpause([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONPLAY), displaybind, bindable]
+    HRESULT onplay([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONPLAY), displaybind, bindable]
+    HRESULT onplay([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONPLAYING), displaybind, bindable]
+    HRESULT onplaying([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONPLAYING), displaybind, bindable]
+    HRESULT onplaying([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONPROGRESS), displaybind, bindable]
+    HRESULT onprogress([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONPROGRESS), displaybind, bindable]
+    HRESULT onprogress([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONRATECHANGE), displaybind, bindable]
+    HRESULT onratechange([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONRATECHANGE), displaybind, bindable]
+    HRESULT onratechange([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONRESET), displaybind, bindable]
+    HRESULT onreset([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONRESET), displaybind, bindable]
+    HRESULT onreset([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONSCROLL), displaybind, bindable]
+    HRESULT onscroll([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONSCROLL), displaybind, bindable]
+    HRESULT onscroll([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONSEEKED), displaybind, bindable]
+    HRESULT onseeked([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONSEEKED), displaybind, bindable]
+    HRESULT onseeked([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONSEEKING), displaybind, bindable]
+    HRESULT onseeking([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONSEEKING), displaybind, bindable]
+    HRESULT onseeking([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONSELECT), displaybind, bindable]
+    HRESULT onselect([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONSELECT), displaybind, bindable]
+    HRESULT onselect([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONSTALLED), displaybind, bindable]
+    HRESULT onstalled([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONSTALLED), displaybind, bindable]
+    HRESULT onstalled([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONSUBMIT), displaybind, bindable]
+    HRESULT onsubmit([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONSUBMIT), displaybind, bindable]
+    HRESULT onsubmit([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONSUSPEND), displaybind, bindable]
+    HRESULT onsuspend([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONSUSPEND), displaybind, bindable]
+    HRESULT onsuspend([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONTIMEUPDATE), displaybind, bindable]
+    HRESULT ontimeupdate([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONTIMEUPDATE), displaybind, bindable]
+    HRESULT ontimeupdate([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONVOLUMECHANGE), displaybind, bindable]
+    HRESULT onvolumechange([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONVOLUMECHANGE), displaybind, bindable]
+    HRESULT onvolumechange([out, retval] VARIANT *p);
+
+    [propput, id(DISPID_IHTMLDOCUMENT7_ONWAITING), displaybind, bindable]
+    HRESULT onwaiting([in] VARIANT v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_ONWAITING), displaybind, bindable]
+    HRESULT onwaiting([out, retval] VARIANT *p);
+
+    [id(DISPID_IHTMLDOCUMENT7_NORMALIZE)]
+    HRESULT normalize();
+
+    [id(DISPID_IHTMLDOCUMENT7_IMPORTNODE)]
+    HRESULT importNode(
+        [in] IHTMLDOMNode *pNodeSource,
+        [in] VARIANT_BOOL fDeep,
+        [out, retval] IHTMLDOMNode3 **ppNodeDest);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_IE9_PARENTWINDOW)]
+    HRESULT parentWindow([out, retval] IHTMLWindow2 **p);
+
+    [propputref, id(DISPID_IHTMLDOCUMENT7_IE9_BODY)]
+    HRESULT body([in] IHTMLElement *v);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_IE9_BODY)]
+    HRESULT body([out, retval] IHTMLElement **p);
+
+    [propget, id(DISPID_IHTMLDOCUMENT7_HEAD)]
+    HRESULT head([out, retval] IHTMLElement **p);
+}
+
 /*****************************************************************************
  *    DispHTMLDocument dispinterface
  */
@@ -18520,3 +19135,55 @@ interface IHTMLPrivateWindow : IUnknown
     HRESULT FindWindowByName(LPCWSTR name, IHTMLWindow2 **ret);
     HRESULT GetAddressBarUrl(BSTR *url);
 }
+
+/*****************************************************************************
+ *    IWebBrowserPriv interface
+ */
+[
+    object,
+    uuid(3050f804-98b5-11cf-bb82-00aa00bdce0b),
+    local
+]
+interface IWebBrowserPriv : IUnknown
+{
+    HRESULT NavigateWithBindCtx(VARIANT *uri, VARIANT *flags, VARIANT *target_frame, VARIANT *post_data,
+            VARIANT *headers, IBindCtx *bind_ctx, LPOLESTR url_fragment);
+    HRESULT OnClose();
+}
+
+/*****************************************************************************
+ *    IWebBrowserPriv2IE8 interface
+ */
+[
+    object,
+    uuid(3ed72303-6ffc-4214-ba90-faf1862dec8a),
+    local
+]
+interface IWebBrowserPriv2IE8 : IUnknown
+{
+  HRESULT NavigateWithBindCtx2(IUri *uri, VARIANT *flags, VARIANT *target_frame, VARIANT *post_data,
+          VARIANT *headers, IBindCtx *bind_ctx, LPOLESTR url_fragment);
+  HRESULT SetBrowserFrameOptions(DWORD opt1, DWORD opt2);
+  HRESULT DetachConnectionPoints();
+  HRESULT GetProcessId(DWORD *pid);
+  HRESULT CompatAttachEditEvents();
+  HRESULT HandleOpenOptions(IUnknown *obj, BSTR bstr, int options);
+  HRESULT SetSearchTerm(BSTR term);
+  HRESULT GetSearchTerm(BSTR *term);
+  HRESULT GetCurrentDocument(IDispatch** doc);
+}
+
+/*****************************************************************************
+ *    IWebBrowserPriv2IE9 interface
+ */
+[
+    object,
+    uuid(3ed72303-6ffc-4214-ba90-faf1862dec8a),
+    local
+]
+interface IWebBrowserPriv2IE9 : IUnknown
+{
+    HRESULT NavigateWithBindCtx2(IUri *uri, VARIANT *flags, VARIANT *target_frame, VARIANT *post_data,
+            VARIANT *headers, IBindCtx *bind_ctx, LPOLESTR url_fragment, DWORD unused);
+    /* Probably more */
+}
index 0ffce1f..89c36b1 100644 (file)
@@ -117,7 +117,7 @@ reactos/dll/win32/msctf               # Synced to Wine-1.7.17
 reactos/dll/win32/msftedit            # Synced to Wine-1.7.1
 reactos/dll/win32/msg711.acm          # Synced to Wine-1.7.1
 reactos/dll/win32/msgsm32.acm         # Synced to Wine-1.7.17
-reactos/dll/win32/mshtml              # Synced to Wine-1.7.1
+reactos/dll/win32/mshtml              # Synced to Wine-1.7.17
 reactos/dll/win32/mshtml.tlb          # Synced to Wine-1.7.17
 reactos/dll/win32/msi                 # Synced to Wine-1.7.17
 reactos/dll/win32/msimg32             # Synced to Wine-1.7.1