Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mshtml/Makefile.in | 2 +- dlls/mshtml/htmldoc.c | 19 +- dlls/mshtml/mshtml_private.h | 3 + dlls/mshtml/{txtrange.c => range.c} | 369 +++++++++++++++++++++++++++- include/mshtml.idl | 14 +- 5 files changed, 394 insertions(+), 13 deletions(-) rename dlls/mshtml/{txtrange.c => range.c} (81%)
diff --git a/dlls/mshtml/Makefile.in b/dlls/mshtml/Makefile.in index f054816056..7e1d517f07 100644 --- a/dlls/mshtml/Makefile.in +++ b/dlls/mshtml/Makefile.in @@ -55,13 +55,13 @@ C_SRCS = \ persist.c \ pluginhost.c \ protocol.c \ + range.c \ script.c \ secmgr.c \ selection.c \ service.c \ svg.c \ task.c \ - txtrange.c \ view.c \ xmlhttprequest.c
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 7595ad852a..a6f22150b9 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -5223,8 +5223,22 @@ static HRESULT WINAPI DocumentRange_Invoke(IDocumentRange *iface, DISPID dispIdM static HRESULT WINAPI DocumentRange_createRange(IDocumentRange *iface, IHTMLDOMRange **p) { HTMLDocument *This = impl_from_IDocumentRange(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + nsIDOMRange *nsrange; + HRESULT hres; + + TRACE("(%p)->(%p)\n", This, p); + + if(!This->doc_node->nsdoc) { + WARN("NULL nsdoc\n"); + return E_UNEXPECTED; + } + + if(NS_FAILED(nsIDOMHTMLDocument_CreateRange(This->doc_node->nsdoc, &nsrange))) + return E_FAIL; + + hres = HTMLDOMRange_Create(This->doc_node, nsrange, p); + nsIDOMRange_Release(nsrange); + return hres; }
static const IDocumentRangeVtbl DocumentRangeVtbl = { @@ -5697,6 +5711,7 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindo HTMLDocumentNode_SecMgr_Init(doc);
list_init(&doc->selection_list); + list_init(&doc->txtrange_list); list_init(&doc->range_list); list_init(&doc->plugin_hosts);
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index ef56f1d23d..b8fb67315c 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -178,6 +178,7 @@ typedef struct EventTarget EventTarget; XIID(IHTMLDOMNode) \ XIID(IHTMLDOMNode2) \ XIID(IHTMLDOMNode3) \ + XIID(IHTMLDOMRange) \ XIID(IHTMLDOMTextNode) \ XIID(IHTMLDOMTextNode2) \ XIID(IHTMLElement) \ @@ -884,6 +885,7 @@ struct HTMLDocumentNode { unsigned unique_id;
struct list selection_list; + struct list txtrange_list; struct list range_list; struct list plugin_hosts; }; @@ -1008,6 +1010,7 @@ HRESULT HTMLSelectionObject_Create(HTMLDocumentNode*,nsISelection*,IHTMLSelectio HRESULT HTMLTxtRange_Create(HTMLDocumentNode*,nsIDOMRange*,IHTMLTxtRange**) DECLSPEC_HIDDEN; IHTMLStyleSheet *HTMLStyleSheet_Create(nsIDOMStyleSheet*) DECLSPEC_HIDDEN; IHTMLStyleSheetsCollection *HTMLStyleSheetsCollection_Create(nsIDOMStyleSheetList*) DECLSPEC_HIDDEN; +HRESULT HTMLDOMRange_Create(HTMLDocumentNode*,nsIDOMRange*,IHTMLDOMRange**) DECLSPEC_HIDDEN;
void detach_document_node(HTMLDocumentNode*) DECLSPEC_HIDDEN; void detach_selection(HTMLDocumentNode*) DECLSPEC_HIDDEN; diff --git a/dlls/mshtml/txtrange.c b/dlls/mshtml/range.c similarity index 81% rename from dlls/mshtml/txtrange.c rename to dlls/mshtml/range.c index c6a6ed096b..3c28ad3e01 100644 --- a/dlls/mshtml/txtrange.c +++ b/dlls/mshtml/range.c @@ -49,6 +49,18 @@ typedef struct { struct list entry; } HTMLTxtRange;
+typedef struct { + DispatchEx dispex; + IHTMLDOMRange IHTMLDOMRange_iface; + + LONG ref; + + nsIDOMRange *nsrange; + HTMLDocumentNode *doc; + + struct list entry; +} HTMLDOMRange; + typedef struct { WCHAR *buf; DWORD len; @@ -73,7 +85,7 @@ static HTMLTxtRange *get_range_object(HTMLDocumentNode *doc, IHTMLTxtRange *ifac { HTMLTxtRange *iter;
- LIST_FOR_EACH_ENTRY(iter, &doc->range_list, HTMLTxtRange, entry) { + LIST_FOR_EACH_ENTRY(iter, &doc->txtrange_list, HTMLTxtRange, entry) { if(&iter->IHTMLTxtRange_iface == iface) return iter; } @@ -1752,18 +1764,369 @@ HRESULT HTMLTxtRange_Create(HTMLDocumentNode *doc, nsIDOMRange *nsrange, IHTMLTx ret->nsrange = nsrange;
ret->doc = doc; - list_add_head(&doc->range_list, &ret->entry); + list_add_head(&doc->txtrange_list, &ret->entry);
*p = &ret->IHTMLTxtRange_iface; return S_OK; }
+static inline HTMLDOMRange *impl_from_IHTMLDOMRange(IHTMLDOMRange *iface) +{ + return CONTAINING_RECORD(iface, HTMLDOMRange, IHTMLDOMRange_iface); +} + +static HRESULT WINAPI HTMLDOMRange_QueryInterface(IHTMLDOMRange *iface, REFIID riid, void **ppv) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + + TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv); + + if(IsEqualGUID(&IID_IUnknown, riid)) { + *ppv = &This->IHTMLDOMRange_iface; + }else if(IsEqualGUID(&IID_IHTMLDOMRange, riid)) { + *ppv = &This->IHTMLDOMRange_iface; + }else if(dispex_query_interface(&This->dispex, riid, ppv)) { + return *ppv ? S_OK : E_NOINTERFACE; + }else { + *ppv = NULL; + WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv); + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; +} + +static ULONG WINAPI HTMLDOMRange_AddRef(IHTMLDOMRange *iface) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + LONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + return ref; +} + +static ULONG WINAPI HTMLDOMRange_Release(IHTMLDOMRange *iface) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + LONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + if(!ref) { + if(This->nsrange) + nsIDOMRange_Release(This->nsrange); + if(This->doc) + list_remove(&This->entry); + release_dispex(&This->dispex); + heap_free(This); + } + + return ref; +} + +static HRESULT WINAPI HTMLDOMRange_GetTypeInfoCount(IHTMLDOMRange *iface, UINT *pctinfo) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + + return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo); +} + +static HRESULT WINAPI HTMLDOMRange_GetTypeInfo(IHTMLDOMRange *iface, UINT iTInfo, + LCID lcid, ITypeInfo **ppTInfo) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + + return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo); +} + +static HRESULT WINAPI HTMLDOMRange_GetIDsOfNames(IHTMLDOMRange *iface, REFIID riid, + LPOLESTR *rgszNames, UINT cNames, + LCID lcid, DISPID *rgDispId) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + + return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, + cNames, lcid, rgDispId); +} + +static HRESULT WINAPI HTMLDOMRange_Invoke(IHTMLDOMRange *iface, DISPID dispIdMember, + REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, + VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + + return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, + lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); +} + +static HRESULT WINAPI HTMLDOMRange_get_startContainer(IHTMLDOMRange *iface, IHTMLDOMNode **p) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDOMRange_get_startOffset(IHTMLDOMRange *iface, LONG *p) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDOMRange_get_endContainer(IHTMLDOMRange *iface, IHTMLDOMNode **p) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDOMRange_get_endOffset(IHTMLDOMRange *iface, LONG *p) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDOMRange_get_collapsed(IHTMLDOMRange *iface, VARIANT_BOOL *p) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDOMRange_get_commonAncestorContainer(IHTMLDOMRange *iface, IHTMLDOMNode **p) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDOMRange_setStart(IHTMLDOMRange *iface, IDispatch *node, LONG offset) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + FIXME("(%p)->(%p, %d)\n", This, node, offset); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDOMRange_setEnd(IHTMLDOMRange *iface, IDispatch *node, LONG offset) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + FIXME("(%p)->(%p, %d)\n", This, node, offset); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDOMRange_setStartBefore(IHTMLDOMRange *iface, IDispatch *node) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + FIXME("(%p)->(%p)\n", This, node); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDOMRange_setStartAfter(IHTMLDOMRange *iface, IDispatch *node) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + FIXME("(%p)->(%p)\n", This, node); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDOMRange_setEndBefore(IHTMLDOMRange *iface, IDispatch *node) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + FIXME("(%p)->(%p)\n", This, node); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDOMRange_setEndAfter(IHTMLDOMRange *iface, IDispatch *node) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + FIXME("(%p)->(%p)\n", This, node); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDOMRange_collapse(IHTMLDOMRange *iface, VARIANT_BOOL tostart) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + FIXME("(%p)->(%x)\n", This, tostart); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDOMRange_selectNode(IHTMLDOMRange *iface, IDispatch *node) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + FIXME("(%p)->(%p)\n", This, node); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDOMRange_selectNodeContents(IHTMLDOMRange *iface, IDispatch *node) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + FIXME("(%p)->(%p)\n", This, node); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDOMRange_compareBoundaryPoints(IHTMLDOMRange *iface, short how, + IDispatch *src_range, LONG *result) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + FIXME("(%p)->(%x, %p, %p)\n", This, how, src_range, result); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDOMRange_deleteContents(IHTMLDOMRange *iface) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + FIXME("(%p)\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDOMRange_extractContents(IHTMLDOMRange *iface, IDispatch **p) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDOMRange_cloneContents(IHTMLDOMRange *iface, IDispatch **p) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDOMRange_insertNode(IHTMLDOMRange *iface, IDispatch *node) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + FIXME("(%p)->(%p)\n", This, node); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDOMRange_surroundContents(IHTMLDOMRange *iface, IDispatch *parent) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + FIXME("(%p)->(%p)\n", This, parent); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDOMRange_cloneRange(IHTMLDOMRange *iface, IHTMLDOMRange **p) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDOMRange_toString(IHTMLDOMRange *iface, BSTR *p) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDOMRange_detach(IHTMLDOMRange *iface) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + FIXME("(%p)\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDOMRange_getClientRects(IHTMLDOMRange *iface, IHTMLRectCollection **p) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDOMRange_getBoundingClientRect(IHTMLDOMRange *iface, IHTMLRect **p) +{ + HTMLDOMRange *This = impl_from_IHTMLDOMRange(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static const IHTMLDOMRangeVtbl HTMLDOMRangeVtbl = { + HTMLDOMRange_QueryInterface, + HTMLDOMRange_AddRef, + HTMLDOMRange_Release, + HTMLDOMRange_GetTypeInfoCount, + HTMLDOMRange_GetTypeInfo, + HTMLDOMRange_GetIDsOfNames, + HTMLDOMRange_Invoke, + HTMLDOMRange_get_startContainer, + HTMLDOMRange_get_startOffset, + HTMLDOMRange_get_endContainer, + HTMLDOMRange_get_endOffset, + HTMLDOMRange_get_collapsed, + HTMLDOMRange_get_commonAncestorContainer, + HTMLDOMRange_setStart, + HTMLDOMRange_setEnd, + HTMLDOMRange_setStartBefore, + HTMLDOMRange_setStartAfter, + HTMLDOMRange_setEndBefore, + HTMLDOMRange_setEndAfter, + HTMLDOMRange_collapse, + HTMLDOMRange_selectNode, + HTMLDOMRange_selectNodeContents, + HTMLDOMRange_compareBoundaryPoints, + HTMLDOMRange_deleteContents, + HTMLDOMRange_extractContents, + HTMLDOMRange_cloneContents, + HTMLDOMRange_insertNode, + HTMLDOMRange_surroundContents, + HTMLDOMRange_cloneRange, + HTMLDOMRange_toString, + HTMLDOMRange_detach, + HTMLDOMRange_getClientRects, + HTMLDOMRange_getBoundingClientRect, +}; + +static const tid_t HTMLDOMRange_iface_tids[] = { + IHTMLDOMRange_tid, + 0 +}; + +static dispex_static_data_t HTMLDOMRange_dispex = { + NULL, + IHTMLDOMRange_tid, + HTMLDOMRange_iface_tids +}; + +HRESULT HTMLDOMRange_Create(HTMLDocumentNode *doc, nsIDOMRange *nsrange, IHTMLDOMRange **p) +{ + HTMLDOMRange *ret; + + ret = heap_alloc(sizeof(*ret)); + if(!ret) + return E_OUTOFMEMORY; + + init_dispex(&ret->dispex, (IUnknown*)&ret->IHTMLDOMRange_iface, &HTMLDOMRange_dispex); + + ret->IHTMLDOMRange_iface.lpVtbl = &HTMLDOMRangeVtbl; + ret->ref = 1; + + if(nsrange) + nsIDOMRange_AddRef(nsrange); + ret->nsrange = nsrange; + + ret->doc = doc; + list_add_head(&doc->range_list, &ret->entry); + + *p = &ret->IHTMLDOMRange_iface; + return S_OK; +} + void detach_ranges(HTMLDocumentNode *This) { + HTMLDOMRange *domrange, *domrange_next; HTMLTxtRange *iter, *next;
- LIST_FOR_EACH_ENTRY_SAFE(iter, next, &This->range_list, HTMLTxtRange, entry) { + LIST_FOR_EACH_ENTRY_SAFE(iter, next, &This->txtrange_list, HTMLTxtRange, entry) { iter->doc = NULL; list_remove(&iter->entry); } + + LIST_FOR_EACH_ENTRY_SAFE(domrange, domrange_next, &This->range_list, HTMLDOMRange, entry) { + domrange->doc = NULL; + list_remove(&domrange->entry); + } } diff --git a/include/mshtml.idl b/include/mshtml.idl index aea888b2b8..10eb3315b8 100644 --- a/include/mshtml.idl +++ b/include/mshtml.idl @@ -12220,13 +12220,13 @@ interface IHTMLDOMRange : IDispatch HRESULT startContainer([out, retval] IHTMLDOMNode **p);
[propget, id(DISPID_IHTMLDOMRANGE_STARTOFFSET)] - HRESULT startOffset([out, retval] long *p); + 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); + HRESULT endOffset([out, retval] LONG *p);
[propget, id(DISPID_IHTMLDOMRANGE_COLLAPSED)] HRESULT collapsed([out, retval] VARIANT_BOOL *p); @@ -12237,12 +12237,12 @@ interface IHTMLDOMRange : IDispatch [id(DISPID_IHTMLDOMRANGE_SETSTART)] HRESULT setStart( [in] IDispatch *refNode, - [in] long offset); + [in] LONG offset);
- [id(DISPID_IHTMLDOMRANGE_SETEND)] HRESULT - setEnd( + [id(DISPID_IHTMLDOMRANGE_SETEND)] + HRESULT setEnd( [in] IDispatch *refNode, - [in] long offset); + [in] LONG offset);
[id(DISPID_IHTMLDOMRANGE_SETSTARTBEFORE)] HRESULT setStartBefore([in] IDispatch* refNode); @@ -12269,7 +12269,7 @@ interface IHTMLDOMRange : IDispatch HRESULT compareBoundaryPoints( [in] short how, [in] IDispatch *sourceRange, - [out, retval] long *compareResult); + [out, retval] LONG *compareResult);
[id(DISPID_IHTMLDOMRANGE_DELETECONTENTS)] HRESULT deleteContents();
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=54182
Your paranoid android.
=== debian9 (32 bit report) ===
mshtml: htmldoc.c:2576: Test failed: unexpected call UpdateUI htmldoc.c:2887: Test failed: unexpected call Exec_UPDATECOMMANDS
=== debian9 (32 bit Chinese:China report) ===
mshtml: htmldoc.c:2576: Test failed: unexpected call UpdateUI htmldoc.c:2887: Test failed: unexpected call Exec_UPDATECOMMANDS
=== debian9 (32 bit WoW report) ===
mshtml: htmldoc.c:2576: Test failed: unexpected call UpdateUI htmldoc.c:2887: Test failed: unexpected call Exec_UPDATECOMMANDS htmldoc.c:2576: Test failed: unexpected call UpdateUI htmldoc.c:2887: Test failed: unexpected call Exec_UPDATECOMMANDS
Hi Nikolay,
On 27/06/2019 10:51, Nikolay Sivov wrote:
- nsIDOMRange *nsrange;
- HTMLDocumentNode *doc;
- struct list entry;
This object will probably not need document reference. Please remove doc and range list, we can always add it if really needed.
+static const tid_t HTMLDOMRange_iface_tids[] = {
- IHTMLDOMRange_tid,
- 0
+};
+static dispex_static_data_t HTMLDOMRange_dispex = {
- NULL,
- IHTMLDOMRange_tid,
- HTMLDOMRange_iface_tids
+};
It's probably right, but it could use a test in dom.c with test_disp() call.
diff --git a/include/mshtml.idl b/include/mshtml.idl index aea888b2b8..10eb3315b8 100644 --- a/include/mshtml.idl +++ b/include/mshtml.idl @@ -12220,13 +12220,13 @@ interface IHTMLDOMRange : IDispatch HRESULT startContainer([out, retval] IHTMLDOMNode **p);
[propget, id(DISPID_IHTMLDOMRANGE_STARTOFFSET)]
- HRESULT startOffset([out, retval] long *p);
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);
HRESULT endOffset([out, retval] LONG *p);
[propget, id(DISPID_IHTMLDOMRANGE_COLLAPSED)] HRESULT collapsed([out, retval] VARIANT_BOOL *p);
@@ -12237,12 +12237,12 @@ interface IHTMLDOMRange : IDispatch [id(DISPID_IHTMLDOMRANGE_SETSTART)] HRESULT setStart( [in] IDispatch *refNode,
[in] long offset);
[in] LONG offset);
- [id(DISPID_IHTMLDOMRANGE_SETEND)] HRESULT
- setEnd(
- [id(DISPID_IHTMLDOMRANGE_SETEND)]
- HRESULT setEnd( [in] IDispatch *refNode,
[in] long offset);
[in] LONG offset); [id(DISPID_IHTMLDOMRANGE_SETSTARTBEFORE)] HRESULT setStartBefore([in] IDispatch* refNode);
@@ -12269,7 +12269,7 @@ interface IHTMLDOMRange : IDispatch HRESULT compareBoundaryPoints( [in] short how, [in] IDispatch *sourceRange,
[out, retval] long *compareResult);
[out, retval] LONG *compareResult); [id(DISPID_IHTMLDOMRANGE_DELETECONTENTS)] HRESULT deleteContents();
Please don't do that, widl can take care of long type.
Thanks,
Jacek
On 6/27/19 12:45 PM, Jacek Caban wrote:
Hi Nikolay,
On 27/06/2019 10:51, Nikolay Sivov wrote:
+ nsIDOMRange *nsrange; + HTMLDocumentNode *doc;
+ struct list entry;
This object will probably not need document reference. Please remove doc and range list, we can always add it if really needed.
Sure.
+static const tid_t HTMLDOMRange_iface_tids[] = { + IHTMLDOMRange_tid, + 0 +};
+static dispex_static_data_t HTMLDOMRange_dispex = { + NULL, + IHTMLDOMRange_tid, + HTMLDOMRange_iface_tids +};
It's probably right, but it could use a test in dom.c with test_disp() call.
This turned out to be wrong.
diff --git a/include/mshtml.idl b/include/mshtml.idl index aea888b2b8..10eb3315b8 100644 --- a/include/mshtml.idl +++ b/include/mshtml.idl @@ -12220,13 +12220,13 @@ interface IHTMLDOMRange : IDispatch HRESULT startContainer([out, retval] IHTMLDOMNode **p); [propget, id(DISPID_IHTMLDOMRANGE_STARTOFFSET)] - HRESULT startOffset([out, retval] long *p); + 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); + HRESULT endOffset([out, retval] LONG *p); [propget, id(DISPID_IHTMLDOMRANGE_COLLAPSED)] HRESULT collapsed([out, retval] VARIANT_BOOL *p); @@ -12237,12 +12237,12 @@ interface IHTMLDOMRange : IDispatch [id(DISPID_IHTMLDOMRANGE_SETSTART)] HRESULT setStart( [in] IDispatch *refNode, - [in] long offset); + [in] LONG offset); - [id(DISPID_IHTMLDOMRANGE_SETEND)] HRESULT - setEnd( + [id(DISPID_IHTMLDOMRANGE_SETEND)] + HRESULT setEnd( [in] IDispatch *refNode, - [in] long offset); + [in] LONG offset); [id(DISPID_IHTMLDOMRANGE_SETSTARTBEFORE)] HRESULT setStartBefore([in] IDispatch* refNode); @@ -12269,7 +12269,7 @@ interface IHTMLDOMRange : IDispatch HRESULT compareBoundaryPoints( [in] short how, [in] IDispatch *sourceRange, - [out, retval] long *compareResult); + [out, retval] LONG *compareResult); [id(DISPID_IHTMLDOMRANGE_DELETECONTENTS)] HRESULT deleteContents();
Please don't do that, widl can take care of long type.
Done.
Thanks,
Jacek