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/list.h"
34 #include "wine/rbtree.h"
42 #include "mshtml_private_iface.h"
46 #define NS_ERROR_GENERATE_FAILURE(module,code) \
47 ((nsresult) (((UINT32)(1u<<31)) | ((UINT32)(module+0x45)<<16) | ((UINT32)(code))))
48 #define NS_ERROR_GENERATE_SUCCESS(module,code) \
49 ((nsresult) (((UINT32)(module+0x45)<<16) | ((UINT32)(code))))
51 #define NS_OK ((nsresult)0x00000000L)
52 #define NS_ERROR_FAILURE ((nsresult)0x80004005L)
53 #define NS_ERROR_OUT_OF_MEMORY ((nsresult)0x8007000EL)
54 #define NS_ERROR_NOT_IMPLEMENTED ((nsresult)0x80004001L)
55 #define NS_NOINTERFACE ((nsresult)0x80004002L)
56 #define NS_ERROR_INVALID_POINTER ((nsresult)0x80004003L)
57 #define NS_ERROR_NULL_POINTER NS_ERROR_INVALID_POINTER
58 #define NS_ERROR_NOT_AVAILABLE ((nsresult)0x80040111L)
59 #define NS_ERROR_INVALID_ARG ((nsresult)0x80070057L)
60 #define NS_ERROR_UNEXPECTED ((nsresult)0x8000ffffL)
61 #define NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR ((nsresult)0x80530007)
62 #define NS_ERROR_DOM_SYNTAX_ERR ((nsresult)0x8053000c)
64 #define NS_ERROR_MODULE_NETWORK 6
66 #define NS_BINDING_ABORTED NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 2)
67 #define NS_ERROR_UNKNOWN_PROTOCOL NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 18)
68 #define NS_SUCCESS_DEFAULT_ACTION NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_NETWORK, 66)
70 #define NS_FAILED(res) ((res) & 0x80000000)
71 #define NS_SUCCEEDED(res) (!NS_FAILED(res))
75 #define MSHTML_E_INVALID_PROPERTY 0x800a01b6
76 #define MSHTML_E_INVALID_ACTION 0x800a01bd
77 #define MSHTML_E_NODOC 0x800a025c
78 #define MSHTML_E_NOT_FUNC 0x800a138a
80 typedef struct DOMEvent DOMEvent
;
81 typedef struct HTMLDOMNode HTMLDOMNode
;
82 typedef struct ConnectionPoint ConnectionPoint
;
83 typedef struct BSCallback BSCallback
;
84 typedef struct EventTarget EventTarget
;
88 XDIID(DispCEventObj) \
90 XDIID(DispDOMChildrenCollection) \
91 XDIID(DispDOMCustomEvent) \
93 XDIID(DispDOMKeyboardEvent) \
94 XDIID(DispDOMMessageEvent) \
95 XDIID(DispDOMMouseEvent) \
96 XDIID(DispDOMProgressEvent) \
97 XDIID(DispDOMStorageEvent) \
98 XDIID(DispDOMUIEvent) \
99 XDIID(DispDOMDocumentType) \
100 XDIID(DispHTMLAnchorElement) \
101 XDIID(DispHTMLAreaElement) \
102 XDIID(DispHTMLAttributeCollection) \
103 XDIID(DispHTMLBody) \
104 XDIID(DispHTMLButtonElement) \
105 XDIID(DispHTMLCommentElement) \
106 XDIID(DispHTMLCurrentStyle) \
107 XDIID(DispHTMLDocument) \
108 XDIID(DispHTMLDOMAttribute) \
109 XDIID(DispHTMLDOMImplementation) \
110 XDIID(DispHTMLDOMRange) \
111 XDIID(DispHTMLDOMTextNode) \
112 XDIID(DispHTMLElementCollection) \
113 XDIID(DispHTMLEmbed) \
114 XDIID(DispHTMLFormElement) \
115 XDIID(DispHTMLGenericElement) \
116 XDIID(DispHTMLFrameElement) \
117 XDIID(DispHTMLHeadElement) \
118 XDIID(DispHTMLHtmlElement) \
119 XDIID(DispHTMLHistory) \
120 XDIID(DispHTMLIFrame) \
122 XDIID(DispHTMLInputElement) \
123 XDIID(DispHTMLLabelElement) \
124 XDIID(DispHTMLLinkElement) \
125 XDIID(DispHTMLLocation) \
126 XDIID(DispHTMLMetaElement) \
127 XDIID(DispHTMLNamespaceCollection) \
128 XDIID(DispHTMLNavigator) \
129 XDIID(DispHTMLObjectElement) \
130 XDIID(DispHTMLOptionElement) \
131 XDIID(DispHTMLScreen) \
132 XDIID(DispHTMLScriptElement) \
133 XDIID(DispHTMLSelectElement) \
134 XDIID(DispHTMLStyle) \
135 XDIID(DispHTMLStyleElement) \
136 XDIID(DispHTMLStyleSheet) \
137 XDIID(DispHTMLStyleSheetRule) \
138 XDIID(DispHTMLStyleSheetRulesCollection) \
139 XDIID(DispHTMLStyleSheetsCollection) \
140 XDIID(DispHTMLTable) \
141 XDIID(DispHTMLTableCell) \
142 XDIID(DispHTMLTableRow) \
143 XDIID(DispHTMLTextAreaElement) \
144 XDIID(DispHTMLTitleElement) \
145 XDIID(DispHTMLUnknownElement) \
146 XDIID(DispHTMLW3CComputedStyle) \
147 XDIID(DispHTMLWindow2) \
148 XDIID(DispHTMLXMLHttpRequest) \
149 XDIID(DispSVGCircleElement) \
150 XDIID(DispSVGSVGElement) \
151 XDIID(DispSVGTSpanElement) \
152 XDIID(HTMLDocumentEvents) \
153 XDIID(HTMLDocumentEvents2) \
154 XDIID(HTMLElementEvents2) \
155 XIID(IDOMCustomEvent) \
157 XIID(IDOMKeyboardEvent) \
158 XIID(IDOMMessageEvent) \
159 XIID(IDOMMouseEvent) \
160 XIID(IDOMProgressEvent) \
161 XIID(IDOMStorageEvent) \
163 XIID(IDOMDocumentType) \
164 XIID(IDocumentEvent) \
165 XIID(IDocumentRange) \
166 XIID(IDocumentSelector) \
167 XIID(IElementSelector) \
168 XIID(IElementTraversal) \
170 XIID(IHTMLAnchorElement) \
171 XIID(IHTMLAreaElement) \
172 XIID(IHTMLAttributeCollection) \
173 XIID(IHTMLAttributeCollection2) \
174 XIID(IHTMLAttributeCollection3) \
175 XIID(IHTMLBodyElement) \
176 XIID(IHTMLBodyElement2) \
177 XIID(IHTMLButtonElement) \
178 XIID(IHTMLCSSStyleDeclaration) \
179 XIID(IHTMLCSSStyleDeclaration2) \
180 XIID(IHTMLCommentElement) \
181 XIID(IHTMLCurrentStyle) \
182 XIID(IHTMLCurrentStyle2) \
183 XIID(IHTMLCurrentStyle3) \
184 XIID(IHTMLCurrentStyle4) \
185 XIID(IHTMLDocument2) \
186 XIID(IHTMLDocument3) \
187 XIID(IHTMLDocument4) \
188 XIID(IHTMLDocument5) \
189 XIID(IHTMLDocument6) \
190 XIID(IHTMLDocument7) \
191 XIID(IHTMLDOMAttribute) \
192 XIID(IHTMLDOMAttribute2) \
193 XIID(IHTMLDOMChildrenCollection) \
194 XIID(IHTMLDOMImplementation) \
195 XIID(IHTMLDOMImplementation2) \
197 XIID(IHTMLDOMNode2) \
198 XIID(IHTMLDOMNode3) \
199 XIID(IHTMLDOMRange) \
200 XIID(IHTMLDOMTextNode) \
201 XIID(IHTMLDOMTextNode2) \
203 XIID(IHTMLElement2) \
204 XIID(IHTMLElement3) \
205 XIID(IHTMLElement4) \
206 XIID(IHTMLElement6) \
207 XIID(IHTMLElement7) \
208 XIID(IHTMLElementCollection) \
209 XIID(IHTMLEmbedElement) \
210 XIID(IHTMLEventObj) \
211 XIID(IHTMLFiltersCollection) \
212 XIID(IHTMLFormElement) \
213 XIID(IHTMLFrameBase) \
214 XIID(IHTMLFrameBase2) \
215 XIID(IHTMLFrameElement3) \
216 XIID(IHTMLGenericElement) \
217 XIID(IHTMLHeadElement) \
218 XIID(IHTMLHtmlElement) \
219 XIID(IHTMLIFrameElement) \
220 XIID(IHTMLIFrameElement2) \
221 XIID(IHTMLIFrameElement3) \
222 XIID(IHTMLImageElementFactory) \
223 XIID(IHTMLImgElement) \
224 XIID(IHTMLInputElement) \
225 XIID(IHTMLInputTextElement2) \
226 XIID(IHTMLLabelElement) \
227 XIID(IHTMLLinkElement) \
228 XIID(IHTMLLocation) \
229 XIID(IHTMLMetaElement) \
230 XIID(IHTMLMimeTypesCollection) \
231 XIID(IHTMLNamespaceCollection) \
232 XIID(IHTMLObjectElement) \
233 XIID(IHTMLObjectElement2) \
234 XIID(IHTMLOptionElement) \
235 XIID(IHTMLOptionElementFactory) \
236 XIID(IHTMLPerformance) \
237 XIID(IHTMLPerformanceNavigation) \
238 XIID(IHTMLPerformanceTiming) \
239 XIID(IHTMLPluginsCollection) \
242 XIID(IHTMLRectCollection) \
244 XIID(IHTMLScriptElement) \
245 XIID(IHTMLSelectElement) \
246 XIID(IHTMLSelectionObject) \
247 XIID(IHTMLSelectionObject2) \
255 XIID(IHTMLStyleElement) \
256 XIID(IHTMLStyleElement2) \
257 XIID(IHTMLStyleSheet) \
258 XIID(IHTMLStyleSheet4) \
259 XIID(IHTMLStyleSheetRule) \
260 XIID(IHTMLStyleSheetRulesCollection) \
261 XIID(IHTMLStyleSheetsCollection) \
265 XIID(IHTMLTableCell) \
266 XIID(IHTMLTableRow) \
267 XIID(IHTMLTextAreaElement) \
268 XIID(IHTMLTextContainer) \
269 XIID(IHTMLTitleElement) \
270 XIID(IHTMLTxtRange) \
271 XIID(IHTMLUniqueName) \
278 XIID(IHTMLXMLHttpRequest) \
279 XIID(IHTMLXMLHttpRequest2) \
280 XIID(IHTMLXMLHttpRequestFactory) \
283 XIID(ISVGCircleElement) \
285 XIID(ISVGSVGElement) \
286 XIID(ISVGTSpanElement) \
287 XIID(ISVGTextContentElement)
289 #define PRIVATE_TID_LIST \
290 XIID(IWineDOMTokenList) \
291 XIID(IWineHTMLElementPrivate) \
292 XIID(IWineHTMLWindowPrivate) \
293 XIID(IWineHTMLWindowCompatPrivate) \
294 XIID(IWinePageTransitionEvent) \
295 XIID(IWineXMLHttpRequestPrivate) \
296 XIID(IWineMSHTMLConsole) \
297 XIID(IWineMSHTMLMediaQueryList)
300 #define XIID(iface) iface ## _tid,
301 #define XDIID(iface) iface ## _tid,
311 COMPAT_MODE_INVALID
= -1,
321 #define COMPAT_MODE_CNT (COMPAT_MODE_IE11+1)
322 #define COMPAT_MODE_NONE COMPAT_MODE_QUIRKS
325 unsigned document_mode
;
327 } compat_mode_info_t
;
329 extern const compat_mode_info_t compat_mode_info
[COMPAT_MODE_CNT
];
331 typedef struct dispex_data_t dispex_data_t
;
332 typedef struct dispex_dynamic_data_t dispex_dynamic_data_t
;
334 #define MSHTML_DISPID_CUSTOM_MIN 0x60000000
335 #define MSHTML_DISPID_CUSTOM_MAX 0x6fffffff
336 #define MSHTML_CUSTOM_DISPID_CNT (MSHTML_DISPID_CUSTOM_MAX-MSHTML_DISPID_CUSTOM_MIN)
338 typedef struct DispatchEx DispatchEx
;
341 HRESULT (*value
)(DispatchEx
*,LCID
,WORD
,DISPPARAMS
*,VARIANT
*,EXCEPINFO
*,IServiceProvider
*);
342 HRESULT (*get_dispid
)(DispatchEx
*,BSTR
,DWORD
,DISPID
*);
343 HRESULT (*get_name
)(DispatchEx
*,DISPID
,BSTR
*);
344 HRESULT (*invoke
)(DispatchEx
*,DISPID
,LCID
,WORD
,DISPPARAMS
*,VARIANT
*,EXCEPINFO
*,IServiceProvider
*);
345 HRESULT (*delete)(DispatchEx
*,DISPID
);
346 HRESULT (*next_dispid
)(DispatchEx
*,DISPID
,DISPID
*);
347 compat_mode_t (*get_compat_mode
)(DispatchEx
*);
348 HRESULT (*populate_props
)(DispatchEx
*);
349 } dispex_static_data_vtbl_t
;
353 const dispex_static_data_vtbl_t
*vtbl
;
354 const tid_t disp_tid
;
355 const tid_t
* const iface_tids
;
356 void (*init_info
)(dispex_data_t
*,compat_mode_t
);
357 dispex_data_t
*info_cache
[COMPAT_MODE_CNT
];
358 dispex_data_t
*delayed_init_info
;
359 } dispex_static_data_t
;
361 typedef HRESULT (*dispex_hook_invoke_t
)(DispatchEx
*,WORD
,DISPPARAMS
*,VARIANT
*,
362 EXCEPINFO
*,IServiceProvider
*);
366 dispex_hook_invoke_t invoke
;
371 IDispatchEx IDispatchEx_iface
;
376 dispex_dynamic_data_t
*dynamic_data
;
381 } nsCycleCollectingAutoRefCnt
;
387 } ExternalCycleCollectionParticipant
;
389 typedef struct nsCycleCollectionTraversalCallback nsCycleCollectionTraversalCallback
;
392 nsresult (NSAPI
*traverse
)(void*,void*,nsCycleCollectionTraversalCallback
*);
393 nsresult (NSAPI
*unlink
)(void*);
394 void (NSAPI
*delete_cycle_collectable
)(void*);
397 DEFINE_GUID(IID_nsXPCOMCycleCollectionParticipant
, 0x9674489b,0x1f6f,0x4550,0xa7,0x30, 0xcc,0xae,0xdd,0x10,0x4c,0xf9);
399 extern nsrefcnt (__cdecl
*ccref_incr
)(nsCycleCollectingAutoRefCnt
*,nsISupports
*);
400 extern nsrefcnt (__cdecl
*ccref_decr
)(nsCycleCollectingAutoRefCnt
*,nsISupports
*,ExternalCycleCollectionParticipant
*);
401 extern void (__cdecl
*ccref_init
)(nsCycleCollectingAutoRefCnt
*,nsrefcnt
);
402 extern void (__cdecl
*ccp_init
)(ExternalCycleCollectionParticipant
*,const CCObjCallback
*);
403 extern void (__cdecl
*describe_cc_node
)(nsCycleCollectingAutoRefCnt
*,const char*,nsCycleCollectionTraversalCallback
*);
404 extern void (__cdecl
*note_cc_edge
)(nsISupports
*,const char*,nsCycleCollectionTraversalCallback
*);
406 void init_dispatch(DispatchEx
*,IUnknown
*,dispex_static_data_t
*,compat_mode_t
);
407 void release_dispex(DispatchEx
*);
408 BOOL
dispex_query_interface(DispatchEx
*,REFIID
,void**);
409 HRESULT
change_type(VARIANT
*,VARIANT
*,VARTYPE
,IServiceProvider
*);
410 HRESULT
dispex_get_dprop_ref(DispatchEx
*,const WCHAR
*,BOOL
,VARIANT
**);
411 HRESULT
get_dispids(tid_t
,DWORD
*,DISPID
**);
412 HRESULT
remove_attribute(DispatchEx
*,DISPID
,VARIANT_BOOL
*);
413 HRESULT
dispex_get_dynid(DispatchEx
*,const WCHAR
*,BOOL
,DISPID
*);
414 void dispex_traverse(DispatchEx
*,nsCycleCollectionTraversalCallback
*);
415 void dispex_unlink(DispatchEx
*);
416 void release_typelib(void);
417 HRESULT
get_class_typeinfo(const CLSID
*,ITypeInfo
**);
418 const void *dispex_get_vtbl(DispatchEx
*);
419 void dispex_info_add_interface(dispex_data_t
*,tid_t
,const dispex_hook_t
*);
420 compat_mode_t
dispex_compat_mode(DispatchEx
*);
421 HRESULT
dispex_to_string(DispatchEx
*,BSTR
*);
422 HRESULT
dispex_call_builtin(DispatchEx
*dispex
, DISPID id
, DISPPARAMS
*dp
,
423 VARIANT
*res
, EXCEPINFO
*ei
, IServiceProvider
*caller
);
429 } dispex_prop_type_t
;
431 dispex_prop_type_t
get_dispid_type(DISPID
);
433 typedef struct HTMLWindow HTMLWindow
;
434 typedef struct HTMLInnerWindow HTMLInnerWindow
;
435 typedef struct HTMLOuterWindow HTMLOuterWindow
;
436 typedef struct HTMLDocumentNode HTMLDocumentNode
;
437 typedef struct HTMLDocumentObj HTMLDocumentObj
;
438 typedef struct HTMLFrameBase HTMLFrameBase
;
439 typedef struct GeckoBrowser GeckoBrowser
;
440 typedef struct HTMLAttributeCollection HTMLAttributeCollection
;
442 typedef struct ScriptHost ScriptHost
;
449 } global_prop_type_t
;
452 global_prop_type_t type
;
454 ScriptHost
*script_host
;
460 IEventTarget IEventTarget_iface
;
461 struct wine_rb_tree handler_map
;
466 IHTMLOptionElementFactory IHTMLOptionElementFactory_iface
;
470 HTMLInnerWindow
*window
;
471 } HTMLOptionElementFactory
;
475 IHTMLImageElementFactory IHTMLImageElementFactory_iface
;
479 HTMLInnerWindow
*window
;
480 } HTMLImageElementFactory
;
484 IHTMLXMLHttpRequestFactory IHTMLXMLHttpRequestFactory_iface
;
488 HTMLInnerWindow
*window
;
489 } HTMLXMLHttpRequestFactory
;
491 struct HTMLLocation
{
493 IHTMLLocation IHTMLLocation_iface
;
498 IOmHistory IOmHistory_iface
;
502 HTMLInnerWindow
*window
;
507 IHTMLPerformanceTiming IHTMLPerformanceTiming_iface
;
511 ULONG navigation_type
;
512 ULONG redirect_count
;
514 ULONGLONG navigation_start_time
;
515 ULONGLONG unload_event_start_time
;
516 ULONGLONG unload_event_end_time
;
517 ULONGLONG redirect_time
;
518 ULONGLONG dns_lookup_time
;
519 ULONGLONG connect_time
;
520 ULONGLONG request_time
;
521 ULONGLONG response_start_time
;
522 ULONGLONG response_end_time
;
523 ULONGLONG dom_interactive_time
;
524 ULONGLONG dom_complete_time
;
525 ULONGLONG dom_content_loaded_event_start_time
;
526 ULONGLONG dom_content_loaded_event_end_time
;
527 ULONGLONG load_event_start_time
;
528 ULONGLONG load_event_end_time
;
529 ULONGLONG first_paint_time
;
530 } HTMLPerformanceTiming
;
532 typedef struct nsChannelBSC nsChannelBSC
;
535 IHTMLWindow2 IHTMLWindow2_iface
;
536 IHTMLWindow3 IHTMLWindow3_iface
;
537 IHTMLWindow4 IHTMLWindow4_iface
;
538 IHTMLWindow5 IHTMLWindow5_iface
;
539 IHTMLWindow6 IHTMLWindow6_iface
;
540 IHTMLWindow7 IHTMLWindow7_iface
;
541 IHTMLPrivateWindow IHTMLPrivateWindow_iface
;
542 IDispatchEx IDispatchEx_iface
;
543 IServiceProvider IServiceProvider_iface
;
544 ITravelLogClient ITravelLogClient_iface
;
545 IObjectIdentity IObjectIdentity_iface
;
546 IProvideMultipleClassInfo IProvideMultipleClassInfo_iface
;
547 IWineHTMLWindowPrivate IWineHTMLWindowPrivate_iface
;
548 IWineHTMLWindowCompatPrivate IWineHTMLWindowCompatPrivate_iface
;
550 IWineMSHTMLConsole
*console
;
554 HTMLInnerWindow
*inner_window
;
555 HTMLOuterWindow
*outer_window
;
558 struct HTMLOuterWindow
{
563 nsIDOMWindow
*nswindow
;
564 mozIDOMWindowProxy
*window_proxy
;
565 HTMLOuterWindow
*parent
;
566 HTMLFrameBase
*frame_element
;
568 GeckoBrowser
*browser
;
569 struct list browser_entry
;
571 READYSTATE readystate
;
572 unsigned readystate_locked
;
573 BOOL readystate_pending
;
575 HTMLInnerWindow
*pending_window
;
576 HTMLLocation location
;
583 struct list sibling_entry
;
584 struct wine_rb_entry entry
;
587 struct HTMLInnerWindow
{
589 EventTarget event_target
;
591 HTMLDocumentNode
*doc
;
593 struct list children
;
594 struct list script_hosts
;
596 IHTMLEventObj
*event
;
598 HTMLImageElementFactory
*image_factory
;
599 HTMLOptionElementFactory
*option_factory
;
600 HTMLXMLHttpRequestFactory
*xhr_factory
;
603 IOmNavigator
*navigator
;
604 IHTMLStorage
*session_storage
;
605 IHTMLStorage
*local_storage
;
607 BOOL performance_initialized
;
609 HTMLPerformanceTiming
*performance_timing
;
611 unsigned blocking_depth
;
612 unsigned parser_callback_cnt
;
613 struct list script_queue
;
615 global_prop_t
*global_props
;
616 DWORD global_prop_cnt
;
617 DWORD global_prop_size
;
622 nsChannelBSC
*bscallback
;
623 struct list bindings
;
632 typedef struct _cp_static_data_t
{
634 void (*on_advise
)(IUnknown
*,struct _cp_static_data_t
*);
642 cp_static_data_t
*desc
;
645 typedef struct ConnectionPointContainer
{
646 IConnectionPointContainer IConnectionPointContainer_iface
;
648 ConnectionPoint
*cps
;
649 const cpc_entry_t
*cp_entries
;
651 struct ConnectionPointContainer
*forward_container
;
652 } ConnectionPointContainer
;
654 struct ConnectionPoint
{
655 IConnectionPoint IConnectionPoint_iface
;
657 ConnectionPointContainer
*container
;
662 IPropertyNotifySink
*propnotif
;
667 cp_static_data_t
*data
;
670 struct HTMLDocumentObj
{
671 IUnknown IUnknown_inner
;
672 IDispatchEx IDispatchEx_iface
;
673 ICustomDoc ICustomDoc_iface
;
674 IHTMLDocument2 IHTMLDocument2_iface
;
675 IHTMLDocument3 IHTMLDocument3_iface
;
676 IHTMLDocument4 IHTMLDocument4_iface
;
677 IHTMLDocument5 IHTMLDocument5_iface
;
678 IHTMLDocument6 IHTMLDocument6_iface
;
679 IHTMLDocument7 IHTMLDocument7_iface
;
680 IDocumentSelector IDocumentSelector_iface
;
681 IDocumentEvent IDocumentEvent_iface
;
682 ISupportErrorInfo ISupportErrorInfo_iface
;
683 IProvideMultipleClassInfo IProvideMultipleClassInfo_iface
;
684 IMarkupServices IMarkupServices_iface
;
685 IMarkupContainer IMarkupContainer_iface
;
686 IDisplayServices IDisplayServices_iface
;
687 IDocumentRange IDocumentRange_iface
;
688 IOleDocumentView IOleDocumentView_iface
;
689 IViewObjectEx IViewObjectEx_iface
;
690 IPersistMoniker IPersistMoniker_iface
;
691 IPersistFile IPersistFile_iface
;
692 IMonikerProp IMonikerProp_iface
;
693 IPersistStreamInit IPersistStreamInit_iface
;
694 IPersistHistory IPersistHistory_iface
;
695 IHlinkTarget IHlinkTarget_iface
;
696 IOleCommandTarget IOleCommandTarget_iface
;
697 IOleObject IOleObject_iface
;
698 IOleDocument IOleDocument_iface
;
699 IOleControl IOleControl_iface
;
700 IOleInPlaceActiveObject IOleInPlaceActiveObject_iface
;
701 IOleInPlaceObjectWindowless IOleInPlaceObjectWindowless_iface
;
702 IObjectWithSite IObjectWithSite_iface
;
703 IOleContainer IOleContainer_iface
;
704 IObjectSafety IObjectSafety_iface
;
705 IServiceProvider IServiceProvider_iface
;
706 ITargetContainer ITargetContainer_iface
;
707 IEventTarget IEventTarget_iface
;
709 IWindowForBindingUI IWindowForBindingUI_iface
;
714 HTMLOuterWindow
*window
;
715 GeckoBrowser
*nscontainer
;
716 HTMLDocumentNode
*doc_node
;
718 IOleClientSite
*client
;
719 IDocHostUIHandler
*hostui
;
720 IOleCommandTarget
*client_cmdtrg
;
722 IOleInPlaceSite
*ipsite
;
723 IOleInPlaceFrame
*frame
;
724 IOleInPlaceUIWindow
*ip_window
;
725 IAdviseSink
*view_sink
;
726 IDocObjectService
*doc_object_service
;
727 IUnknown
*webbrowser
;
728 ITravelLog
*travel_log
;
729 IUnknown
*browser_service
;
730 IOleAdviseHolder
*advise_holder
;
732 ConnectionPointContainer cp_container
;
733 DOCHOSTUIINFO hostinfo
;
735 IOleUndoManager
*undomgr
;
736 IHTMLEditServices
*editsvcs
;
742 BOOL request_uiactivate
;
743 BOOL in_place_active
;
747 BOOL container_locked
;
759 typedef struct nsWeakReference nsWeakReference
;
764 SCRIPTMODE_ACTIVESCRIPT
767 struct GeckoBrowser
{
768 nsIWebBrowserChrome nsIWebBrowserChrome_iface
;
769 nsIContextMenuListener nsIContextMenuListener_iface
;
770 nsIURIContentListener nsIURIContentListener_iface
;
771 nsIEmbeddingSiteWindow nsIEmbeddingSiteWindow_iface
;
772 nsITooltipListener nsITooltipListener_iface
;
773 nsIInterfaceRequestor nsIInterfaceRequestor_iface
;
774 nsISupportsWeakReference nsISupportsWeakReference_iface
;
776 nsIWebBrowser
*webbrowser
;
777 nsIWebNavigation
*navigation
;
778 nsIBaseWindow
*window
;
779 nsIWebBrowserFocus
*focus
;
781 HTMLOuterWindow
*content_window
;
784 nsIController
*editor_controller
;
788 nsWeakReference
*weak_reference
;
790 HTMLDocumentObj
*doc
;
792 nsIURIContentListener
*content_listener
;
795 SCRIPTMODE script_mode
;
798 struct list document_nodes
;
799 struct list outer_windows
;
804 HRESULT (*qi
)(HTMLDOMNode
*,REFIID
,void**);
805 void (*destructor
)(HTMLDOMNode
*);
806 const cpc_entry_t
*cpc_entries
;
807 HRESULT (*clone
)(HTMLDOMNode
*,nsIDOMNode
*,HTMLDOMNode
**);
808 HRESULT (*handle_event
)(HTMLDOMNode
*,DWORD
,nsIDOMEvent
*,BOOL
*);
809 HRESULT (*get_attr_col
)(HTMLDOMNode
*,HTMLAttributeCollection
**);
810 EventTarget
*(*get_event_prop_target
)(HTMLDOMNode
*,int);
811 HRESULT (*put_disabled
)(HTMLDOMNode
*,VARIANT_BOOL
);
812 HRESULT (*get_disabled
)(HTMLDOMNode
*,VARIANT_BOOL
*);
813 HRESULT (*get_document
)(HTMLDOMNode
*,IDispatch
**);
814 HRESULT (*get_readystate
)(HTMLDOMNode
*,BSTR
*);
815 HRESULT (*get_dispid
)(HTMLDOMNode
*,BSTR
,DWORD
,DISPID
*);
816 HRESULT (*get_name
)(HTMLDOMNode
*,DISPID
,BSTR
*);
817 HRESULT (*invoke
)(HTMLDOMNode
*,DISPID
,LCID
,WORD
,DISPPARAMS
*,VARIANT
*,EXCEPINFO
*,IServiceProvider
*);
818 HRESULT (*bind_to_tree
)(HTMLDOMNode
*);
819 void (*traverse
)(HTMLDOMNode
*,nsCycleCollectionTraversalCallback
*);
820 void (*unlink
)(HTMLDOMNode
*);
821 BOOL (*is_text_edit
)(HTMLDOMNode
*);
822 BOOL (*is_settable
)(HTMLDOMNode
*,DISPID
);
826 EventTarget event_target
;
827 IHTMLDOMNode IHTMLDOMNode_iface
;
828 IHTMLDOMNode2 IHTMLDOMNode2_iface
;
829 IHTMLDOMNode3 IHTMLDOMNode3_iface
;
830 const NodeImplVtbl
*vtbl
;
832 nsCycleCollectingAutoRefCnt ccref
;
835 HTMLDocumentNode
*doc
;
838 HTMLDOMNode
*unsafe_impl_from_IHTMLDOMNode(IHTMLDOMNode
*);
840 static inline void node_addref(HTMLDOMNode
*node
)
842 IHTMLDOMNode_AddRef(&node
->IHTMLDOMNode_iface
);
845 static inline void node_release(HTMLDOMNode
*node
)
847 IHTMLDOMNode_Release(&node
->IHTMLDOMNode_iface
);
852 ConnectionPointContainer cp_container
;
854 IHTMLElement IHTMLElement_iface
;
855 IHTMLElement2 IHTMLElement2_iface
;
856 IHTMLElement3 IHTMLElement3_iface
;
857 IHTMLElement4 IHTMLElement4_iface
;
858 IHTMLElement6 IHTMLElement6_iface
;
859 IHTMLElement7 IHTMLElement7_iface
;
860 IHTMLUniqueName IHTMLUniqueName_iface
;
861 IElementSelector IElementSelector_iface
;
862 IElementTraversal IElementTraversal_iface
;
863 IProvideMultipleClassInfo IProvideMultipleClassInfo_iface
;
864 IWineHTMLElementPrivate IWineHTMLElementPrivate_iface
;
866 nsIDOMElement
*dom_element
; /* NULL for legacy comments represented as HTML elements */
867 nsIDOMHTMLElement
*html_element
; /* NULL for non-HTML elements (like SVG elements) */
869 HTMLStyle
*runtime_style
;
870 HTMLAttributeCollection
*attrs
;
875 #define HTMLELEMENT_TIDS \
883 extern cp_static_data_t HTMLElementEvents2_data
;
884 #define HTMLELEMENT_CPC {&DIID_HTMLElementEvents2, &HTMLElementEvents2_data}
885 extern const cpc_entry_t HTMLElement_cpc
[];
887 struct HTMLFrameBase
{
890 IHTMLFrameBase IHTMLFrameBase_iface
;
891 IHTMLFrameBase2 IHTMLFrameBase2_iface
;
893 HTMLOuterWindow
*content_window
;
895 nsIDOMHTMLFrameElement
*nsframe
;
896 nsIDOMHTMLIFrameElement
*nsiframe
;
899 typedef struct nsDocumentEventListener nsDocumentEventListener
;
901 struct HTMLDocumentNode
{
904 IDispatchEx IDispatchEx_iface
;
905 IHTMLDocument2 IHTMLDocument2_iface
;
906 IHTMLDocument3 IHTMLDocument3_iface
;
907 IHTMLDocument4 IHTMLDocument4_iface
;
908 IHTMLDocument5 IHTMLDocument5_iface
;
909 IHTMLDocument6 IHTMLDocument6_iface
;
910 IHTMLDocument7 IHTMLDocument7_iface
;
911 IDocumentSelector IDocumentSelector_iface
;
912 IDocumentEvent IDocumentEvent_iface
;
913 ISupportErrorInfo ISupportErrorInfo_iface
;
914 IProvideMultipleClassInfo IProvideMultipleClassInfo_iface
;
915 IMarkupServices IMarkupServices_iface
;
916 IMarkupContainer IMarkupContainer_iface
;
917 IDisplayServices IDisplayServices_iface
;
918 IDocumentRange IDocumentRange_iface
;
919 IPersistMoniker IPersistMoniker_iface
;
920 IPersistFile IPersistFile_iface
;
921 IMonikerProp IMonikerProp_iface
;
922 IPersistStreamInit IPersistStreamInit_iface
;
923 IPersistHistory IPersistHistory_iface
;
924 IHlinkTarget IHlinkTarget_iface
;
925 IOleCommandTarget IOleCommandTarget_iface
;
926 IOleObject IOleObject_iface
;
927 IOleDocument IOleDocument_iface
;
928 IOleControl IOleControl_iface
;
929 IOleInPlaceActiveObject IOleInPlaceActiveObject_iface
;
930 IOleInPlaceObjectWindowless IOleInPlaceObjectWindowless_iface
;
931 IObjectWithSite IObjectWithSite_iface
;
932 IOleContainer IOleContainer_iface
;
933 IObjectSafety IObjectSafety_iface
;
934 IServiceProvider IServiceProvider_iface
;
935 IInternetHostSecurityManager IInternetHostSecurityManager_iface
;
937 nsIDocumentObserver nsIDocumentObserver_iface
;
941 ConnectionPointContainer cp_container
;
942 HTMLOuterWindow
*outer_window
;
943 HTMLInnerWindow
*window
;
944 HTMLDocumentObj
*doc_obj
;
946 GeckoBrowser
*browser
;
947 struct list browser_entry
;
949 compat_mode_t document_mode
;
950 BOOL document_mode_locked
;
952 nsIDOMDocument
*dom_document
;
953 nsIDOMHTMLDocument
*html_document
;
954 BOOL content_ready
: 1;
955 BOOL unload_sent
: 1;
957 IHTMLDOMImplementation
*dom_implementation
;
958 IHTMLNamespaceCollection
*namespaces
;
960 ICatInformation
*catmgr
;
961 nsDocumentEventListener
*nsevent_listener
;
965 unsigned elem_vars_size
;
966 unsigned elem_vars_cnt
;
968 BOOL skip_mutation_notif
;
974 struct list selection_list
;
975 struct list range_list
;
976 struct list plugin_hosts
;
979 HRESULT
HTMLDocument_Create(IUnknown
*,REFIID
,void**);
980 HRESULT
MHTMLDocument_Create(IUnknown
*,REFIID
,void**);
981 HRESULT
HTMLLoadOptions_Create(IUnknown
*,REFIID
,void**);
982 HRESULT
create_document_node(nsIDOMDocument
*,GeckoBrowser
*,HTMLInnerWindow
*,
983 compat_mode_t
,HTMLDocumentNode
**);
984 HRESULT
create_doctype_node(HTMLDocumentNode
*,nsIDOMNode
*,HTMLDOMNode
**);
986 HRESULT
create_outer_window(GeckoBrowser
*,mozIDOMWindowProxy
*,HTMLOuterWindow
*,HTMLOuterWindow
**);
987 HRESULT
update_window_doc(HTMLInnerWindow
*);
988 HTMLOuterWindow
*mozwindow_to_window(const mozIDOMWindowProxy
*);
989 void get_top_window(HTMLOuterWindow
*,HTMLOuterWindow
**);
990 HRESULT
HTMLOptionElementFactory_Create(HTMLInnerWindow
*,HTMLOptionElementFactory
**);
991 HRESULT
HTMLImageElementFactory_Create(HTMLInnerWindow
*,HTMLImageElementFactory
**);
992 HRESULT
HTMLXMLHttpRequestFactory_Create(HTMLInnerWindow
*,HTMLXMLHttpRequestFactory
**);
993 void HTMLLocation_Init(HTMLLocation
*);
994 HRESULT
create_navigator(compat_mode_t
,IOmNavigator
**);
995 HRESULT
create_html_screen(compat_mode_t
,IHTMLScreen
**);
996 HRESULT
create_performance(HTMLInnerWindow
*,IHTMLPerformance
**);
997 HRESULT
create_performance_timing(HTMLPerformanceTiming
**);
998 HRESULT
create_history(HTMLInnerWindow
*,OmHistory
**);
999 HRESULT
create_namespace_collection(compat_mode_t
,IHTMLNamespaceCollection
**);
1000 HRESULT
create_dom_implementation(HTMLDocumentNode
*,IHTMLDOMImplementation
**);
1001 void detach_dom_implementation(IHTMLDOMImplementation
*);
1003 HRESULT
create_html_storage(HTMLInnerWindow
*,BOOL
,IHTMLStorage
**);
1004 void detach_html_storage(IHTMLStorage
*);
1006 void HTMLDocument_View_Init(HTMLDocumentObj
*);
1007 void HTMLDocumentObj_Persist_Init(HTMLDocumentObj
*);
1008 void HTMLDocumentObj_Service_Init(HTMLDocumentObj
*);
1009 void HTMLDocumentObj_OleCmd_Init(HTMLDocumentObj
*);
1010 void TargetContainer_Init(HTMLDocumentObj
*);
1012 void HTMLDocumentNode_Persist_Init(HTMLDocumentNode
*);
1013 void HTMLDocumentNode_Service_Init(HTMLDocumentNode
*);
1014 void HTMLDocumentNode_OleCmd_Init(HTMLDocumentNode
*);
1015 void HTMLDocumentNode_OleObj_Init(HTMLDocumentNode
*);
1016 void HTMLDocumentNode_SecMgr_Init(HTMLDocumentNode
*);
1018 HRESULT
HTMLCurrentStyle_Create(HTMLElement
*,IHTMLCurrentStyle
**);
1020 void ConnectionPointContainer_Init(ConnectionPointContainer
*,IUnknown
*,const cpc_entry_t
*);
1021 void ConnectionPointContainer_Destroy(ConnectionPointContainer
*);
1023 HRESULT
create_gecko_browser(HTMLDocumentObj
*,GeckoBrowser
**);
1024 void detach_gecko_browser(GeckoBrowser
*);
1026 DWORD
get_compat_mode_version(compat_mode_t compat_mode
);
1027 compat_mode_t
lock_document_mode(HTMLDocumentNode
*);
1029 void init_mutation(nsIComponentManager
*);
1030 void init_document_mutation(HTMLDocumentNode
*);
1031 void release_document_mutation(HTMLDocumentNode
*);
1032 JSContext
*get_context_from_document(nsIDOMDocument
*);
1034 void HTMLDocument_LockContainer(HTMLDocumentObj
*,BOOL
);
1035 void show_context_menu(HTMLDocumentObj
*,DWORD
,POINT
*,IDispatch
*);
1036 void notif_focus(HTMLDocumentObj
*);
1038 void show_tooltip(HTMLDocumentObj
*,DWORD
,DWORD
,LPCWSTR
);
1039 void hide_tooltip(HTMLDocumentObj
*);
1040 HRESULT
get_client_disp_property(IOleClientSite
*,DISPID
,VARIANT
*);
1042 UINT
get_document_charset(HTMLDocumentNode
*);
1044 HRESULT
ProtocolFactory_Create(REFCLSID
,REFIID
,void**);
1046 BOOL
load_gecko(void);
1047 void close_gecko(void);
1048 void register_nsservice(nsIComponentRegistrar
*,nsIServiceManager
*);
1049 void init_nsio(nsIComponentManager
*);
1050 void release_nsio(void);
1051 BOOL
is_gecko_path(const char*);
1052 void set_viewer_zoom(GeckoBrowser
*,float);
1053 float get_viewer_zoom(GeckoBrowser
*);
1055 void init_node_cc(void);
1057 HRESULT
nsuri_to_url(LPCWSTR
,BOOL
,BSTR
*);
1059 HRESULT
call_disp_func(IDispatch
*,DISPPARAMS
*,VARIANT
*);
1060 void call_property_onchanged(ConnectionPointContainer
*,DISPID
);
1061 HRESULT
call_set_active_object(IOleInPlaceUIWindow
*,IOleInPlaceActiveObject
*);
1064 void *nsalloc(size_t) __WINE_ALLOC_SIZE(1) __WINE_DEALLOC(nsfree
) __WINE_MALLOC
;
1066 BOOL
nsACString_Init(nsACString
*str
, const char *data
);
1067 void nsACString_InitDepend(nsACString
*,const char*);
1068 void nsACString_SetData(nsACString
*,const char*);
1069 UINT32
nsACString_GetData(const nsACString
*,const char**);
1070 void nsACString_Finish(nsACString
*);
1072 BOOL
nsAString_Init(nsAString
*,const PRUnichar
*);
1073 void nsAString_InitDepend(nsAString
*,const PRUnichar
*);
1074 void nsAString_SetData(nsAString
*,const PRUnichar
*);
1075 UINT32
nsAString_GetData(const nsAString
*,const PRUnichar
**);
1076 void nsAString_Finish(nsAString
*);
1078 #define NSSTR_IMPLICIT_PX 0x01
1079 #define NSSTR_COLOR 0x02
1081 HRESULT
map_nsresult(nsresult
);
1082 HRESULT
return_nsstr(nsresult
,nsAString
*,BSTR
*);
1083 HRESULT
return_nsstr_variant(nsresult
,nsAString
*,unsigned,VARIANT
*);
1084 HRESULT
variant_to_nsstr(VARIANT
*,BOOL
,nsAString
*);
1085 HRESULT
return_nsform(nsresult
,nsIDOMHTMLFormElement
*,IHTMLFormElement
**);
1087 nsICommandParams
*create_nscommand_params(void);
1088 HRESULT
nsnode_to_nsstring(nsIDOMNode
*,nsAString
*);
1089 void setup_editor_controller(GeckoBrowser
*);
1090 nsresult
get_nsinterface(nsISupports
*,REFIID
,void**);
1091 nsIWritableVariant
*create_nsvariant(void);
1092 nsIXMLHttpRequest
*create_nsxhr(nsIDOMWindow
*nswindow
);
1093 nsresult
create_nsfile(const PRUnichar
*,nsIFile
**);
1094 char *get_nscategory_entry(const char*,const char*);
1096 HRESULT
create_pending_window(HTMLOuterWindow
*,nsChannelBSC
*);
1097 HRESULT
start_binding(HTMLInnerWindow
*,BSCallback
*,IBindCtx
*);
1098 HRESULT
async_start_doc_binding(HTMLOuterWindow
*,HTMLInnerWindow
*,DWORD
);
1099 void abort_window_bindings(HTMLInnerWindow
*);
1100 void set_download_state(HTMLDocumentObj
*,int);
1101 void call_docview_84(HTMLDocumentObj
*);
1102 HRESULT
reload_page(HTMLOuterWindow
*);
1104 void set_ready_state(HTMLOuterWindow
*,READYSTATE
);
1105 HRESULT
get_readystate_string(READYSTATE
,BSTR
*);
1107 HRESULT
HTMLSelectionObject_Create(HTMLDocumentNode
*,nsISelection
*,IHTMLSelectionObject
**);
1108 HRESULT
HTMLTxtRange_Create(HTMLDocumentNode
*,nsIDOMRange
*,IHTMLTxtRange
**);
1109 HRESULT
create_style_sheet(nsIDOMStyleSheet
*,compat_mode_t
,IHTMLStyleSheet
**);
1110 HRESULT
create_style_sheet_collection(nsIDOMStyleSheetList
*,compat_mode_t
,
1111 IHTMLStyleSheetsCollection
**);
1112 HRESULT
create_dom_range(nsIDOMRange
*,compat_mode_t
,IHTMLDOMRange
**);
1113 HRESULT
create_markup_pointer(IMarkupPointer
**);
1115 void detach_document_node(HTMLDocumentNode
*);
1116 void detach_selection(HTMLDocumentNode
*);
1117 void detach_ranges(HTMLDocumentNode
*);
1118 HRESULT
get_node_text(HTMLDOMNode
*,BSTR
*);
1119 HRESULT
replace_node_by_html(nsIDOMDocument
*,nsIDOMNode
*,const WCHAR
*);
1121 HRESULT
create_nselem(HTMLDocumentNode
*,const WCHAR
*,nsIDOMElement
**);
1122 HRESULT
create_element(HTMLDocumentNode
*,const WCHAR
*,HTMLElement
**);
1124 HRESULT
HTMLDOMTextNode_Create(HTMLDocumentNode
*,nsIDOMNode
*,HTMLDOMNode
**);
1126 BOOL
variant_to_nscolor(const VARIANT
*v
, nsAString
*nsstr
);
1127 HRESULT
nscolor_to_str(LPCWSTR color
, BSTR
*ret
);
1129 static inline BOOL
is_main_content_window(HTMLOuterWindow
*window
)
1131 return window
->browser
&& window
== window
->browser
->content_window
;
1134 struct HTMLAttributeCollection
{
1136 IHTMLAttributeCollection IHTMLAttributeCollection_iface
;
1137 IHTMLAttributeCollection2 IHTMLAttributeCollection2_iface
;
1138 IHTMLAttributeCollection3 IHTMLAttributeCollection3_iface
;
1148 IHTMLDOMAttribute IHTMLDOMAttribute_iface
;
1149 IHTMLDOMAttribute2 IHTMLDOMAttribute2_iface
;
1153 /* value is valid only for detached attributes (when elem == NULL). */
1155 /* name must be valid for detached attributes */
1163 HTMLDOMAttribute
*unsafe_impl_from_IHTMLDOMAttribute(IHTMLDOMAttribute
*);
1165 HRESULT
HTMLDOMAttribute_Create(const WCHAR
*,HTMLElement
*,DISPID
,compat_mode_t
,HTMLDOMAttribute
**);
1167 HRESULT
HTMLElement_Create(HTMLDocumentNode
*,nsIDOMNode
*,BOOL
,HTMLElement
**);
1168 HRESULT
HTMLCommentElement_Create(HTMLDocumentNode
*,nsIDOMNode
*,HTMLElement
**);
1169 HRESULT
HTMLAnchorElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**);
1170 HRESULT
HTMLAreaElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**);
1171 HRESULT
HTMLBodyElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**);
1172 HRESULT
HTMLButtonElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**);
1173 HRESULT
HTMLEmbedElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**);
1174 HRESULT
HTMLFormElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**);
1175 HRESULT
HTMLFrameElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**);
1176 HRESULT
HTMLHeadElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**);
1177 HRESULT
HTMLHtmlElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**);
1178 HRESULT
HTMLIFrame_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**);
1179 HRESULT
HTMLStyleElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**);
1180 HRESULT
HTMLImgElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**);
1181 HRESULT
HTMLInputElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**);
1182 HRESULT
HTMLLabelElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**);
1183 HRESULT
HTMLLinkElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**);
1184 HRESULT
HTMLMetaElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**);
1185 HRESULT
HTMLObjectElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**);
1186 HRESULT
HTMLOptionElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**);
1187 HRESULT
HTMLScriptElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**);
1188 HRESULT
HTMLSelectElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**);
1189 HRESULT
HTMLTable_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**);
1190 HRESULT
HTMLTableCell_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**);
1191 HRESULT
HTMLTableRow_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**);
1192 HRESULT
HTMLTextAreaElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**);
1193 HRESULT
HTMLTitleElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**);
1194 HRESULT
HTMLGenericElement_Create(HTMLDocumentNode
*,nsIDOMElement
*,HTMLElement
**);
1196 HRESULT
create_svg_element(HTMLDocumentNode
*,nsIDOMSVGElement
*,const WCHAR
*,HTMLElement
**);
1198 void HTMLDOMNode_Init(HTMLDocumentNode
*,HTMLDOMNode
*,nsIDOMNode
*,dispex_static_data_t
*);
1199 void HTMLElement_Init(HTMLElement
*,HTMLDocumentNode
*,nsIDOMElement
*,dispex_static_data_t
*);
1201 void EventTarget_Init(EventTarget
*,IUnknown
*,dispex_static_data_t
*,compat_mode_t
);
1202 HRESULT
EventTarget_QI(EventTarget
*,REFIID
,void**);
1203 void EventTarget_init_dispex_info(dispex_data_t
*,compat_mode_t
);
1205 HRESULT
HTMLDOMNode_QI(HTMLDOMNode
*,REFIID
,void**);
1206 void HTMLDOMNode_destructor(HTMLDOMNode
*);
1207 void HTMLDOMNode_init_dispex_info(dispex_data_t
*,compat_mode_t
);
1209 HRESULT
HTMLElement_QI(HTMLDOMNode
*,REFIID
,void**);
1210 void HTMLElement_destructor(HTMLDOMNode
*);
1211 HRESULT
HTMLElement_clone(HTMLDOMNode
*,nsIDOMNode
*,HTMLDOMNode
**);
1212 HRESULT
HTMLElement_get_attr_col(HTMLDOMNode
*,HTMLAttributeCollection
**);
1213 HRESULT
HTMLElement_handle_event(HTMLDOMNode
*,DWORD
,nsIDOMEvent
*,BOOL
*);
1214 void HTMLElement_init_dispex_info(dispex_data_t
*,compat_mode_t
);
1216 HRESULT
get_node(nsIDOMNode
*,BOOL
,HTMLDOMNode
**);
1217 HRESULT
get_element(nsIDOMElement
*,HTMLElement
**);
1218 HRESULT
get_document_node(nsIDOMDocument
*,HTMLDocumentNode
**);
1220 HTMLElement
*unsafe_impl_from_IHTMLElement(IHTMLElement
*);
1222 HRESULT
search_window_props(HTMLInnerWindow
*,BSTR
,DWORD
,DISPID
*);
1223 HRESULT
get_frame_by_name(HTMLOuterWindow
*,const WCHAR
*,BOOL
,HTMLOuterWindow
**);
1224 HRESULT
get_doc_elem_by_id(HTMLDocumentNode
*,const WCHAR
*,HTMLElement
**);
1225 HTMLOuterWindow
*get_target_window(HTMLOuterWindow
*,nsAString
*,BOOL
*);
1226 HRESULT
handle_link_click_event(HTMLElement
*,nsAString
*,nsAString
*,nsIDOMEvent
*,BOOL
*);
1228 HRESULT
wrap_iface(IUnknown
*,IUnknown
*,IUnknown
**);
1230 IHTMLElementCollection
*create_all_collection(HTMLDOMNode
*,BOOL
);
1231 IHTMLElementCollection
*create_collection_from_nodelist(nsIDOMNodeList
*,compat_mode_t
);
1232 IHTMLElementCollection
*create_collection_from_htmlcol(nsIDOMHTMLCollection
*,compat_mode_t
);
1233 HRESULT
create_child_collection(nsIDOMNodeList
*,compat_mode_t
,IHTMLDOMChildrenCollection
**);
1235 HRESULT
attr_value_to_string(VARIANT
*);
1236 HRESULT
get_elem_attr_value_by_dispid(HTMLElement
*,DISPID
,VARIANT
*);
1237 HRESULT
get_elem_source_index(HTMLElement
*,LONG
*);
1239 nsresult
get_elem_attr_value(nsIDOMElement
*,const WCHAR
*,nsAString
*,const PRUnichar
**);
1240 HRESULT
elem_string_attr_getter(HTMLElement
*,const WCHAR
*,BOOL
,BSTR
*);
1241 HRESULT
elem_string_attr_setter(HTMLElement
*,const WCHAR
*,const WCHAR
*);
1243 HRESULT
elem_unique_id(unsigned id
, BSTR
*p
);
1248 HRESULT (*query
)(HTMLDocumentNode
*,OLECMD
*);
1249 HRESULT (*exec
)(HTMLDocumentNode
*,DWORD
,VARIANT
*,VARIANT
*);
1252 extern const cmdtable_t editmode_cmds
[];
1254 void do_ns_command(HTMLDocumentNode
*,const char*,nsICommandParams
*);
1257 #define UPDATE_UI 0x0001
1258 #define UPDATE_TITLE 0x0002
1260 void update_doc(HTMLDocumentObj
*,DWORD
);
1261 void update_title(HTMLDocumentObj
*);
1262 void set_document_navigation(HTMLDocumentObj
*,BOOL
);
1264 HRESULT
do_query_service(IUnknown
*,REFGUID
,REFIID
,void**);
1267 HRESULT
setup_edit_mode(HTMLDocumentObj
*);
1268 void init_editor(HTMLDocumentNode
*);
1269 void handle_edit_event(HTMLDocumentNode
*,nsIDOMEvent
*);
1270 HRESULT
editor_exec_copy(HTMLDocumentNode
*,DWORD
,VARIANT
*,VARIANT
*);
1271 HRESULT
editor_exec_cut(HTMLDocumentNode
*,DWORD
,VARIANT
*,VARIANT
*);
1272 HRESULT
editor_exec_paste(HTMLDocumentNode
*,DWORD
,VARIANT
*,VARIANT
*);
1273 HRESULT
browser_is_dirty(GeckoBrowser
*);
1274 void set_dirty(GeckoBrowser
*,VARIANT_BOOL
);
1276 extern DWORD mshtml_tls
;
1278 typedef struct task_t task_t
;
1279 typedef void (*task_proc_t
)(task_t
*);
1288 typedef struct event_task_t event_task_t
;
1289 typedef void (*event_task_proc_t
)(event_task_t
*);
1291 struct event_task_t
{
1293 BOOL thread_blocked
;
1294 event_task_proc_t proc
;
1295 event_task_proc_t destr
;
1297 HTMLInnerWindow
*window
;
1302 HTMLDocumentObj
*doc
;
1307 struct list task_list
;
1308 struct list event_task_list
;
1309 struct list timer_list
;
1310 struct list
*pending_xhr_events_tail
;
1311 struct wine_rb_tree session_storage_map
;
1315 thread_data_t
*get_thread_data(BOOL
);
1316 HWND
get_thread_hwnd(void);
1317 void unblock_tasks_and_timers(thread_data_t
*);
1318 int session_storage_map_cmp(const void*,const struct wine_rb_entry
*);
1319 void destroy_session_storage(thread_data_t
*);
1321 LONG
get_task_target_magic(void);
1322 HRESULT
push_task(task_t
*,task_proc_t
,task_proc_t
,LONG
);
1323 HRESULT
push_event_task(event_task_t
*,HTMLInnerWindow
*,event_task_proc_t
,event_task_proc_t
,LONG
);
1324 void remove_target_tasks(LONG
);
1325 ULONGLONG
get_time_stamp(void);
1330 TIMER_ANIMATION_FRAME
,
1333 HRESULT
set_task_timer(HTMLInnerWindow
*,LONG
,enum timer_type
,IDispatch
*,LONG
*);
1334 HRESULT
clear_task_timer(HTMLInnerWindow
*,DWORD
);
1335 HRESULT
clear_animation_timer(HTMLInnerWindow
*,DWORD
);
1337 const WCHAR
*parse_compat_version(const WCHAR
*,compat_mode_t
*);
1339 const char *debugstr_mshtml_guid(const GUID
*);
1341 DEFINE_GUID(CLSID_AboutProtocol
, 0x3050F406, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
1342 DEFINE_GUID(CLSID_JSProtocol
, 0x3050F3B2, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
1343 DEFINE_GUID(CLSID_MailtoProtocol
, 0x3050F3DA, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
1344 DEFINE_GUID(CLSID_ResProtocol
, 0x3050F3BC, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
1345 DEFINE_GUID(CLSID_SysimageProtocol
, 0x76E67A63, 0x06E9, 0x11D2, 0xA8,0x40, 0x00,0x60,0x08,0x05,0x93,0x82);
1347 DEFINE_GUID(CLSID_CMarkup
,0x3050f4fb,0x98b5,0x11cf,0xbb,0x82,0x00,0xaa,0x00,0xbd,0xce,0x0b);
1349 DEFINE_OLEGUID(CGID_DocHostCmdPriv
, 0x000214D4L
, 0, 0);
1351 DEFINE_GUID(CLSID_JScript
, 0xf414c260,0x6ac0,0x11cf, 0xb6,0xd1,0x00,0xaa,0x00,0xbb,0xbb,0x58);
1352 DEFINE_GUID(CLSID_VBScript
, 0xb54f3741,0x5b07,0x11cf, 0xa4,0xb0,0x00,0xaa,0x00,0x4a,0x55,0xe8);
1354 DEFINE_GUID(IID_UndocumentedScriptIface
,0x719c3050,0xf9d3,0x11cf,0xa4,0x93,0x00,0x40,0x05,0x23,0xa8,0xa0);
1355 DEFINE_GUID(IID_IDispatchJS
,0x719c3050,0xf9d3,0x11cf,0xa4,0x93,0x00,0x40,0x05,0x23,0xa8,0xa6);
1357 /* memory allocation functions */
1359 static inline WCHAR
*strndupW(LPCWSTR str
, unsigned len
)
1364 ret
= malloc((len
+ 1) * sizeof(WCHAR
));
1367 memcpy(ret
, str
, len
*sizeof(WCHAR
));
1375 static inline WCHAR
*strdupAtoW(const char *str
)
1382 len
= MultiByteToWideChar(CP_ACP
, 0, str
, -1, NULL
, 0);
1383 ret
= malloc(len
* sizeof(WCHAR
));
1385 MultiByteToWideChar(CP_ACP
, 0, str
, -1, ret
, len
);
1391 static inline char *strdupWtoA(const WCHAR
*str
)
1396 DWORD size
= WideCharToMultiByte(CP_ACP
, 0, str
, -1, NULL
, 0, NULL
, NULL
);
1399 WideCharToMultiByte(CP_ACP
, 0, str
, -1, ret
, size
, NULL
, NULL
);
1405 static inline WCHAR
*strdupUtoW(const char *str
)
1412 len
= MultiByteToWideChar(CP_UTF8
, 0, str
, -1, NULL
, 0);
1413 ret
= malloc(len
* sizeof(WCHAR
));
1415 MultiByteToWideChar(CP_UTF8
, 0, str
, -1, ret
, len
);
1421 static inline char *strdupWtoU(const WCHAR
*str
)
1426 size_t size
= WideCharToMultiByte(CP_UTF8
, 0, str
, -1, NULL
, 0, NULL
, NULL
);
1429 WideCharToMultiByte(CP_UTF8
, 0, str
, -1, ret
, size
, NULL
, NULL
);
1435 static inline char *strndupWtoU(const WCHAR
*str
, unsigned len
)
1441 size
= len
? WideCharToMultiByte(CP_UTF8
, 0, str
, len
, NULL
, 0, NULL
, NULL
) : 0;
1442 ret
= malloc(size
+ 1);
1444 if(len
) WideCharToMultiByte(CP_UTF8
, 0, str
, len
, ret
, size
, NULL
, NULL
);
1452 static inline VARIANT_BOOL
variant_bool(BOOL b
)
1454 return b
? VARIANT_TRUE
: VARIANT_FALSE
;
1457 static inline BOOL
is_digit(WCHAR c
)
1459 return '0' <= c
&& c
<= '9';
1462 static inline BOOL
is_power_of_2(unsigned x
)
1464 return !(x
& (x
- 1));
1468 extern void *call_thiscall_func
;
1471 compat_mode_t
get_max_compat_mode(IUri
*);
1472 UINT
cp_from_charset_string(BSTR
);
1473 BSTR
charset_string_from_cp(UINT
);
1474 HRESULT
get_mime_type_display_name(const WCHAR
*,BSTR
*);
1475 HINSTANCE
get_shdoclc(void);
1476 void set_statustext(HTMLDocumentObj
*,INT
,LPCWSTR
);
1477 IInternetSecurityManager
*get_security_manager(void);
1479 extern HINSTANCE hInst
;
1480 void create_console(compat_mode_t compat_mode
, IWineMSHTMLConsole
**ret
);
1481 HRESULT
create_media_query_list(HTMLWindow
*window
, BSTR media_query
, IDispatch
**ret
);