Author: cwittich
Date: Sat May 29 16:54:55 2010
New Revision: 47416
URL:
http://svn.reactos.org/svn/reactos?rev=47416&view=rev
Log:
[MSHTML]
-sync to wine 1.2 RC2
-add ros_diff.patch
Added:
trunk/reactos/dll/win32/mshtml/ros_diff.patch (with props)
Modified:
trunk/reactos/dll/win32/mshtml/Nl.rc
trunk/reactos/dll/win32/mshtml/Ru.rc
trunk/reactos/dll/win32/mshtml/htmlbody.c
trunk/reactos/dll/win32/mshtml/htmldoc.c
trunk/reactos/dll/win32/mshtml/htmldoc3.c
trunk/reactos/dll/win32/mshtml/htmlelem.c
trunk/reactos/dll/win32/mshtml/htmlevent.c
trunk/reactos/dll/win32/mshtml/htmlevent.h
trunk/reactos/dll/win32/mshtml/htmlform.c
trunk/reactos/dll/win32/mshtml/htmlinput.c
trunk/reactos/dll/win32/mshtml/htmloption.c
trunk/reactos/dll/win32/mshtml/htmlselect.c
trunk/reactos/dll/win32/mshtml/htmltextarea.c
trunk/reactos/dll/win32/mshtml/htmlwindow.c
trunk/reactos/dll/win32/mshtml/mshtml_private.h
trunk/reactos/dll/win32/mshtml/nsembed.c
trunk/reactos/dll/win32/mshtml/nsiface.idl
trunk/reactos/dll/win32/mshtml/nsio.c
trunk/reactos/dll/win32/mshtml/secmgr.c
trunk/reactos/dll/win32/mshtml/task.c
Modified: trunk/reactos/dll/win32/mshtml/Nl.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/Nl.rc?rev…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/Nl.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/Nl.rc [iso-8859-1] Sat May 29 16:54:55 2010
@@ -35,9 +35,9 @@
CAPTION "Wine-Gecko-Installatie"
FONT 8, "MS Shell Dlg"
{
- LTEXT "Wine could not find a Gecko package which is needed for applications
embedding HTML " \
- "to work correctly. Wine can automatically download and install it for
you.\n\n" \
- "Note: it's recommended to use distro packages instead. See
http://wiki.winehq.org/Gecko for details.",
+ LTEXT "Wine kon geen Gecko pakket vinden. Gecko is nodig voor programma's
die gebruik maken " \
+ "van embedded HTML. Wine kan het automatisch voor u downloaden en
installeren.\n\n" \
+ "Noot: het is aanbevolen om distro pakketten te gebruiken. Zie
http://wiki.winehq.org/Gecko voor details.",
ID_DWL_STATUS, 10, 10, 240, 50, SS_LEFT
CONTROL "Voortgang", ID_DWL_PROGRESS, PROGRESS_CLASSA,
WS_BORDER|PBS_SMOOTH, 10, 50, 240, 12
DEFPUSHBUTTON "&Installeren", ID_DWL_INSTALL, 200, 70, 50, 15, WS_GROUP
| WS_TABSTOP
Modified: trunk/reactos/dll/win32/mshtml/Ru.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/Ru.rc?rev…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/Ru.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/Ru.rc [iso-8859-1] Sat May 29 16:54:55 2010
@@ -36,10 +36,12 @@
CAPTION "УÑÑановка Wine Gecko"
FONT 8, "MS Shell Dlg"
{
- LTEXT "Wine не Ð¼Ð¾Ð¶ÐµÑ Ð½Ð°Ð¹Ñи Ð¿Ð°ÐºÐµÑ Gecko коÑоÑÑй
нÑжен Ð´Ð»Ñ Ð¿Ñиложений Ñо вÑÑÑоеннÑм HTML " \
- "Ð´Ð»Ñ ÐºÐ¾ÑÑекÑной ÑабоÑÑ. Wine можеÑ
авÑомаÑиÑеÑки загÑÑзиÑÑ Ð¸ ÑÑÑановиÑÑ ÐµÐ³Ð¾ длÑ
ÐаÑ.\n\n" \
- "ÐÑимеÑание: Рекомендовано иÑполÑзоваÑÑ
Ð¿Ð°ÐºÐµÑ Ð¸Ð· ÐаÑего диÑÑÑибÑÑива. ÐоÑеÑиÑе
http://wiki.winehq.org/Gecko Ð´Ð»Ñ Ð´ÐµÑалей.",
- ID_DWL_STATUS, 10, 10, 240, 50, SS_LEFT
+ LTEXT "Wine не Ð¼Ð¾Ð¶ÐµÑ Ð½Ð°Ð¹Ñи Ð¿Ð°ÐºÐµÑ Gecko, коÑоÑÑй
необÑ
одим Ð´Ð»Ñ ÐºÐ¾ÑÑекÑной ÑабоÑÑ Ð¿Ñиложений"\
+ "Ñ Ð¿Ð¾Ð´Ð´ÐµÑжкой HTML. " \
+ "Wine Ð¼Ð¾Ð¶ÐµÑ Ð°Ð²ÑомаÑиÑеÑки загÑÑзиÑÑ Ð¸
ÑÑÑановиÑÑ ÐµÐ³Ð¾ Ð´Ð»Ñ Ð²Ð°Ñ.\n\n" \
+ "ÐÑимеÑание: ÑекомендÑеÑÑÑ Ð¸ÑполÑзоваÑÑ
пакеÑ, пÑедоÑÑавлÑемÑй ваÑим диÑÑÑибÑÑивом. "\
+ "ÐоÑеÑиÑе
http://wiki.winehq.org/Gecko Ð´Ð»Ñ Ð¿Ð¾Ð»ÑÑениÑ
более подÑобной инÑоÑмаÑии.",
+ ID_DWL_STATUS, 10, 10, 240, 70, SS_LEFT
CONTROL "ÐÑогÑеÑÑ", ID_DWL_PROGRESS, PROGRESS_CLASSA,
WS_BORDER|PBS_SMOOTH, 10, 65, 240, 12
DEFPUSHBUTTON "&УÑÑановиÑÑ", ID_DWL_INSTALL, 180, 85, 70, 15,
WS_GROUP | WS_TABSTOP
PUSHBUTTON "&ÐÑмена", IDCANCEL, 100, 85, 70, 15, WS_GROUP |
WS_TABSTOP
Modified: trunk/reactos/dll/win32/mshtml/htmlbody.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/htmlbody.…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/htmlbody.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/htmlbody.c [iso-8859-1] Sat May 29 16:54:55 2010
@@ -434,6 +434,10 @@
nsres = nsIDOMHTMLBodyElement_SetText(This->nsbody, &text);
nsAString_Finish(&text);
+ if(NS_FAILED(nsres)) {
+ ERR("SetText failed: %08x\n", nsres);
+ return E_FAIL;
+ }
return S_OK;
}
@@ -462,7 +466,7 @@
nsAString_Finish(&text);
- return S_OK;
+ return hres;
}
static HRESULT WINAPI HTMLBodyElement_put_link(IHTMLBodyElement *iface, VARIANT v)
Modified: trunk/reactos/dll/win32/mshtml/htmldoc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/htmldoc.c…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/htmldoc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/htmldoc.c [iso-8859-1] Sat May 29 16:54:55 2010
@@ -889,8 +889,25 @@
static HRESULT WINAPI HTMLDocument_clear(IHTMLDocument2 *iface)
{
HTMLDocument *This = HTMLDOC_THIS(iface);
- FIXME("(%p)\n", This);
- return E_NOTIMPL;
+ nsIDOMNSHTMLDocument *nsdoc;
+ nsresult nsres;
+
+ TRACE("(%p)\n", This);
+
+ nsres = nsIDOMHTMLDocument_QueryInterface(This->doc_node->nsdoc,
&IID_nsIDOMNSHTMLDocument, (void**)&nsdoc);
+ if(NS_FAILED(nsres)) {
+ ERR("Could not get nsIDOMNSHTMLDocument iface: %08x\n", nsres);
+ return E_FAIL;
+ }
+
+ nsres = nsIDOMNSHTMLDocument_Clear(nsdoc);
+ nsIDOMNSHTMLDocument_Release(nsdoc);
+ if(NS_FAILED(nsres)) {
+ ERR("Clear failed: %08x\n", nsres);
+ return E_FAIL;
+ }
+
+ return S_OK;
}
static HRESULT WINAPI HTMLDocument_queryCommandSupported(IHTMLDocument2 *iface, BSTR
cmdID,
Modified: trunk/reactos/dll/win32/mshtml/htmldoc3.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/htmldoc3.…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/htmldoc3.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/htmldoc3.c [iso-8859-1] Sat May 29 16:54:55 2010
@@ -308,15 +308,19 @@
static HRESULT WINAPI HTMLDocument3_put_oncontextmenu(IHTMLDocument3 *iface, VARIANT v)
{
HTMLDocument *This = HTMLDOC3_THIS(iface);
- FIXME("(%p)->()\n", This);
- return E_NOTIMPL;
+
+ TRACE("(%p)->()\n", This);
+
+ return set_doc_event(This, EVENTID_CONTEXTMENU, &v);
}
static HRESULT WINAPI HTMLDocument3_get_oncontextmenu(IHTMLDocument3 *iface, VARIANT *p)
{
HTMLDocument *This = HTMLDOC3_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ return get_doc_event(This, EVENTID_CONTEXTMENU, p);
}
static HRESULT WINAPI HTMLDocument3_put_onstop(IHTMLDocument3 *iface, VARIANT v)
Modified: trunk/reactos/dll/win32/mshtml/htmlelem.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/htmlelem.…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/htmlelem.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/htmlelem.c [iso-8859-1] Sat May 29 16:54:55 2010
@@ -1803,13 +1803,11 @@
{
HTMLFiltersCollection *This = HTMLFILTERSCOLLECTION_THIS(iface);
+ if(!p)
+ return E_POINTER;
+
FIXME("(%p)->(%p) Always returning 0\n", This, p);
-
- if(!p)
- return E_POINTER;
-
- if(p)
- *p = 0;
+ *p = 0;
return S_OK;
}
Modified: trunk/reactos/dll/win32/mshtml/htmlevent.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/htmlevent…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/htmlevent.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/htmlevent.c [iso-8859-1] Sat May 29 16:54:55 2010
@@ -56,6 +56,9 @@
static const WCHAR clickW[] =
{'c','l','i','c','k',0};
static const WCHAR onclickW[] =
{'o','n','c','l','i','c','k',0};
+static const WCHAR contextmenuW[] =
{'c','o','n','t','e','x','t','m','e','n','u',0};
+static const WCHAR oncontextmenuW[] =
{'o','n','c','o','n','t','e','x','t','m','e','n','u',0};
+
static const WCHAR dblclickW[] =
{'d','b','l','c','l','i','c','k',0};
static const WCHAR ondblclickW[] =
{'o','n','d','b','l','c','l','i','c','k',0};
@@ -141,6 +144,8 @@
EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{clickW, onclickW, EVENTT_MOUSE, DISPID_EVMETH_ONCLICK,
EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
+ {contextmenuW, oncontextmenuW, EVENTT_MOUSE,
DISPID_EVMETH_ONCONTEXTMENU,
+ EVENT_BUBBLE},
{dblclickW, ondblclickW, EVENTT_MOUSE, DISPID_EVMETH_ONDBLCLICK,
EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
{dragW, ondragW, EVENTT_MOUSE, DISPID_EVMETH_ONDRAG,
@@ -283,16 +288,14 @@
static HRESULT WINAPI HTMLEventObj_GetTypeInfoCount(IHTMLEventObj *iface, UINT *pctinfo)
{
HTMLEventObj *This = HTMLEVENTOBJ_THIS(iface);
- FIXME("(%p)->(%p)\n", This, pctinfo);
- return E_NOTIMPL;
+ return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo);
}
static HRESULT WINAPI HTMLEventObj_GetTypeInfo(IHTMLEventObj *iface, UINT iTInfo,
LCID lcid, ITypeInfo **ppTInfo)
{
HTMLEventObj *This = HTMLEVENTOBJ_THIS(iface);
- FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
- return E_NOTIMPL;
+ return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid,
ppTInfo);
}
static HRESULT WINAPI HTMLEventObj_GetIDsOfNames(IHTMLEventObj *iface, REFIID riid,
@@ -300,9 +303,7 @@
LCID lcid, DISPID *rgDispId)
{
HTMLEventObj *This = HTMLEVENTOBJ_THIS(iface);
- FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames,
cNames,
- lcid, rgDispId);
- return E_NOTIMPL;
+ return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames,
cNames, lcid, rgDispId);
}
static HRESULT WINAPI HTMLEventObj_Invoke(IHTMLEventObj *iface, DISPID dispIdMember,
@@ -310,9 +311,8 @@
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
{
HTMLEventObj *This = HTMLEVENTOBJ_THIS(iface);
- FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember,
debugstr_guid(riid),
- lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
- return E_NOTIMPL;
+ return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid,
lcid,
+ wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
}
static HRESULT WINAPI HTMLEventObj_get_srcElement(IHTMLEventObj *iface, IHTMLElement
**p)
Modified: trunk/reactos/dll/win32/mshtml/htmlevent.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/htmlevent…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/htmlevent.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/htmlevent.h [iso-8859-1] Sat May 29 16:54:55 2010
@@ -21,6 +21,7 @@
EVENTID_BLUR,
EVENTID_CHANGE,
EVENTID_CLICK,
+ EVENTID_CONTEXTMENU,
EVENTID_DBLCLICK,
EVENTID_DRAG,
EVENTID_DRAGSTART,
Modified: trunk/reactos/dll/win32/mshtml/htmlform.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/htmlform.…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/htmlform.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/htmlform.c [iso-8859-1] Sat May 29 16:54:55 2010
@@ -41,6 +41,41 @@
#define HTMLFORM(x) (&(x)->lpHTMLFormElementVtbl)
+static HRESULT htmlform_item(HTMLFormElement *This, int i, IDispatch **ret)
+{
+ nsIDOMHTMLCollection *elements;
+ nsIDOMNode *item;
+ HTMLDOMNode *node;
+ nsresult nsres;
+
+ nsres = nsIDOMHTMLFormElement_GetElements(This->nsform, &elements);
+ if(NS_FAILED(nsres)) {
+ FIXME("GetElements failed: 0x%08x\n", nsres);
+ return E_FAIL;
+ }
+
+ nsres = nsIDOMHTMLCollection_Item(elements, i, &item);
+ nsIDOMHTMLCollection_Release(elements);
+ if(NS_FAILED(nsres)) {
+ FIXME("Item failed: 0x%08x\n", nsres);
+ return E_FAIL;
+ }
+
+ if(item) {
+ node = get_node(This->element.node.doc, item, TRUE);
+ if(!node)
+ return E_OUTOFMEMORY;
+
+ IHTMLDOMNode_AddRef(HTMLDOMNODE(node));
+ nsIDOMNode_Release(item);
+ *ret = (IDispatch*)HTMLDOMNODE(node);
+ }else {
+ *ret = NULL;
+ }
+
+ return S_OK;
+}
+
#define HTMLFORM_THIS(iface) DEFINE_THIS(HTMLFormElement, HTMLFormElement, iface)
static HRESULT WINAPI HTMLFormElement_QueryInterface(IHTMLFormElement *iface,
@@ -98,87 +133,115 @@
static HRESULT WINAPI HTMLFormElement_put_action(IHTMLFormElement *iface, BSTR v)
{
HTMLFormElement *This = HTMLFORM_THIS(iface);
+ nsAString action_str;
+ nsresult nsres;
+
+ TRACE("(%p)->(%s)\n", This, wine_dbgstr_w(v));
+
+ nsAString_InitDepend(&action_str, v);
+ nsres = nsIDOMHTMLFormElement_SetAction(This->nsform, &action_str);
+ nsAString_Finish(&action_str);
+ if(NS_FAILED(nsres)) {
+ ERR("SetAction failed: %08x\n", nsres);
+ return E_FAIL;
+ }
+
+ return S_OK;
+}
+
+static HRESULT WINAPI HTMLFormElement_get_action(IHTMLFormElement *iface, BSTR *p)
+{
+ HTMLFormElement *This = HTMLFORM_THIS(iface);
+ nsAString action_str;
+ nsresult nsres;
+ HRESULT hres;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ nsAString_Init(&action_str, NULL);
+ nsres = nsIDOMHTMLFormElement_GetAction(This->nsform, &action_str);
+ if(NS_SUCCEEDED(nsres)) {
+ const PRUnichar *action;
+ nsAString_GetData(&action_str, &action);
+ hres = nsuri_to_url(action, FALSE, p);
+ }else {
+ ERR("GetAction failed: %08x\n", nsres);
+ hres = E_FAIL;
+ }
+
+ return hres;
+}
+
+static HRESULT WINAPI HTMLFormElement_put_dir(IHTMLFormElement *iface, BSTR v)
+{
+ HTMLFormElement *This = HTMLFORM_THIS(iface);
FIXME("(%p)->(%s)\n", This, wine_dbgstr_w(v));
return E_NOTIMPL;
}
-static HRESULT WINAPI HTMLFormElement_get_action(IHTMLFormElement *iface, BSTR *p)
-{
- HTMLFormElement *This = HTMLFORM_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLFormElement_put_dir(IHTMLFormElement *iface, BSTR v)
+static HRESULT WINAPI HTMLFormElement_get_dir(IHTMLFormElement *iface, BSTR *p)
+{
+ HTMLFormElement *This = HTMLFORM_THIS(iface);
+ FIXME("(%p)->(%p)\n", This, p);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLFormElement_put_encoding(IHTMLFormElement *iface, BSTR v)
{
HTMLFormElement *This = HTMLFORM_THIS(iface);
FIXME("(%p)->(%s)\n", This, wine_dbgstr_w(v));
return E_NOTIMPL;
}
-static HRESULT WINAPI HTMLFormElement_get_dir(IHTMLFormElement *iface, BSTR *p)
-{
- HTMLFormElement *This = HTMLFORM_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLFormElement_put_encoding(IHTMLFormElement *iface, BSTR v)
+static HRESULT WINAPI HTMLFormElement_get_encoding(IHTMLFormElement *iface, BSTR *p)
+{
+ HTMLFormElement *This = HTMLFORM_THIS(iface);
+ FIXME("(%p)->(%p)\n", This, p);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLFormElement_put_method(IHTMLFormElement *iface, BSTR v)
{
HTMLFormElement *This = HTMLFORM_THIS(iface);
FIXME("(%p)->(%s)\n", This, wine_dbgstr_w(v));
return E_NOTIMPL;
}
-static HRESULT WINAPI HTMLFormElement_get_encoding(IHTMLFormElement *iface, BSTR *p)
-{
- HTMLFormElement *This = HTMLFORM_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLFormElement_put_method(IHTMLFormElement *iface, BSTR v)
+static HRESULT WINAPI HTMLFormElement_get_method(IHTMLFormElement *iface, BSTR *p)
+{
+ HTMLFormElement *This = HTMLFORM_THIS(iface);
+ FIXME("(%p)->(%p)\n", This, p);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLFormElement_get_elements(IHTMLFormElement *iface, IDispatch
**p)
+{
+ HTMLFormElement *This = HTMLFORM_THIS(iface);
+ FIXME("(%p)->(%p)\n", This, p);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLFormElement_put_target(IHTMLFormElement *iface, BSTR v)
{
HTMLFormElement *This = HTMLFORM_THIS(iface);
FIXME("(%p)->(%s)\n", This, wine_dbgstr_w(v));
return E_NOTIMPL;
}
-static HRESULT WINAPI HTMLFormElement_get_method(IHTMLFormElement *iface, BSTR *p)
-{
- HTMLFormElement *This = HTMLFORM_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLFormElement_get_elements(IHTMLFormElement *iface, IDispatch
**p)
-{
- HTMLFormElement *This = HTMLFORM_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLFormElement_put_target(IHTMLFormElement *iface, BSTR v)
+static HRESULT WINAPI HTMLFormElement_get_target(IHTMLFormElement *iface, BSTR *p)
+{
+ HTMLFormElement *This = HTMLFORM_THIS(iface);
+ FIXME("(%p)->(%p)\n", This, p);
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI HTMLFormElement_put_name(IHTMLFormElement *iface, BSTR v)
{
HTMLFormElement *This = HTMLFORM_THIS(iface);
FIXME("(%p)->(%s)\n", This, wine_dbgstr_w(v));
return E_NOTIMPL;
}
-static HRESULT WINAPI HTMLFormElement_get_target(IHTMLFormElement *iface, BSTR *p)
-{
- HTMLFormElement *This = HTMLFORM_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
-}
-
-static HRESULT WINAPI HTMLFormElement_put_name(IHTMLFormElement *iface, BSTR v)
-{
- HTMLFormElement *This = HTMLFORM_THIS(iface);
- FIXME("(%p)->(%s)\n", This, wine_dbgstr_w(v));
- return E_NOTIMPL;
-}
-
static HRESULT WINAPI HTMLFormElement_get_name(IHTMLFormElement *iface, BSTR *p)
{
HTMLFormElement *This = HTMLFORM_THIS(iface);
@@ -238,8 +301,19 @@
static HRESULT WINAPI HTMLFormElement_get_length(IHTMLFormElement *iface, LONG *p)
{
HTMLFormElement *This = HTMLFORM_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+ PRInt32 length;
+ nsresult nsres;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ nsres = nsIDOMHTMLFormElement_GetLength(This->nsform, &length);
+ if(NS_FAILED(nsres)) {
+ ERR("GetLength failed: %08x\n", nsres);
+ return E_FAIL;
+ }
+
+ *p = length;
+ return S_OK;
}
static HRESULT WINAPI HTMLFormElement__newEnum(IHTMLFormElement *iface, IUnknown **p)
@@ -253,7 +327,20 @@
VARIANT index, IDispatch **pdisp)
{
HTMLFormElement *This = HTMLFORM_THIS(iface);
- FIXME("(%p)->(v v %p)\n", This, pdisp);
+
+ TRACE("(%p)->(%s %s %p)\n", This, debugstr_variant(&name),
debugstr_variant(&index), pdisp);
+
+ if(!pdisp)
+ return E_INVALIDARG;
+ *pdisp = NULL;
+
+ if(V_VT(&name) == VT_I4) {
+ if(V_I4(&name) < 0)
+ return E_INVALIDARG;
+ return htmlform_item(This, V_I4(&name), pdisp);
+ }
+
+ FIXME("Unsupported args\n");
return E_NOTIMPL;
}
@@ -428,34 +515,21 @@
EXCEPINFO *ei, IServiceProvider *caller)
{
HTMLFormElement *This = HTMLFORM_NODE_THIS(iface);
- nsIDOMHTMLCollection *elements;
- nsIDOMNode *item;
- HTMLDOMNode *node;
- nsresult nsres;
+ IDispatch *ret;
+ HRESULT hres;
TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This, id, lcid, flags, params,
res, ei, caller);
- nsres = nsIDOMHTMLFormElement_GetElements(This->nsform, &elements);
- if(NS_FAILED(nsres)) {
- FIXME("GetElements failed: 0x%08x\n", nsres);
- return E_FAIL;
- }
-
- nsres = nsIDOMHTMLCollection_Item(elements, id - MSHTML_DISPID_CUSTOM_MIN,
&item);
- nsIDOMHTMLCollection_Release(elements);
- if(NS_FAILED(nsres)) {
- FIXME("Item failed: 0x%08x\n", nsres);
- return E_FAIL;
- }
-
- node = get_node(This->element.node.doc, item, TRUE);
-
- V_VT(res) = VT_DISPATCH;
- V_DISPATCH(res) = (IDispatch*)node;
-
- IHTMLDOMNode_AddRef(HTMLDOMNODE(node));
- nsIDOMNode_Release(item);
-
+ hres = htmlform_item(This, id - MSHTML_DISPID_CUSTOM_MIN, &ret);
+ if(FAILED(hres))
+ return hres;
+
+ if(ret) {
+ V_VT(res) = VT_DISPATCH;
+ V_DISPATCH(res) = ret;
+ }else {
+ V_VT(res) = VT_NULL;
+ }
return S_OK;
}
Modified: trunk/reactos/dll/win32/mshtml/htmlinput.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/htmlinput…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/htmlinput.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/htmlinput.c [iso-8859-1] Sat May 29 16:54:55 2010
@@ -106,8 +106,24 @@
static HRESULT WINAPI HTMLInputElement_put_type(IHTMLInputElement *iface, BSTR v)
{
HTMLInputElement *This = HTMLINPUT_THIS(iface);
- FIXME("(%p)->(%s)\n", This, debugstr_w(v));
- return E_NOTIMPL;
+ nsAString type_str;
+ nsresult nsres;
+
+ TRACE("(%p)->(%s)\n", This, debugstr_w(v));
+
+ /*
+ * FIXME:
+ * On IE setting type works only on dynamically created elements before adding them
to DOM tree.
+ */
+ nsAString_InitDepend(&type_str, v);
+ nsres = nsIDOMHTMLInputElement_SetType(This->nsinput, &type_str);
+ nsAString_Finish(&type_str);
+ if(NS_FAILED(nsres)) {
+ ERR("SetType failed: %08x\n", nsres);
+ return E_FAIL;
+ }
+
+ return S_OK;
}
static HRESULT WINAPI HTMLInputElement_get_type(IHTMLInputElement *iface, BSTR *p)
@@ -180,8 +196,20 @@
static HRESULT WINAPI HTMLInputElement_put_name(IHTMLInputElement *iface, BSTR v)
{
HTMLInputElement *This = HTMLINPUT_THIS(iface);
- FIXME("(%p)->(%s)\n", This, debugstr_w(v));
- return E_NOTIMPL;
+ nsAString name_str;
+ nsresult nsres;
+
+ TRACE("(%p)->(%s)\n", This, debugstr_w(v));
+
+ nsAString_InitDepend(&name_str, v);
+ nsres = nsIDOMHTMLInputElement_SetName(This->nsinput, &name_str);
+ nsAString_Finish(&name_str);
+ if(NS_FAILED(nsres)) {
+ ERR("SetName failed: %08x\n", nsres);
+ return E_FAIL;
+ }
+
+ return S_OK;
}
static HRESULT WINAPI HTMLInputElement_get_name(IHTMLInputElement *iface, BSTR *p)
@@ -190,6 +218,7 @@
nsAString name_str;
const PRUnichar *name;
nsresult nsres;
+ HRESULT hres = S_OK;
TRACE("(%p)->(%p)\n", This, p);
@@ -198,16 +227,14 @@
nsres = nsIDOMHTMLInputElement_GetName(This->nsinput, &name_str);
if(NS_SUCCEEDED(nsres)) {
nsAString_GetData(&name_str, &name);
- *p = SysAllocString(name);
+ *p = *name ? SysAllocString(name) : NULL;
}else {
ERR("GetName failed: %08x\n", nsres);
- return E_FAIL;
+ hres = E_FAIL;
}
nsAString_Finish(&name_str);
-
- TRACE("name=%s\n", debugstr_w(*p));
- return S_OK;
+ return hres;
}
static HRESULT WINAPI HTMLInputElement_put_status(IHTMLInputElement *iface, VARIANT_BOOL
v)
Modified: trunk/reactos/dll/win32/mshtml/htmloption.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/htmloptio…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/htmloption.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/htmloption.c [iso-8859-1] Sat May 29 16:54:55 2010
@@ -98,15 +98,35 @@
static HRESULT WINAPI HTMLOptionElement_put_selected(IHTMLOptionElement *iface,
VARIANT_BOOL v)
{
HTMLOptionElement *This = HTMLOPTION_THIS(iface);
- FIXME("(%p)->(%x)\n", This, v);
- return E_NOTIMPL;
+ nsresult nsres;
+
+ TRACE("(%p)->(%x)\n", This, v);
+
+ nsres = nsIDOMHTMLOptionElement_SetSelected(This->nsoption, v != VARIANT_FALSE);
+ if(NS_FAILED(nsres)) {
+ ERR("SetSelected failed: %08x\n", nsres);
+ return E_FAIL;
+ }
+
+ return S_OK;
}
static HRESULT WINAPI HTMLOptionElement_get_selected(IHTMLOptionElement *iface,
VARIANT_BOOL *p)
{
HTMLOptionElement *This = HTMLOPTION_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+ PRBool selected;
+ nsresult nsres;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ nsres = nsIDOMHTMLOptionElement_GetSelected(This->nsoption, &selected);
+ if(NS_FAILED(nsres)) {
+ ERR("GetSelected failed: %08x\n", nsres);
+ return E_FAIL;
+ }
+
+ *p = selected ? VARIANT_TRUE : VARIANT_FALSE;
+ return S_OK;
}
static HRESULT WINAPI HTMLOptionElement_put_value(IHTMLOptionElement *iface, BSTR v)
Modified: trunk/reactos/dll/win32/mshtml/htmlselect.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/htmlselec…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/htmlselect.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/htmlselect.c [iso-8859-1] Sat May 29 16:54:55 2010
@@ -42,6 +42,43 @@
#define HTMLSELECT(x) ((IHTMLSelectElement*)
&(x)->lpHTMLSelectElementVtbl)
+static HRESULT htmlselect_item(HTMLSelectElement *This, int i, IDispatch **ret)
+{
+ nsIDOMHTMLOptionsCollection *nscol;
+ nsIDOMNode *nsnode;
+ nsresult nsres;
+
+ nsres = nsIDOMHTMLSelectElement_GetOptions(This->nsselect, &nscol);
+ if(NS_FAILED(nsres)) {
+ ERR("GetOptions failed: %08x\n", nsres);
+ return E_FAIL;
+ }
+
+ nsres = nsIDOMHTMLOptionsCollection_Item(nscol, i, &nsnode);
+ nsIDOMHTMLOptionsCollection_Release(nscol);
+ if(NS_FAILED(nsres)) {
+ ERR("Item failed: %08x\n", nsres);
+ return E_FAIL;
+ }
+
+ if(nsnode) {
+ HTMLDOMNode *node;
+
+ node = get_node(This->element.node.doc, nsnode, TRUE);
+ nsIDOMNode_Release(nsnode);
+ if(!node) {
+ ERR("Could not find node\n");
+ return E_FAIL;
+ }
+
+ IHTMLDOMNode_AddRef(HTMLDOMNODE(node));
+ *ret = (IDispatch*)HTMLDOMNODE(node);
+ }else {
+ *ret = NULL;
+ }
+ return S_OK;
+}
+
#define HTMLSELECT_THIS(iface) DEFINE_THIS(HTMLSelectElement, HTMLSelectElement, iface)
static HRESULT WINAPI HTMLSelectElement_QueryInterface(IHTMLSelectElement *iface,
@@ -170,8 +207,12 @@
static HRESULT WINAPI HTMLSelectElement_get_options(IHTMLSelectElement *iface, IDispatch
**p)
{
HTMLSelectElement *This = HTMLSELECT_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ *p = (IDispatch*)HTMLSELECT(This);
+ IDispatch_AddRef(*p);
+ return S_OK;
}
static HRESULT WINAPI HTMLSelectElement_put_onchange(IHTMLSelectElement *iface, VARIANT
v)
@@ -364,8 +405,15 @@
static HRESULT WINAPI HTMLSelectElement_put_length(IHTMLSelectElement *iface, LONG v)
{
HTMLSelectElement *This = HTMLSELECT_THIS(iface);
- FIXME("(%p)->(%d)\n", This, v);
- return E_NOTIMPL;
+ nsresult nsres;
+
+ TRACE("(%p)->(%d)\n", This, v);
+
+ nsres = nsIDOMHTMLSelectElement_SetLength(This->nsselect, v);
+ if(NS_FAILED(nsres))
+ ERR("SetLength failed: %08x\n", nsres);
+
+ return S_OK;
}
static HRESULT WINAPI HTMLSelectElement_get_length(IHTMLSelectElement *iface, LONG *p)
@@ -397,7 +445,20 @@
VARIANT index, IDispatch **pdisp)
{
HTMLSelectElement *This = HTMLSELECT_THIS(iface);
- FIXME("(%p)->(v v %p)\n", This, pdisp);
+
+ TRACE("(%p)->(%s %s %p)\n", This, debugstr_variant(&name),
debugstr_variant(&index), pdisp);
+
+ if(!pdisp)
+ return E_POINTER;
+ *pdisp = NULL;
+
+ if(V_VT(&name) == VT_I4) {
+ if(V_I4(&name) < 0)
+ return E_INVALIDARG;
+ return htmlselect_item(This, V_I4(&name), pdisp);
+ }
+
+ FIXME("Unsupported args\n");
return E_NOTIMPL;
}
@@ -493,6 +554,60 @@
return IHTMLSelectElement_get_disabled(HTMLSELECT(This), p);
}
+#define DISPID_OPTIONCOL_0 MSHTML_DISPID_CUSTOM_MIN
+
+static HRESULT HTMLSelectElement_get_dispid(HTMLDOMNode *iface, BSTR name, DWORD flags,
DISPID *dispid)
+{
+ const WCHAR *ptr;
+ DWORD idx = 0;
+
+ for(ptr = name; *ptr && isdigitW(*ptr); ptr++) {
+ idx = idx*10 + (*ptr-'0');
+ if(idx > MSHTML_CUSTOM_DISPID_CNT) {
+ WARN("too big idx\n");
+ return DISP_E_UNKNOWNNAME;
+ }
+ }
+ if(*ptr)
+ return DISP_E_UNKNOWNNAME;
+
+ *dispid = DISPID_OPTIONCOL_0 + idx;
+ return S_OK;
+}
+
+static HRESULT HTMLSelectElement_invoke(HTMLDOMNode *iface, DISPID id, LCID lcid, WORD
flags, DISPPARAMS *params,
+ VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller)
+{
+ HTMLSelectElement *This = HTMLSELECT_NODE_THIS(iface);
+
+ TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This, id, lcid, flags, params,
res, ei, caller);
+
+ switch(flags) {
+ case DISPATCH_PROPERTYGET: {
+ IDispatch *ret;
+ HRESULT hres;
+
+ hres = htmlselect_item(This, id-DISPID_OPTIONCOL_0, &ret);
+ if(FAILED(hres))
+ return hres;
+
+ if(ret) {
+ V_VT(res) = VT_DISPATCH;
+ V_DISPATCH(res) = ret;
+ }else {
+ V_VT(res) = VT_NULL;
+ }
+ break;
+ }
+
+ default:
+ FIXME("unimplemented flags %x\n", flags);
+ return E_NOTIMPL;
+ }
+
+ return S_OK;
+}
+
#undef HTMLSELECT_NODE_THIS
static const NodeImplVtbl HTMLSelectElementImplVtbl = {
@@ -501,7 +616,11 @@
NULL,
NULL,
HTMLSelectElementImpl_put_disabled,
- HTMLSelectElementImpl_get_disabled
+ HTMLSelectElementImpl_get_disabled,
+ NULL,
+ NULL,
+ HTMLSelectElement_get_dispid,
+ HTMLSelectElement_invoke
};
static const tid_t HTMLSelectElement_tids[] = {
Modified: trunk/reactos/dll/win32/mshtml/htmltextarea.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/htmltexta…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/htmltextarea.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/htmltextarea.c [iso-8859-1] Sat May 29 16:54:55 2010
@@ -105,8 +105,20 @@
static HRESULT WINAPI HTMLTextAreaElement_put_value(IHTMLTextAreaElement *iface, BSTR v)
{
HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
- FIXME("(%p)->(%s)\n", This, debugstr_w(v));
- return E_NOTIMPL;
+ nsAString value_str;
+ nsresult nsres;
+
+ TRACE("(%p)->(%s)\n", This, debugstr_w(v));
+
+ nsAString_InitDepend(&value_str, v);
+ nsres = nsIDOMHTMLTextAreaElement_SetValue(This->nstextarea, &value_str);
+ nsAString_Finish(&value_str);
+ if(NS_FAILED(nsres)) {
+ ERR("SetValue failed: %08x\n", nsres);
+ return E_FAIL;
+ }
+
+ return S_OK;
}
static HRESULT WINAPI HTMLTextAreaElement_get_value(IHTMLTextAreaElement *iface, BSTR
*p)
@@ -115,6 +127,7 @@
nsAString value_str;
const PRUnichar *value;
nsresult nsres;
+ HRESULT hres = S_OK;
TRACE("(%p)->(%p)\n", This, p);
@@ -123,15 +136,14 @@
nsres = nsIDOMHTMLTextAreaElement_GetValue(This->nstextarea, &value_str);
if(NS_SUCCEEDED(nsres)) {
nsAString_GetData(&value_str, &value);
- *p = SysAllocString(value);
+ *p = *value ? SysAllocString(value) : NULL;
}else {
ERR("GetValue failed: %08x\n", nsres);
+ hres = E_FAIL;
}
nsAString_Finish(&value_str);
-
- TRACE("%s\n", debugstr_w(*p));
- return S_OK;
+ return hres;
}
static HRESULT WINAPI HTMLTextAreaElement_put_name(IHTMLTextAreaElement *iface, BSTR v)
@@ -253,15 +265,35 @@
static HRESULT WINAPI HTMLTextAreaElement_put_readOnly(IHTMLTextAreaElement *iface,
VARIANT_BOOL v)
{
HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
- FIXME("(%p)->(%x)\n", This, v);
- return E_NOTIMPL;
+ nsresult nsres;
+
+ TRACE("(%p)->(%x)\n", This, v);
+
+ nsres = nsIDOMHTMLTextAreaElement_SetReadOnly(This->nstextarea, v !=
VARIANT_FALSE);
+ if(NS_FAILED(nsres)) {
+ ERR("SetReadOnly failed: %08x\n", nsres);
+ return E_FAIL;
+ }
+
+ return S_OK;
}
static HRESULT WINAPI HTMLTextAreaElement_get_readOnly(IHTMLTextAreaElement *iface,
VARIANT_BOOL *p)
{
HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+ PRBool b;
+ nsresult nsres;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ nsres = nsIDOMHTMLTextAreaElement_GetReadOnly(This->nstextarea, &b);
+ if(NS_FAILED(nsres)) {
+ ERR("GetReadOnly failed: %08x\n", nsres);
+ return E_FAIL;
+ }
+
+ *p = b ? VARIANT_TRUE : VARIANT_FALSE;
+ return S_OK;
}
static HRESULT WINAPI HTMLTextAreaElement_put_rows(IHTMLTextAreaElement *iface, LONG v)
Modified: trunk/reactos/dll/win32/mshtml/htmlwindow.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/htmlwindo…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/htmlwindow.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/htmlwindow.c [iso-8859-1] Sat May 29 16:54:55 2010
@@ -511,20 +511,34 @@
return clear_task_timer(&This->doc->basedoc, FALSE, timerID);
}
+#define MAX_MESSAGE_LEN 2000
+
static HRESULT WINAPI HTMLWindow2_alert(IHTMLWindow2 *iface, BSTR message)
{
HTMLWindow *This = HTMLWINDOW2_THIS(iface);
- WCHAR wszTitle[100];
+ WCHAR title[100], *msg = message;
+ DWORD len;
TRACE("(%p)->(%s)\n", This, debugstr_w(message));
- if(!LoadStringW(get_shdoclc(), IDS_MESSAGE_BOX_TITLE, wszTitle,
- sizeof(wszTitle)/sizeof(WCHAR))) {
+ if(!LoadStringW(get_shdoclc(), IDS_MESSAGE_BOX_TITLE, title,
+ sizeof(title)/sizeof(WCHAR))) {
WARN("Could not load message box title: %d\n", GetLastError());
return S_OK;
}
- MessageBoxW(This->doc_obj->hwnd, message, wszTitle, MB_ICONWARNING);
+ len = SysStringLen(message);
+ if(len > MAX_MESSAGE_LEN) {
+ msg = heap_alloc((MAX_MESSAGE_LEN+1)*sizeof(WCHAR));
+ if(!msg)
+ return E_OUTOFMEMORY;
+ memcpy(msg, message, MAX_MESSAGE_LEN*sizeof(WCHAR));
+ msg[MAX_MESSAGE_LEN] = 0;
+ }
+
+ MessageBoxW(This->doc_obj->hwnd, msg, title, MB_ICONWARNING);
+ if(msg != message)
+ heap_free(msg);
return S_OK;
}
Modified: trunk/reactos/dll/win32/mshtml/mshtml_private.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/mshtml_pr…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/mshtml_private.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/mshtml_private.h [iso-8859-1] Sat May 29 16:54:55 2010
@@ -144,6 +144,7 @@
#define MSHTML_DISPID_CUSTOM_MIN 0x60000000
#define MSHTML_DISPID_CUSTOM_MAX 0x6fffffff
+#define MSHTML_CUSTOM_DISPID_CNT (MSHTML_DISPID_CUSTOM_MAX-MSHTML_DISPID_CUSTOM_MIN)
typedef struct {
HRESULT
(*value)(IUnknown*,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,IServiceProvider*);
@@ -727,8 +728,10 @@
void *nsalloc(size_t) __WINE_ALLOC_SIZE(1);
void nsfree(void*);
+void nsACString_InitDepend(nsACString*,const char*);
void nsACString_SetData(nsACString*,const char*);
PRUint32 nsACString_GetData(const nsACString*,const char**);
+void nsACString_Finish(nsACString*);
BOOL nsAString_Init(nsAString*,const PRUnichar*);
void nsAString_InitDepend(nsAString*,const PRUnichar*);
Modified: trunk/reactos/dll/win32/mshtml/nsembed.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/nsembed.c…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/nsembed.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/nsembed.c [iso-8859-1] Sat May 29 16:54:55 2010
@@ -32,6 +32,7 @@
#include "wine/unicode.h"
#include "mshtml_private.h"
+#include "htmlevent.h"
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
WINE_DECLARE_DEBUG_CHANNEL(gecko);
@@ -48,20 +49,14 @@
#define PR_UINT32_MAX 0xffffffff
-struct nsCStringContainer {
- void *v;
- void *d1;
- PRUint32 d2;
- PRUint32 d3;
-};
-
#define NS_STRING_CONTAINER_INIT_DEPEND 0x0002
+#define NS_CSTRING_CONTAINER_INIT_DEPEND 0x0002
static nsresult (*NS_InitXPCOM2)(nsIServiceManager**,void*,void*);
static nsresult (*NS_ShutdownXPCOM)(nsIServiceManager*);
static nsresult (*NS_GetComponentRegistrar)(nsIComponentRegistrar**);
static nsresult (*NS_StringContainerInit2)(nsStringContainer*,const
PRUnichar*,PRUint32,PRUint32);
-static nsresult (*NS_CStringContainerInit)(nsCStringContainer*);
+static nsresult (*NS_CStringContainerInit2)(nsCStringContainer*,const
char*,PRUint32,PRUint32);
static nsresult (*NS_StringContainerFinish)(nsStringContainer*);
static nsresult (*NS_CStringContainerFinish)(nsCStringContainer*);
static nsresult (*NS_StringSetData)(nsAString*,const PRUnichar*,PRUint32);
@@ -188,7 +183,7 @@
NS_DLSYM(NS_ShutdownXPCOM);
NS_DLSYM(NS_GetComponentRegistrar);
NS_DLSYM(NS_StringContainerInit2);
- NS_DLSYM(NS_CStringContainerInit);
+ NS_DLSYM(NS_CStringContainerInit2);
NS_DLSYM(NS_StringContainerFinish);
NS_DLSYM(NS_CStringContainerFinish);
NS_DLSYM(NS_StringSetData);
@@ -526,11 +521,18 @@
nsIMemory_Free(nsmem, mem);
}
-static void nsACString_Init(nsACString *str, const char *data)
-{
- NS_CStringContainerInit(str);
- if(data)
- nsACString_SetData(str, data);
+static BOOL nsACString_Init(nsACString *str, const char *data)
+{
+ return NS_SUCCEEDED(NS_CStringContainerInit2(str, data, PR_UINT32_MAX, 0));
+}
+
+/*
+ * Initializes nsACString with data owned by caller.
+ * Caller must ensure that data is valid during lifetime of string object.
+ */
+void nsACString_InitDepend(nsACString *str, const char *data)
+{
+ NS_CStringContainerInit2(str, data, PR_UINT32_MAX,
NS_CSTRING_CONTAINER_INIT_DEPEND);
}
void nsACString_SetData(nsACString *str, const char *data)
@@ -543,7 +545,7 @@
return NS_CStringGetData(str, data, NULL);
}
-static void nsACString_Finish(nsACString *str)
+void nsACString_Finish(nsACString *str)
{
NS_CStringContainerFinish(str);
}
@@ -1006,6 +1008,8 @@
TRACE("(%p)->(%08x %p %p)\n", This, aContextFlags, aEvent, aNode);
+ fire_event(This->doc->basedoc.doc_node /* FIXME */, EVENTID_CONTEXTMENU, TRUE,
aNode, aEvent);
+
nsres = nsIDOMEvent_QueryInterface(aEvent, &IID_nsIDOMMouseEvent,
(void**)&event);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIDOMMouseEvent interface: %08x\n", nsres);
Modified: trunk/reactos/dll/win32/mshtml/nsiface.idl
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/nsiface.i…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/nsiface.idl [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/nsiface.idl [iso-8859-1] Sat May 29 16:54:55 2010
@@ -119,7 +119,6 @@
typedef nsISupports nsIDOMCDATASection;
typedef nsISupports nsIDOMProcessingInstruction;
typedef nsISupports nsIDOMEntityReference;
-typedef nsISupports nsIDOMHTMLOptionsCollection;
typedef nsISupports nsIWebProgressListener;
typedef nsISupports nsIDOMCSSValue;
typedef nsISupports nsIPrintSession;
@@ -1317,6 +1316,20 @@
nsresult SetSelected(PRBool aSelected);
nsresult GetValue(nsAString *aValue);
nsresult SetValue(const nsAString *aValue);
+}
+
+[
+ object,
+ uuid(bce0213c-f70f-488f-b93f-688acca55d63),
+ local
+ /* FROZEN */
+]
+interface nsIDOMHTMLOptionsCollection : nsISupports
+{
+ nsresult GetLength(PRUint32 *aLength);
+ nsresult SetLength(PRUint32 aLength);
+ nsresult Item(PRUint32 index, nsIDOMNode **_retval);
+ nsresult NamedItem(const nsAString *name, nsIDOMNode **_retval);
}
[
Modified: trunk/reactos/dll/win32/mshtml/nsio.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/nsio.c?re…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/nsio.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/nsio.c [iso-8859-1] Sat May 29 16:54:55 2010
@@ -196,16 +196,15 @@
url = heap_strdupW(uri->wine_url);
hres = IDocHostUIHandler_TranslateUrl(doc->hostui, 0, url, &new_url);
+ if(hres == S_OK && new_url) {
+ if(strcmpW(url, new_url)) {
+ FIXME("TranslateUrl returned new URL %s -> %s\n",
debugstr_w(url), debugstr_w(new_url));
+ ret = TRUE;
+ }
+ CoTaskMemFree(new_url);
+ }
+
heap_free(url);
- if(hres != S_OK || !new_url)
- return FALSE;
-
- if(strcmpW(url, new_url)) {
- FIXME("TranslateUrl returned new URL %s -> %s\n", debugstr_w(url),
debugstr_w(new_url));
- ret = TRUE;
- }
-
- CoTaskMemFree(new_url);
return ret;
}
@@ -229,7 +228,7 @@
}
wine_uri->is_doc_uri = TRUE;
- *_retval = translate_url(nscontainer->doc->basedoc.doc_obj, wine_uri);
+ *_retval = translate_url(nscontainer->doc, wine_uri);
}
nsIURI_Release(NSURI(wine_uri));
@@ -2453,6 +2452,7 @@
HTMLWindow *window = NULL;
nsIURI *uri = NULL;
LPCWSTR base_wine_url = NULL;
+ nsACString spec_str;
nsresult nsres;
nsACString_GetData(aSpec, &spec);
@@ -2485,7 +2485,9 @@
}
}
+ nsACString_InitDepend(&spec_str, spec);
nsres = nsIIOService_NewURI(nsio, aSpec, aOriginCharset, aBaseURI, &uri);
+ nsACString_Finish(&spec_str);
if(NS_FAILED(nsres))
TRACE("NewURI failed: %08x\n", nsres);
Added: trunk/reactos/dll/win32/mshtml/ros_diff.patch
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/ros_diff.…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/ros_diff.patch (added)
+++ trunk/reactos/dll/win32/mshtml/ros_diff.patch [iso-8859-1] Sat May 29 16:54:55 2010
@@ -1,0 +1,43 @@
+--- C:/Users/CHRIST~1/AppData/Local/Temp/install.-rev47414.svn001.tmp.c Sa Mai 29
16:46:40 2010
++++ C:/Users/Christoph/Desktop/Projekte/ReactOS/dll/win32/mshtml/install.c Sa Mai 29
16:43:49 2010
+@@ -60,6 +60,11 @@
+ '\\','W','i','n','e',
+
'\\','M','S','H','T','M','L',0};
+
++static const CHAR mshtml_keyA[] =
++
{'S','o','f','t','w','a','r','e',
++ '\\','W','i','n','e',
++
'\\','M','S','H','T','M','L',0};
++
+ static HWND install_dialog = NULL;
+ static LPWSTR tmp_file_name = NULL;
+ static HANDLE tmp_file = INVALID_HANDLE_VALUE;
+@@ -225,23 +230,18 @@
+ static BOOL install_from_registered_dir(void)
+ {
+ char *file_name;
+- HKEY hkey;
+ DWORD res, type, size = MAX_PATH;
+ BOOL ret;
+
++ file_name = heap_alloc(size+sizeof(GECKO_FILE_NAME));
+ /* @@ Wine registry key: HKCU\Software\Wine\MSHTML */
+- res = RegOpenKeyW(HKEY_CURRENT_USER, mshtml_keyW, &hkey);
+- if(res != ERROR_SUCCESS)
+- return FALSE;
+-
+- file_name = heap_alloc(size+sizeof(GECKO_FILE_NAME));
+- res = RegQueryValueExA(hkey, "GeckoCabDir", NULL, &type,
(PBYTE)file_name, &size);
++ res = RegGetValueA(HKEY_CURRENT_USER, mshtml_keyA, "GeckoCabDir",
RRF_RT_ANY, &type, (PBYTE)file_name, &size);
+ if(res == ERROR_MORE_DATA) {
+ file_name = heap_realloc(file_name, size+sizeof(GECKO_FILE_NAME));
+- res = RegQueryValueExA(hkey, "GeckoCabDir", NULL, &type,
(PBYTE)file_name, &size);
++ res = RegGetValueA(HKEY_CURRENT_USER, mshtml_keyA, "GeckoCabDir",
RRF_RT_ANY, &type, (PBYTE)file_name, &size);
+ }
+- RegCloseKey(hkey);
+- if(res != ERROR_SUCCESS || type != REG_SZ) {
++
++ if(res != ERROR_SUCCESS || (type != REG_SZ && type != REG_EXPAND_SZ)) {
+ heap_free(file_name);
+ return FALSE;
+ }
Propchange: trunk/reactos/dll/win32/mshtml/ros_diff.patch
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/dll/win32/mshtml/secmgr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/secmgr.c?…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/secmgr.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/secmgr.c [iso-8859-1] Sat May 29 16:54:55 2010
@@ -90,6 +90,8 @@
IObjectSafety *obj_safety;
HRESULT hres;
+ TRACE("%s %p %s\n", debugstr_w(url), cs->pUnk,
debugstr_guid(&cs->clsid));
+
/* FIXME: Check URLACTION_ACTIVEX_OVERRIDE_SCRIPT_SAFETY */
hres = IInternetSecurityManager_ProcessUrlAction(This->secmgr, url,
URLACTION_SCRIPT_SAFE_ACTIVEX,
@@ -119,11 +121,17 @@
}
hres = IObjectSafety_GetInterfaceSafetyOptions(obj_safety, &IID_IDispatchEx,
&supported_opts, &enabled_opts);
- if(SUCCEEDED(hres)) {
- enabled_opts = INTERFACESAFE_FOR_UNTRUSTED_CALLER;
- if(supported_opts & INTERFACE_USES_SECURITY_MANAGER)
- enabled_opts |= INTERFACE_USES_SECURITY_MANAGER;
- hres = IObjectSafety_SetInterfaceSafetyOptions(obj_safety, &IID_IDispatchEx,
enabled_opts, enabled_opts);
+ if(FAILED(hres))
+ supported_opts = 0;
+
+ enabled_opts = INTERFACESAFE_FOR_UNTRUSTED_CALLER;
+ if(supported_opts & INTERFACE_USES_SECURITY_MANAGER)
+ enabled_opts |= INTERFACE_USES_SECURITY_MANAGER;
+
+ hres = IObjectSafety_SetInterfaceSafetyOptions(obj_safety, &IID_IDispatchEx,
enabled_opts, enabled_opts);
+ if(FAILED(hres)) {
+ enabled_opts &= ~INTERFACE_USES_SECURITY_MANAGER;
+ hres = IObjectSafety_SetInterfaceSafetyOptions(obj_safety, &IID_IDispatch,
enabled_opts, enabled_opts);
}
IObjectSafety_Release(obj_safety);
@@ -175,6 +183,7 @@
*(DWORD*)*ppPolicy = policy;
*pcbPolicy = sizeof(policy);
+ TRACE("policy %x\n", policy);
return S_OK;
}
Modified: trunk/reactos/dll/win32/mshtml/task.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mshtml/task.c?re…
==============================================================================
--- trunk/reactos/dll/win32/mshtml/task.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mshtml/task.c [iso-8859-1] Sat May 29 16:54:55 2010
@@ -222,7 +222,6 @@
static LRESULT process_timer(void)
{
thread_data_t *thread_data = get_thread_data(TRUE);
- HTMLDocument *doc;
IDispatch *disp;
DWORD tc;
task_timer_t *timer;
@@ -238,7 +237,6 @@
return 0;
}
- doc = timer->doc;
disp = timer->disp;
IDispatch_AddRef(disp);