ReactOS 0.4.16-dev-91-g764881a
htmlanchor.c
Go to the documentation of this file.
1/*
2 * Copyright 2007 Jacek Caban for CodeWeavers
3 *
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.
8 *
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.
13 *
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
17 */
18
19#include "mshtml_private.h"
20
21typedef struct {
23
24 IHTMLAnchorElement IHTMLAnchorElement_iface;
25
28
30{
31 const PRUnichar *href;
32 IUri *uri;
34
35 nsAString_GetData(href_str, &href);
36 hres = create_relative_uri(element->node.doc->basedoc.window, href, &uri);
37 if(FAILED(hres))
38 return hres;
39
40 hres = navigate_new_window(element->node.doc->basedoc.window, uri, target, NULL, NULL);
41 IUri_Release(uri);
42 return hres;
43}
44
46{
47 HTMLOuterWindow *top_window, *ret_window;
48 const PRUnichar *target;
50
51 static const WCHAR _parentW[] = {'_','p','a','r','e','n','t',0};
52 static const WCHAR _selfW[] = {'_','s','e','l','f',0};
53 static const WCHAR _topW[] = {'_','t','o','p',0};
54
55 *use_new_window = FALSE;
56
57 nsAString_GetData(target_str, &target);
58 TRACE("%s\n", debugstr_w(target));
59
60 if(!*target || !strcmpiW(target, _selfW)) {
61 IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface);
62 return window;
63 }
64
65 if(!strcmpiW(target, _topW)) {
66 get_top_window(window, &top_window);
67 IHTMLWindow2_AddRef(&top_window->base.IHTMLWindow2_iface);
68 return top_window;
69 }
70
71 if(!strcmpiW(target, _parentW)) {
72 if(!window->parent) {
73 WARN("Window has no parent, treat as self\n");
74 IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface);
75 return window;
76 }
77
78 IHTMLWindow2_AddRef(&window->parent->base.IHTMLWindow2_iface);
79 return window->parent;
80 }
81
82 get_top_window(window, &top_window);
83
84 hres = get_frame_by_name(top_window, target, TRUE, &ret_window);
85 if(FAILED(hres) || !ret_window) {
86 *use_new_window = TRUE;
87 return NULL;
88 }
89
90 IHTMLWindow2_AddRef(&ret_window->base.IHTMLWindow2_iface);
91 return ret_window;
92}
93
95{
97 BOOL use_new_window;
98 const PRUnichar *href;
100
101 window = get_target_window(element->node.doc->basedoc.window, target_str, &use_new_window);
102 if(!window) {
103 if(use_new_window) {
104 const PRUnichar *target;
105 nsAString_GetData(target_str, &target);
106 return navigate_href_new_window(element, href_str, target);
107 }else {
108 return S_OK;
109 }
110 }
111
112 nsAString_GetData(href_str, &href);
113 if(*href) {
114 hres = navigate_url(window, href, window->uri_nofrag, BINDING_NAVIGATED);
115 }else {
116 TRACE("empty href\n");
117 hres = S_OK;
118 }
119 IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface);
120 return hres;
121}
122
124 nsIDOMEvent *event, BOOL *prevent_default)
125{
128 nsresult nsres;
130
131 TRACE("CLICK\n");
132
133 nsres = nsIDOMEvent_QueryInterface(event, &IID_nsIDOMMouseEvent, (void**)&mouse_event);
134 assert(nsres == NS_OK);
135
136 nsres = nsIDOMMouseEvent_GetButton(mouse_event, &button);
137 assert(nsres == NS_OK);
138
139 nsIDOMMouseEvent_Release(mouse_event);
140
141 switch(button) {
142 case 0:
143 *prevent_default = TRUE;
144 hres = navigate_href(element, href_str, target_str);
145 break;
146 case 1:
147 *prevent_default = TRUE;
149 break;
150 default:
151 *prevent_default = FALSE;
152 hres = S_OK;
153 }
154
155 nsAString_Finish(href_str);
156 nsAString_Finish(target_str);
157 return hres;
158}
159
160static inline HTMLAnchorElement *impl_from_IHTMLAnchorElement(IHTMLAnchorElement *iface)
161{
162 return CONTAINING_RECORD(iface, HTMLAnchorElement, IHTMLAnchorElement_iface);
163}
164
165static HRESULT WINAPI HTMLAnchorElement_QueryInterface(IHTMLAnchorElement *iface,
166 REFIID riid, void **ppv)
167{
169
170 return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
171}
172
173static ULONG WINAPI HTMLAnchorElement_AddRef(IHTMLAnchorElement *iface)
174{
176
177 return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
178}
179
180static ULONG WINAPI HTMLAnchorElement_Release(IHTMLAnchorElement *iface)
181{
183
184 return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
185}
186
187static HRESULT WINAPI HTMLAnchorElement_GetTypeInfoCount(IHTMLAnchorElement *iface, UINT *pctinfo)
188{
190 return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
191}
192
193static HRESULT WINAPI HTMLAnchorElement_GetTypeInfo(IHTMLAnchorElement *iface, UINT iTInfo,
194 LCID lcid, ITypeInfo **ppTInfo)
195{
197 return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
198 ppTInfo);
199}
200
201static HRESULT WINAPI HTMLAnchorElement_GetIDsOfNames(IHTMLAnchorElement *iface, REFIID riid,
202 LPOLESTR *rgszNames, UINT cNames,
203 LCID lcid, DISPID *rgDispId)
204{
206 return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
207 cNames, lcid, rgDispId);
208}
209
210static HRESULT WINAPI HTMLAnchorElement_Invoke(IHTMLAnchorElement *iface, DISPID dispIdMember,
211 REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
212 VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
213{
215 return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
216 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
217}
218
219static HRESULT WINAPI HTMLAnchorElement_put_href(IHTMLAnchorElement *iface, BSTR v)
220{
222 nsAString nsstr;
223 nsresult nsres;
224
225 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
226
227 nsAString_InitDepend(&nsstr, v);
228 nsres = nsIDOMHTMLAnchorElement_SetHref(This->nsanchor, &nsstr);
229 nsAString_Finish(&nsstr);
230 if(NS_FAILED(nsres))
231 return E_FAIL;
232
233 return S_OK;
234}
235
236static HRESULT WINAPI HTMLAnchorElement_get_href(IHTMLAnchorElement *iface, BSTR *p)
237{
239 nsAString href_str;
240 nsresult nsres;
242
243 TRACE("(%p)->(%p)\n", This, p);
244
245 nsAString_Init(&href_str, NULL);
246 nsres = nsIDOMHTMLAnchorElement_GetHref(This->nsanchor, &href_str);
247 if(NS_SUCCEEDED(nsres)) {
248 const PRUnichar *href;
249
250 nsAString_GetData(&href_str, &href);
251 hres = nsuri_to_url(href, TRUE, p);
252 }else {
253 ERR("GetHref failed: %08x\n", nsres);
254 hres = E_FAIL;
255 }
256
257 nsAString_Finish(&href_str);
258 return hres;
259}
260
261static HRESULT WINAPI HTMLAnchorElement_put_target(IHTMLAnchorElement *iface, BSTR v)
262{
264 nsAString nsstr;
265 nsresult nsres;
266
267 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
268
269 nsAString_InitDepend(&nsstr, v);
270 nsres = nsIDOMHTMLAnchorElement_SetTarget(This->nsanchor, &nsstr);
271 nsAString_Finish(&nsstr);
272 if(NS_FAILED(nsres))
273 return E_FAIL;
274
275 return S_OK;
276}
277
278static HRESULT WINAPI HTMLAnchorElement_get_target(IHTMLAnchorElement *iface, BSTR *p)
279{
281 nsAString target_str;
282 nsresult nsres;
283
284 TRACE("(%p)->(%p)\n", This, p);
285
286 nsAString_Init(&target_str, NULL);
287 nsres = nsIDOMHTMLAnchorElement_GetTarget(This->nsanchor, &target_str);
288
289 return return_nsstr(nsres, &target_str, p);
290}
291
292static HRESULT WINAPI HTMLAnchorElement_put_rel(IHTMLAnchorElement *iface, BSTR v)
293{
295 nsAString nsstr;
296 nsresult nsres;
297
298 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
299
300 nsAString_InitDepend(&nsstr, v);
301 nsres = nsIDOMHTMLAnchorElement_SetRel(This->nsanchor, &nsstr);
302 nsAString_Finish(&nsstr);
303 if(NS_FAILED(nsres))
304 return E_FAIL;
305
306 return S_OK;
307}
308
309static HRESULT WINAPI HTMLAnchorElement_get_rel(IHTMLAnchorElement *iface, BSTR *p)
310{
312 nsAString nsstr;
313 nsresult nsres;
314
315 TRACE("(%p)->(%p)\n", This, p);
316
317 nsAString_Init(&nsstr, NULL);
318 nsres = nsIDOMHTMLAnchorElement_GetRel(This->nsanchor, &nsstr);
319 return return_nsstr(nsres, &nsstr, p);
320}
321
322static HRESULT WINAPI HTMLAnchorElement_put_rev(IHTMLAnchorElement *iface, BSTR v)
323{
325 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
326 return E_NOTIMPL;
327}
328
329static HRESULT WINAPI HTMLAnchorElement_get_rev(IHTMLAnchorElement *iface, BSTR *p)
330{
332 FIXME("(%p)->(%p)\n", This, p);
333 return E_NOTIMPL;
334}
335
336static HRESULT WINAPI HTMLAnchorElement_put_urn(IHTMLAnchorElement *iface, BSTR v)
337{
339 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
340 return E_NOTIMPL;
341}
342
343static HRESULT WINAPI HTMLAnchorElement_get_urn(IHTMLAnchorElement *iface, BSTR *p)
344{
346 FIXME("(%p)->(%p)\n", This, p);
347 return E_NOTIMPL;
348}
349
350static HRESULT WINAPI HTMLAnchorElement_put_Methods(IHTMLAnchorElement *iface, BSTR v)
351{
353 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
354 return E_NOTIMPL;
355}
356
357static HRESULT WINAPI HTMLAnchorElement_get_Methods(IHTMLAnchorElement *iface, BSTR *p)
358{
360 FIXME("(%p)->(%p)\n", This, p);
361 return E_NOTIMPL;
362}
363
364static HRESULT WINAPI HTMLAnchorElement_put_name(IHTMLAnchorElement *iface, BSTR v)
365{
367 nsAString nsstr;
368 nsresult nsres;
369
370 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
371
372 nsAString_InitDepend(&nsstr, v);
373 nsres = nsIDOMHTMLAnchorElement_SetName(This->nsanchor, &nsstr);
374 nsAString_Finish(&nsstr);
375 if(NS_FAILED(nsres))
376 return E_FAIL;
377
378 return S_OK;
379}
380
381static HRESULT WINAPI HTMLAnchorElement_get_name(IHTMLAnchorElement *iface, BSTR *p)
382{
384 nsAString name_str;
385 nsresult nsres;
386
387 TRACE("(%p)->(%p)\n", This, p);
388
389 nsAString_Init(&name_str, NULL);
390 nsres = nsIDOMHTMLAnchorElement_GetName(This->nsanchor, &name_str);
391
392 return return_nsstr(nsres, &name_str, p);
393}
394
395static HRESULT WINAPI HTMLAnchorElement_put_host(IHTMLAnchorElement *iface, BSTR v)
396{
398 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
399 return E_NOTIMPL;
400}
401
402static HRESULT WINAPI HTMLAnchorElement_get_host(IHTMLAnchorElement *iface, BSTR *p)
403{
405 FIXME("(%p)->(%p)\n", This, p);
406 return E_NOTIMPL;
407}
408
409static HRESULT WINAPI HTMLAnchorElement_put_hostname(IHTMLAnchorElement *iface, BSTR v)
410{
412 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
413 return E_NOTIMPL;
414}
415
416static HRESULT WINAPI HTMLAnchorElement_get_hostname(IHTMLAnchorElement *iface, BSTR *p)
417{
419 nsAString hostname_str;
420 nsresult nsres;
421
422 TRACE("(%p)->(%p)\n", This, p);
423
424 nsAString_Init(&hostname_str, NULL);
425 nsres = nsIDOMHTMLAnchorElement_GetHostname(This->nsanchor, &hostname_str);
426 return return_nsstr(nsres, &hostname_str, p);
427}
428
429static HRESULT WINAPI HTMLAnchorElement_put_pathname(IHTMLAnchorElement *iface, BSTR v)
430{
432 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
433 return E_NOTIMPL;
434}
435
436static HRESULT WINAPI HTMLAnchorElement_get_pathname(IHTMLAnchorElement *iface, BSTR *p)
437{
439 FIXME("(%p)->(%p)\n", This, p);
440 return E_NOTIMPL;
441}
442
443static HRESULT WINAPI HTMLAnchorElement_put_port(IHTMLAnchorElement *iface, BSTR v)
444{
446 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
447 return E_NOTIMPL;
448}
449
450static HRESULT WINAPI HTMLAnchorElement_get_port(IHTMLAnchorElement *iface, BSTR *p)
451{
453 FIXME("(%p)->(%p)\n", This, p);
454 return E_NOTIMPL;
455}
456
457static HRESULT WINAPI HTMLAnchorElement_put_protocol(IHTMLAnchorElement *iface, BSTR v)
458{
460 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
461 return E_NOTIMPL;
462}
463
464static HRESULT WINAPI HTMLAnchorElement_get_protocol(IHTMLAnchorElement *iface, BSTR *p)
465{
467 FIXME("(%p)->(%p)\n", This, p);
468 return E_NOTIMPL;
469}
470
471static HRESULT WINAPI HTMLAnchorElement_put_search(IHTMLAnchorElement *iface, BSTR v)
472{
474 nsAString nsstr;
475 nsresult nsres;
476
477 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
478
479 nsAString_InitDepend(&nsstr, v);
480 nsres = nsIDOMHTMLAnchorElement_SetSearch(This->nsanchor, &nsstr);
481 nsAString_Finish(&nsstr);
482 if(NS_FAILED(nsres))
483 return E_FAIL;
484
485 return S_OK;
486}
487
488static HRESULT WINAPI HTMLAnchorElement_get_search(IHTMLAnchorElement *iface, BSTR *p)
489{
491 nsAString search_str;
492 nsresult nsres;
493
494 TRACE("(%p)->(%p)\n", This, p);
495
496 nsAString_Init(&search_str, NULL);
497 nsres = nsIDOMHTMLAnchorElement_GetSearch(This->nsanchor, &search_str);
498 return return_nsstr(nsres, &search_str, p);
499}
500
501static HRESULT WINAPI HTMLAnchorElement_put_hash(IHTMLAnchorElement *iface, BSTR v)
502{
504 FIXME("(%p)->(%s)\n", This, debugstr_w(v));
505 return E_NOTIMPL;
506}
507
508static HRESULT WINAPI HTMLAnchorElement_get_hash(IHTMLAnchorElement *iface, BSTR *p)
509{
511 nsAString hash_str;
512 nsresult nsres;
513
514 TRACE("(%p)->(%p)\n", This, p);
515
516 nsAString_Init(&hash_str, NULL);
517 nsres = nsIDOMHTMLAnchorElement_GetHash(This->nsanchor, &hash_str);
518 return return_nsstr(nsres, &hash_str, p);
519}
520
521static HRESULT WINAPI HTMLAnchorElement_put_onblur(IHTMLAnchorElement *iface, VARIANT v)
522{
524
525 TRACE("(%p)->()\n", This);
526
527 return IHTMLElement2_put_onblur(&This->element.IHTMLElement2_iface, v);
528}
529
530static HRESULT WINAPI HTMLAnchorElement_get_onblur(IHTMLAnchorElement *iface, VARIANT *p)
531{
533
534 TRACE("(%p)->(%p)\n", This, p);
535
536 return IHTMLElement2_get_onblur(&This->element.IHTMLElement2_iface, p);
537}
538
539static HRESULT WINAPI HTMLAnchorElement_put_onfocus(IHTMLAnchorElement *iface, VARIANT v)
540{
542
543 TRACE("(%p)->()\n", This);
544
545 return IHTMLElement2_put_onfocus(&This->element.IHTMLElement2_iface, v);
546}
547
548static HRESULT WINAPI HTMLAnchorElement_get_onfocus(IHTMLAnchorElement *iface, VARIANT *p)
549{
551
552 TRACE("(%p)->(%p)\n", This, p);
553
554 return IHTMLElement2_get_onfocus(&This->element.IHTMLElement2_iface, p);
555}
556
557static HRESULT WINAPI HTMLAnchorElement_put_accessKey(IHTMLAnchorElement *iface, BSTR v)
558{
560
561 TRACE("(%p)->(%s)\n", This, debugstr_w(v));
562
563 return IHTMLElement2_put_accessKey(&This->element.IHTMLElement2_iface, v);
564}
565
566static HRESULT WINAPI HTMLAnchorElement_get_accessKey(IHTMLAnchorElement *iface, BSTR *p)
567{
569
570 TRACE("(%p)->(%p)\n", This, p);
571
572 return IHTMLElement2_get_accessKey(&This->element.IHTMLElement2_iface, p);
573}
574
575static HRESULT WINAPI HTMLAnchorElement_get_protocolLong(IHTMLAnchorElement *iface, BSTR *p)
576{
578 FIXME("(%p)->(%p)\n", This, p);
579 return E_NOTIMPL;
580}
581
582static HRESULT WINAPI HTMLAnchorElement_get_mimeType(IHTMLAnchorElement *iface, BSTR *p)
583{
585 FIXME("(%p)->(%p)\n", This, p);
586 return E_NOTIMPL;
587}
588
589static HRESULT WINAPI HTMLAnchorElement_get_nameProp(IHTMLAnchorElement *iface, BSTR *p)
590{
592 FIXME("(%p)->(%p)\n", This, p);
593 return E_NOTIMPL;
594}
595
596static HRESULT WINAPI HTMLAnchorElement_put_tabIndex(IHTMLAnchorElement *iface, short v)
597{
599
600 TRACE("(%p)->()\n", This);
601
602 return IHTMLElement2_put_tabIndex(&This->element.IHTMLElement2_iface, v);
603}
604
605static HRESULT WINAPI HTMLAnchorElement_get_tabIndex(IHTMLAnchorElement *iface, short *p)
606{
608
609 TRACE("(%p)->(%p)\n", This, p);
610
611 return IHTMLElement2_get_tabIndex(&This->element.IHTMLElement2_iface, p);
612}
613
614static HRESULT WINAPI HTMLAnchorElement_focus(IHTMLAnchorElement *iface)
615{
617
618 TRACE("(%p)\n", This);
619
620 return IHTMLElement2_focus(&This->element.IHTMLElement2_iface);
621}
622
623static HRESULT WINAPI HTMLAnchorElement_blur(IHTMLAnchorElement *iface)
624{
626
627 TRACE("(%p)\n", This);
628
629 return IHTMLElement2_blur(&This->element.IHTMLElement2_iface);
630}
631
632static const IHTMLAnchorElementVtbl HTMLAnchorElementVtbl = {
681};
682
684{
685 return CONTAINING_RECORD(iface, HTMLAnchorElement, element.node);
686}
687
689{
691
692 *ppv = NULL;
693
695 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
696 *ppv = &This->IHTMLAnchorElement_iface;
697 }else if(IsEqualGUID(&IID_IDispatch, riid)) {
698 TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
699 *ppv = &This->IHTMLAnchorElement_iface;
700 }else if(IsEqualGUID(&IID_IHTMLAnchorElement, riid)) {
701 TRACE("(%p)->(IID_IHTMLAnchorElement %p)\n", This, ppv);
702 *ppv = &This->IHTMLAnchorElement_iface;
703 }
704
705 if(*ppv) {
706 IUnknown_AddRef((IUnknown*)*ppv);
707 return S_OK;
708 }
709
710 return HTMLElement_QI(&This->element.node, riid, ppv);
711}
712
714{
716 nsAString href_str, target_str;
717 nsresult nsres;
718
719 if(eid == EVENTID_CLICK) {
720 nsAString_Init(&href_str, NULL);
721 nsres = nsIDOMHTMLAnchorElement_GetHref(This->nsanchor, &href_str);
722 if (NS_FAILED(nsres)) {
723 ERR("Could not get anchor href: %08x\n", nsres);
724 goto fallback;
725 }
726
727 nsAString_Init(&target_str, NULL);
728 nsres = nsIDOMHTMLAnchorElement_GetTarget(This->nsanchor, &target_str);
729 if (NS_FAILED(nsres)) {
730 ERR("Could not get anchor target: %08x\n", nsres);
731 goto fallback;
732 }
733
734 return handle_link_click_event(&This->element, &href_str, &target_str, event, prevent_default);
735
736fallback:
737 nsAString_Finish(&href_str);
738 nsAString_Finish(&target_str);
739 }
740
741 return HTMLElement_handle_event(&This->element.node, eid, event, prevent_default);
742}
743
745{
747
748 if(This->nsanchor)
749 note_cc_edge((nsISupports*)This->nsanchor, "This->nsanchor", cb);
750}
751
753{
755
756 if(This->nsanchor) {
757 nsIDOMHTMLAnchorElement *nsanchor = This->nsanchor;
758
759 This->nsanchor = NULL;
760 nsIDOMHTMLAnchorElement_Release(nsanchor);
761 }
762}
763
771 NULL,
772 NULL,
773 NULL,
774 NULL,
775 NULL,
776 NULL,
777 NULL,
778 NULL,
779 NULL,
782};
783
785 IHTMLAnchorElement_tid,
787 IHTMLUniqueName_tid,
788 0
789};
790
792 NULL,
793 DispHTMLAnchorElement_tid,
794 NULL,
796};
797
799{
801 nsresult nsres;
802
803 ret = heap_alloc_zero(sizeof(HTMLAnchorElement));
804 if(!ret)
805 return E_OUTOFMEMORY;
806
807 ret->IHTMLAnchorElement_iface.lpVtbl = &HTMLAnchorElementVtbl;
808 ret->element.node.vtbl = &HTMLAnchorElementImplVtbl;
809
810 HTMLElement_Init(&ret->element, doc, nselem, &HTMLAnchorElement_dispex);
811
812 nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLAnchorElement, (void**)&ret->nsanchor);
813 assert(nsres == NS_OK);
814
815 *elem = &ret->element;
816 return S_OK;
817}
signed short INT16
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
const GUID IID_IUnknown
#define BINDING_NAVIGATED
Definition: binding.h:127
HRESULT create_relative_uri(HTMLOuterWindow *, const WCHAR *, IUri **) DECLSPEC_HIDDEN
Definition: persist.c:163
HRESULT navigate_new_window(HTMLOuterWindow *, IUri *, const WCHAR *, request_data_t *, IHTMLWindow2 **) DECLSPEC_HIDDEN
Definition: navigate.c:2132
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
OLECHAR * BSTR
Definition: compat.h:2293
static HRESULT navigate_url(HHInfo *info, LPCWSTR surl)
Definition: help.c:193
#define assert(x)
Definition: debug.h:53
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
const GLdouble * v
Definition: gl.h:2040
struct _cl_event * event
Definition: glext.h:7739
GLfloat GLfloat p
Definition: glext.h:8902
GLenum target
Definition: glext.h:7315
static const tid_t HTMLAnchorElement_iface_tids[]
Definition: htmlanchor.c:784
static HRESULT WINAPI HTMLAnchorElement_get_tabIndex(IHTMLAnchorElement *iface, short *p)
Definition: htmlanchor.c:605
static HRESULT HTMLAnchorElement_handle_event(HTMLDOMNode *iface, DWORD eid, nsIDOMEvent *event, BOOL *prevent_default)
Definition: htmlanchor.c:713
static HRESULT WINAPI HTMLAnchorElement_get_port(IHTMLAnchorElement *iface, BSTR *p)
Definition: htmlanchor.c:450
static HRESULT WINAPI HTMLAnchorElement_Invoke(IHTMLAnchorElement *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: htmlanchor.c:210
static HRESULT WINAPI HTMLAnchorElement_get_onfocus(IHTMLAnchorElement *iface, VARIANT *p)
Definition: htmlanchor.c:548
static HRESULT WINAPI HTMLAnchorElement_GetTypeInfo(IHTMLAnchorElement *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: htmlanchor.c:193
static const IHTMLAnchorElementVtbl HTMLAnchorElementVtbl
Definition: htmlanchor.c:632
HRESULT handle_link_click_event(HTMLElement *element, nsAString *href_str, nsAString *target_str, nsIDOMEvent *event, BOOL *prevent_default)
Definition: htmlanchor.c:123
static HTMLAnchorElement * impl_from_IHTMLAnchorElement(IHTMLAnchorElement *iface)
Definition: htmlanchor.c:160
static HTMLAnchorElement * impl_from_HTMLDOMNode(HTMLDOMNode *iface)
Definition: htmlanchor.c:683
static HRESULT WINAPI HTMLAnchorElement_put_hash(IHTMLAnchorElement *iface, BSTR v)
Definition: htmlanchor.c:501
static HRESULT WINAPI HTMLAnchorElement_put_port(IHTMLAnchorElement *iface, BSTR v)
Definition: htmlanchor.c:443
static HRESULT WINAPI HTMLAnchorElement_put_name(IHTMLAnchorElement *iface, BSTR v)
Definition: htmlanchor.c:364
static HRESULT WINAPI HTMLAnchorElement_get_protocolLong(IHTMLAnchorElement *iface, BSTR *p)
Definition: htmlanchor.c:575
static HRESULT WINAPI HTMLAnchorElement_put_pathname(IHTMLAnchorElement *iface, BSTR v)
Definition: htmlanchor.c:429
static HRESULT WINAPI HTMLAnchorElement_get_accessKey(IHTMLAnchorElement *iface, BSTR *p)
Definition: htmlanchor.c:566
static dispex_static_data_t HTMLAnchorElement_dispex
Definition: htmlanchor.c:791
static void HTMLAnchorElement_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
Definition: htmlanchor.c:744
static HRESULT WINAPI HTMLAnchorElement_get_href(IHTMLAnchorElement *iface, BSTR *p)
Definition: htmlanchor.c:236
static HRESULT navigate_href(HTMLElement *element, nsAString *href_str, nsAString *target_str)
Definition: htmlanchor.c:94
static HRESULT WINAPI HTMLAnchorElement_put_rel(IHTMLAnchorElement *iface, BSTR v)
Definition: htmlanchor.c:292
static HRESULT WINAPI HTMLAnchorElement_get_onblur(IHTMLAnchorElement *iface, VARIANT *p)
Definition: htmlanchor.c:530
static HRESULT WINAPI HTMLAnchorElement_put_search(IHTMLAnchorElement *iface, BSTR v)
Definition: htmlanchor.c:471
static HRESULT navigate_href_new_window(HTMLElement *element, nsAString *href_str, const WCHAR *target)
Definition: htmlanchor.c:29
static HRESULT WINAPI HTMLAnchorElement_put_tabIndex(IHTMLAnchorElement *iface, short v)
Definition: htmlanchor.c:596
static HRESULT WINAPI HTMLAnchorElement_get_search(IHTMLAnchorElement *iface, BSTR *p)
Definition: htmlanchor.c:488
static HRESULT WINAPI HTMLAnchorElement_get_name(IHTMLAnchorElement *iface, BSTR *p)
Definition: htmlanchor.c:381
static HRESULT WINAPI HTMLAnchorElement_put_href(IHTMLAnchorElement *iface, BSTR v)
Definition: htmlanchor.c:219
static HRESULT WINAPI HTMLAnchorElement_GetIDsOfNames(IHTMLAnchorElement *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: htmlanchor.c:201
static HRESULT WINAPI HTMLAnchorElement_get_mimeType(IHTMLAnchorElement *iface, BSTR *p)
Definition: htmlanchor.c:582
static HRESULT WINAPI HTMLAnchorElement_get_pathname(IHTMLAnchorElement *iface, BSTR *p)
Definition: htmlanchor.c:436
static HRESULT WINAPI HTMLAnchorElement_get_host(IHTMLAnchorElement *iface, BSTR *p)
Definition: htmlanchor.c:402
static HRESULT WINAPI HTMLAnchorElement_put_onfocus(IHTMLAnchorElement *iface, VARIANT v)
Definition: htmlanchor.c:539
static HRESULT WINAPI HTMLAnchorElement_get_rel(IHTMLAnchorElement *iface, BSTR *p)
Definition: htmlanchor.c:309
static HRESULT WINAPI HTMLAnchorElement_GetTypeInfoCount(IHTMLAnchorElement *iface, UINT *pctinfo)
Definition: htmlanchor.c:187
HRESULT HTMLAnchorElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
Definition: htmlanchor.c:798
static HRESULT WINAPI HTMLAnchorElement_get_hostname(IHTMLAnchorElement *iface, BSTR *p)
Definition: htmlanchor.c:416
static HRESULT WINAPI HTMLAnchorElement_get_rev(IHTMLAnchorElement *iface, BSTR *p)
Definition: htmlanchor.c:329
static HRESULT WINAPI HTMLAnchorElement_blur(IHTMLAnchorElement *iface)
Definition: htmlanchor.c:623
static HRESULT WINAPI HTMLAnchorElement_put_target(IHTMLAnchorElement *iface, BSTR v)
Definition: htmlanchor.c:261
static ULONG WINAPI HTMLAnchorElement_AddRef(IHTMLAnchorElement *iface)
Definition: htmlanchor.c:173
static HRESULT WINAPI HTMLAnchorElement_get_hash(IHTMLAnchorElement *iface, BSTR *p)
Definition: htmlanchor.c:508
HTMLOuterWindow * get_target_window(HTMLOuterWindow *window, nsAString *target_str, BOOL *use_new_window)
Definition: htmlanchor.c:45
static HRESULT WINAPI HTMLAnchorElement_put_Methods(IHTMLAnchorElement *iface, BSTR v)
Definition: htmlanchor.c:350
static void HTMLAnchorElement_unlink(HTMLDOMNode *iface)
Definition: htmlanchor.c:752
static HRESULT WINAPI HTMLAnchorElement_get_target(IHTMLAnchorElement *iface, BSTR *p)
Definition: htmlanchor.c:278
static HRESULT WINAPI HTMLAnchorElement_get_Methods(IHTMLAnchorElement *iface, BSTR *p)
Definition: htmlanchor.c:357
static HRESULT WINAPI HTMLAnchorElement_QueryInterface(IHTMLAnchorElement *iface, REFIID riid, void **ppv)
Definition: htmlanchor.c:165
static HRESULT WINAPI HTMLAnchorElement_put_onblur(IHTMLAnchorElement *iface, VARIANT v)
Definition: htmlanchor.c:521
static HRESULT WINAPI HTMLAnchorElement_get_nameProp(IHTMLAnchorElement *iface, BSTR *p)
Definition: htmlanchor.c:589
static HRESULT WINAPI HTMLAnchorElement_put_host(IHTMLAnchorElement *iface, BSTR v)
Definition: htmlanchor.c:395
static HRESULT WINAPI HTMLAnchorElement_get_urn(IHTMLAnchorElement *iface, BSTR *p)
Definition: htmlanchor.c:343
static HRESULT WINAPI HTMLAnchorElement_get_protocol(IHTMLAnchorElement *iface, BSTR *p)
Definition: htmlanchor.c:464
static HRESULT WINAPI HTMLAnchorElement_focus(IHTMLAnchorElement *iface)
Definition: htmlanchor.c:614
static HRESULT WINAPI HTMLAnchorElement_put_hostname(IHTMLAnchorElement *iface, BSTR v)
Definition: htmlanchor.c:409
static HRESULT HTMLAnchorElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
Definition: htmlanchor.c:688
static HRESULT WINAPI HTMLAnchorElement_put_accessKey(IHTMLAnchorElement *iface, BSTR v)
Definition: htmlanchor.c:557
static HRESULT WINAPI HTMLAnchorElement_put_urn(IHTMLAnchorElement *iface, BSTR v)
Definition: htmlanchor.c:336
static const NodeImplVtbl HTMLAnchorElementImplVtbl
Definition: htmlanchor.c:764
static ULONG WINAPI HTMLAnchorElement_Release(IHTMLAnchorElement *iface)
Definition: htmlanchor.c:180
static HRESULT WINAPI HTMLAnchorElement_put_rev(IHTMLAnchorElement *iface, BSTR v)
Definition: htmlanchor.c:322
static HRESULT WINAPI HTMLAnchorElement_put_protocol(IHTMLAnchorElement *iface, BSTR v)
Definition: htmlanchor.c:457
HRESULT HTMLElement_clone(HTMLDOMNode *iface, nsIDOMNode *nsnode, HTMLDOMNode **ret)
Definition: htmlelem.c:3793
void HTMLElement_destructor(HTMLDOMNode *iface)
Definition: htmlelem.c:3764
HRESULT HTMLElement_handle_event(HTMLDOMNode *iface, DWORD eid, nsIDOMEvent *event, BOOL *prevent_default)
Definition: htmlelem.c:3815
const cpc_entry_t HTMLElement_cpc[]
Definition: htmlelem.c:3847
void HTMLElement_Init(HTMLElement *This, HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, dispex_static_data_t *dispex_data)
Definition: htmlelem.c:4008
HRESULT HTMLElement_get_attr_col(HTMLDOMNode *iface, HTMLAttributeCollection **ac)
Definition: htmlelem.c:4827
HRESULT HTMLElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
Definition: htmlelem.c:3738
@ EVENTID_CLICK
Definition: htmlevent.h:26
HRESULT get_frame_by_name(HTMLOuterWindow *This, const WCHAR *name, BOOL deep, HTMLOuterWindow **ret)
Definition: htmlwindow.c:343
void get_top_window(HTMLOuterWindow *window, HTMLOuterWindow **ret)
Definition: htmlwindow.c:59
tid_t
Definition: ieframe.h:311
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_w
Definition: kernel32.h:32
DWORD button
Definition: button.c:166
HRESULT hres
Definition: protocol.c:465
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
static IHTMLWindow2 * window
Definition: events.c:77
static size_t elem
Definition: string.c:68
static LPOLESTR
Definition: stg_prop.c:27
static VARIANTARG static DISPID
Definition: ordinal.c:52
const char * uri
Definition: sec_mgr.c:1588
#define NS_OK
void nsAString_Finish(nsAString *) DECLSPEC_HIDDEN
Definition: nsembed.c:836
UINT32 nsAString_GetData(const nsAString *, const PRUnichar **) DECLSPEC_HIDDEN
Definition: nsembed.c:831
#define HTMLELEMENT_TIDS
void nsAString_InitDepend(nsAString *, const PRUnichar *) DECLSPEC_HIDDEN
Definition: nsembed.c:826
HRESULT nsuri_to_url(LPCWSTR, BOOL, BSTR *) DECLSPEC_HIDDEN
Definition: nsio.c:175
BOOL nsAString_Init(nsAString *, const PRUnichar *) DECLSPEC_HIDDEN
Definition: nsembed.c:817
struct nsCycleCollectionTraversalCallback nsCycleCollectionTraversalCallback
#define NS_SUCCEEDED(res)
#define NS_FAILED(res)
HRESULT return_nsstr(nsresult, nsAString *, BSTR *) DECLSPEC_HIDDEN
Definition: nsembed.c:841
unsigned int UINT
Definition: ndis.h:50
WCHAR PRUnichar
Definition: nsiface.idl:48
const GUID IID_IDispatch
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
#define strcmpiW(s1, s2)
Definition: unicode.h:45
DWORD LCID
Definition: nls.h:13
#define TRACE(s)
Definition: solgame.cpp:4
nsIDOMHTMLAnchorElement * nsanchor
Definition: htmlanchor.c:26
HTMLElement element
Definition: htmlanchor.c:22
IHTMLAnchorElement IHTMLAnchorElement_iface
Definition: htmlanchor.c:24
IHTMLWindow2 IHTMLWindow2_iface
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
int ret
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:531
#define WINAPI
Definition: msvc.h:6
void WINAPI mouse_event(_In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ ULONG_PTR)
__wchar_t WCHAR
Definition: xmlstorage.h:180