Split from !7779.
From: Gabriel Ivăncescu gabrielopcode@gmail.com
--- dlls/mshtml/htmlimg.c | 11 ++++++----- dlls/mshtml/tests/documentmode.js | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/dlls/mshtml/htmlimg.c b/dlls/mshtml/htmlimg.c index f6a4b992ab6..5716bbd7ac4 100644 --- a/dlls/mshtml/htmlimg.c +++ b/dlls/mshtml/htmlimg.c @@ -864,10 +864,11 @@ static HRESULT HTMLImageElementFactory_value(DispatchEx *dispex, LCID lcid, return S_OK; }
-static const tid_t HTMLImageElementFactory_iface_tids[] = { - IHTMLImageElementFactory_tid, - 0 -}; +static void HTMLImageElementFactory_init_dispex_info(dispex_data_t *info, compat_mode_t mode) +{ + if(mode < COMPAT_MODE_IE9) + dispex_info_add_interface(info, IHTMLImageElementFactory_tid, NULL); +}
static const dispex_static_data_vtbl_t HTMLImageElementFactory_dispex_vtbl = { .query_interface = HTMLImageElementFactory_query_interface, @@ -882,7 +883,7 @@ static dispex_static_data_t HTMLImageElementFactory_dispex = { .constructor_id = PROT_HTMLImageElement, .vtbl = &HTMLImageElementFactory_dispex_vtbl, .disp_tid = IHTMLImageElementFactory_tid, - .iface_tids = HTMLImageElementFactory_iface_tids, + .init_info = HTMLImageElementFactory_init_dispex_info, };
HRESULT HTMLImageElementFactory_Create(HTMLInnerWindow *window, HTMLImageElementFactory **ret_val) diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 5bbd8b098f6..f1149652bb4 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -906,6 +906,20 @@ sync_test("style_props", function() { } });
+sync_test("constructor props", function() { + function test_exposed(constructor, prop, expect) { + if(expect) + ok(prop in constructor, prop + " not found in " + constructor); + else + ok(!(prop in constructor), prop + " found in " + constructor); + } + var v = document.documentMode; + + test_exposed(Image, "create", v < 9); + test_exposed(XMLHttpRequest, "create", true); + if(v >= 11) test_exposed(MutationObserver, "create", false); +}); + sync_test("createElement_inline_attr", function() { var v = document.documentMode, e, s;
From: Gabriel Ivăncescu gabrielopcode@gmail.com
--- dlls/mshtml/htmlselect.c | 11 ++++++----- dlls/mshtml/tests/documentmode.js | 1 + 2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/dlls/mshtml/htmlselect.c b/dlls/mshtml/htmlselect.c index 2d02589db38..b55c37e4e77 100644 --- a/dlls/mshtml/htmlselect.c +++ b/dlls/mshtml/htmlselect.c @@ -510,10 +510,11 @@ static HRESULT HTMLOptionElementFactory_value(DispatchEx *dispex, LCID lcid, return S_OK; }
-static const tid_t HTMLOptionElementFactory_iface_tids[] = { - IHTMLOptionElementFactory_tid, - 0 -}; +static void HTMLOptionElementFactory_init_dispex_info(dispex_data_t *info, compat_mode_t mode) +{ + if(mode < COMPAT_MODE_IE9) + dispex_info_add_interface(info, IHTMLOptionElementFactory_tid, NULL); +}
static const dispex_static_data_vtbl_t HTMLOptionElementFactory_dispex_vtbl = { .query_interface = HTMLOptionElementFactory_query_interface, @@ -528,7 +529,7 @@ static dispex_static_data_t HTMLOptionElementFactory_dispex = { .constructor_id = PROT_HTMLOptionElement, .vtbl = &HTMLOptionElementFactory_dispex_vtbl, .disp_tid = IHTMLOptionElementFactory_tid, - .iface_tids = HTMLOptionElementFactory_iface_tids, + .init_info = HTMLOptionElementFactory_init_dispex_info, };
HRESULT HTMLOptionElementFactory_Create(HTMLInnerWindow *window, HTMLOptionElementFactory **ret_ptr) diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index f1149652bb4..fc89c38e326 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -916,6 +916,7 @@ sync_test("constructor props", function() { var v = document.documentMode;
test_exposed(Image, "create", v < 9); + test_exposed(Option, "create", v < 9); test_exposed(XMLHttpRequest, "create", true); if(v >= 11) test_exposed(MutationObserver, "create", false); });
From: Jacek Caban jacek@codeweavers.com
--- dlls/mshtml/dispex.c | 10 +++++----- dlls/mshtml/htmlanchor.c | 4 ++-- dlls/mshtml/htmlarea.c | 4 ++-- dlls/mshtml/htmlattr.c | 4 ++-- dlls/mshtml/htmlbody.c | 4 ++-- dlls/mshtml/htmlcurstyle.c | 4 ++-- dlls/mshtml/htmldoc.c | 16 ++++++++-------- dlls/mshtml/htmlelem.c | 16 ++++++++-------- dlls/mshtml/htmlelemcol.c | 2 +- dlls/mshtml/htmlevent.c | 36 ++++++++++++++++++------------------ dlls/mshtml/htmlform.c | 4 ++-- dlls/mshtml/htmlframe.c | 8 ++++---- dlls/mshtml/htmlgeneric.c | 4 ++-- dlls/mshtml/htmlhead.c | 16 ++++++++-------- dlls/mshtml/htmlimg.c | 6 +++--- dlls/mshtml/htmlinput.c | 12 ++++++------ dlls/mshtml/htmllink.c | 4 ++-- dlls/mshtml/htmlnode.c | 4 ++-- dlls/mshtml/htmlobject.c | 8 ++++---- dlls/mshtml/htmlscript.c | 4 ++-- dlls/mshtml/htmlselect.c | 10 +++++----- dlls/mshtml/htmlstorage.c | 2 +- dlls/mshtml/htmlstyle.c | 10 +++++----- dlls/mshtml/htmlstyleelem.c | 4 ++-- dlls/mshtml/htmlstylesheet.c | 16 ++++++++-------- dlls/mshtml/htmltable.c | 16 ++++++++-------- dlls/mshtml/htmltextarea.c | 4 ++-- dlls/mshtml/htmltextnode.c | 12 ++++++------ dlls/mshtml/htmlwindow.c | 12 ++++++------ dlls/mshtml/mshtml_private.h | 30 +++++++++++++++--------------- dlls/mshtml/mutation.c | 4 ++-- dlls/mshtml/omnavigator.c | 24 ++++++++++++------------ dlls/mshtml/range.c | 4 ++-- dlls/mshtml/script.c | 4 ++-- dlls/mshtml/selection.c | 2 +- dlls/mshtml/svg.c | 24 ++++++++++++------------ dlls/mshtml/xmlhttprequest.c | 4 ++-- 37 files changed, 176 insertions(+), 176 deletions(-)
diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 77eec049912..8d762ca7346 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -546,7 +546,7 @@ static BOOL find_prototype_member(const dispex_data_t *info, DISPID id)
static const char *object_names[] = { #define X(name) #name, - ALL_PROTOTYPES + ALL_OBJECTS #undef X };
@@ -2969,7 +2969,7 @@ void init_dispatch_with_owner(DispatchEx *dispex, dispex_static_data_t *desc, Di dispex_static_data_t *object_descriptors[] = { NULL, #define X(name) &name ## _dispex, - ALL_PROTOTYPES + ALL_OBJECTS #undef X };
@@ -3007,7 +3007,7 @@ static const dispex_static_data_vtbl_t prototype_dispex_vtbl = { .find_dispid = prototype_find_dispid, };
-HRESULT get_prototype(HTMLInnerWindow *script_global, prototype_id_t id, DispatchEx **ret) +HRESULT get_prototype(HTMLInnerWindow *script_global, object_id_t id, DispatchEx **ret) { compat_mode_t compat_mode = script_global->doc->document_mode; DispatchEx *prototype, *prot_prototype = NULL; @@ -3055,7 +3055,7 @@ HRESULT get_prototype(HTMLInnerWindow *script_global, prototype_id_t id, Dispatc struct constructor { DispatchEx dispex; - prototype_id_t id; + object_id_t id; };
static inline struct constructor *constr_from_DispatchEx(DispatchEx *iface) @@ -3112,7 +3112,7 @@ static dispex_static_data_t constructor_dispex = { .js_flags = HOSTOBJ_CONSTRUCTOR, };
-HRESULT get_constructor(HTMLInnerWindow *script_global, prototype_id_t id, DispatchEx **ret) +HRESULT get_constructor(HTMLInnerWindow *script_global, object_id_t id, DispatchEx **ret) { dispex_static_data_t *info;
diff --git a/dlls/mshtml/htmlanchor.c b/dlls/mshtml/htmlanchor.c index 15d2c50cf17..d5629309697 100644 --- a/dlls/mshtml/htmlanchor.c +++ b/dlls/mshtml/htmlanchor.c @@ -846,8 +846,8 @@ static const tid_t HTMLAnchorElement_iface_tids[] = { };
dispex_static_data_t HTMLAnchorElement_dispex = { - .id = PROT_HTMLAnchorElement, - .prototype_id = PROT_HTMLElement, + .id = OBJID_HTMLAnchorElement, + .prototype_id = OBJID_HTMLElement, .vtbl = &HTMLAnchorElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLAnchorElement_tid, .iface_tids = HTMLAnchorElement_iface_tids, diff --git a/dlls/mshtml/htmlarea.c b/dlls/mshtml/htmlarea.c index bde44cb9075..82f13ed77f1 100644 --- a/dlls/mshtml/htmlarea.c +++ b/dlls/mshtml/htmlarea.c @@ -456,8 +456,8 @@ static const tid_t HTMLAreaElement_iface_tids[] = { 0 }; dispex_static_data_t HTMLAreaElement_dispex = { - .id = PROT_HTMLAreaElement, - .prototype_id = PROT_HTMLElement, + .id = OBJID_HTMLAreaElement, + .prototype_id = OBJID_HTMLElement, .vtbl = &HTMLAreaElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLAreaElement_tid, .iface_tids = HTMLAreaElement_iface_tids, diff --git a/dlls/mshtml/htmlattr.c b/dlls/mshtml/htmlattr.c index 9b306eff406..1fe5570feba 100644 --- a/dlls/mshtml/htmlattr.c +++ b/dlls/mshtml/htmlattr.c @@ -406,8 +406,8 @@ static const tid_t HTMLDOMAttribute_iface_tids[] = { 0 }; dispex_static_data_t Attr_dispex = { - .id = PROT_Attr, - .prototype_id = PROT_Node, + .id = OBJID_Attr, + .prototype_id = OBJID_Node, .vtbl = &HTMLDOMAttribute_dispex_vtbl, .disp_tid = DispHTMLDOMAttribute_tid, .iface_tids = HTMLDOMAttribute_iface_tids, diff --git a/dlls/mshtml/htmlbody.c b/dlls/mshtml/htmlbody.c index 4ca08e0e3a4..2add4567069 100644 --- a/dlls/mshtml/htmlbody.c +++ b/dlls/mshtml/htmlbody.c @@ -893,8 +893,8 @@ static const tid_t HTMLBodyElement_iface_tids[] = { };
dispex_static_data_t HTMLBodyElement_dispex = { - .id = PROT_HTMLBodyElement, - .prototype_id = PROT_HTMLElement, + .id = OBJID_HTMLBodyElement, + .prototype_id = OBJID_HTMLElement, .vtbl = &HTMLBodyElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLBody_tid, .iface_tids = HTMLBodyElement_iface_tids, diff --git a/dlls/mshtml/htmlcurstyle.c b/dlls/mshtml/htmlcurstyle.c index ffccceb2457..e2f3f2ff9e8 100644 --- a/dlls/mshtml/htmlcurstyle.c +++ b/dlls/mshtml/htmlcurstyle.c @@ -1195,8 +1195,8 @@ static const tid_t MSCurrentStyleCSSProperties_iface_tids[] = { 0 }; dispex_static_data_t MSCurrentStyleCSSProperties_dispex = { - .id = PROT_MSCurrentStyleCSSProperties, - .prototype_id = PROT_MSCSSProperties, + .id = OBJID_MSCurrentStyleCSSProperties, + .prototype_id = OBJID_MSCSSProperties, .vtbl = &MSCurrentStyleCSSProperties_dispex_vtbl, .disp_tid = DispHTMLCurrentStyle_tid, .iface_tids = MSCurrentStyleCSSProperties_iface_tids, diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index ffd594291f3..ca55b8e1d5b 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -320,8 +320,8 @@ static const tid_t DocumentType_iface_tids[] = { };
dispex_static_data_t DocumentType_dispex = { - .id = PROT_DocumentType, - .prototype_id = PROT_Node, + .id = OBJID_DocumentType, + .prototype_id = OBJID_Node, .vtbl = &DocumentType_event_target_vtbl.dispex_vtbl, .disp_tid = DispDOMDocumentType_tid, .iface_tids = DocumentType_iface_tids, @@ -5758,8 +5758,8 @@ static void HTMLDocumentNode_init_dispex_info(dispex_data_t *info, compat_mode_t }
dispex_static_data_t Document_dispex = { - .id = PROT_Document, - .prototype_id = PROT_Node, + .id = OBJID_Document, + .prototype_id = OBJID_Node, .vtbl = &HTMLDocument_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLDocument_tid, .iface_tids = HTMLDocumentNode_iface_tids, @@ -5767,8 +5767,8 @@ dispex_static_data_t Document_dispex = { };
dispex_static_data_t HTMLDocument_dispex = { - .id = PROT_HTMLDocument, - .prototype_id = PROT_Document, + .id = OBJID_HTMLDocument, + .prototype_id = OBJID_Document, .vtbl = &HTMLDocument_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLDocument_tid, .iface_tids = HTMLDocumentNode_iface_tids, @@ -5900,8 +5900,8 @@ static const tid_t DocumentFragment_iface_tids[] = { 0 }; dispex_static_data_t DocumentFragment_dispex = { - .id = PROT_DocumentFragment, - .prototype_id = PROT_Node, + .id = OBJID_DocumentFragment, + .prototype_id = OBJID_Node, .vtbl = &HTMLDocument_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLDocument_tid, .iface_tids = DocumentFragment_iface_tids, diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index fcd8c969a01..86efd8fab4f 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -762,7 +762,7 @@ static const tid_t ClientRect_iface_tids[] = { 0 }; dispex_static_data_t ClientRect_dispex = { - .id = PROT_ClientRect, + .id = OBJID_ClientRect, .vtbl = &ClientRect_dispex_vtbl, .disp_tid = IHTMLRect_tid, .iface_tids = ClientRect_iface_tids, @@ -1125,7 +1125,7 @@ static const tid_t ClientRectList_iface_tids[] = { 0 }; dispex_static_data_t ClientRectList_dispex = { - .id = PROT_ClientRectList, + .id = OBJID_ClientRectList, .vtbl = &HTMLRectCollection_dispex_vtbl, .disp_tid = IHTMLRectCollection_tid, .iface_tids = ClientRectList_iface_tids, @@ -7207,7 +7207,7 @@ static const tid_t DOMTokenList_tids[] = { 0 }; dispex_static_data_t DOMTokenList_dispex = { - .id = PROT_DOMTokenList, + .id = OBJID_DOMTokenList, .vtbl = &token_list_dispex_vtbl, .disp_tid = IWineDOMTokenList_tid, .iface_tids = DOMTokenList_tids, @@ -7410,14 +7410,14 @@ static void Element_init_dispex_info(dispex_data_t *info, compat_mode_t mode) }
dispex_static_data_t Element_dispex = { - .id = PROT_Element, - .prototype_id = PROT_Node, + .id = OBJID_Element, + .prototype_id = OBJID_Node, .init_info = Element_init_dispex_info, };
dispex_static_data_t HTMLElement_dispex = { - .id = PROT_HTMLElement, - .prototype_id = PROT_Element, + .id = OBJID_HTMLElement, + .prototype_id = OBJID_Element, .vtbl = &HTMLElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLUnknownElement_tid, .init_info = HTMLElement_init_dispex_info, @@ -8264,7 +8264,7 @@ const tid_t NamedNodeMap_iface_tids[] = { };
dispex_static_data_t NamedNodeMap_dispex = { - .id = PROT_NamedNodeMap, + .id = OBJID_NamedNodeMap, .vtbl = &HTMLAttributeCollection_dispex_vtbl, .disp_tid = DispHTMLAttributeCollection_tid, .iface_tids = NamedNodeMap_iface_tids, diff --git a/dlls/mshtml/htmlelemcol.c b/dlls/mshtml/htmlelemcol.c index dd7ffeea222..5b3d9b56310 100644 --- a/dlls/mshtml/htmlelemcol.c +++ b/dlls/mshtml/htmlelemcol.c @@ -575,7 +575,7 @@ static const tid_t HTMLCollection_iface_tids[] = { };
dispex_static_data_t HTMLCollection_dispex = { - .id = PROT_HTMLCollection, + .id = OBJID_HTMLCollection, .vtbl = &HTMLElementColection_dispex_vtbl, .disp_tid = DispHTMLElementCollection_tid, .iface_tids = HTMLCollection_iface_tids, diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index d1c39a10519..8af5a1ff6a1 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -1809,7 +1809,7 @@ static const tid_t MSEventObj_iface_tids[] = { };
dispex_static_data_t MSEventObj_dispex = { - .id = PROT_MSEventObj, + .id = OBJID_MSEventObj, .vtbl = &HTMLEventObj_dispex_vtbl, .disp_tid = DispCEventObj_tid, .iface_tids = MSEventObj_iface_tids, @@ -3582,7 +3582,7 @@ static const tid_t Event_iface_tids[] = { };
dispex_static_data_t Event_dispex = { - .id = PROT_Event, + .id = OBJID_Event, .vtbl = &DOMEvent_dispex_vtbl, .disp_tid = DispDOMEvent_tid, .iface_tids = Event_iface_tids, @@ -3602,8 +3602,8 @@ static const tid_t UIEvent_iface_tids[] = { };
dispex_static_data_t UIEvent_dispex = { - .id = PROT_UIEvent, - .prototype_id = PROT_Event, + .id = OBJID_UIEvent, + .prototype_id = OBJID_Event, .vtbl = &DOMUIEvent_dispex_vtbl, .disp_tid = DispDOMUIEvent_tid, .iface_tids = UIEvent_iface_tids, @@ -3624,8 +3624,8 @@ static const tid_t MouseEvent_iface_tids[] = { };
dispex_static_data_t MouseEvent_dispex = { - .id = PROT_MouseEvent, - .prototype_id = PROT_UIEvent, + .id = OBJID_MouseEvent, + .prototype_id = OBJID_UIEvent, .vtbl = &DOMMouseEvent_dispex_vtbl, .disp_tid = DispDOMMouseEvent_tid, .iface_tids = MouseEvent_iface_tids, @@ -3654,8 +3654,8 @@ static const tid_t KeyboardEvent_iface_tids[] = { };
dispex_static_data_t KeyboardEvent_dispex = { - .id = PROT_KeyboardEvent, - .prototype_id = PROT_UIEvent, + .id = OBJID_KeyboardEvent, + .prototype_id = OBJID_UIEvent, .vtbl = &DOMKeyboardEvent_dispex_vtbl, .disp_tid = DispDOMKeyboardEvent_tid, .iface_tids = KeyboardEvent_iface_tids, @@ -3675,8 +3675,8 @@ static const dispex_static_data_vtbl_t DOMPageTransitionEvent_dispex_vtbl = { };
dispex_static_data_t PageTransitionEvent_dispex = { - .id = PROT_PageTransitionEvent, - .prototype_id = PROT_Event, + .id = OBJID_PageTransitionEvent, + .prototype_id = OBJID_Event, .vtbl = &DOMPageTransitionEvent_dispex_vtbl, .disp_tid = DispDOMEvent_tid, .iface_tids = Event_iface_tids, @@ -3698,8 +3698,8 @@ static const tid_t CustomEvent_iface_tids[] = { };
dispex_static_data_t CustomEvent_dispex = { - .id = PROT_CustomEvent, - .prototype_id = PROT_Event, + .id = OBJID_CustomEvent, + .prototype_id = OBJID_Event, .vtbl = &DOMCustomEvent_dispex_vtbl, .disp_tid = DispDOMCustomEvent_tid, .iface_tids = CustomEvent_iface_tids, @@ -3713,8 +3713,8 @@ static const dispex_static_data_vtbl_t DOMMessageEvent_dispex_vtbl = { };
dispex_static_data_t MessageEvent_dispex = { - .id = PROT_MessageEvent, - .prototype_id = PROT_Event, + .id = OBJID_MessageEvent, + .prototype_id = OBJID_Event, .vtbl = &DOMMessageEvent_dispex_vtbl, .disp_tid = DispDOMMessageEvent_tid, .iface_tids = Event_iface_tids, @@ -3735,8 +3735,8 @@ static const tid_t ProgressEvent_iface_tids[] = { };
dispex_static_data_t ProgressEvent_dispex = { - .id = PROT_ProgressEvent, - .prototype_id = PROT_Event, + .id = OBJID_ProgressEvent, + .prototype_id = OBJID_Event, .vtbl = &DOMProgressEvent_dispex_vtbl, .disp_tid = DispDOMProgressEvent_tid, .iface_tids = ProgressEvent_iface_tids, @@ -3757,8 +3757,8 @@ static const tid_t StorageEvent_iface_tids[] = { };
dispex_static_data_t StorageEvent_dispex = { - .id = PROT_StorageEvent, - .prototype_id = PROT_Event, + .id = OBJID_StorageEvent, + .prototype_id = OBJID_Event, .vtbl = &DOMStorageEvent_dispex_vtbl, .disp_tid = DispDOMStorageEvent_tid, .iface_tids = StorageEvent_iface_tids, diff --git a/dlls/mshtml/htmlform.c b/dlls/mshtml/htmlform.c index 1b90a7bd0e1..49c8b72e883 100644 --- a/dlls/mshtml/htmlform.c +++ b/dlls/mshtml/htmlform.c @@ -908,8 +908,8 @@ static const tid_t HTMLFormElement_iface_tids[] = { };
dispex_static_data_t HTMLFormElement_dispex = { - .id = PROT_HTMLFormElement, - .prototype_id = PROT_HTMLElement, + .id = OBJID_HTMLFormElement, + .prototype_id = OBJID_HTMLElement, .vtbl = &HTMLFormElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLFormElement_tid, .iface_tids = HTMLFormElement_iface_tids, diff --git a/dlls/mshtml/htmlframe.c b/dlls/mshtml/htmlframe.c index 62a826ffbae..48312b59a21 100644 --- a/dlls/mshtml/htmlframe.c +++ b/dlls/mshtml/htmlframe.c @@ -928,8 +928,8 @@ static const tid_t HTMLFrameElement_iface_tids[] = { };
dispex_static_data_t HTMLFrameElement_dispex = { - .id = PROT_HTMLFrameElement, - .prototype_id = PROT_HTMLElement, + .id = OBJID_HTMLFrameElement, + .prototype_id = OBJID_HTMLElement, .vtbl = &HTMLFrameElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLFrameElement_tid, .iface_tids = HTMLFrameElement_iface_tids, @@ -1365,8 +1365,8 @@ static const tid_t HTMLIFrameElement_iface_tids[] = { };
dispex_static_data_t HTMLIFrameElement_dispex = { - .id = PROT_HTMLIFrameElement, - .prototype_id = PROT_HTMLElement, + .id = OBJID_HTMLIFrameElement, + .prototype_id = OBJID_HTMLElement, .vtbl = &HTMLIFrameElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLIFrame_tid, .iface_tids = HTMLIFrameElement_iface_tids, diff --git a/dlls/mshtml/htmlgeneric.c b/dlls/mshtml/htmlgeneric.c index e57e3558a49..83b581cc230 100644 --- a/dlls/mshtml/htmlgeneric.c +++ b/dlls/mshtml/htmlgeneric.c @@ -114,8 +114,8 @@ static const tid_t HTMLUnknownElement_iface_tids[] = { };
dispex_static_data_t HTMLUnknownElement_dispex = { - .id = PROT_HTMLUnknownElement, - .prototype_id = PROT_HTMLElement, + .id = OBJID_HTMLUnknownElement, + .prototype_id = OBJID_HTMLElement, .vtbl = &HTMLGenericElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLGenericElement_tid, .iface_tids = HTMLUnknownElement_iface_tids, diff --git a/dlls/mshtml/htmlhead.c b/dlls/mshtml/htmlhead.c index 7f05e506dce..2386f243599 100644 --- a/dlls/mshtml/htmlhead.c +++ b/dlls/mshtml/htmlhead.c @@ -126,8 +126,8 @@ static const tid_t HTMLTitleElement_iface_tids[] = { 0 }; dispex_static_data_t HTMLTitleElement_dispex = { - .id = PROT_HTMLTitleElement, - .prototype_id = PROT_HTMLElement, + .id = OBJID_HTMLTitleElement, + .prototype_id = OBJID_HTMLElement, .vtbl = &HTMLTitleElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLTitleElement_tid, .iface_tids = HTMLTitleElement_iface_tids, @@ -241,8 +241,8 @@ static const tid_t HTMLHtmlElement_iface_tids[] = { 0 }; dispex_static_data_t HTMLHtmlElement_dispex = { - .id = PROT_HTMLHtmlElement, - .prototype_id = PROT_HTMLElement, + .id = OBJID_HTMLHtmlElement, + .prototype_id = OBJID_HTMLElement, .vtbl = &HTMLHtmlElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLHtmlElement_tid, .iface_tids = HTMLHtmlElement_iface_tids, @@ -420,8 +420,8 @@ static const tid_t HTMLMetaElement_iface_tids[] = { };
dispex_static_data_t HTMLMetaElement_dispex = { - .id = PROT_HTMLMetaElement, - .prototype_id = PROT_HTMLElement, + .id = OBJID_HTMLMetaElement, + .prototype_id = OBJID_HTMLElement, .vtbl = &HTMLMetaElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLMetaElement_tid, .iface_tids = HTMLMetaElement_iface_tids, @@ -526,8 +526,8 @@ static const tid_t HTMLHeadElement_iface_tids[] = { 0 }; dispex_static_data_t HTMLHeadElement_dispex = { - .id = PROT_HTMLHeadElement, - .prototype_id = PROT_HTMLElement, + .id = OBJID_HTMLHeadElement, + .prototype_id = OBJID_HTMLElement, .vtbl = &HTMLHeadElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLHeadElement_tid, .iface_tids = HTMLHeadElement_iface_tids, diff --git a/dlls/mshtml/htmlimg.c b/dlls/mshtml/htmlimg.c index 5716bbd7ac4..1cad4127946 100644 --- a/dlls/mshtml/htmlimg.c +++ b/dlls/mshtml/htmlimg.c @@ -679,8 +679,8 @@ static void HTMLImgElement_init_dispex_info(dispex_data_t *info, compat_mode_t m }
dispex_static_data_t HTMLImageElement_dispex = { - .id = PROT_HTMLImageElement, - .prototype_id = PROT_HTMLElement, + .id = OBJID_HTMLImageElement, + .prototype_id = OBJID_HTMLElement, .vtbl = &HTMLImgElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLImg_tid, .init_info = HTMLImgElement_init_dispex_info, @@ -880,7 +880,7 @@ static const dispex_static_data_vtbl_t HTMLImageElementFactory_dispex_vtbl = {
static dispex_static_data_t HTMLImageElementFactory_dispex = { .name = "Function", - .constructor_id = PROT_HTMLImageElement, + .constructor_id = OBJID_HTMLImageElement, .vtbl = &HTMLImageElementFactory_dispex_vtbl, .disp_tid = IHTMLImageElementFactory_tid, .init_info = HTMLImageElementFactory_init_dispex_info, diff --git a/dlls/mshtml/htmlinput.c b/dlls/mshtml/htmlinput.c index 4605005d6fd..ca0de3131e3 100644 --- a/dlls/mshtml/htmlinput.c +++ b/dlls/mshtml/htmlinput.c @@ -1288,8 +1288,8 @@ static const tid_t HTMLInputElement_iface_tids[] = { 0 }; dispex_static_data_t HTMLInputElement_dispex = { - .id = PROT_HTMLInputElement, - .prototype_id = PROT_HTMLElement, + .id = OBJID_HTMLInputElement, + .prototype_id = OBJID_HTMLElement, .vtbl = &HTMLInputElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLInputElement_tid, .iface_tids = HTMLInputElement_iface_tids, @@ -1431,8 +1431,8 @@ static const tid_t HTMLLabelElement_iface_tids[] = { };
dispex_static_data_t HTMLLabelElement_dispex = { - .id = PROT_HTMLLabelElement, - .prototype_id = PROT_HTMLElement, + .id = OBJID_HTMLLabelElement, + .prototype_id = OBJID_HTMLElement, .vtbl = &HTMLLabelElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLLabelElement_tid, .iface_tids = HTMLLabelElement_iface_tids, @@ -1717,8 +1717,8 @@ static const tid_t HTMLButtonElement_iface_tids[] = { };
dispex_static_data_t HTMLButtonElement_dispex = { - .id = PROT_HTMLButtonElement, - .prototype_id = PROT_HTMLElement, + .id = OBJID_HTMLButtonElement, + .prototype_id = OBJID_HTMLElement, .vtbl = &HTMLButtonElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLButtonElement_tid, .iface_tids = HTMLButtonElement_iface_tids, diff --git a/dlls/mshtml/htmllink.c b/dlls/mshtml/htmllink.c index c9e35d69d95..9ad66eef52e 100644 --- a/dlls/mshtml/htmllink.c +++ b/dlls/mshtml/htmllink.c @@ -387,8 +387,8 @@ static const tid_t HTMLLinkElement_iface_tids[] = { 0 }; dispex_static_data_t HTMLLinkElement_dispex = { - .id = PROT_HTMLLinkElement, - .prototype_id = PROT_HTMLElement, + .id = OBJID_HTMLLinkElement, + .prototype_id = OBJID_HTMLElement, .vtbl = &HTMLLinkElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLLinkElement_tid, .iface_tids = HTMLLinkElement_iface_tids, diff --git a/dlls/mshtml/htmlnode.c b/dlls/mshtml/htmlnode.c index c39159d9b43..84c3e669109 100644 --- a/dlls/mshtml/htmlnode.c +++ b/dlls/mshtml/htmlnode.c @@ -385,7 +385,7 @@ static const tid_t NodeList_iface_tids[] = { };
dispex_static_data_t NodeList_dispex = { - .id = PROT_NodeList, + .id = OBJID_NodeList, .vtbl = &HTMLDOMChildrenCollection_dispex_vtbl, .disp_tid = DispDOMChildrenCollection_tid, .iface_tids = NodeList_iface_tids, @@ -1347,7 +1347,7 @@ static const dispex_static_data_vtbl_t Node_dispex_vtbl = { };
dispex_static_data_t Node_dispex = { - .id = PROT_Node, + .id = OBJID_Node, .vtbl = &Node_dispex_vtbl, .disp_tid = IHTMLDOMNode_tid, .init_info = HTMLDOMNode_init_dispex_info, diff --git a/dlls/mshtml/htmlobject.c b/dlls/mshtml/htmlobject.c index c99afb03137..ca49708d54e 100644 --- a/dlls/mshtml/htmlobject.c +++ b/dlls/mshtml/htmlobject.c @@ -682,8 +682,8 @@ static const tid_t HTMLObjectElement_iface_tids[] = { 0 }; dispex_static_data_t HTMLObjectElement_dispex = { - .id = PROT_HTMLObjectElement, - .prototype_id = PROT_HTMLElement, + .id = OBJID_HTMLObjectElement, + .prototype_id = OBJID_HTMLElement, .vtbl = &HTMLObjectElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLObjectElement_tid, .iface_tids = HTMLObjectElement_iface_tids, @@ -887,8 +887,8 @@ static const tid_t HTMLEmbedElement_iface_tids[] = { 0 }; dispex_static_data_t HTMLEmbedElement_dispex = { - .id = PROT_HTMLEmbedElement, - .prototype_id = PROT_HTMLElement, + .id = OBJID_HTMLEmbedElement, + .prototype_id = OBJID_HTMLElement, .vtbl = &HTMLEmbedElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLEmbed_tid, .iface_tids = HTMLEmbedElement_iface_tids, diff --git a/dlls/mshtml/htmlscript.c b/dlls/mshtml/htmlscript.c index b490e374356..9e21d15ce26 100644 --- a/dlls/mshtml/htmlscript.c +++ b/dlls/mshtml/htmlscript.c @@ -414,8 +414,8 @@ static const tid_t HTMLScriptElement_iface_tids[] = { };
dispex_static_data_t HTMLScriptElement_dispex = { - .id = PROT_HTMLScriptElement, - .prototype_id = PROT_HTMLElement, + .id = OBJID_HTMLScriptElement, + .prototype_id = OBJID_HTMLElement, .vtbl = &HTMLScriptElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLScriptElement_tid, .iface_tids = HTMLScriptElement_iface_tids, diff --git a/dlls/mshtml/htmlselect.c b/dlls/mshtml/htmlselect.c index b55c37e4e77..787a61b1b91 100644 --- a/dlls/mshtml/htmlselect.c +++ b/dlls/mshtml/htmlselect.c @@ -345,8 +345,8 @@ static const tid_t HTMLOptionElement_iface_tids[] = { 0 }; dispex_static_data_t HTMLOptionElement_dispex = { - .id = PROT_HTMLOptionElement, - .prototype_id = PROT_HTMLElement, + .id = OBJID_HTMLOptionElement, + .prototype_id = OBJID_HTMLElement, .vtbl = &HTMLOptionElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLOptionElement_tid, .iface_tids = HTMLOptionElement_iface_tids, @@ -526,7 +526,7 @@ static const dispex_static_data_vtbl_t HTMLOptionElementFactory_dispex_vtbl = {
static dispex_static_data_t HTMLOptionElementFactory_dispex = { .name = "Function", - .constructor_id = PROT_HTMLOptionElement, + .constructor_id = OBJID_HTMLOptionElement, .vtbl = &HTMLOptionElementFactory_dispex_vtbl, .disp_tid = IHTMLOptionElementFactory_tid, .init_info = HTMLOptionElementFactory_init_dispex_info, @@ -1299,8 +1299,8 @@ static const tid_t HTMLSelectElement_tids[] = { };
dispex_static_data_t HTMLSelectElement_dispex = { - .id = PROT_HTMLSelectElement, - .prototype_id = PROT_HTMLElement, + .id = OBJID_HTMLSelectElement, + .prototype_id = OBJID_HTMLElement, .vtbl = &HTMLSelectElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLSelectElement_tid, .iface_tids = HTMLSelectElement_tids, diff --git a/dlls/mshtml/htmlstorage.c b/dlls/mshtml/htmlstorage.c index 98c1202e315..632469d0f9b 100644 --- a/dlls/mshtml/htmlstorage.c +++ b/dlls/mshtml/htmlstorage.c @@ -1294,7 +1294,7 @@ static const tid_t HTMLStorage_iface_tids[] = { 0 }; dispex_static_data_t Storage_dispex = { - .id = PROT_Storage, + .id = OBJID_Storage, .vtbl = &Storage_dispex_vtbl, .disp_tid = IHTMLStorage_tid, .iface_tids = HTMLStorage_iface_tids, diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index 36d685bf3d1..2e9acc4ad86 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -9729,8 +9729,8 @@ void MSCSSProperties_init_dispex_info(dispex_data_t *info, compat_mode_t mode) }
dispex_static_data_t MSCSSProperties_dispex = { - .id = PROT_MSCSSProperties, - .prototype_id = PROT_CSSStyleDeclaration, + .id = OBJID_MSCSSProperties, + .prototype_id = OBJID_CSSStyleDeclaration, .init_info = MSCSSProperties_init_dispex_info, };
@@ -9772,8 +9772,8 @@ static const tid_t MSStyleCSSProperties_iface_tids[] = { 0 }; dispex_static_data_t MSStyleCSSProperties_dispex = { - .id = PROT_MSStyleCSSProperties, - .prototype_id = PROT_MSCSSProperties, + .id = OBJID_MSStyleCSSProperties, + .prototype_id = OBJID_MSCSSProperties, .vtbl = &MSStyleCSSProperties_dispex_vtbl, .disp_tid = DispHTMLStyle_tid, .iface_tids = MSStyleCSSProperties_iface_tids, @@ -9918,7 +9918,7 @@ static const dispex_static_data_vtbl_t CSSStyleDeclaration_dispex_vtbl = { };
dispex_static_data_t CSSStyleDeclaration_dispex = { - .id = PROT_CSSStyleDeclaration, + .id = OBJID_CSSStyleDeclaration, .vtbl = &CSSStyleDeclaration_dispex_vtbl, .disp_tid = DispHTMLW3CComputedStyle_tid, .init_info = CSSStyleDeclaration_init_dispex_info, diff --git a/dlls/mshtml/htmlstyleelem.c b/dlls/mshtml/htmlstyleelem.c index b08e73b767e..d400f4980cb 100644 --- a/dlls/mshtml/htmlstyleelem.c +++ b/dlls/mshtml/htmlstyleelem.c @@ -332,8 +332,8 @@ static const event_target_vtbl_t HTMLStyleElement_event_target_vtbl = { };
dispex_static_data_t HTMLStyleElement_dispex = { - .id = PROT_HTMLStyleElement, - .prototype_id = PROT_HTMLElement, + .id = OBJID_HTMLStyleElement, + .prototype_id = OBJID_HTMLElement, .vtbl = &HTMLStyleElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLStyleElement_tid, .init_info = HTMLStyleElement_init_dispex_info, diff --git a/dlls/mshtml/htmlstylesheet.c b/dlls/mshtml/htmlstylesheet.c index 4b9cc3f56a6..fb9d71f894f 100644 --- a/dlls/mshtml/htmlstylesheet.c +++ b/dlls/mshtml/htmlstylesheet.c @@ -155,7 +155,7 @@ static void HTMLStyleSheetRule_destructor(DispatchEx *dispex) }
dispex_static_data_t CSSRule_dispex = { - .id = PROT_CSSRule, + .id = OBJID_CSSRule, };
static const dispex_static_data_vtbl_t CSSStyleRule_dispex_vtbl = { @@ -170,8 +170,8 @@ static const tid_t CSSStyleRule_iface_tids[] = { 0 }; dispex_static_data_t CSSStyleRule_dispex = { - .id = PROT_CSSStyleRule, - .prototype_id = PROT_CSSRule, + .id = OBJID_CSSStyleRule, + .prototype_id = OBJID_CSSRule, .vtbl = &CSSStyleRule_dispex_vtbl, .disp_tid = DispHTMLStyleSheetRule_tid, .iface_tids = CSSStyleRule_iface_tids, @@ -373,7 +373,7 @@ static const tid_t MSCSSRuleList_iface_tids[] = { 0 }; dispex_static_data_t MSCSSRuleList_dispex = { - .id = PROT_MSCSSRuleList, + .id = OBJID_MSCSSRuleList, .vtbl = &MSCSSRuleList_dispex_vtbl, .disp_tid = DispHTMLStyleSheetRulesCollection_tid, .iface_tids = MSCSSRuleList_iface_tids, @@ -735,7 +735,7 @@ static const tid_t StyleSheetList_iface_tids[] = { 0 }; dispex_static_data_t StyleSheetList_dispex = { - .id = PROT_StyleSheetList, + .id = OBJID_StyleSheetList, .vtbl = &StyleSheetList_dispex_vtbl, .disp_tid = DispHTMLStyleSheetsCollection_tid, .iface_tids = StyleSheetList_iface_tids, @@ -1226,7 +1226,7 @@ static void HTMLStyleSheet_init_dispex_info(dispex_data_t *info, compat_mode_t m }
dispex_static_data_t StyleSheet_dispex = { - .id = PROT_StyleSheet, + .id = OBJID_StyleSheet, .init_info = StyleSheet_init_dispex_info, };
@@ -1242,8 +1242,8 @@ static const tid_t CSSStyleSheet_iface_tids[] = { 0 }; dispex_static_data_t CSSStyleSheet_dispex = { - .id = PROT_CSSStyleSheet, - .prototype_id = PROT_StyleSheet, + .id = OBJID_CSSStyleSheet, + .prototype_id = OBJID_StyleSheet, .vtbl = &CSSStyleSheet_dispex_vtbl, .disp_tid = DispHTMLStyleSheet_tid, .iface_tids = CSSStyleSheet_iface_tids, diff --git a/dlls/mshtml/htmltable.c b/dlls/mshtml/htmltable.c index 934047412d6..27e1d258b22 100644 --- a/dlls/mshtml/htmltable.c +++ b/dlls/mshtml/htmltable.c @@ -436,8 +436,8 @@ static const tid_t HTMLTableDataCellElement_iface_tids[] = { };
dispex_static_data_t HTMLTableCellElement_dispex = { - .id = PROT_HTMLTableCellElement, - .prototype_id = PROT_HTMLElement, + .id = OBJID_HTMLTableCellElement, + .prototype_id = OBJID_HTMLElement, .disp_tid = DispHTMLTableCell_tid, .iface_tids = HTMLTableDataCellElement_iface_tids, .init_info = HTMLElement_init_dispex_info, @@ -456,8 +456,8 @@ static const event_target_vtbl_t HTMLTableDataCellElement_event_target_vtbl = { };
dispex_static_data_t HTMLTableDataCellElement_dispex = { - .id = PROT_HTMLTableDataCellElement, - .prototype_id = PROT_HTMLTableCellElement, + .id = OBJID_HTMLTableDataCellElement, + .prototype_id = OBJID_HTMLTableCellElement, .vtbl = &HTMLTableDataCellElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLTableCell_tid, .iface_tids = HTMLTableDataCellElement_iface_tids, @@ -830,8 +830,8 @@ static const tid_t HTMLTableRowElement_iface_tids[] = { };
dispex_static_data_t HTMLTableRowElement_dispex = { - .id = PROT_HTMLTableRowElement, - .prototype_id = PROT_HTMLElement, + .id = OBJID_HTMLTableRowElement, + .prototype_id = OBJID_HTMLElement, .vtbl = &HTMLTableRowElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLTableRow_tid, .iface_tids = HTMLTableRowElement_iface_tids, @@ -1683,8 +1683,8 @@ static const tid_t HTMLTableElement_iface_tids[] = { };
dispex_static_data_t HTMLTableElement_dispex = { - .id = PROT_HTMLTableElement, - .prototype_id = PROT_HTMLElement, + .id = OBJID_HTMLTableElement, + .prototype_id = OBJID_HTMLElement, .vtbl = &HTMLTableElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLTable_tid, .iface_tids = HTMLTableElement_iface_tids, diff --git a/dlls/mshtml/htmltextarea.c b/dlls/mshtml/htmltextarea.c index 659ebbe2776..e8a846047e8 100644 --- a/dlls/mshtml/htmltextarea.c +++ b/dlls/mshtml/htmltextarea.c @@ -415,8 +415,8 @@ static const tid_t HTMLTextAreaElement_iface_tids[] = { };
dispex_static_data_t HTMLTextAreaElement_dispex = { - .id = PROT_HTMLTextAreaElement, - .prototype_id = PROT_HTMLElement, + .id = OBJID_HTMLTextAreaElement, + .prototype_id = OBJID_HTMLElement, .vtbl = &HTMLTextAreaElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLTextAreaElement_tid, .iface_tids = HTMLTextAreaElement_iface_tids, diff --git a/dlls/mshtml/htmltextnode.c b/dlls/mshtml/htmltextnode.c index 63158f7cb8a..63886a4083c 100644 --- a/dlls/mshtml/htmltextnode.c +++ b/dlls/mshtml/htmltextnode.c @@ -221,8 +221,8 @@ static void CharacterData_init_dispex_info(dispex_data_t *info, compat_mode_t mo }
dispex_static_data_t CharacterData_dispex = { - .id = PROT_CharacterData, - .prototype_id = PROT_Node, + .id = OBJID_CharacterData, + .prototype_id = OBJID_Node, .init_info = CharacterData_init_dispex_info, };
@@ -434,8 +434,8 @@ static const tid_t Text_iface_tids[] = { 0 }; dispex_static_data_t Text_dispex = { - .id = PROT_Text, - .prototype_id = PROT_CharacterData, + .id = OBJID_Text, + .prototype_id = OBJID_CharacterData, .vtbl = &Text_dispex_vtbl, .disp_tid = DispHTMLDOMTextNode_tid, .iface_tids = Text_iface_tids, @@ -669,8 +669,8 @@ static void Comment_init_dispex_info(dispex_data_t *info, compat_mode_t mode) }
dispex_static_data_t Comment_dispex = { - .id = PROT_Comment, - .prototype_id = PROT_CharacterData, + .id = OBJID_Comment, + .prototype_id = OBJID_CharacterData, .vtbl = &HTMLCommentElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLCommentElement_tid, .init_info = Comment_init_dispex_info, diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index ffcaf86a361..8d734d8b71a 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -1920,16 +1920,16 @@ static HRESULT WINAPI HTMLWindow5_get_XMLHttpRequest(IHTMLWindow5 *iface, VARIAN return S_OK; }
- if(!window->constructors[PROT_XMLHttpRequest]) { + if(!window->constructors[OBJID_XMLHttpRequest]) { HRESULT hres;
- hres = HTMLXMLHttpRequestFactory_Create(window, &window->constructors[PROT_XMLHttpRequest]); + hres = HTMLXMLHttpRequestFactory_Create(window, &window->constructors[OBJID_XMLHttpRequest]); if(FAILED(hres)) return hres; }
V_VT(p) = VT_DISPATCH; - V_DISPATCH(p) = (IDispatch*)&window->constructors[PROT_XMLHttpRequest]->IWineJSDispatchHost_iface; + V_DISPATCH(p) = (IDispatch*)&window->constructors[OBJID_XMLHttpRequest]->IWineJSDispatchHost_iface; IDispatch_AddRef(V_DISPATCH(p));
return S_OK; @@ -3807,7 +3807,7 @@ static HRESULT HTMLWindow_lookup_dispid(DispatchEx *dispex, const WCHAR *name, D
static const WCHAR *constructor_names[] = { #define X(name) L ## #name, - ALL_PROTOTYPES + ALL_OBJECTS #undef X };
@@ -3828,7 +3828,7 @@ static HRESULT HTMLWindow_find_dispid(DispatchEx *dispex, const WCHAR *name, DWO const WCHAR **constr_name = bsearch(&name, constructor_names, ARRAYSIZE(constructor_names) , sizeof(constructor_names[0]), cmp_name); if(constr_name) { - prototype_id_t id = constr_name - constructor_names + 1; + object_id_t id = constr_name - constructor_names + 1; compat_mode_t compat_mode = dispex_compat_mode(dispex); DispatchEx *constr; VARIANT v; @@ -4260,7 +4260,7 @@ static const event_target_vtbl_t HTMLWindow_event_target_vtbl = { };
dispex_static_data_t Window_dispex = { - .id = PROT_Window, + .id = OBJID_Window, .vtbl = &HTMLWindow_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLWindow2_tid, .init_info = HTMLWindow_init_dispex_info, diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index f306cff68c6..e0718e28d82 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -413,7 +413,7 @@ typedef struct { const char *(*get_name)(DispatchEx*); } dispex_static_data_vtbl_t;
-#define ALL_PROTOTYPES \ +#define ALL_OBJECTS \ X(Attr) \ X(CSSRule) \ X(CSSStyleDeclaration) \ @@ -505,12 +505,12 @@ typedef struct { X(XMLHttpRequest)
typedef enum { - PROT_NONE, -#define X(name) PROT_##name, - ALL_PROTOTYPES + OBJID_NONE, +#define X(name) OBJID_##name, + ALL_OBJECTS #undef X - PROT_LAST, -} prototype_id_t; + OBJID_LAST, +} object_id_t;
struct dispex_static_data_t { const char *name; @@ -522,9 +522,9 @@ struct dispex_static_data_t { dispex_data_t *info_cache[COMPAT_MODE_CNT]; dispex_data_t *prototype_info[COMPAT_MODE_CNT - COMPAT_MODE_IE9]; dispex_data_t *delayed_init_info; - prototype_id_t id; - prototype_id_t prototype_id; - prototype_id_t constructor_id; + object_id_t id; + object_id_t prototype_id; + object_id_t constructor_id; UINT32 js_flags; compat_mode_t min_compat_mode; compat_mode_t max_compat_mode; @@ -532,10 +532,10 @@ struct dispex_static_data_t { };
#define X(name) extern dispex_static_data_t name ## _dispex; -ALL_PROTOTYPES +ALL_OBJECTS #undef X
-extern dispex_static_data_t *object_descriptors[PROT_LAST]; +extern dispex_static_data_t *object_descriptors[OBJID_LAST];
typedef HRESULT (*dispex_hook_invoke_t)(DispatchEx*,WORD,DISPPARAMS*,VARIANT*, EXCEPINFO*,IServiceProvider*); @@ -644,8 +644,8 @@ HRESULT dispex_prop_name(DispatchEx *dispex, DISPID id, BSTR *ret); HRESULT dispex_define_property(DispatchEx *dispex, const WCHAR *name, DWORD flags, VARIANT *v, DISPID *id); HRESULT dispex_index_prop_desc(DispatchEx*,DISPID,struct property_info*); IWineJSDispatchHost *dispex_outer_iface(DispatchEx *dispex); -HRESULT get_constructor(HTMLInnerWindow *script_global, prototype_id_t id, DispatchEx **ret); -HRESULT get_prototype(HTMLInnerWindow *script_global, prototype_id_t id, DispatchEx **ret); +HRESULT get_constructor(HTMLInnerWindow *script_global, object_id_t id, DispatchEx **ret); +HRESULT get_prototype(HTMLInnerWindow *script_global, object_id_t id, DispatchEx **ret);
typedef enum { DISPEXPROP_CUSTOM, @@ -800,8 +800,8 @@ struct HTMLInnerWindow { ULONG navigation_type; ULONG redirect_count;
- DispatchEx *prototypes[PROT_LAST]; - DispatchEx *constructors[PROT_LAST]; + DispatchEx *prototypes[OBJID_LAST]; + DispatchEx *constructors[OBJID_LAST];
ULONGLONG navigation_start_time; ULONGLONG unload_event_start_time; diff --git a/dlls/mshtml/mutation.c b/dlls/mshtml/mutation.c index a203c03e2dc..91cc61b6191 100644 --- a/dlls/mshtml/mutation.c +++ b/dlls/mshtml/mutation.c @@ -1212,7 +1212,7 @@ static const tid_t mutation_observer_iface_tids[] = { 0 }; dispex_static_data_t MutationObserver_dispex = { - .id = PROT_MutationObserver, + .id = OBJID_MutationObserver, .init_constructor = create_mutation_observer_ctor, .vtbl = &mutation_observer_dispex_vtbl, .disp_tid = IWineMSHTMLMutationObserver_tid, @@ -1311,7 +1311,7 @@ static const dispex_static_data_vtbl_t mutation_observer_ctor_dispex_vtbl = {
static dispex_static_data_t mutation_observer_ctor_dispex = { .name = "Function", - .constructor_id = PROT_MutationObserver, + .constructor_id = OBJID_MutationObserver, .vtbl = &mutation_observer_ctor_dispex_vtbl, };
diff --git a/dlls/mshtml/omnavigator.c b/dlls/mshtml/omnavigator.c index 8dd785e72ba..660510fc3f2 100644 --- a/dlls/mshtml/omnavigator.c +++ b/dlls/mshtml/omnavigator.c @@ -227,7 +227,7 @@ static const tid_t HTMLDOMImplementation_iface_tids[] = { 0 }; dispex_static_data_t DOMImplementation_dispex = { - .id = PROT_DOMImplementation, + .id = OBJID_DOMImplementation, .vtbl = &DOMImplementation_dispex_vtbl, .disp_tid = DispHTMLDOMImplementation_tid, .iface_tids = HTMLDOMImplementation_iface_tids, @@ -427,7 +427,7 @@ static const tid_t Screen_iface_tids[] = { 0 }; dispex_static_data_t Screen_dispex = { - .id = PROT_Screen, + .id = OBJID_Screen, .vtbl = &HTMLScreen_dispex_vtbl, .disp_tid = DispHTMLScreen_tid, .iface_tids = Screen_iface_tids, @@ -560,7 +560,7 @@ static const tid_t History_iface_tids[] = { 0 }; dispex_static_data_t History_dispex = { - .id = PROT_History, + .id = OBJID_History, .vtbl = &OmHistory_dispex_vtbl, .disp_tid = DispHTMLHistory_tid, .iface_tids = History_iface_tids, @@ -675,7 +675,7 @@ static const tid_t PluginArray_iface_tids[] = { 0 }; dispex_static_data_t PluginArray_dispex = { - .id = PROT_PluginArray, + .id = OBJID_PluginArray, .vtbl = &HTMLPluginsCollection_dispex_vtbl, .disp_tid = DispCPlugins_tid, .iface_tids = PluginArray_iface_tids, @@ -776,7 +776,7 @@ static const tid_t MimeTypeArray_iface_tids[] = { 0 }; dispex_static_data_t MimeTypeArray_dispex = { - .id = PROT_MimeTypeArray, + .id = OBJID_MimeTypeArray, .vtbl = &HTMLMimeTypesCollection_dispex_vtbl, .disp_tid = IHTMLMimeTypesCollection_tid, .iface_tids = MimeTypeArray_iface_tids, @@ -1158,7 +1158,7 @@ static const tid_t Navigator_iface_tids[] = { 0 }; dispex_static_data_t Navigator_dispex = { - .id = PROT_Navigator, + .id = OBJID_Navigator, .vtbl = &Navigator_dispex_vtbl, .disp_tid = DispHTMLNavigator_tid, .iface_tids = Navigator_iface_tids, @@ -1532,7 +1532,7 @@ static const tid_t PerformanceTiming_iface_tids[] = { 0 }; dispex_static_data_t PerformanceTiming_dispex = { - .id = PROT_PerformanceTiming, + .id = OBJID_PerformanceTiming, .vtbl = &HTMLPerformanceTiming_dispex_vtbl, .disp_tid = IHTMLPerformanceTiming_tid, .iface_tids = PerformanceTiming_iface_tids, @@ -1653,7 +1653,7 @@ static const tid_t PerformanceNavigation_iface_tids[] = { 0 }; dispex_static_data_t PerformanceNavigation_dispex = { - .id = PROT_PerformanceNavigation, + .id = OBJID_PerformanceNavigation, .vtbl = &HTMLPerformanceNavigation_dispex_vtbl, .disp_tid = IHTMLPerformanceNavigation_tid, .iface_tids = PerformanceNavigation_iface_tids, @@ -1816,7 +1816,7 @@ static const tid_t Performance_iface_tids[] = { 0 }; dispex_static_data_t Performance_dispex = { - .id = PROT_Performance, + .id = OBJID_Performance, .vtbl = &HTMLPerformance_dispex_vtbl, .disp_tid = IHTMLPerformance_tid, .iface_tids = Performance_iface_tids, @@ -1921,7 +1921,7 @@ static const tid_t MSNamespaceInfoCollection_iface_tids[] = { 0 }; dispex_static_data_t MSNamespaceInfoCollection_dispex = { - .id = PROT_MSNamespaceInfoCollection, + .id = OBJID_MSNamespaceInfoCollection, .vtbl = &HTMLNamespaceCollection_dispex_vtbl, .disp_tid = DispHTMLNamespaceCollection_tid, .iface_tids = MSNamespaceInfoCollection_iface_tids, @@ -2123,7 +2123,7 @@ static const tid_t Console_iface_tids[] = { 0 }; dispex_static_data_t Console_dispex = { - .id = PROT_Console, + .id = OBJID_Console, .vtbl = &Console_dispex_vtbl, .disp_tid = IWineMSHTMLConsole_tid, .iface_tids = Console_iface_tids, @@ -2414,7 +2414,7 @@ static const tid_t MediaQueryList_iface_tids[] = { 0 }; dispex_static_data_t MediaQueryList_dispex = { - .id = PROT_MediaQueryList, + .id = OBJID_MediaQueryList, .vtbl = &MediaQueryList_dispex_vtbl, .disp_tid = IWineMSHTMLMediaQueryList_tid, .iface_tids = MediaQueryList_iface_tids, diff --git a/dlls/mshtml/range.c b/dlls/mshtml/range.c index f10a42a895d..81b921a615a 100644 --- a/dlls/mshtml/range.c +++ b/dlls/mshtml/range.c @@ -1685,7 +1685,7 @@ static const tid_t TextRange_iface_tids[] = { 0 }; dispex_static_data_t TextRange_dispex = { - .id = PROT_TextRange, + .id = OBJID_TextRange, .vtbl = &HTMLTxtRange_dispex_vtbl, .disp_tid = IHTMLTxtRange_tid, .iface_tids = TextRange_iface_tids, @@ -1991,7 +1991,7 @@ static const tid_t Range_iface_tids[] = { };
dispex_static_data_t Range_dispex = { - .id = PROT_Range, + .id = OBJID_Range, .vtbl = &HTMLDOMRange_dispex_vtbl, .disp_tid = DispHTMLDOMRange_tid, .iface_tids = Range_iface_tids, diff --git a/dlls/mshtml/script.c b/dlls/mshtml/script.c index a6ebb4a266d..9d663ee1cf7 100644 --- a/dlls/mshtml/script.c +++ b/dlls/mshtml/script.c @@ -210,11 +210,11 @@ static BOOL init_script_engine(ScriptHost *script_host, IActiveScript *script) assert(!script_host->window->event_target.dispex.jsdisp); script_host->window->jscript = jscript;
- hres = get_prototype(script_host->window, PROT_Window, &prototype); + hres = get_prototype(script_host->window, OBJID_Window, &prototype); if(SUCCEEDED(hres)) hres = IWineJScript_InitHostObject(jscript, &script_host->window->event_target.dispex.IWineJSDispatchHost_iface, - prototype->jsdisp, object_descriptors[PROT_Window]->js_flags, + prototype->jsdisp, object_descriptors[OBJID_Window]->js_flags, &script_host->window->event_target.dispex.jsdisp); if(FAILED(hres)) ERR("Could not initialize script global: %08lx\n", hres); diff --git a/dlls/mshtml/selection.c b/dlls/mshtml/selection.c index 03d269dbb0a..d3242204cc3 100644 --- a/dlls/mshtml/selection.c +++ b/dlls/mshtml/selection.c @@ -239,7 +239,7 @@ static const tid_t MSSelection_iface_tids[] = { 0 }; dispex_static_data_t MSSelection_dispex = { - .id = PROT_MSSelection, + .id = OBJID_MSSelection, .vtbl = &HTMLSelectionObject_dispex_vtbl, .disp_tid = IHTMLSelectionObject_tid, .iface_tids = MSSelection_iface_tids, diff --git a/dlls/mshtml/svg.c b/dlls/mshtml/svg.c index 3baf422989a..6d6db909219 100644 --- a/dlls/mshtml/svg.c +++ b/dlls/mshtml/svg.c @@ -157,8 +157,8 @@ static const event_target_vtbl_t SVGElement_event_target_vtbl = { };
dispex_static_data_t SVGElement_dispex = { - .id = PROT_SVGElement, - .prototype_id = PROT_Element, + .id = OBJID_SVGElement, + .prototype_id = OBJID_Element, .vtbl = &SVGElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLUnknownElement_tid, .init_info = HTMLElement_init_dispex_info, @@ -657,8 +657,8 @@ static const event_target_vtbl_t SVGSVGElement_event_target_vtbl = { };
dispex_static_data_t SVGSVGElement_dispex = { - .id = PROT_SVGSVGElement, - .prototype_id = PROT_SVGElement, + .id = OBJID_SVGSVGElement, + .prototype_id = OBJID_SVGElement, .vtbl = &SVGSVGElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLUnknownElement_tid, .init_info = HTMLElement_init_dispex_info, @@ -787,8 +787,8 @@ static const event_target_vtbl_t SVGCircleElement_event_target_vtbl = { };
dispex_static_data_t SVGCircleElement_dispex = { - .id = PROT_SVGCircleElement, - .prototype_id = PROT_SVGElement, + .id = OBJID_SVGCircleElement, + .prototype_id = OBJID_SVGElement, .vtbl = &SVGCircleElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLUnknownElement_tid, .init_info = HTMLElement_init_dispex_info, @@ -974,13 +974,13 @@ static void *SVGTSpanElement_query_interface(DispatchEx *dispex, REFIID riid) }
dispex_static_data_t SVGTextContentElement_dispex = { - .id = PROT_SVGTextContentElement, - .prototype_id = PROT_SVGElement, + .id = OBJID_SVGTextContentElement, + .prototype_id = OBJID_SVGElement, };
dispex_static_data_t SVGTextPositioningElement_dispex = { - .id = PROT_SVGTextPositioningElement, - .prototype_id = PROT_SVGTextContentElement, + .id = OBJID_SVGTextPositioningElement, + .prototype_id = OBJID_SVGTextContentElement, };
static const NodeImplVtbl SVGTSpanElementImplVtbl = { @@ -1003,8 +1003,8 @@ static const event_target_vtbl_t SVGTSpanElement_event_target_vtbl = { };
dispex_static_data_t SVGTSpanElement_dispex = { - .id = PROT_SVGTSpanElement, - .prototype_id = PROT_SVGTextPositioningElement, + .id = OBJID_SVGTSpanElement, + .prototype_id = OBJID_SVGTextPositioningElement, .vtbl = &SVGTSpanElement_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLUnknownElement_tid, .init_info = HTMLElement_init_dispex_info, diff --git a/dlls/mshtml/xmlhttprequest.c b/dlls/mshtml/xmlhttprequest.c index c2730d4f7cd..371d4f65a93 100644 --- a/dlls/mshtml/xmlhttprequest.c +++ b/dlls/mshtml/xmlhttprequest.c @@ -1494,7 +1494,7 @@ static const tid_t HTMLXMLHttpRequest_iface_tids[] = { 0 }; dispex_static_data_t XMLHttpRequest_dispex = { - .id = PROT_XMLHttpRequest, + .id = OBJID_XMLHttpRequest, .init_constructor = HTMLXMLHttpRequestFactory_Create, .vtbl = &HTMLXMLHttpRequest_event_target_vtbl.dispex_vtbl, .disp_tid = DispHTMLXMLHttpRequest_tid, @@ -1668,7 +1668,7 @@ static const tid_t HTMLXMLHttpRequestFactory_iface_tids[] = { }; static dispex_static_data_t HTMLXMLHttpRequestFactory_dispex = { .name = "Function", - .constructor_id = PROT_XMLHttpRequest, + .constructor_id = OBJID_XMLHttpRequest, .vtbl = &HTMLXMLHttpRequestFactory_dispex_vtbl, .disp_tid = IHTMLXMLHttpRequestFactory_tid, .iface_tids = HTMLXMLHttpRequestFactory_iface_tids,
From: Gabriel Ivăncescu gabrielopcode@gmail.com
--- dlls/mshtml/dispex.c | 5 ++-- dlls/mshtml/htmlimg.c | 23 ++++++++-------- dlls/mshtml/htmlwindow.c | 45 +++++++++++++------------------ dlls/mshtml/mshtml_private.h | 3 +-- dlls/mshtml/tests/documentmode.js | 16 +++++++++++ 5 files changed, 51 insertions(+), 41 deletions(-)
diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 8d762ca7346..375f9be5402 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -3116,8 +3116,6 @@ HRESULT get_constructor(HTMLInnerWindow *script_global, object_id_t id, Dispatch { dispex_static_data_t *info;
- assert(script_global->doc->document_mode >= COMPAT_MODE_IE9); - if(script_global->constructors[id]) { *ret = script_global->constructors[id]; return S_OK; @@ -3130,6 +3128,9 @@ HRESULT get_constructor(HTMLInnerWindow *script_global, object_id_t id, Dispatch return hres; }else { struct constructor *constr; + + assert(script_global->doc->document_mode >= COMPAT_MODE_IE9); + if(!(constr = calloc(sizeof(*constr), 1))) return E_OUTOFMEMORY;
diff --git a/dlls/mshtml/htmlimg.c b/dlls/mshtml/htmlimg.c index 1cad4127946..942cf885cc4 100644 --- a/dlls/mshtml/htmlimg.c +++ b/dlls/mshtml/htmlimg.c @@ -878,15 +878,7 @@ static const dispex_static_data_vtbl_t HTMLImageElementFactory_dispex_vtbl = { .value = HTMLImageElementFactory_value, };
-static dispex_static_data_t HTMLImageElementFactory_dispex = { - .name = "Function", - .constructor_id = OBJID_HTMLImageElement, - .vtbl = &HTMLImageElementFactory_dispex_vtbl, - .disp_tid = IHTMLImageElementFactory_tid, - .init_info = HTMLImageElementFactory_init_dispex_info, -}; - -HRESULT HTMLImageElementFactory_Create(HTMLInnerWindow *window, HTMLImageElementFactory **ret_val) +static HRESULT HTMLImageElementFactory_Create(HTMLInnerWindow *window, DispatchEx **ret_val) { HTMLImageElementFactory *ret;
@@ -898,9 +890,18 @@ HRESULT HTMLImageElementFactory_Create(HTMLInnerWindow *window, HTMLImageElement ret->window = window; IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface);
- init_dispatch(&ret->dispex, &HTMLImageElementFactory_dispex, window, + init_dispatch(&ret->dispex, &Image_dispex, window, dispex_compat_mode(&window->event_target.dispex));
- *ret_val = ret; + *ret_val = &ret->dispex; return S_OK; } + +dispex_static_data_t Image_dispex = { + .name = "Function", + .constructor_id = OBJID_HTMLImageElement, + .init_constructor = HTMLImageElementFactory_Create, + .vtbl = &HTMLImageElementFactory_dispex_vtbl, + .disp_tid = IHTMLImageElementFactory_tid, + .init_info = HTMLImageElementFactory_init_dispex_info, +}; diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 8d734d8b71a..a5e8b399e3a 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -673,21 +673,16 @@ static HRESULT WINAPI HTMLWindow2_get_Image(IHTMLWindow2 *iface, IHTMLImageEleme { HTMLWindow *This = impl_from_IHTMLWindow2(iface); HTMLInnerWindow *window = This->inner_window; + DispatchEx *constr; + HRESULT hres;
TRACE("(%p)->(%p)\n", This, p);
- if(!window->image_factory) { - HRESULT hres; - - hres = HTMLImageElementFactory_Create(window, &window->image_factory); - if(FAILED(hres)) - return hres; - } - - *p = &window->image_factory->IHTMLImageElementFactory_iface; - IHTMLImageElementFactory_AddRef(*p); + hres = get_constructor(window, OBJID_Image, &constr); + if(FAILED(hres)) + return hres;
- return S_OK; + return IWineJSDispatchHost_QueryInterface(&constr->IWineJSDispatchHost_iface, &IID_IHTMLImageElementFactory, (void**)p); }
static HRESULT WINAPI HTMLWindow2_get_location(IHTMLWindow2 *iface, IHTMLLocation **p) @@ -3700,8 +3695,6 @@ static void HTMLWindow_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCa note_cc_edge((nsISupports*)&This->doc->node.IHTMLDOMNode_iface, "doc", cb); if(This->console) note_cc_edge((nsISupports*)This->console, "console", cb); - if(This->image_factory) - note_cc_edge((nsISupports*)&This->image_factory->IHTMLImageElementFactory_iface, "image_factory", cb); if(This->option_factory) note_cc_edge((nsISupports*)&This->option_factory->IHTMLOptionElementFactory_iface, "option_factory", cb); if(This->screen) @@ -3742,11 +3735,6 @@ static void HTMLWindow_unlink(DispatchEx *dispex)
release_event_target(&This->event_target);
- if(This->image_factory) { - HTMLImageElementFactory *image_factory = This->image_factory; - This->image_factory = NULL; - IHTMLImageElementFactory_Release(&image_factory->IHTMLImageElementFactory_iface); - } if(This->option_factory) { HTMLOptionElementFactory *option_factory = This->option_factory; This->option_factory = NULL; @@ -3818,13 +3806,14 @@ static int CDECL cmp_name(const void *x, const void *y)
static HRESULT HTMLWindow_find_dispid(DispatchEx *dispex, const WCHAR *name, DWORD grfdex, DISPID *dispid) { + compat_mode_t compat_mode = dispex_compat_mode(dispex); HTMLInnerWindow *This = impl_from_DispatchEx(dispex); HTMLOuterWindow *frame; global_prop_t *prop; HTMLElement *elem; HRESULT hres;
- if(dispex_compat_mode(dispex) >= COMPAT_MODE_IE9) { + if(compat_mode >= COMPAT_MODE_IE9) { const WCHAR **constr_name = bsearch(&name, constructor_names, ARRAYSIZE(constructor_names) , sizeof(constructor_names[0]), cmp_name); if(constr_name) { @@ -4188,15 +4177,18 @@ static HRESULT IHTMLWindow6_postMessage_hook(DispatchEx *dispex, WORD flags, DIS
static void HTMLWindow_init_dispex_info(dispex_data_t *info, compat_mode_t compat_mode) { - static const dispex_hook_t window2_hooks[] = { - {DISPID_IHTMLWINDOW2_LOCATION, IHTMLWindow2_location_hook}, - {DISPID_UNKNOWN} - }; static const dispex_hook_t window2_ie11_hooks[] = { - {DISPID_IHTMLWINDOW2_LOCATION, IHTMLWindow2_location_hook}, - {DISPID_IHTMLWINDOW2_EXECSCRIPT, NULL}, + {DISPID_IHTMLWINDOW2_EXECSCRIPT}, + + /* IE9+ */ + {DISPID_IHTMLWINDOW2_IMAGE}, + + /* Common for all modes */ + {DISPID_IHTMLWINDOW2_LOCATION, IHTMLWindow2_location_hook}, {DISPID_UNKNOWN} }; + const dispex_hook_t *const window2_ie9_hooks = window2_ie11_hooks + 1; + const dispex_hook_t *const window2_hooks = window2_ie9_hooks + 1; static const dispex_hook_t window3_hooks[] = { {DISPID_IHTMLWINDOW3_SETTIMEOUT, IHTMLWindow3_setTimeout_hook}, {DISPID_UNKNOWN} @@ -4228,7 +4220,8 @@ static void HTMLWindow_init_dispex_info(dispex_data_t *info, compat_mode_t compa dispex_info_add_interface(info, IHTMLWindow5_tid, NULL); dispex_info_add_interface(info, IHTMLWindow4_tid, compat_mode >= COMPAT_MODE_IE11 ? window4_ie11_hooks : NULL); dispex_info_add_interface(info, IHTMLWindow3_tid, compat_mode >= COMPAT_MODE_IE11 ? window3_ie11_hooks : window3_hooks); - dispex_info_add_interface(info, IHTMLWindow2_tid, compat_mode >= COMPAT_MODE_IE11 ? window2_ie11_hooks : window2_hooks); + dispex_info_add_interface(info, IHTMLWindow2_tid, compat_mode >= COMPAT_MODE_IE11 ? window2_ie11_hooks : + compat_mode >= COMPAT_MODE_IE9 ? window2_ie9_hooks : window2_hooks); EventTarget_init_dispex_info(info, compat_mode); }
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index e0718e28d82..fce5669c259 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -463,6 +463,7 @@ typedef struct { X(HTMLTitleElement) \ X(HTMLUnknownElement) \ X(History) \ + X(Image) \ X(KeyboardEvent) \ X(MSCSSProperties) \ X(MSCSSRuleList) \ @@ -771,7 +772,6 @@ struct HTMLInnerWindow {
IHTMLEventObj *event;
- HTMLImageElementFactory *image_factory; HTMLOptionElementFactory *option_factory; IHTMLScreen *screen; OmHistory *history; @@ -1170,7 +1170,6 @@ HRESULT update_window_doc(HTMLInnerWindow*); HTMLOuterWindow *mozwindow_to_window(const mozIDOMWindowProxy*); void get_top_window(HTMLOuterWindow*,HTMLOuterWindow**); HRESULT HTMLOptionElementFactory_Create(HTMLInnerWindow*,HTMLOptionElementFactory**); -HRESULT HTMLImageElementFactory_Create(HTMLInnerWindow*,HTMLImageElementFactory**); HRESULT HTMLXMLHttpRequestFactory_Create(HTMLInnerWindow*,DispatchEx**); HRESULT create_location(HTMLOuterWindow*,HTMLLocation**); HRESULT create_navigator(HTMLInnerWindow*,IOmNavigator**); diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index fc89c38e326..b3189f16d6e 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -3996,3 +3996,19 @@ sync_test("prototype props", function() { check(Text, [ "removeNode", "replaceNode", "replaceWholeText", "splitText", "swapNode", "wholeText" ], [ "replaceWholeText", "wholeText" ]); check(UIEvent, [ "detail", "initUIEvent", "view" ], null, [ "deviceSessionId" ]); }); + +sync_test("constructors", function() { + var v = document.documentMode, i, r; + if(v < 9) + return; + + var ctors = [ "Image", "XMLHttpRequest" ]; + if (v >= 11) + ctors.push("MutationObserver"); + for(i = 0; i < ctors.length; i++) { + r = ctors[i]; + ok(window.hasOwnProperty(r), r + " not prop of window"); + ok(!(r in Window.prototype), r + " is a prop of window's prototype"); + } + ok(window.Image.prototype === window.HTMLImageElement.prototype, "Image.prototype != HTMLImageElement.prototype"); +});
From: Gabriel Ivăncescu gabrielopcode@gmail.com
--- dlls/mshtml/htmlselect.c | 23 ++++++++++++----------- dlls/mshtml/htmlwindow.c | 27 ++++++++------------------- dlls/mshtml/mshtml_private.h | 3 +-- dlls/mshtml/tests/documentmode.js | 3 ++- 4 files changed, 23 insertions(+), 33 deletions(-)
diff --git a/dlls/mshtml/htmlselect.c b/dlls/mshtml/htmlselect.c index 787a61b1b91..29875d91d7e 100644 --- a/dlls/mshtml/htmlselect.c +++ b/dlls/mshtml/htmlselect.c @@ -524,15 +524,7 @@ static const dispex_static_data_vtbl_t HTMLOptionElementFactory_dispex_vtbl = { .value = HTMLOptionElementFactory_value, };
-static dispex_static_data_t HTMLOptionElementFactory_dispex = { - .name = "Function", - .constructor_id = OBJID_HTMLOptionElement, - .vtbl = &HTMLOptionElementFactory_dispex_vtbl, - .disp_tid = IHTMLOptionElementFactory_tid, - .init_info = HTMLOptionElementFactory_init_dispex_info, -}; - -HRESULT HTMLOptionElementFactory_Create(HTMLInnerWindow *window, HTMLOptionElementFactory **ret_ptr) +static HRESULT HTMLOptionElementFactory_Create(HTMLInnerWindow *window, DispatchEx **ret_ptr) { HTMLOptionElementFactory *ret;
@@ -544,13 +536,22 @@ HRESULT HTMLOptionElementFactory_Create(HTMLInnerWindow *window, HTMLOptionEleme ret->window = window; IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface);
- init_dispatch(&ret->dispex, &HTMLOptionElementFactory_dispex, window, + init_dispatch(&ret->dispex, &Option_dispex, window, dispex_compat_mode(&window->event_target.dispex));
- *ret_ptr = ret; + *ret_ptr = &ret->dispex; return S_OK; }
+dispex_static_data_t Option_dispex = { + .name = "Function", + .constructor_id = OBJID_HTMLOptionElement, + .init_constructor = HTMLOptionElementFactory_Create, + .vtbl = &HTMLOptionElementFactory_dispex_vtbl, + .disp_tid = IHTMLOptionElementFactory_tid, + .init_info = HTMLOptionElementFactory_init_dispex_info, +}; + struct HTMLSelectElement { HTMLElement element;
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index a5e8b399e3a..90d42a00506 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -1226,21 +1226,16 @@ static HRESULT WINAPI HTMLWindow2_get_Option(IHTMLWindow2 *iface, IHTMLOptionEle { HTMLWindow *This = impl_from_IHTMLWindow2(iface); HTMLInnerWindow *window = This->inner_window; + DispatchEx *constr; + HRESULT hres;
TRACE("(%p)->(%p)\n", This, p);
- if(!window->option_factory) { - HRESULT hres; - - hres = HTMLOptionElementFactory_Create(window, &window->option_factory); - if(FAILED(hres)) - return hres; - } - - *p = &window->option_factory->IHTMLOptionElementFactory_iface; - IHTMLOptionElementFactory_AddRef(*p); + hres = get_constructor(window, OBJID_Option, &constr); + if(FAILED(hres)) + return hres;
- return S_OK; + return IWineJSDispatchHost_QueryInterface(&constr->IWineJSDispatchHost_iface, &IID_IHTMLOptionElementFactory, (void**)p); }
static HRESULT WINAPI HTMLWindow2_focus(IHTMLWindow2 *iface) @@ -3695,8 +3690,6 @@ static void HTMLWindow_traverse(DispatchEx *dispex, nsCycleCollectionTraversalCa note_cc_edge((nsISupports*)&This->doc->node.IHTMLDOMNode_iface, "doc", cb); if(This->console) note_cc_edge((nsISupports*)This->console, "console", cb); - if(This->option_factory) - note_cc_edge((nsISupports*)&This->option_factory->IHTMLOptionElementFactory_iface, "option_factory", cb); if(This->screen) note_cc_edge((nsISupports*)This->screen, "screen", cb); if(This->history) @@ -3735,11 +3728,6 @@ static void HTMLWindow_unlink(DispatchEx *dispex)
release_event_target(&This->event_target);
- if(This->option_factory) { - HTMLOptionElementFactory *option_factory = This->option_factory; - This->option_factory = NULL; - IHTMLOptionElementFactory_Release(&option_factory->IHTMLOptionElementFactory_iface); - } unlink_ref(&This->screen); if(This->history) { OmHistory *history = This->history; @@ -4182,13 +4170,14 @@ static void HTMLWindow_init_dispex_info(dispex_data_t *info, compat_mode_t compa
/* IE9+ */ {DISPID_IHTMLWINDOW2_IMAGE}, + {DISPID_IHTMLWINDOW2_OPTION},
/* Common for all modes */ {DISPID_IHTMLWINDOW2_LOCATION, IHTMLWindow2_location_hook}, {DISPID_UNKNOWN} }; const dispex_hook_t *const window2_ie9_hooks = window2_ie11_hooks + 1; - const dispex_hook_t *const window2_hooks = window2_ie9_hooks + 1; + const dispex_hook_t *const window2_hooks = window2_ie9_hooks + 2; static const dispex_hook_t window3_hooks[] = { {DISPID_IHTMLWINDOW3_SETTIMEOUT, IHTMLWindow3_setTimeout_hook}, {DISPID_UNKNOWN} diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index fce5669c259..4741249cbc1 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -481,6 +481,7 @@ typedef struct { X(Navigator) \ X(Node) \ X(NodeList) \ + X(Option) \ X(PageTransitionEvent) \ X(Performance) \ X(PerformanceNavigation) \ @@ -772,7 +773,6 @@ struct HTMLInnerWindow {
IHTMLEventObj *event;
- HTMLOptionElementFactory *option_factory; IHTMLScreen *screen; OmHistory *history; IOmNavigator *navigator; @@ -1169,7 +1169,6 @@ HRESULT create_outer_window(GeckoBrowser*,mozIDOMWindowProxy*,HTMLOuterWindow*,H HRESULT update_window_doc(HTMLInnerWindow*); HTMLOuterWindow *mozwindow_to_window(const mozIDOMWindowProxy*); void get_top_window(HTMLOuterWindow*,HTMLOuterWindow**); -HRESULT HTMLOptionElementFactory_Create(HTMLInnerWindow*,HTMLOptionElementFactory**); HRESULT HTMLXMLHttpRequestFactory_Create(HTMLInnerWindow*,DispatchEx**); HRESULT create_location(HTMLOuterWindow*,HTMLLocation**); HRESULT create_navigator(HTMLInnerWindow*,IOmNavigator**); diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index b3189f16d6e..55df3d746e4 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -4002,7 +4002,7 @@ sync_test("constructors", function() { if(v < 9) return;
- var ctors = [ "Image", "XMLHttpRequest" ]; + var ctors = [ "Image", "Option", "XMLHttpRequest" ]; if (v >= 11) ctors.push("MutationObserver"); for(i = 0; i < ctors.length; i++) { @@ -4011,4 +4011,5 @@ sync_test("constructors", function() { ok(!(r in Window.prototype), r + " is a prop of window's prototype"); } ok(window.Image.prototype === window.HTMLImageElement.prototype, "Image.prototype != HTMLImageElement.prototype"); + ok(window.Option.prototype === window.HTMLOptionElement.prototype, "Option.prototype != HTMLOptionElement.prototype"); });
From: Gabriel Ivăncescu gabrielopcode@gmail.com
--- dlls/mshtml/htmlwindow.c | 14 ++++++-------- dlls/mshtml/mshtml_private.h | 1 - dlls/mshtml/xmlhttprequest.c | 29 ++++++++++++++--------------- 3 files changed, 20 insertions(+), 24 deletions(-)
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 90d42a00506..c8c0c7c1ea6 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -1902,6 +1902,8 @@ static HRESULT WINAPI HTMLWindow5_get_XMLHttpRequest(IHTMLWindow5 *iface, VARIAN { HTMLWindow *This = impl_from_IHTMLWindow5(iface); HTMLInnerWindow *window = This->inner_window; + DispatchEx *constr; + HRESULT hres;
TRACE("(%p)->(%p)\n", This, p);
@@ -1910,16 +1912,12 @@ static HRESULT WINAPI HTMLWindow5_get_XMLHttpRequest(IHTMLWindow5 *iface, VARIAN return S_OK; }
- if(!window->constructors[OBJID_XMLHttpRequest]) { - HRESULT hres; - - hres = HTMLXMLHttpRequestFactory_Create(window, &window->constructors[OBJID_XMLHttpRequest]); - if(FAILED(hres)) - return hres; - } + hres = get_constructor(window, OBJID_XMLHttpRequest, &constr); + if(FAILED(hres)) + return hres;
V_VT(p) = VT_DISPATCH; - V_DISPATCH(p) = (IDispatch*)&window->constructors[OBJID_XMLHttpRequest]->IWineJSDispatchHost_iface; + V_DISPATCH(p) = (IDispatch*)&constr->IWineJSDispatchHost_iface; IDispatch_AddRef(V_DISPATCH(p));
return S_OK; diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 4741249cbc1..cf8c2a5162b 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -1169,7 +1169,6 @@ HRESULT create_outer_window(GeckoBrowser*,mozIDOMWindowProxy*,HTMLOuterWindow*,H HRESULT update_window_doc(HTMLInnerWindow*); HTMLOuterWindow *mozwindow_to_window(const mozIDOMWindowProxy*); void get_top_window(HTMLOuterWindow*,HTMLOuterWindow**); -HRESULT HTMLXMLHttpRequestFactory_Create(HTMLInnerWindow*,DispatchEx**); HRESULT create_location(HTMLOuterWindow*,HTMLLocation**); HRESULT create_navigator(HTMLInnerWindow*,IOmNavigator**); HRESULT create_html_screen(HTMLInnerWindow*,IHTMLScreen**); diff --git a/dlls/mshtml/xmlhttprequest.c b/dlls/mshtml/xmlhttprequest.c index 371d4f65a93..109ef990f67 100644 --- a/dlls/mshtml/xmlhttprequest.c +++ b/dlls/mshtml/xmlhttprequest.c @@ -1489,20 +1489,6 @@ static const event_target_vtbl_t HTMLXMLHttpRequest_event_target_vtbl = { .bind_event = HTMLXMLHttpRequest_bind_event };
-static const tid_t HTMLXMLHttpRequest_iface_tids[] = { - IHTMLXMLHttpRequest2_tid, - 0 -}; -dispex_static_data_t XMLHttpRequest_dispex = { - .id = OBJID_XMLHttpRequest, - .init_constructor = HTMLXMLHttpRequestFactory_Create, - .vtbl = &HTMLXMLHttpRequest_event_target_vtbl.dispex_vtbl, - .disp_tid = DispHTMLXMLHttpRequest_tid, - .iface_tids = HTMLXMLHttpRequest_iface_tids, - .init_info = HTMLXMLHttpRequest_init_dispex_info, -}; - - /* IHTMLXMLHttpRequestFactory */ static inline HTMLXMLHttpRequestFactory *impl_from_IHTMLXMLHttpRequestFactory(IHTMLXMLHttpRequestFactory *iface) { @@ -1674,7 +1660,7 @@ static dispex_static_data_t HTMLXMLHttpRequestFactory_dispex = { .iface_tids = HTMLXMLHttpRequestFactory_iface_tids, };
-HRESULT HTMLXMLHttpRequestFactory_Create(HTMLInnerWindow* window, DispatchEx **ret_ptr) +static HRESULT HTMLXMLHttpRequestFactory_Create(HTMLInnerWindow *window, DispatchEx **ret_ptr) { HTMLXMLHttpRequestFactory *ret;
@@ -1692,3 +1678,16 @@ HRESULT HTMLXMLHttpRequestFactory_Create(HTMLInnerWindow* window, DispatchEx **r *ret_ptr = &ret->dispex; return S_OK; } + +static const tid_t HTMLXMLHttpRequest_iface_tids[] = { + IHTMLXMLHttpRequest2_tid, + 0 +}; +dispex_static_data_t XMLHttpRequest_dispex = { + .id = OBJID_XMLHttpRequest, + .init_constructor = HTMLXMLHttpRequestFactory_Create, + .vtbl = &HTMLXMLHttpRequest_event_target_vtbl.dispex_vtbl, + .disp_tid = DispHTMLXMLHttpRequest_tid, + .iface_tids = HTMLXMLHttpRequest_iface_tids, + .init_info = HTMLXMLHttpRequest_init_dispex_info, +};
This merge request was approved by Jacek Caban.
This merge request was approved by Gabriel Ivăncescu.