2 * Copyright 2005-2009 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "docobjectservice.h"
31 #include "shdeprecated.h"
33 #include "wine/heap.h"
34 #include "wine/list.h"
35 #include "wine/rbtree.h"
36 #include "wine/unicode.h"
44 #define NS_ERROR_GENERATE_FAILURE(module,code) \
45 ((nsresult) (((UINT32)(1u<<31)) | ((UINT32)(module+0x45)<<16) | ((UINT32)(code))))
46 #define NS_ERROR_GENERATE_SUCCESS(module,code) \
47 ((nsresult) (((UINT32)(module+0x45)<<16) | ((UINT32)(code))))
49 #define NS_OK ((nsresult)0x00000000L)
50 #define NS_ERROR_FAILURE ((nsresult)0x80004005L)
51 #define NS_ERROR_OUT_OF_MEMORY ((nsresult)0x8007000EL)
52 #define NS_ERROR_NOT_IMPLEMENTED ((nsresult)0x80004001L)
53 #define NS_NOINTERFACE ((nsresult)0x80004002L)
54 #define NS_ERROR_INVALID_POINTER ((nsresult)0x80004003L)
55 #define NS_ERROR_NULL_POINTER NS_ERROR_INVALID_POINTER
56 #define NS_ERROR_NOT_AVAILABLE ((nsresult)0x80040111L)
57 #define NS_ERROR_INVALID_ARG ((nsresult)0x80070057L)
58 #define NS_ERROR_UNEXPECTED ((nsresult)0x8000ffffL)
60 #define NS_ERROR_MODULE_NETWORK 6
62 #define NS_BINDING_ABORTED NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 2)
63 #define NS_ERROR_UNKNOWN_PROTOCOL NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 18)
64 #define NS_SUCCESS_DEFAULT_ACTION NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_NETWORK, 66)
66 #define NS_FAILED(res) ((res) & 0x80000000)
67 #define NS_SUCCEEDED(res) (!NS_FAILED(res))
71 #define MSHTML_E_NODOC 0x800a025c
73 typedef struct HTMLDOMNode HTMLDOMNode
;
74 typedef struct ConnectionPoint ConnectionPoint
;
75 typedef struct BSCallback BSCallback
;
76 typedef struct EventTarget EventTarget
;
80 XDIID(DispCEventObj) \
82 XDIID(DispDOMChildrenCollection) \
84 XDIID(DispDOMKeyboardEvent) \
85 XDIID(DispDOMMouseEvent) \
86 XDIID(DispDOMUIEvent) \
87 XDIID(DispHTMLAnchorElement) \
88 XDIID(DispHTMLAreaElement) \
89 XDIID(DispHTMLAttributeCollection) \
91 XDIID(DispHTMLButtonElement) \
92 XDIID(DispHTMLCommentElement) \
93 XDIID(DispHTMLCurrentStyle) \
94 XDIID(DispHTMLDocument) \
95 XDIID(DispHTMLDOMAttribute) \
96 XDIID(DispHTMLDOMTextNode) \
97 XDIID(DispHTMLElementCollection) \
98 XDIID(DispHTMLEmbed) \
99 XDIID(DispHTMLFormElement) \
100 XDIID(DispHTMLGenericElement) \
101 XDIID(DispHTMLFrameElement) \
102 XDIID(DispHTMLHeadElement) \
103 XDIID(DispHTMLHtmlElement) \
104 XDIID(DispHTMLHistory) \
105 XDIID(DispHTMLIFrame) \
107 XDIID(DispHTMLInputElement) \
108 XDIID(DispHTMLLabelElement) \
109 XDIID(DispHTMLLinkElement) \
110 XDIID(DispHTMLLocation) \
111 XDIID(DispHTMLMetaElement) \
112 XDIID(DispHTMLNavigator) \
113 XDIID(DispHTMLObjectElement) \
114 XDIID(DispHTMLOptionElement) \
115 XDIID(DispHTMLScreen) \
116 XDIID(DispHTMLScriptElement) \
117 XDIID(DispHTMLSelectElement) \
118 XDIID(DispHTMLStyle) \
119 XDIID(DispHTMLStyleElement) \
120 XDIID(DispHTMLStyleSheet) \
121 XDIID(DispHTMLStyleSheetRulesCollection) \
122 XDIID(DispHTMLStyleSheetsCollection) \
123 XDIID(DispHTMLTable) \
124 XDIID(DispHTMLTableCell) \
125 XDIID(DispHTMLTableRow) \
126 XDIID(DispHTMLTextAreaElement) \
127 XDIID(DispHTMLTitleElement) \
128 XDIID(DispHTMLUnknownElement) \
129 XDIID(DispHTMLWindow2) \
130 XDIID(DispHTMLXMLHttpRequest) \
131 XDIID(HTMLDocumentEvents) \
132 XDIID(HTMLElementEvents2) \
134 XIID(IDOMKeyboardEvent) \
135 XIID(IDOMMouseEvent) \
137 XIID(IDocumentEvent) \
138 XIID(IDocumentSelector) \
139 XIID(IElementSelector) \
140 XIID(IElementTraversal) \
142 XIID(IHTMLAnchorElement) \
143 XIID(IHTMLAreaElement) \
144 XIID(IHTMLAttributeCollection) \
145 XIID(IHTMLAttributeCollection2) \
146 XIID(IHTMLAttributeCollection3) \
147 XIID(IHTMLBodyElement) \
148 XIID(IHTMLBodyElement2) \
149 XIID(IHTMLButtonElement) \
150 XIID(IHTMLCommentElement) \
151 XIID(IHTMLCurrentStyle) \
152 XIID(IHTMLCurrentStyle2) \
153 XIID(IHTMLCurrentStyle3) \
154 XIID(IHTMLCurrentStyle4) \
155 XIID(IHTMLDocument2) \
156 XIID(IHTMLDocument3) \
157 XIID(IHTMLDocument4) \
158 XIID(IHTMLDocument5) \
159 XIID(IHTMLDocument6) \
160 XIID(IHTMLDocument7) \
161 XIID(IHTMLDOMAttribute) \
162 XIID(IHTMLDOMAttribute2) \
163 XIID(IHTMLDOMChildrenCollection) \
164 XIID(IHTMLDOMImplementation) \
166 XIID(IHTMLDOMNode2) \
167 XIID(IHTMLDOMNode3) \
168 XIID(IHTMLDOMTextNode) \
169 XIID(IHTMLDOMTextNode2) \
171 XIID(IHTMLElement2) \
172 XIID(IHTMLElement3) \
173 XIID(IHTMLElement4) \
174 XIID(IHTMLElement6) \
175 XIID(IHTMLElementCollection) \
176 XIID(IHTMLEmbedElement) \
177 XIID(IHTMLEventObj) \
178 XIID(IHTMLFiltersCollection) \
179 XIID(IHTMLFormElement) \
180 XIID(IHTMLFrameBase) \
181 XIID(IHTMLFrameBase2) \
182 XIID(IHTMLFrameElement3) \
183 XIID(IHTMLGenericElement) \
184 XIID(IHTMLHeadElement) \
185 XIID(IHTMLHtmlElement) \
186 XIID(IHTMLIFrameElement) \
187 XIID(IHTMLIFrameElement2) \
188 XIID(IHTMLIFrameElement3) \
189 XIID(IHTMLImageElementFactory) \
190 XIID(IHTMLImgElement) \
191 XIID(IHTMLInputElement) \
192 XIID(IHTMLInputTextElement2) \
193 XIID(IHTMLLabelElement) \
194 XIID(IHTMLLinkElement) \
195 XIID(IHTMLLocation) \
196 XIID(IHTMLMetaElement) \
197 XIID(IHTMLMimeTypesCollection) \
198 XIID(IHTMLObjectElement) \
199 XIID(IHTMLObjectElement2) \
200 XIID(IHTMLOptionElement) \
201 XIID(IHTMLOptionElementFactory) \
202 XIID(IHTMLPluginsCollection) \
205 XIID(IHTMLScriptElement) \
206 XIID(IHTMLSelectElement) \
207 XIID(IHTMLSelectionObject) \
208 XIID(IHTMLSelectionObject2) \
216 XIID(IHTMLStyleElement) \
217 XIID(IHTMLStyleSheet) \
218 XIID(IHTMLStyleSheetRulesCollection) \
219 XIID(IHTMLStyleSheetsCollection) \
223 XIID(IHTMLTableCell) \
224 XIID(IHTMLTableRow) \
225 XIID(IHTMLTextAreaElement) \
226 XIID(IHTMLTextContainer) \
227 XIID(IHTMLTitleElement) \
228 XIID(IHTMLTxtRange) \
229 XIID(IHTMLUniqueName) \
235 XIID(IHTMLXMLHttpRequest) \
236 XIID(IHTMLXMLHttpRequestFactory) \
241 #define XIID(iface) iface ## _tid,
242 #define XDIID(iface) iface ## _tid,
259 #define COMPAT_MODE_CNT (COMPAT_MODE_IE11+1)
260 #define COMPAT_MODE_NONE COMPAT_MODE_QUIRKS
263 unsigned document_mode
;
265 } compat_mode_info_t
;
267 extern const compat_mode_info_t compat_mode_info
[COMPAT_MODE_CNT
] DECLSPEC_HIDDEN
;
269 typedef struct dispex_data_t dispex_data_t
;
270 typedef struct dispex_dynamic_data_t dispex_dynamic_data_t
;
272 #define MSHTML_DISPID_CUSTOM_MIN 0x60000000
273 #define MSHTML_DISPID_CUSTOM_MAX 0x6fffffff
274 #define MSHTML_CUSTOM_DISPID_CNT (MSHTML_DISPID_CUSTOM_MAX-MSHTML_DISPID_CUSTOM_MIN)
276 typedef struct DispatchEx DispatchEx
;
279 HRESULT (*value
)(DispatchEx
*,LCID
,WORD
,DISPPARAMS
*,VARIANT
*,EXCEPINFO
*,IServiceProvider
*);
280 HRESULT (*get_dispid
)(DispatchEx
*,BSTR
,DWORD
,DISPID
*);
281 HRESULT (*invoke
)(DispatchEx
*,DISPID
,LCID
,WORD
,DISPPARAMS
*,VARIANT
*,EXCEPINFO
*,IServiceProvider
*);
282 compat_mode_t (*get_compat_mode
)(DispatchEx
*);
283 HRESULT (*populate_props
)(DispatchEx
*);
284 } dispex_static_data_vtbl_t
;
287 const dispex_static_data_vtbl_t
*vtbl
;
288 const tid_t disp_tid
;
289 const tid_t
* const iface_tids
;
290 void (*init_info
)(dispex_data_t
*,compat_mode_t
);
291 dispex_data_t
*info_cache
[COMPAT_MODE_CNT
];
292 dispex_data_t
*delayed_init_info
;
293 } dispex_static_data_t
;
295 typedef HRESULT (*dispex_hook_invoke_t
)(DispatchEx
*,LCID
,WORD
,DISPPARAMS
*,VARIANT
*,
296 EXCEPINFO
*,IServiceProvider
*);
300 dispex_hook_invoke_t invoke
;
304 IDispatchEx IDispatchEx_iface
;
309 dispex_dynamic_data_t
*dynamic_data
;
314 } nsCycleCollectingAutoRefCnt
;
320 } ExternalCycleCollectionParticipant
;
322 typedef struct nsCycleCollectionTraversalCallback nsCycleCollectionTraversalCallback
;
325 nsresult (NSAPI
*traverse
)(void*,void*,nsCycleCollectionTraversalCallback
*);
326 nsresult (NSAPI
*unlink
)(void*);
327 void (NSAPI
*delete_cycle_collectable
)(void*);
330 DEFINE_GUID(IID_nsXPCOMCycleCollectionParticipant
, 0x9674489b,0x1f6f,0x4550,0xa7,0x30, 0xcc,0xae,0xdd,0x10,0x4c,0xf9);
332 nsrefcnt (__cdecl
*ccref_incr
)(nsCycleCollectingAutoRefCnt
*,nsISupports
*) DECLSPEC_HIDDEN
;
333 nsrefcnt (__cdecl
*ccref_decr
)(nsCycleCollectingAutoRefCnt
*,nsISupports
*,ExternalCycleCollectionParticipant
*) DECLSPEC_HIDDEN
;
334 void (__cdecl
*ccref_init
)(nsCycleCollectingAutoRefCnt
*,nsrefcnt
) DECLSPEC_HIDDEN
;
335 void (__cdecl
*ccp_init
)(ExternalCycleCollectionParticipant
*,const CCObjCallback
*) DECLSPEC_HIDDEN
;
336 void (__cdecl
*describe_cc_node
)(nsCycleCollectingAutoRefCnt
*,const char*,nsCycleCollectionTraversalCallback
*) DECLSPEC_HIDDEN
;
337 void (__cdecl
*note_cc_edge
)(nsISupports
*,const char*,nsCycleCollectionTraversalCallback
*) DECLSPEC_HIDDEN
;
339 void init_dispex_with_compat_mode(DispatchEx
*,IUnknown
*,dispex_static_data_t
*,compat_mode_t
) DECLSPEC_HIDDEN
;
340 void release_dispex(DispatchEx
*) DECLSPEC_HIDDEN
;
341 BOOL
dispex_query_interface(DispatchEx
*,REFIID
,void**) DECLSPEC_HIDDEN
;
342 HRESULT
dispex_get_dprop_ref(DispatchEx
*,const WCHAR
*,BOOL
,VARIANT
**) DECLSPEC_HIDDEN
;
343 HRESULT
get_dispids(tid_t
,DWORD
*,DISPID
**) DECLSPEC_HIDDEN
;
344 HRESULT
remove_attribute(DispatchEx
*,DISPID
,VARIANT_BOOL
*) DECLSPEC_HIDDEN
;
345 HRESULT
dispex_get_dynid(DispatchEx
*,const WCHAR
*,DISPID
*) DECLSPEC_HIDDEN
;
346 void dispex_traverse(DispatchEx
*,nsCycleCollectionTraversalCallback
*) DECLSPEC_HIDDEN
;
347 void dispex_unlink(DispatchEx
*) DECLSPEC_HIDDEN
;
348 void release_typelib(void) DECLSPEC_HIDDEN
;
349 HRESULT
get_class_typeinfo(const CLSID
*,ITypeInfo
**) DECLSPEC_HIDDEN
;
350 const void *dispex_get_vtbl(DispatchEx
*) DECLSPEC_HIDDEN
;
351 void dispex_info_add_interface(dispex_data_t
*,tid_t
,const dispex_hook_t
*) DECLSPEC_HIDDEN
;
352 compat_mode_t
dispex_compat_mode(DispatchEx
*) DECLSPEC_HIDDEN
;
354 static inline void init_dispex(DispatchEx
*dispex
, IUnknown
*outer
, dispex_static_data_t
*desc
)
356 init_dispex_with_compat_mode(dispex
, outer
, desc
, COMPAT_MODE_NONE
);
363 } dispex_prop_type_t
;
365 dispex_prop_type_t
get_dispid_type(DISPID
) DECLSPEC_HIDDEN
;
367 typedef struct HTMLWindow HTMLWindow
;
368 typedef struct HTMLInnerWindow HTMLInnerWindow
;
369 typedef struct HTMLOuterWindow HTMLOuterWindow
;
370 typedef struct HTMLDocumentNode HTMLDocumentNode
;
371 typedef struct HTMLDocumentObj HTMLDocumentObj
;
372 typedef struct HTMLFrameBase HTMLFrameBase
;
373 typedef struct NSContainer NSContainer
;
374 typedef struct HTMLAttributeCollection HTMLAttributeCollection
;
378 SCRIPTMODE_ACTIVESCRIPT
381 typedef struct ScriptHost ScriptHost
;
388 } global_prop_type_t
;
391 global_prop_type_t type
;
393 ScriptHost
*script_host
;
399 IEventTarget IEventTarget_iface
;
400 struct wine_rb_tree handler_map
;
405 IHTMLOptionElementFactory IHTMLOptionElementFactory_iface
;
409 HTMLInnerWindow
*window
;
410 } HTMLOptionElementFactory
;
414 IHTMLImageElementFactory IHTMLImageElementFactory_iface
;
418 HTMLInnerWindow
*window
;
419 } HTMLImageElementFactory
;
423 IHTMLXMLHttpRequestFactory IHTMLXMLHttpRequestFactory_iface
;
427 HTMLInnerWindow
*window
;
428 } HTMLXMLHttpRequestFactory
;
430 struct HTMLLocation
{
432 IHTMLLocation IHTMLLocation_iface
;
436 HTMLInnerWindow
*window
;
441 IOmHistory IOmHistory_iface
;
445 HTMLInnerWindow
*window
;
449 HTMLOuterWindow
*window
;
453 typedef struct nsChannelBSC nsChannelBSC
;
456 IHTMLWindow2 IHTMLWindow2_iface
;
457 IHTMLWindow3 IHTMLWindow3_iface
;
458 IHTMLWindow4 IHTMLWindow4_iface
;
459 IHTMLWindow5 IHTMLWindow5_iface
;
460 IHTMLWindow6 IHTMLWindow6_iface
;
461 IHTMLPrivateWindow IHTMLPrivateWindow_iface
;
462 IDispatchEx IDispatchEx_iface
;
463 IServiceProvider IServiceProvider_iface
;
464 ITravelLogClient ITravelLogClient_iface
;
465 IObjectIdentity IObjectIdentity_iface
;
466 IProvideMultipleClassInfo IProvideMultipleClassInfo_iface
;
470 HTMLInnerWindow
*inner_window
;
471 HTMLOuterWindow
*outer_window
;
474 struct HTMLOuterWindow
{
477 windowref_t
*window_ref
;
480 HTMLDocumentObj
*doc_obj
;
481 nsIDOMWindow
*nswindow
;
482 mozIDOMWindowProxy
*window_proxy
;
483 HTMLOuterWindow
*parent
;
484 HTMLFrameBase
*frame_element
;
486 READYSTATE readystate
;
487 BOOL readystate_locked
;
488 unsigned readystate_pending
;
490 HTMLInnerWindow
*pending_window
;
497 SCRIPTMODE scriptmode
;
499 IInternetSecurityManager
*secmgr
;
501 struct list children
;
502 struct list sibling_entry
;
503 struct wine_rb_entry entry
;
506 struct HTMLInnerWindow
{
508 EventTarget event_target
;
510 HTMLDocumentNode
*doc
;
512 struct list script_hosts
;
514 IHTMLEventObj
*event
;
516 HTMLImageElementFactory
*image_factory
;
517 HTMLOptionElementFactory
*option_factory
;
518 HTMLXMLHttpRequestFactory
*xhr_factory
;
521 IHTMLStorage
*session_storage
;
523 unsigned parser_callback_cnt
;
524 struct list script_queue
;
526 global_prop_t
*global_props
;
527 DWORD global_prop_cnt
;
528 DWORD global_prop_size
;
532 HTMLLocation
*location
;
535 nsChannelBSC
*bscallback
;
536 struct list bindings
;
545 typedef struct _cp_static_data_t
{
547 void (*on_advise
)(IUnknown
*,struct _cp_static_data_t
*);
555 cp_static_data_t
*desc
;
558 typedef struct ConnectionPointContainer
{
559 IConnectionPointContainer IConnectionPointContainer_iface
;
561 ConnectionPoint
*cps
;
562 const cpc_entry_t
*cp_entries
;
564 struct ConnectionPointContainer
*forward_container
;
565 } ConnectionPointContainer
;
567 struct ConnectionPoint
{
568 IConnectionPoint IConnectionPoint_iface
;
570 ConnectionPointContainer
*container
;
575 IPropertyNotifySink
*propnotif
;
580 cp_static_data_t
*data
;
583 struct HTMLDocument
{
584 IHTMLDocument2 IHTMLDocument2_iface
;
585 IHTMLDocument3 IHTMLDocument3_iface
;
586 IHTMLDocument4 IHTMLDocument4_iface
;
587 IHTMLDocument5 IHTMLDocument5_iface
;
588 IHTMLDocument6 IHTMLDocument6_iface
;
589 IHTMLDocument7 IHTMLDocument7_iface
;
590 IDocumentSelector IDocumentSelector_iface
;
591 IDocumentEvent IDocumentEvent_iface
;
592 IPersistMoniker IPersistMoniker_iface
;
593 IPersistFile IPersistFile_iface
;
594 IPersistHistory IPersistHistory_iface
;
595 IMonikerProp IMonikerProp_iface
;
596 IOleObject IOleObject_iface
;
597 IOleDocument IOleDocument_iface
;
598 IOleDocumentView IOleDocumentView_iface
;
599 IOleInPlaceActiveObject IOleInPlaceActiveObject_iface
;
600 IViewObjectEx IViewObjectEx_iface
;
601 IOleInPlaceObjectWindowless IOleInPlaceObjectWindowless_iface
;
602 IServiceProvider IServiceProvider_iface
;
603 IOleCommandTarget IOleCommandTarget_iface
;
604 IOleControl IOleControl_iface
;
605 IHlinkTarget IHlinkTarget_iface
;
606 IPersistStreamInit IPersistStreamInit_iface
;
607 IDispatchEx IDispatchEx_iface
;
608 ISupportErrorInfo ISupportErrorInfo_iface
;
609 IObjectWithSite IObjectWithSite_iface
;
610 IOleContainer IOleContainer_iface
;
611 IObjectSafety IObjectSafety_iface
;
612 IProvideMultipleClassInfo IProvideMultipleClassInfo_iface
;
617 HTMLDocumentObj
*doc_obj
;
618 HTMLDocumentNode
*doc_node
;
620 HTMLOuterWindow
*window
;
622 ConnectionPointContainer cp_container
;
625 static inline HRESULT
htmldoc_query_interface(HTMLDocument
*This
, REFIID riid
, void **ppv
)
627 return IUnknown_QueryInterface(This
->outer_unk
, riid
, ppv
);
630 static inline ULONG
htmldoc_addref(HTMLDocument
*This
)
632 return IUnknown_AddRef(This
->outer_unk
);
635 static inline ULONG
htmldoc_release(HTMLDocument
*This
)
637 return IUnknown_Release(This
->outer_unk
);
640 struct HTMLDocumentObj
{
641 HTMLDocument basedoc
;
643 IUnknown IUnknown_outer
;
644 ICustomDoc ICustomDoc_iface
;
645 ITargetContainer ITargetContainer_iface
;
647 IWindowForBindingUI IWindowForBindingUI_iface
;
651 NSContainer
*nscontainer
;
653 IOleClientSite
*client
;
654 IDocHostUIHandler
*hostui
;
655 IOleCommandTarget
*client_cmdtrg
;
657 IOleInPlaceSite
*ipsite
;
658 IOleInPlaceFrame
*frame
;
659 IOleInPlaceUIWindow
*ip_window
;
660 IAdviseSink
*view_sink
;
661 IDocObjectService
*doc_object_service
;
662 IUnknown
*webbrowser
;
663 ITravelLog
*travel_log
;
664 IUnknown
*browser_service
;
665 IOleAdviseHolder
*advise_holder
;
667 DOCHOSTUIINFO hostinfo
;
669 IOleUndoManager
*undomgr
;
670 IHTMLEditServices
*editsvcs
;
676 BOOL request_uiactivate
;
677 BOOL in_place_active
;
681 BOOL container_locked
;
693 typedef struct nsWeakReference nsWeakReference
;
696 nsIWebBrowserChrome nsIWebBrowserChrome_iface
;
697 nsIContextMenuListener nsIContextMenuListener_iface
;
698 nsIURIContentListener nsIURIContentListener_iface
;
699 nsIEmbeddingSiteWindow nsIEmbeddingSiteWindow_iface
;
700 nsITooltipListener nsITooltipListener_iface
;
701 nsIInterfaceRequestor nsIInterfaceRequestor_iface
;
702 nsISupportsWeakReference nsISupportsWeakReference_iface
;
704 nsIWebBrowser
*webbrowser
;
705 nsIWebNavigation
*navigation
;
706 nsIBaseWindow
*window
;
707 nsIWebBrowserFocus
*focus
;
710 nsIController
*editor_controller
;
714 nsWeakReference
*weak_reference
;
716 HTMLDocumentObj
*doc
;
718 nsIURIContentListener
*content_listener
;
725 HRESULT (*qi
)(HTMLDOMNode
*,REFIID
,void**);
726 void (*destructor
)(HTMLDOMNode
*);
727 const cpc_entry_t
*cpc_entries
;
728 HRESULT (*clone
)(HTMLDOMNode
*,nsIDOMNode
*,HTMLDOMNode
**);
729 HRESULT (*handle_event
)(HTMLDOMNode
*,DWORD
,nsIDOMEvent
*,BOOL
*);
730 HRESULT (*get_attr_col
)(HTMLDOMNode
*,HTMLAttributeCollection
**);
731 EventTarget
*(*get_event_prop_target
)(HTMLDOMNode
*,int);
732 HRESULT (*put_disabled
)(HTMLDOMNode
*,VARIANT_BOOL
);
733 HRESULT (*get_disabled
)(HTMLDOMNode
*,VARIANT_BOOL
*);
734 HRESULT (*get_document
)(HTMLDOMNode
*,IDispatch
**);
735 HRESULT (*get_readystate
)(HTMLDOMNode
*,BSTR
*);
736 HRESULT (*get_dispid
)(HTMLDOMNode
*,BSTR
,DWORD
,DISPID
*);
737 HRESULT (*invoke
)(HTMLDOMNode
*,DISPID
,LCID
,WORD
,DISPPARAMS
*,VARIANT
*,EXCEPINFO
*,IServiceProvider
*);
738 HRESULT (*bind_to_tree
)(HTMLDOMNode
*);
739 void (*traverse
)(HTMLDOMNode
*,nsCycleCollectionTraversalCallback
*);
740 void (*unlink
)(HTMLDOMNode
*);
741 BOOL (*is_text_edit
)(HTMLDOMNode
*);
742 BOOL (*is_settable
)(HTMLDOMNode
*,DISPID
);
746 EventTarget event_target
;
747 IHTMLDOMNode IHTMLDOMNode_iface
;
748 IHTMLDOMNode2 IHTMLDOMNode2_iface
;
749 IHTMLDOMNode3 IHTMLDOMNode3_iface
;
750 const NodeImplVtbl
*vtbl
;
752 nsCycleCollectingAutoRefCnt ccref
;
755 HTMLDocumentNode
*doc
;
758 static inline void node_addref(HTMLDOMNode
*node
)
760 IHTMLDOMNode_AddRef(&node
->IHTMLDOMNode_iface
);
763 static inline void node_release(HTMLDOMNode
*node
)
765 IHTMLDOMNode_Release(&node
->IHTMLDOMNode_iface
);
770 ConnectionPointContainer cp_container
;
772 IHTMLElement IHTMLElement_iface
;
773 IHTMLElement2 IHTMLElement2_iface
;
774 IHTMLElement3 IHTMLElement3_iface
;
775 IHTMLElement4 IHTMLElement4_iface
;
776 IHTMLElement6 IHTMLElement6_iface
;
777 IHTMLUniqueName IHTMLUniqueName_iface
;
778 IElementSelector IElementSelector_iface
;
779 IElementTraversal IElementTraversal_iface
;
780 IProvideMultipleClassInfo IProvideMultipleClassInfo_iface
;
782 nsIDOMElement
*dom_element
; /* NULL for legacy comments represented as HTML elements */
783 nsIDOMHTMLElement
*html_element
; /* NULL for non-HTML elements (like SVG elements) */
785 HTMLStyle
*runtime_style
;
786 HTMLAttributeCollection
*attrs
;
791 #define HTMLELEMENT_TIDS \
799 extern cp_static_data_t HTMLElementEvents2_data DECLSPEC_HIDDEN
;
800 #define HTMLELEMENT_CPC {&DIID_HTMLElementEvents2, &HTMLElementEvents2_data}
801 extern const cpc_entry_t HTMLElement_cpc
[] DECLSPEC_HIDDEN
;
806 IHTMLTextContainer IHTMLTextContainer_iface
;
809 struct HTMLFrameBase
{
812 IHTMLFrameBase IHTMLFrameBase_iface
;
813 IHTMLFrameBase2 IHTMLFrameBase2_iface
;
815 HTMLOuterWindow
*content_window
;
817 nsIDOMHTMLFrameElement
*nsframe
;
818 nsIDOMHTMLIFrameElement
*nsiframe
;
821 typedef struct nsDocumentEventListener nsDocumentEventListener
;
823 struct HTMLDocumentNode
{
825 HTMLDocument basedoc
;
827 IInternetHostSecurityManager IInternetHostSecurityManager_iface
;
829 nsIDocumentObserver nsIDocumentObserver_iface
;
833 HTMLInnerWindow
*window
;
835 compat_mode_t document_mode
;
836 BOOL document_mode_locked
;
838 nsIDOMHTMLDocument
*nsdoc
;
841 IHTMLDOMImplementation
*dom_implementation
;
843 ICatInformation
*catmgr
;
844 nsDocumentEventListener
*nsevent_listener
;
848 unsigned elem_vars_size
;
849 unsigned elem_vars_cnt
;
851 BOOL skip_mutation_notif
;
857 struct list selection_list
;
858 struct list range_list
;
859 struct list plugin_hosts
;
862 HRESULT
HTMLDocument_Create(IUnknown
*,REFIID
,void**) DECLSPEC_HIDDEN
;
863 HRESULT
MHTMLDocument_Create(IUnknown
*,REFIID
,void**) DECLSPEC_HIDDEN
;
864 HRESULT
HTMLLoadOptions_Create(IUnknown
*,REFIID
,void**) DECLSPEC_HIDDEN
;
865 HRESULT
create_doc_from_nsdoc(nsIDOMHTMLDocument
*,HTMLDocumentObj
*,HTMLInnerWindow
*,HTMLDocumentNode
**) DECLSPEC_HIDDEN
;
867 HRESULT
HTMLOuterWindow_Create(HTMLDocumentObj
*,nsIDOMWindow
*,HTMLOuterWindow
*,HTMLOuterWindow
**) DECLSPEC_HIDDEN
;
868 HRESULT
update_window_doc(HTMLInnerWindow
*) DECLSPEC_HIDDEN
;
869 HTMLOuterWindow
*mozwindow_to_window(const mozIDOMWindowProxy
*) DECLSPEC_HIDDEN
;
870 void get_top_window(HTMLOuterWindow
*,HTMLOuterWindow
**) DECLSPEC_HIDDEN
;
871 HRESULT
HTMLOptionElementFactory_Create(HTMLInnerWindow
*,HTMLOptionElementFactory
**) DECLSPEC_HIDDEN
;
872 HRESULT
HTMLImageElementFactory_Create(HTMLInnerWindow
*,HTMLImageElementFactory
**) DECLSPEC_HIDDEN
;
873 HRESULT
HTMLXMLHttpRequestFactory_Create(HTMLInnerWindow
*,HTMLXMLHttpRequestFactory
**) DECLSPEC_HIDDEN
;
874 HRESULT
HTMLLocation_Create(HTMLInnerWindow
*,HTMLLocation
**) DECLSPEC_HIDDEN
;
875 IOmNavigator
*OmNavigator_Create(void) DECLSPEC_HIDDEN
;
876 HRESULT
HTMLScreen_Create(IHTMLScreen
**) DECLSPEC_HIDDEN
;
877 HRESULT
create_history(HTMLInnerWindow
*,OmHistory
**) DECLSPEC_HIDDEN
;
878 HRESULT
create_dom_implementation(IHTMLDOMImplementation
**) DECLSPEC_HIDDEN
;
880 HRESULT
create_storage(IHTMLStorage
**) DECLSPEC_HIDDEN
;
882 void HTMLDocument_Persist_Init(HTMLDocument
*) DECLSPEC_HIDDEN
;
883 void HTMLDocument_OleCmd_Init(HTMLDocument
*) DECLSPEC_HIDDEN
;
884 void HTMLDocument_OleObj_Init(HTMLDocument
*) DECLSPEC_HIDDEN
;
885 void HTMLDocument_View_Init(HTMLDocument
*) DECLSPEC_HIDDEN
;
886 void HTMLDocument_Service_Init(HTMLDocument
*) DECLSPEC_HIDDEN
;
888 void TargetContainer_Init(HTMLDocumentObj
*) DECLSPEC_HIDDEN
;
889 void init_binding_ui(HTMLDocumentObj
*) DECLSPEC_HIDDEN
;
891 void HTMLDocumentNode_SecMgr_Init(HTMLDocumentNode
*) DECLSPEC_HIDDEN
;
893 HRESULT
HTMLCurrentStyle_Create(HTMLElement
*,IHTMLCurrentStyle
**) DECLSPEC_HIDDEN
;
895 void ConnectionPointContainer_Init(ConnectionPointContainer
*,IUnknown
*,const cpc_entry_t
*) DECLSPEC_HIDDEN
;
896 void ConnectionPointContainer_Destroy(ConnectionPointContainer
*) DECLSPEC_HIDDEN
;
898 HRESULT
create_nscontainer(HTMLDocumentObj
*,NSContainer
**) DECLSPEC_HIDDEN
;
899 void NSContainer_Release(NSContainer
*) DECLSPEC_HIDDEN
;
901 void init_mutation(nsIComponentManager
*) DECLSPEC_HIDDEN
;
902 void init_document_mutation(HTMLDocumentNode
*) DECLSPEC_HIDDEN
;
903 void release_document_mutation(HTMLDocumentNode
*) DECLSPEC_HIDDEN
;
904 JSContext
*get_context_from_document(nsIDOMHTMLDocument
*) DECLSPEC_HIDDEN
;
906 void HTMLDocument_LockContainer(HTMLDocumentObj
*,BOOL
) DECLSPEC_HIDDEN
;
907 void show_context_menu(HTMLDocumentObj
*,DWORD
,POINT
*,IDispatch
*) DECLSPEC_HIDDEN
;
908 void notif_focus(HTMLDocumentObj
*) DECLSPEC_HIDDEN
;
910 void show_tooltip(HTMLDocumentObj
*,DWORD
,DWORD
,LPCWSTR
) DECLSPEC_HIDDEN
;
911 void hide_tooltip(HTMLDocumentObj
*) DECLSPEC_HIDDEN
;
912 HRESULT
get_client_disp_property(IOleClientSite
*,DISPID
,VARIANT
*) DECLSPEC_HIDDEN
;
914 UINT
get_document_charset(HTMLDocumentNode
*) DECLSPEC_HIDDEN
;
916 HRESULT
ProtocolFactory_Create(REFCLSID
,REFIID
,void**) DECLSPEC_HIDDEN
;
918 BOOL
load_gecko(void) DECLSPEC_HIDDEN
;
919 void close_gecko(void) DECLSPEC_HIDDEN
;
920 void register_nsservice(nsIComponentRegistrar
*,nsIServiceManager
*) DECLSPEC_HIDDEN
;
921 void init_nsio(nsIComponentManager
*) DECLSPEC_HIDDEN
;
922 void release_nsio(void) DECLSPEC_HIDDEN
;
923 BOOL
is_gecko_path(const char*) DECLSPEC_HIDDEN
;
924 void set_viewer_zoom(NSContainer
*,float) DECLSPEC_HIDDEN
;
926 void init_node_cc(void) DECLSPEC_HIDDEN
;
928 HRESULT
nsuri_to_url(LPCWSTR
,BOOL
,BSTR
*) DECLSPEC_HIDDEN
;
930 HRESULT
set_frame_doc(HTMLFrameBase
*,nsIDOMDocument
*) DECLSPEC_HIDDEN
;
932 void call_property_onchanged(ConnectionPointContainer
*,DISPID
) DECLSPEC_HIDDEN
;
933 HRESULT
call_set_active_object(IOleInPlaceUIWindow
*,IOleInPlaceActiveObject
*) DECLSPEC_HIDDEN
;
935 void *nsalloc(size_t) __WINE_ALLOC_SIZE(1) DECLSPEC_HIDDEN
;
936 void nsfree(void*) DECLSPEC_HIDDEN
;
938 BOOL
nsACString_Init(nsACString
*str
, const char *data
) DECLSPEC_HIDDEN
;
939 void nsACString_InitDepend(nsACString
*,const char*) DECLSPEC_HIDDEN
;
940 void nsACString_SetData(nsACString
*,const char*) DECLSPEC_HIDDEN
;
941 UINT32
nsACString_GetData(const nsACString
*,const char**) DECLSPEC_HIDDEN
;
942 void nsACString_Finish(nsACString
*) DECLSPEC_HIDDEN
;
944 BOOL
nsAString_Init(nsAString
*,const PRUnichar
*) DECLSPEC_HIDDEN
;
945 void nsAString_InitDepend(nsAString
*,const PRUnichar
*) DECLSPEC_HIDDEN
;
946 UINT32
nsAString_GetData(const nsAString
*,const PRUnichar
**) DECLSPEC_HIDDEN
;
947 void nsAString_Finish(nsAString
*) DECLSPEC_HIDDEN
;
949 HRESULT
return_nsstr(nsresult
,nsAString
*,BSTR
*) DECLSPEC_HIDDEN
;
950 HRESULT
return_nsstr_variant(nsresult nsres
, nsAString
*nsstr
, VARIANT
*p
) DECLSPEC_HIDDEN
;
952 nsICommandParams
*create_nscommand_params(void) DECLSPEC_HIDDEN
;
953 HRESULT
nsnode_to_nsstring(nsIDOMNode
*,nsAString
*) DECLSPEC_HIDDEN
;
954 void get_editor_controller(NSContainer
*) DECLSPEC_HIDDEN
;
955 nsresult
get_nsinterface(nsISupports
*,REFIID
,void**) DECLSPEC_HIDDEN
;
956 nsIWritableVariant
*create_nsvariant(void) DECLSPEC_HIDDEN
;
957 nsIXMLHttpRequest
*create_nsxhr(nsIDOMWindow
*nswindow
) DECLSPEC_HIDDEN
;
958 nsresult
create_nsfile(const PRUnichar
*,nsIFile
**) DECLSPEC_HIDDEN
;
959 char *get_nscategory_entry(const char*,const char*) DECLSPEC_HIDDEN
;
961 HRESULT
create_pending_window(HTMLOuterWindow
*,nsChannelBSC
*) DECLSPEC_HIDDEN
;
962 HRESULT
start_binding(HTMLInnerWindow
*,BSCallback
*,IBindCtx
*) DECLSPEC_HIDDEN
;
963 HRESULT
async_start_doc_binding(HTMLOuterWindow
*,HTMLInnerWindow
*) DECLSPEC_HIDDEN
;
964 void abort_window_bindings(HTMLInnerWindow
*) DECLSPEC_HIDDEN
;
965 void set_download_state(HTMLDocumentObj
*,int) DECLSPEC_HIDDEN
;
966 void call_docview_84(HTMLDocumentObj
*) DECLSPEC_HIDDEN
;
968 void set_ready_state(HTMLOuterWindow
*,READYSTATE
) DECLSPEC_HIDDEN
;
969 HRESULT
get_readystate_string(READYSTATE
,BSTR
*) DECLSPEC_HIDDEN
;
971 HRESULT
HTMLSelectionObject_Create(HTMLDocumentNode
*,nsISelection
*,IHTMLSelectionObject
**) DECLSPEC_HIDDEN
;
972 HRESULT
HTMLTxtRange_Create(HTMLDocumentNode
*,nsIDOMRange
*,IHTMLTxtRange
**) DECLSPEC_HIDDEN
;
973 IHTMLStyleSheet
*HTMLStyleSheet_Create(nsIDOMStyleSheet
*) DECLSPEC_HIDDEN
;
974 IHTMLStyleSheetsCollection
*HTMLStyleSheetsCollection_Create(nsIDOMStyleSheetList
*) DECLSPEC_HIDDEN
;
976 void detach_selection(HTMLDocumentNode
*) DECLSPEC_HIDDEN
;
977 void detach_ranges(HTMLDocumentNode
*) DECLSPEC_HIDDEN
;
978 HRESULT
get_node_text(HTMLDOMNode
*,BSTR
*) DECLSPEC_HIDDEN
;
979 HRESULT
replace_node_by_html(nsIDOMHTMLDocument
*,nsIDOMNode
*,const WCHAR
*) DECLSPEC_HIDDEN
;
981 HRESULT
create_nselem(HTMLDocumentNode
*,const WCHAR
*,nsIDOMElement
**) DECLSPEC_HIDDEN
;
982 HRESULT
create_element(HTMLDocumentNode
*,const WCHAR
*,HTMLElement
**) DECLSPEC_HIDDEN
;
984 HRESULT
HTMLDOMTextNode_Create(HTMLDocumentNode
*,nsIDOMNode
*,HTMLDOMNode
**) DECLSPEC_HIDDEN
;
986 BOOL
variant_to_nscolor(const VARIANT
*v
, nsAString
*nsstr
) DECLSPEC_HIDDEN
;
987 HRESULT
nscolor_to_str(LPCWSTR color
, BSTR
*ret
) DECLSPEC_HIDDEN
;
990 struct HTMLAttributeCollection
{
992 IHTMLAttributeCollection IHTMLAttributeCollection_iface
;
993 IHTMLAttributeCollection2 IHTMLAttributeCollection2_iface
;
994 IHTMLAttributeCollection3 IHTMLAttributeCollection3_iface
;
1004 IHTMLDOMAttribute IHTMLDOMAttribute_iface
;
1005 IHTMLDOMAttribute2 IHTMLDOMAttribute2_iface
;
1009 /* value is valid only for detached attributes (when elem == NULL). */
1011 /* name must be valid for detached attributes */
1019 HTMLDOMAttribute
*unsafe_impl_from_IHTMLDOMAttribute(IHTMLDOMAttribute
*) DECLSPEC_HIDDEN
;
1021 HRESULT
HTMLDOMAttribute_Create(const WCHAR
*,HTMLElement
*,DISPID
,HTMLDOMAttribute
**) DECLSPEC_HIDDEN
;
1023 HRESULT
HTMLElement_Create(HTMLDocumentNode
*,nsIDOMNode
*,BOOL
,HTMLElement
**) DECLSPEC_HIDDEN
;
1024 HRESULT
HTMLCommentElement_Create(HTMLDocumentNode
*,nsIDOMNode
*,HTMLElement
**) DECLSPEC_HIDDEN
;
1025 HRESULT
HTMLAnchorElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
1026 HRESULT
HTMLAreaElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
1027 HRESULT
HTMLBodyElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
1028 HRESULT
HTMLButtonElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
1029 HRESULT
HTMLEmbedElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
1030 HRESULT
HTMLFormElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
1031 HRESULT
HTMLFrameElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
1032 HRESULT
HTMLHeadElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
1033 HRESULT
HTMLHtmlElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
1034 HRESULT
HTMLIFrame_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
1035 HRESULT
HTMLStyleElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
1036 HRESULT
HTMLImgElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
1037 HRESULT
HTMLInputElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
1038 HRESULT
HTMLLabelElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
1039 HRESULT
HTMLLinkElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
1040 HRESULT
HTMLMetaElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
1041 HRESULT
HTMLObjectElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
1042 HRESULT
HTMLOptionElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
1043 HRESULT
HTMLScriptElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
1044 HRESULT
HTMLSelectElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
1045 HRESULT
HTMLTable_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
1046 HRESULT
HTMLTableCell_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
1047 HRESULT
HTMLTableRow_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
1048 HRESULT
HTMLTextAreaElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
1049 HRESULT
HTMLTitleElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
1050 HRESULT
HTMLGenericElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
1052 void HTMLDOMNode_Init(HTMLDocumentNode
*,HTMLDOMNode
*,nsIDOMNode
*,dispex_static_data_t
*) DECLSPEC_HIDDEN
;
1053 void HTMLElement_Init(HTMLElement
*,HTMLDocumentNode
*,nsIDOMElement
*,dispex_static_data_t
*) DECLSPEC_HIDDEN
;
1054 void HTMLTextContainer_Init(HTMLTextContainer
*,HTMLDocumentNode
*,nsIDOMElement
*,dispex_static_data_t
*) DECLSPEC_HIDDEN
;
1055 void HTMLFrameBase_Init(HTMLFrameBase
*,HTMLDocumentNode
*,nsIDOMElement
*,dispex_static_data_t
*) DECLSPEC_HIDDEN
;
1057 void EventTarget_Init(EventTarget
*,IUnknown
*,dispex_static_data_t
*,compat_mode_t
) DECLSPEC_HIDDEN
;
1058 HRESULT
EventTarget_QI(EventTarget
*,REFIID
,void**) DECLSPEC_HIDDEN
;
1059 void EventTarget_init_dispex_info(dispex_data_t
*,compat_mode_t
) DECLSPEC_HIDDEN
;
1061 HRESULT
HTMLDOMNode_QI(HTMLDOMNode
*,REFIID
,void**) DECLSPEC_HIDDEN
;
1062 void HTMLDOMNode_destructor(HTMLDOMNode
*) DECLSPEC_HIDDEN
;
1063 void HTMLDOMNode_init_dispex_info(dispex_data_t
*,compat_mode_t
) DECLSPEC_HIDDEN
;
1065 HRESULT
HTMLElement_QI(HTMLDOMNode
*,REFIID
,void**) DECLSPEC_HIDDEN
;
1066 void HTMLElement_destructor(HTMLDOMNode
*) DECLSPEC_HIDDEN
;
1067 HRESULT
HTMLElement_clone(HTMLDOMNode
*,nsIDOMNode
*,HTMLDOMNode
**) DECLSPEC_HIDDEN
;
1068 HRESULT
HTMLElement_get_attr_col(HTMLDOMNode
*,HTMLAttributeCollection
**) DECLSPEC_HIDDEN
;
1069 HRESULT
HTMLElement_handle_event(HTMLDOMNode
*,DWORD
,nsIDOMEvent
*,BOOL
*) DECLSPEC_HIDDEN
;
1070 void HTMLElement_init_dispex_info(dispex_data_t
*,compat_mode_t
) DECLSPEC_HIDDEN
;
1072 HRESULT
HTMLFrameBase_QI(HTMLFrameBase
*,REFIID
,void**) DECLSPEC_HIDDEN
;
1073 void HTMLFrameBase_destructor(HTMLFrameBase
*) DECLSPEC_HIDDEN
;
1075 HRESULT
get_node(nsIDOMNode
*,BOOL
,HTMLDOMNode
**) DECLSPEC_HIDDEN
;
1076 HRESULT
get_element(nsIDOMElement
*,HTMLElement
**) DECLSPEC_HIDDEN
;
1077 HRESULT
get_document_node(nsIDOMDocument
*,HTMLDocumentNode
**) DECLSPEC_HIDDEN
;
1079 HTMLElement
*unsafe_impl_from_IHTMLElement(IHTMLElement
*) DECLSPEC_HIDDEN
;
1081 HRESULT
search_window_props(HTMLInnerWindow
*,BSTR
,DWORD
,DISPID
*) DECLSPEC_HIDDEN
;
1082 HRESULT
get_frame_by_name(HTMLOuterWindow
*,const WCHAR
*,BOOL
,HTMLOuterWindow
**) DECLSPEC_HIDDEN
;
1083 HRESULT
get_doc_elem_by_id(HTMLDocumentNode
*,const WCHAR
*,HTMLElement
**) DECLSPEC_HIDDEN
;
1084 HTMLOuterWindow
*get_target_window(HTMLOuterWindow
*,nsAString
*,BOOL
*) DECLSPEC_HIDDEN
;
1085 HRESULT
handle_link_click_event(HTMLElement
*,nsAString
*,nsAString
*,nsIDOMEvent
*,BOOL
*) DECLSPEC_HIDDEN
;
1087 HRESULT
wrap_iface(IUnknown
*,IUnknown
*,IUnknown
**) DECLSPEC_HIDDEN
;
1089 IHTMLElementCollection
*create_all_collection(HTMLDOMNode
*,BOOL
) DECLSPEC_HIDDEN
;
1090 IHTMLElementCollection
*create_collection_from_nodelist(nsIDOMNodeList
*,compat_mode_t
) DECLSPEC_HIDDEN
;
1091 IHTMLElementCollection
*create_collection_from_htmlcol(nsIDOMHTMLCollection
*,compat_mode_t
) DECLSPEC_HIDDEN
;
1092 IHTMLDOMChildrenCollection
*create_child_collection(nsIDOMNodeList
*) DECLSPEC_HIDDEN
;
1094 HRESULT
attr_value_to_string(VARIANT
*) DECLSPEC_HIDDEN
;
1095 HRESULT
get_elem_attr_value_by_dispid(HTMLElement
*,DISPID
,VARIANT
*) DECLSPEC_HIDDEN
;
1096 HRESULT
get_elem_source_index(HTMLElement
*,LONG
*) DECLSPEC_HIDDEN
;
1098 nsresult
get_elem_attr_value(nsIDOMElement
*,const WCHAR
*,nsAString
*,const PRUnichar
**) DECLSPEC_HIDDEN
;
1099 HRESULT
elem_string_attr_getter(HTMLElement
*,const WCHAR
*,BOOL
,BSTR
*) DECLSPEC_HIDDEN
;
1100 HRESULT
elem_string_attr_setter(HTMLElement
*,const WCHAR
*,const WCHAR
*) DECLSPEC_HIDDEN
;
1102 HRESULT
elem_unique_id(unsigned id
, BSTR
*p
) DECLSPEC_HIDDEN
;
1107 HRESULT (*query
)(HTMLDocument
*,OLECMD
*);
1108 HRESULT (*exec
)(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*);
1111 extern const cmdtable_t editmode_cmds
[] DECLSPEC_HIDDEN
;
1113 void do_ns_command(HTMLDocument
*,const char*,nsICommandParams
*) DECLSPEC_HIDDEN
;
1116 #define UPDATE_UI 0x0001
1117 #define UPDATE_TITLE 0x0002
1119 void update_doc(HTMLDocumentObj
*,DWORD
) DECLSPEC_HIDDEN
;
1120 void update_title(HTMLDocumentObj
*) DECLSPEC_HIDDEN
;
1121 void set_document_navigation(HTMLDocumentObj
*,BOOL
) DECLSPEC_HIDDEN
;
1123 HRESULT
do_query_service(IUnknown
*,REFGUID
,REFIID
,void**) DECLSPEC_HIDDEN
;
1126 HRESULT
setup_edit_mode(HTMLDocumentObj
*) DECLSPEC_HIDDEN
;
1127 void init_editor(HTMLDocument
*) DECLSPEC_HIDDEN
;
1128 void handle_edit_event(HTMLDocument
*,nsIDOMEvent
*) DECLSPEC_HIDDEN
;
1129 HRESULT
editor_exec_copy(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*) DECLSPEC_HIDDEN
;
1130 HRESULT
editor_exec_cut(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*) DECLSPEC_HIDDEN
;
1131 HRESULT
editor_exec_paste(HTMLDocument
*,DWORD
,VARIANT
*,VARIANT
*) DECLSPEC_HIDDEN
;
1132 void handle_edit_load(HTMLDocument
*) DECLSPEC_HIDDEN
;
1133 HRESULT
editor_is_dirty(HTMLDocument
*) DECLSPEC_HIDDEN
;
1134 void set_dirty(HTMLDocument
*,VARIANT_BOOL
) DECLSPEC_HIDDEN
;
1136 extern DWORD mshtml_tls DECLSPEC_HIDDEN
;
1138 typedef struct task_t task_t
;
1139 typedef void (*task_proc_t
)(task_t
*);
1150 HTMLDocumentObj
*doc
;
1155 struct list task_list
;
1156 struct list timer_list
;
1159 thread_data_t
*get_thread_data(BOOL
) DECLSPEC_HIDDEN
;
1160 HWND
get_thread_hwnd(void) DECLSPEC_HIDDEN
;
1162 LONG
get_task_target_magic(void) DECLSPEC_HIDDEN
;
1163 HRESULT
push_task(task_t
*,task_proc_t
,task_proc_t
,LONG
) DECLSPEC_HIDDEN
;
1164 void remove_target_tasks(LONG
) DECLSPEC_HIDDEN
;
1166 HRESULT
set_task_timer(HTMLInnerWindow
*,LONG
,BOOL
,IDispatch
*,LONG
*) DECLSPEC_HIDDEN
;
1167 HRESULT
clear_task_timer(HTMLInnerWindow
*,DWORD
) DECLSPEC_HIDDEN
;
1169 const char *debugstr_mshtml_guid(const GUID
*) DECLSPEC_HIDDEN
;
1171 DEFINE_GUID(CLSID_AboutProtocol
, 0x3050F406, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
1172 DEFINE_GUID(CLSID_JSProtocol
, 0x3050F3B2, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
1173 DEFINE_GUID(CLSID_MailtoProtocol
, 0x3050F3DA, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
1174 DEFINE_GUID(CLSID_ResProtocol
, 0x3050F3BC, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
1175 DEFINE_GUID(CLSID_SysimageProtocol
, 0x76E67A63, 0x06E9, 0x11D2, 0xA8,0x40, 0x00,0x60,0x08,0x05,0x93,0x82);
1177 DEFINE_GUID(CLSID_CMarkup
,0x3050f4fb,0x98b5,0x11cf,0xbb,0x82,0x00,0xaa,0x00,0xbd,0xce,0x0b);
1179 DEFINE_OLEGUID(CGID_DocHostCmdPriv
, 0x000214D4L
, 0, 0);
1181 DEFINE_GUID(CLSID_JScript
, 0xf414c260,0x6ac0,0x11cf, 0xb6,0xd1,0x00,0xaa,0x00,0xbb,0xbb,0x58);
1182 DEFINE_GUID(CLSID_VBScript
, 0xb54f3741,0x5b07,0x11cf, 0xa4,0xb0,0x00,0xaa,0x00,0x4a,0x55,0xe8);
1184 DEFINE_GUID(IID_UndocumentedScriptIface
,0x719c3050,0xf9d3,0x11cf,0xa4,0x93,0x00,0x40,0x05,0x23,0xa8,0xa0);
1185 DEFINE_GUID(IID_IDispatchJS
,0x719c3050,0xf9d3,0x11cf,0xa4,0x93,0x00,0x40,0x05,0x23,0xa8,0xa6);
1187 /* memory allocation functions */
1189 static inline void * __WINE_ALLOC_SIZE(2) heap_realloc_zero(void *mem
, size_t len
)
1191 return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, mem
, len
);
1194 static inline LPWSTR
heap_strdupW(LPCWSTR str
)
1201 size
= (strlenW(str
)+1)*sizeof(WCHAR
);
1202 ret
= heap_alloc(size
);
1204 memcpy(ret
, str
, size
);
1210 static inline LPWSTR
heap_strndupW(LPCWSTR str
, unsigned len
)
1215 ret
= heap_alloc((len
+1)*sizeof(WCHAR
));
1218 memcpy(ret
, str
, len
*sizeof(WCHAR
));
1226 static inline char *heap_strdupA(const char *str
)
1233 size
= strlen(str
)+1;
1234 ret
= heap_alloc(size
);
1236 memcpy(ret
, str
, size
);
1242 static inline WCHAR
*heap_strdupAtoW(const char *str
)
1249 len
= MultiByteToWideChar(CP_ACP
, 0, str
, -1, NULL
, 0);
1250 ret
= heap_alloc(len
*sizeof(WCHAR
));
1252 MultiByteToWideChar(CP_ACP
, 0, str
, -1, ret
, len
);
1258 static inline char *heap_strdupWtoA(LPCWSTR str
)
1263 DWORD size
= WideCharToMultiByte(CP_ACP
, 0, str
, -1, NULL
, 0, NULL
, NULL
);
1264 ret
= heap_alloc(size
);
1266 WideCharToMultiByte(CP_ACP
, 0, str
, -1, ret
, size
, NULL
, NULL
);
1272 static inline WCHAR
*heap_strdupUtoW(const char *str
)
1279 len
= MultiByteToWideChar(CP_UTF8
, 0, str
, -1, NULL
, 0);
1280 ret
= heap_alloc(len
*sizeof(WCHAR
));
1282 MultiByteToWideChar(CP_UTF8
, 0, str
, -1, ret
, len
);
1288 static inline char *heap_strdupWtoU(const WCHAR
*str
)
1293 size_t size
= WideCharToMultiByte(CP_UTF8
, 0, str
, -1, NULL
, 0, NULL
, NULL
);
1294 ret
= heap_alloc(size
);
1296 WideCharToMultiByte(CP_UTF8
, 0, str
, -1, ret
, size
, NULL
, NULL
);
1302 static inline char *heap_strndupWtoU(LPCWSTR str
, unsigned len
)
1308 size
= WideCharToMultiByte(CP_UTF8
, 0, str
, len
, NULL
, 0, NULL
, NULL
);
1309 ret
= heap_alloc(size
+ 1);
1311 WideCharToMultiByte(CP_UTF8
, 0, str
, len
, ret
, size
, NULL
, NULL
);
1319 static inline void windowref_addref(windowref_t
*ref
)
1321 InterlockedIncrement(&ref
->ref
);
1324 static inline void windowref_release(windowref_t
*ref
)
1326 if(!InterlockedDecrement(&ref
->ref
))
1330 static inline VARIANT_BOOL
variant_bool(BOOL b
)
1332 return b
? VARIANT_TRUE
: VARIANT_FALSE
;
1336 extern void *call_thiscall_func
;
1339 UINT
cp_from_charset_string(BSTR
) DECLSPEC_HIDDEN
;
1340 BSTR
charset_string_from_cp(UINT
) DECLSPEC_HIDDEN
;
1341 HINSTANCE
get_shdoclc(void) DECLSPEC_HIDDEN
;
1342 void set_statustext(HTMLDocumentObj
*,INT
,LPCWSTR
) DECLSPEC_HIDDEN
;
1344 extern HINSTANCE hInst DECLSPEC_HIDDEN
;