ReactOS  0.4.14-dev-55-g2da92ac
htmlscript.c File Reference
#include "mshtml_private.h"
Include dependency graph for htmlscript.c:

Go to the source code of this file.

Functions

static HTMLScriptElementimpl_from_IHTMLScriptElement (IHTMLScriptElement *iface)
 
static HRESULT WINAPI HTMLScriptElement_QueryInterface (IHTMLScriptElement *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI HTMLScriptElement_AddRef (IHTMLScriptElement *iface)
 
static ULONG WINAPI HTMLScriptElement_Release (IHTMLScriptElement *iface)
 
static HRESULT WINAPI HTMLScriptElement_GetTypeInfoCount (IHTMLScriptElement *iface, UINT *pctinfo)
 
static HRESULT WINAPI HTMLScriptElement_GetTypeInfo (IHTMLScriptElement *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI HTMLScriptElement_GetIDsOfNames (IHTMLScriptElement *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI HTMLScriptElement_Invoke (IHTMLScriptElement *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI HTMLScriptElement_put_src (IHTMLScriptElement *iface, BSTR v)
 
static HRESULT WINAPI HTMLScriptElement_get_src (IHTMLScriptElement *iface, BSTR *p)
 
static HRESULT WINAPI HTMLScriptElement_put_htmlFor (IHTMLScriptElement *iface, BSTR v)
 
static HRESULT WINAPI HTMLScriptElement_get_htmlFor (IHTMLScriptElement *iface, BSTR *p)
 
static HRESULT WINAPI HTMLScriptElement_put_event (IHTMLScriptElement *iface, BSTR v)
 
static HRESULT WINAPI HTMLScriptElement_get_event (IHTMLScriptElement *iface, BSTR *p)
 
static HRESULT WINAPI HTMLScriptElement_put_text (IHTMLScriptElement *iface, BSTR v)
 
static HRESULT WINAPI HTMLScriptElement_get_text (IHTMLScriptElement *iface, BSTR *p)
 
static HRESULT WINAPI HTMLScriptElement_put_defer (IHTMLScriptElement *iface, VARIANT_BOOL v)
 
static HRESULT WINAPI HTMLScriptElement_get_defer (IHTMLScriptElement *iface, VARIANT_BOOL *p)
 
static HRESULT WINAPI HTMLScriptElement_get_readyState (IHTMLScriptElement *iface, BSTR *p)
 
static HRESULT WINAPI HTMLScriptElement_put_onerror (IHTMLScriptElement *iface, VARIANT v)
 
static HRESULT WINAPI HTMLScriptElement_get_onerror (IHTMLScriptElement *iface, VARIANT *p)
 
static HRESULT WINAPI HTMLScriptElement_put_type (IHTMLScriptElement *iface, BSTR v)
 
static HRESULT WINAPI HTMLScriptElement_get_type (IHTMLScriptElement *iface, BSTR *p)
 
static HTMLScriptElementimpl_from_HTMLDOMNode (HTMLDOMNode *iface)
 
static HRESULT HTMLScriptElement_QI (HTMLDOMNode *iface, REFIID riid, void **ppv)
 
static HRESULT HTMLScriptElement_get_readystate (HTMLDOMNode *iface, BSTR *p)
 
static void HTMLScriptElement_traverse (HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
 
static void HTMLScriptElement_unlink (HTMLDOMNode *iface)
 
HRESULT script_elem_from_nsscript (HTMLDocumentNode *doc, nsIDOMHTMLScriptElement *nsscript, HTMLScriptElement **ret)
 
HRESULT HTMLScriptElement_Create (HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, HTMLElement **elem)
 

Variables

static const IHTMLScriptElementVtbl HTMLScriptElementVtbl
 
static const NodeImplVtbl HTMLScriptElementImplVtbl
 
static const tid_t HTMLScriptElement_iface_tids []
 
static dispex_static_data_t HTMLScriptElement_dispex
 

Function Documentation

◆ HTMLScriptElement_AddRef()

static ULONG WINAPI HTMLScriptElement_AddRef ( IHTMLScriptElement *  iface)
static

Definition at line 34 of file htmlscript.c.

35 {
37 
38  return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
39 }
static HTMLScriptElement * impl_from_IHTMLScriptElement(IHTMLScriptElement *iface)
Definition: htmlscript.c:21

◆ HTMLScriptElement_Create()

HRESULT HTMLScriptElement_Create ( HTMLDocumentNode doc,
nsIDOMHTMLElement nselem,
HTMLElement **  elem 
)

Definition at line 458 of file htmlscript.c.

459 {
461  nsresult nsres;
462 
463  ret = heap_alloc_zero(sizeof(HTMLScriptElement));
464  if(!ret)
465  return E_OUTOFMEMORY;
466 
467  ret->IHTMLScriptElement_iface.lpVtbl = &HTMLScriptElementVtbl;
468  ret->element.node.vtbl = &HTMLScriptElementImplVtbl;
469 
470  HTMLElement_Init(&ret->element, doc, nselem, &HTMLScriptElement_dispex);
471 
472  nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLScriptElement, (void**)&ret->nsscript);
473  assert(nsres == NS_OK);
474 
475  *elem = &ret->element;
476  return S_OK;
477 }
#define assert(x)
Definition: debug.h:53
static const NodeImplVtbl HTMLScriptElementImplVtbl
Definition: htmlscript.c:405
#define NS_OK
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static size_t elem
Definition: string.c:68
static dispex_static_data_t HTMLScriptElement_dispex
Definition: htmlscript.c:451
int ret
void HTMLElement_Init(HTMLElement *This, HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem, dispex_static_data_t *dispex_data)
Definition: htmlelem.c:4008
static const IHTMLScriptElementVtbl HTMLScriptElementVtbl
Definition: htmlscript.c:323
#define S_OK
Definition: intsafe.h:59
HRESULT nsresult
Definition: nsiface.idl:39

◆ HTMLScriptElement_get_defer()

static HRESULT WINAPI HTMLScriptElement_get_defer ( IHTMLScriptElement *  iface,
VARIANT_BOOL p 
)
static

Definition at line 244 of file htmlscript.c.

245 {
247  cpp_bool defer = FALSE;
248  nsresult nsres;
249 
250  TRACE("(%p)->(%p)\n", This, p);
251 
252  if(!p)
253  return E_INVALIDARG;
254 
255  nsres = nsIDOMHTMLScriptElement_GetDefer(This->nsscript, &defer);
256  if(NS_FAILED(nsres)) {
257  ERR("GetSrc failed: %08x\n", nsres);
258  }
259 
260  *p = defer ? VARIANT_TRUE : VARIANT_FALSE;
261 
262  TRACE("*p = %d\n", *p);
263  return S_OK;
264 }
static HTMLScriptElement * impl_from_IHTMLScriptElement(IHTMLScriptElement *iface)
Definition: htmlscript.c:21
#define E_INVALIDARG
Definition: ddrawi.h:101
#define NS_FAILED(res)
unsigned char cpp_bool
Definition: atl.c:39
#define TRACE(s)
Definition: solgame.cpp:4
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
HRESULT nsresult
Definition: nsiface.idl:39
GLfloat GLfloat p
Definition: glext.h:8902

◆ HTMLScriptElement_get_event()

static HRESULT WINAPI HTMLScriptElement_get_event ( IHTMLScriptElement *  iface,
BSTR p 
)
static

Definition at line 170 of file htmlscript.c.

171 {
173  FIXME("(%p)->(%p)\n", This, p);
174  return E_NOTIMPL;
175 }
static HTMLScriptElement * impl_from_IHTMLScriptElement(IHTMLScriptElement *iface)
Definition: htmlscript.c:21
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
GLfloat GLfloat p
Definition: glext.h:8902

◆ HTMLScriptElement_get_htmlFor()

static HRESULT WINAPI HTMLScriptElement_get_htmlFor ( IHTMLScriptElement *  iface,
BSTR p 
)
static

Definition at line 156 of file htmlscript.c.

157 {
159  FIXME("(%p)->(%p)\n", This, p);
160  return E_NOTIMPL;
161 }
static HTMLScriptElement * impl_from_IHTMLScriptElement(IHTMLScriptElement *iface)
Definition: htmlscript.c:21
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
GLfloat GLfloat p
Definition: glext.h:8902

◆ HTMLScriptElement_get_onerror()

static HRESULT WINAPI HTMLScriptElement_get_onerror ( IHTMLScriptElement *  iface,
VARIANT p 
)
static

Definition at line 284 of file htmlscript.c.

285 {
287 
288  TRACE("(%p)->(%p)\n", This, p);
289 
290  return get_node_event(&This->element.node, EVENTID_ERROR, p);
291 }
static HTMLScriptElement * impl_from_IHTMLScriptElement(IHTMLScriptElement *iface)
Definition: htmlscript.c:21
static HRESULT get_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *var)
Definition: htmlevent.h:85
#define TRACE(s)
Definition: solgame.cpp:4
GLfloat GLfloat p
Definition: glext.h:8902

◆ HTMLScriptElement_get_readyState()

static HRESULT WINAPI HTMLScriptElement_get_readyState ( IHTMLScriptElement *  iface,
BSTR p 
)
static

Definition at line 266 of file htmlscript.c.

267 {
269 
270  TRACE("(%p)->(%p)\n", This, p);
271 
272  return get_readystate_string(This->readystate, p);
273 }
static HTMLScriptElement * impl_from_IHTMLScriptElement(IHTMLScriptElement *iface)
Definition: htmlscript.c:21
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT get_readystate_string(READYSTATE readystate, BSTR *p)
Definition: htmlelem.c:205
GLfloat GLfloat p
Definition: glext.h:8902

◆ HTMLScriptElement_get_readystate()

static HRESULT HTMLScriptElement_get_readystate ( HTMLDOMNode iface,
BSTR p 
)
static

Definition at line 378 of file htmlscript.c.

379 {
381 
382  return IHTMLScriptElement_get_readyState(&This->IHTMLScriptElement_iface, p);
383 }
static HTMLScriptElement * impl_from_HTMLDOMNode(HTMLDOMNode *iface)
Definition: htmlscript.c:348
GLfloat GLfloat p
Definition: glext.h:8902

◆ HTMLScriptElement_get_src()

static HRESULT WINAPI HTMLScriptElement_get_src ( IHTMLScriptElement *  iface,
BSTR p 
)
static

Definition at line 136 of file htmlscript.c.

137 {
139  nsAString src_str;
140  nsresult nsres;
141 
142  TRACE("(%p)->(%p)\n", This, p);
143 
144  nsAString_Init(&src_str, NULL);
145  nsres = nsIDOMHTMLScriptElement_GetSrc(This->nsscript, &src_str);
146  return return_nsstr(nsres, &src_str, p);
147 }
static HTMLScriptElement * impl_from_IHTMLScriptElement(IHTMLScriptElement *iface)
Definition: htmlscript.c:21
smooth NULL
Definition: ftsmooth.c:416
HRESULT return_nsstr(nsresult, nsAString *, BSTR *) DECLSPEC_HIDDEN
Definition: nsembed.c:841
#define TRACE(s)
Definition: solgame.cpp:4
BOOL nsAString_Init(nsAString *, const PRUnichar *) DECLSPEC_HIDDEN
Definition: nsembed.c:817
HRESULT nsresult
Definition: nsiface.idl:39
GLfloat GLfloat p
Definition: glext.h:8902

◆ HTMLScriptElement_get_text()

static HRESULT WINAPI HTMLScriptElement_get_text ( IHTMLScriptElement *  iface,
BSTR p 
)
static

Definition at line 214 of file htmlscript.c.

215 {
217  nsAString nsstr;
218  nsresult nsres;
219 
220  TRACE("(%p)->(%p)\n", This, p);
221 
222  nsAString_Init(&nsstr, NULL);
223  nsres = nsIDOMHTMLScriptElement_GetText(This->nsscript, &nsstr);
224  return return_nsstr(nsres, &nsstr, p);
225 }
static HTMLScriptElement * impl_from_IHTMLScriptElement(IHTMLScriptElement *iface)
Definition: htmlscript.c:21
smooth NULL
Definition: ftsmooth.c:416
HRESULT return_nsstr(nsresult, nsAString *, BSTR *) DECLSPEC_HIDDEN
Definition: nsembed.c:841
#define TRACE(s)
Definition: solgame.cpp:4
BOOL nsAString_Init(nsAString *, const PRUnichar *) DECLSPEC_HIDDEN
Definition: nsembed.c:817
HRESULT nsresult
Definition: nsiface.idl:39
GLfloat GLfloat p
Definition: glext.h:8902

◆ HTMLScriptElement_get_type()

static HRESULT WINAPI HTMLScriptElement_get_type ( IHTMLScriptElement *  iface,
BSTR p 
)
static

Definition at line 310 of file htmlscript.c.

311 {
313  nsAString nstype_str;
314  nsresult nsres;
315 
316  TRACE("(%p)->(%p)\n", This, p);
317 
318  nsAString_Init(&nstype_str, NULL);
319  nsres = nsIDOMHTMLScriptElement_GetType(This->nsscript, &nstype_str);
320  return return_nsstr(nsres, &nstype_str, p);
321 }
static HTMLScriptElement * impl_from_IHTMLScriptElement(IHTMLScriptElement *iface)
Definition: htmlscript.c:21
smooth NULL
Definition: ftsmooth.c:416
HRESULT return_nsstr(nsresult, nsAString *, BSTR *) DECLSPEC_HIDDEN
Definition: nsembed.c:841
#define TRACE(s)
Definition: solgame.cpp:4
BOOL nsAString_Init(nsAString *, const PRUnichar *) DECLSPEC_HIDDEN
Definition: nsembed.c:817
HRESULT nsresult
Definition: nsiface.idl:39
GLfloat GLfloat p
Definition: glext.h:8902

◆ HTMLScriptElement_GetIDsOfNames()

static HRESULT WINAPI HTMLScriptElement_GetIDsOfNames ( IHTMLScriptElement *  iface,
REFIID  riid,
LPOLESTR rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 62 of file htmlscript.c.

65 {
67  return IDispatchEx_GetIDsOfNames(&This->element.node.event_target.dispex.IDispatchEx_iface, riid, rgszNames,
68  cNames, lcid, rgDispId);
69 }
static HTMLScriptElement * impl_from_IHTMLScriptElement(IHTMLScriptElement *iface)
Definition: htmlscript.c:21
REFIID riid
Definition: precomp.h:44

◆ HTMLScriptElement_GetTypeInfo()

static HRESULT WINAPI HTMLScriptElement_GetTypeInfo ( IHTMLScriptElement *  iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 54 of file htmlscript.c.

56 {
58  return IDispatchEx_GetTypeInfo(&This->element.node.event_target.dispex.IDispatchEx_iface, iTInfo, lcid,
59  ppTInfo);
60 }
static HTMLScriptElement * impl_from_IHTMLScriptElement(IHTMLScriptElement *iface)
Definition: htmlscript.c:21

◆ HTMLScriptElement_GetTypeInfoCount()

static HRESULT WINAPI HTMLScriptElement_GetTypeInfoCount ( IHTMLScriptElement *  iface,
UINT pctinfo 
)
static

Definition at line 48 of file htmlscript.c.

49 {
51  return IDispatchEx_GetTypeInfoCount(&This->element.node.event_target.dispex.IDispatchEx_iface, pctinfo);
52 }
static HTMLScriptElement * impl_from_IHTMLScriptElement(IHTMLScriptElement *iface)
Definition: htmlscript.c:21

◆ HTMLScriptElement_Invoke()

static HRESULT WINAPI HTMLScriptElement_Invoke ( IHTMLScriptElement *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 71 of file htmlscript.c.

74 {
76  return IDispatchEx_Invoke(&This->element.node.event_target.dispex.IDispatchEx_iface, dispIdMember, riid,
77  lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
78 }
static HTMLScriptElement * impl_from_IHTMLScriptElement(IHTMLScriptElement *iface)
Definition: htmlscript.c:21
REFIID riid
Definition: precomp.h:44
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519

◆ HTMLScriptElement_put_defer()

static HRESULT WINAPI HTMLScriptElement_put_defer ( IHTMLScriptElement *  iface,
VARIANT_BOOL  v 
)
static

Definition at line 227 of file htmlscript.c.

228 {
230  HRESULT hr = S_OK;
231  nsresult nsres;
232 
233  TRACE("(%p)->(%x)\n", This, v);
234 
235  nsres = nsIDOMHTMLScriptElement_SetDefer(This->nsscript, v != VARIANT_FALSE);
236  if(NS_FAILED(nsres))
237  {
238  hr = E_FAIL;
239  }
240 
241  return hr;
242 }
static HTMLScriptElement * impl_from_IHTMLScriptElement(IHTMLScriptElement *iface)
Definition: htmlscript.c:21
HRESULT hr
Definition: shlfolder.c:183
#define E_FAIL
Definition: ddrawi.h:102
#define NS_FAILED(res)
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
const GLdouble * v
Definition: gl.h:2040
HRESULT nsresult
Definition: nsiface.idl:39

◆ HTMLScriptElement_put_event()

static HRESULT WINAPI HTMLScriptElement_put_event ( IHTMLScriptElement *  iface,
BSTR  v 
)
static

Definition at line 163 of file htmlscript.c.

164 {
166  FIXME("(%p)->(%s)\n", This, debugstr_w(v));
167  return E_NOTIMPL;
168 }
static HTMLScriptElement * impl_from_IHTMLScriptElement(IHTMLScriptElement *iface)
Definition: htmlscript.c:21
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
const GLdouble * v
Definition: gl.h:2040
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ HTMLScriptElement_put_htmlFor()

static HRESULT WINAPI HTMLScriptElement_put_htmlFor ( IHTMLScriptElement *  iface,
BSTR  v 
)
static

Definition at line 149 of file htmlscript.c.

150 {
152  FIXME("(%p)->(%s)\n", This, debugstr_w(v));
153  return E_NOTIMPL;
154 }
static HTMLScriptElement * impl_from_IHTMLScriptElement(IHTMLScriptElement *iface)
Definition: htmlscript.c:21
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
const GLdouble * v
Definition: gl.h:2040
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ HTMLScriptElement_put_onerror()

static HRESULT WINAPI HTMLScriptElement_put_onerror ( IHTMLScriptElement *  iface,
VARIANT  v 
)
static

Definition at line 275 of file htmlscript.c.

276 {
278 
279  FIXME("(%p)->(%s) semi-stub\n", This, debugstr_variant(&v));
280 
281  return set_node_event(&This->element.node, EVENTID_ERROR, &v);
282 }
static HTMLScriptElement * impl_from_IHTMLScriptElement(IHTMLScriptElement *iface)
Definition: htmlscript.c:21
static HRESULT set_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *var)
Definition: htmlevent.h:80
#define FIXME(fmt,...)
Definition: debug.h:110
static const char * debugstr_variant(const VARIANT *var)
Definition: container.c:46
const GLdouble * v
Definition: gl.h:2040

◆ HTMLScriptElement_put_src()

static HRESULT WINAPI HTMLScriptElement_put_src ( IHTMLScriptElement *  iface,
BSTR  v 
)
static

Definition at line 80 of file htmlscript.c.

81 {
85  nsAString src_str;
86  nsresult nsres;
87 
88  TRACE("(%p)->(%s)\n", This, debugstr_w(v));
89 
90  if(!This->element.node.doc || !This->element.node.doc->window) {
91  WARN("no windoow\n");
92  return E_UNEXPECTED;
93  }
94 
95  window = This->element.node.doc->window;
96 
97  nsAString_InitDepend(&src_str, v);
98  nsres = nsIDOMHTMLScriptElement_SetSrc(This->nsscript, &src_str);
99  nsAString_Finish(&src_str);
100  if(NS_FAILED(nsres)) {
101  ERR("SetSrc failed: %08x\n", nsres);
102  return E_FAIL;
103  }
104 
105  if(This->parsed) {
106  WARN("already parsed\n");
107  return S_OK;
108  }
109 
110  if(window->parser_callback_cnt) {
112 
113  queue = heap_alloc(sizeof(*queue));
114  if(!queue)
115  return E_OUTOFMEMORY;
116 
117  IHTMLScriptElement_AddRef(&This->IHTMLScriptElement_iface);
118  queue->script = This;
119 
120  list_add_tail(&window->script_queue, &queue->entry);
121  return S_OK;
122  }
123 
124  nsres = nsIDOMHTMLElement_GetParentNode(This->element.nselem, &parent);
125  if(NS_FAILED(nsres) || !parent) {
126  TRACE("No parent, not executing\n");
127  This->parse_on_bind = TRUE;
128  return S_OK;
129  }
130 
131  nsIDOMNode_Release(parent);
133  return S_OK;
134 }
static HTMLScriptElement * impl_from_IHTMLScriptElement(IHTMLScriptElement *iface)
Definition: htmlscript.c:21
#define TRUE
Definition: types.h:120
#define WARN(fmt,...)
Definition: debug.h:111
Definition: htmlscript.h:33
#define E_FAIL
Definition: ddrawi.h:102
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define debugstr_w
Definition: kernel32.h:32
Definition: _queue.h:59
#define NS_FAILED(res)
#define TRACE(s)
Definition: solgame.cpp:4
r parent
Definition: btrfs.c:2897
static IHTMLWindow2 * window
Definition: events.c:77
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
const GLdouble * v
Definition: gl.h:2040
void nsAString_InitDepend(nsAString *, const PRUnichar *) DECLSPEC_HIDDEN
Definition: nsembed.c:826
void doc_insert_script(HTMLInnerWindow *, HTMLScriptElement *) DECLSPEC_HIDDEN
Definition: script.c:1172
#define E_UNEXPECTED
Definition: winerror.h:2456
void nsAString_Finish(nsAString *) DECLSPEC_HIDDEN
Definition: nsembed.c:836
HRESULT nsresult
Definition: nsiface.idl:39

◆ HTMLScriptElement_put_text()

static HRESULT WINAPI HTMLScriptElement_put_text ( IHTMLScriptElement *  iface,
BSTR  v 
)
static

Definition at line 177 of file htmlscript.c.

178 {
182  nsAString text_str;
183  nsresult nsres;
184 
185  TRACE("(%p)->(%s)\n", This, debugstr_w(v));
186 
187  if(!This->element.node.doc || !This->element.node.doc->window) {
188  WARN("no windoow\n");
189  return E_UNEXPECTED;
190  }
191 
192  window = This->element.node.doc->window;
193 
194  nsAString_InitDepend(&text_str, v);
195  nsres = nsIDOMHTMLScriptElement_SetText(This->nsscript, &text_str);
196  nsAString_Finish(&text_str);
197  if(NS_FAILED(nsres)) {
198  ERR("SetSrc failed: %08x\n", nsres);
199  return E_FAIL;
200  }
201 
202  nsres = nsIDOMHTMLElement_GetParentNode(This->element.nselem, &parent);
203  if(NS_FAILED(nsres) || !parent) {
204  TRACE("No parent, not executing\n");
205  This->parse_on_bind = TRUE;
206  return S_OK;
207  }
208 
209  nsIDOMNode_Release(parent);
211  return S_OK;
212 }
static HTMLScriptElement * impl_from_IHTMLScriptElement(IHTMLScriptElement *iface)
Definition: htmlscript.c:21
#define TRUE
Definition: types.h:120
#define WARN(fmt,...)
Definition: debug.h:111
#define E_FAIL
Definition: ddrawi.h:102
#define debugstr_w
Definition: kernel32.h:32
#define NS_FAILED(res)
#define TRACE(s)
Definition: solgame.cpp:4
r parent
Definition: btrfs.c:2897
static IHTMLWindow2 * window
Definition: events.c:77
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
const GLdouble * v
Definition: gl.h:2040
void nsAString_InitDepend(nsAString *, const PRUnichar *) DECLSPEC_HIDDEN
Definition: nsembed.c:826
void doc_insert_script(HTMLInnerWindow *, HTMLScriptElement *) DECLSPEC_HIDDEN
Definition: script.c:1172
#define E_UNEXPECTED
Definition: winerror.h:2456
void nsAString_Finish(nsAString *) DECLSPEC_HIDDEN
Definition: nsembed.c:836
HRESULT nsresult
Definition: nsiface.idl:39

◆ HTMLScriptElement_put_type()

static HRESULT WINAPI HTMLScriptElement_put_type ( IHTMLScriptElement *  iface,
BSTR  v 
)
static

Definition at line 293 of file htmlscript.c.

294 {
296  nsAString nstype_str;
297  nsresult nsres;
298 
299  TRACE("(%p)->(%s)\n", This, debugstr_w(v));
300 
301  nsAString_Init(&nstype_str, v);
302  nsres = nsIDOMHTMLScriptElement_SetType(This->nsscript, &nstype_str);
303  if (NS_FAILED(nsres))
304  ERR("SetType failed: %08x\n", nsres);
305  nsAString_Finish (&nstype_str);
306 
307  return S_OK;
308 }
static HTMLScriptElement * impl_from_IHTMLScriptElement(IHTMLScriptElement *iface)
Definition: htmlscript.c:21
#define debugstr_w
Definition: kernel32.h:32
#define NS_FAILED(res)
#define TRACE(s)
Definition: solgame.cpp:4
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
const GLdouble * v
Definition: gl.h:2040
BOOL nsAString_Init(nsAString *, const PRUnichar *) DECLSPEC_HIDDEN
Definition: nsembed.c:817
void nsAString_Finish(nsAString *) DECLSPEC_HIDDEN
Definition: nsembed.c:836
HRESULT nsresult
Definition: nsiface.idl:39

◆ HTMLScriptElement_QI()

static HRESULT HTMLScriptElement_QI ( HTMLDOMNode iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 353 of file htmlscript.c.

354 {
356 
357  *ppv = NULL;
358 
359  if(IsEqualGUID(&IID_IUnknown, riid)) {
360  TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
361  *ppv = &This->IHTMLScriptElement_iface;
362  }else if(IsEqualGUID(&IID_IDispatch, riid)) {
363  TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
364  *ppv = &This->IHTMLScriptElement_iface;
365  }else if(IsEqualGUID(&IID_IHTMLScriptElement, riid)) {
366  TRACE("(%p)->(IID_IHTMLScriptElement %p)\n", This, ppv);
367  *ppv = &This->IHTMLScriptElement_iface;
368  }
369 
370  if(*ppv) {
371  IUnknown_AddRef((IUnknown*)*ppv);
372  return S_OK;
373  }
374 
375  return HTMLElement_QI(&This->element.node, riid, ppv);
376 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
HRESULT HTMLElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
Definition: htmlelem.c:3738
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
const GUID IID_IDispatch
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
static HTMLScriptElement * impl_from_HTMLDOMNode(HTMLDOMNode *iface)
Definition: htmlscript.c:348

◆ HTMLScriptElement_QueryInterface()

static HRESULT WINAPI HTMLScriptElement_QueryInterface ( IHTMLScriptElement *  iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 26 of file htmlscript.c.

28 {
30 
31  return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
32 }
static HTMLScriptElement * impl_from_IHTMLScriptElement(IHTMLScriptElement *iface)
Definition: htmlscript.c:21
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39

◆ HTMLScriptElement_Release()

static ULONG WINAPI HTMLScriptElement_Release ( IHTMLScriptElement *  iface)
static

Definition at line 41 of file htmlscript.c.

42 {
44 
45  return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
46 }
static HTMLScriptElement * impl_from_IHTMLScriptElement(IHTMLScriptElement *iface)
Definition: htmlscript.c:21

◆ HTMLScriptElement_traverse()

static void HTMLScriptElement_traverse ( HTMLDOMNode iface,
nsCycleCollectionTraversalCallback cb 
)
static

Definition at line 385 of file htmlscript.c.

386 {
388 
389  if(This->nsscript)
390  note_cc_edge((nsISupports*)This->nsscript, "This->nsscript", cb);
391 }
static DWORD cb
Definition: integrity.c:41
static HTMLScriptElement * impl_from_HTMLDOMNode(HTMLDOMNode *iface)
Definition: htmlscript.c:348

◆ HTMLScriptElement_unlink()

static void HTMLScriptElement_unlink ( HTMLDOMNode iface)
static

Definition at line 393 of file htmlscript.c.

394 {
396 
397  if(This->nsscript) {
398  nsIDOMHTMLScriptElement *nsscript = This->nsscript;
399 
400  This->nsscript = NULL;
401  nsIDOMHTMLScriptElement_Release(nsscript);
402  }
403 }
smooth NULL
Definition: ftsmooth.c:416
static HTMLScriptElement * impl_from_HTMLDOMNode(HTMLDOMNode *iface)
Definition: htmlscript.c:348

◆ impl_from_HTMLDOMNode()

static HTMLScriptElement* impl_from_HTMLDOMNode ( HTMLDOMNode iface)
inlinestatic

Definition at line 348 of file htmlscript.c.

349 {
350  return CONTAINING_RECORD(iface, HTMLScriptElement, element.node);
351 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by HTMLScriptElement_get_readystate(), HTMLScriptElement_QI(), HTMLScriptElement_traverse(), HTMLScriptElement_unlink(), and script_elem_from_nsscript().

◆ impl_from_IHTMLScriptElement()

◆ script_elem_from_nsscript()

HRESULT script_elem_from_nsscript ( HTMLDocumentNode doc,
nsIDOMHTMLScriptElement nsscript,
HTMLScriptElement **  ret 
)

Definition at line 425 of file htmlscript.c.

426 {
427  nsIDOMNode *nsnode;
428  HTMLDOMNode *node;
429  nsresult nsres;
430  HRESULT hres;
431 
432  nsres = nsIDOMHTMLScriptElement_QueryInterface(nsscript, &IID_nsIDOMNode, (void**)&nsnode);
433  assert(nsres == NS_OK);
434 
435  hres = get_node(doc, nsnode, TRUE, &node);
436  nsIDOMNode_Release(nsnode);
437  if(FAILED(hres))
438  return hres;
439 
442  return S_OK;
443 }
#define TRUE
Definition: types.h:120
#define assert(x)
Definition: debug.h:53
static const NodeImplVtbl HTMLScriptElementImplVtbl
Definition: htmlscript.c:405
#define NS_OK
struct node node
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
int ret
#define S_OK
Definition: intsafe.h:59
HRESULT get_node(HTMLDocumentNode *This, nsIDOMNode *nsnode, BOOL create, HTMLDOMNode **ret)
Definition: htmlnode.c:1339
static HTMLScriptElement * impl_from_HTMLDOMNode(HTMLDOMNode *iface)
Definition: htmlscript.c:348
HRESULT nsresult
Definition: nsiface.idl:39
Definition: dlist.c:348

Referenced by bind_event_scripts(), nsDocumentObserver_BindToDocument(), and run_insert_script().

Variable Documentation

◆ HTMLScriptElement_dispex

dispex_static_data_t HTMLScriptElement_dispex
static
Initial value:
= {
DispHTMLScriptElement_tid,
}
static const tid_t HTMLScriptElement_iface_tids[]
Definition: htmlscript.c:445
smooth NULL
Definition: ftsmooth.c:416

Definition at line 451 of file htmlscript.c.

Referenced by HTMLScriptElement_Create().

◆ HTMLScriptElement_iface_tids

const tid_t HTMLScriptElement_iface_tids[]
static
Initial value:
= {
IHTMLScriptElement_tid,
0
}
#define HTMLELEMENT_TIDS

Definition at line 445 of file htmlscript.c.

◆ HTMLScriptElementImplVtbl

const NodeImplVtbl HTMLScriptElementImplVtbl
static
Initial value:
= {
}
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
HRESULT HTMLElement_get_attr_col(HTMLDOMNode *iface, HTMLAttributeCollection **ac)
Definition: htmlelem.c:4827
static void HTMLScriptElement_traverse(HTMLDOMNode *iface, nsCycleCollectionTraversalCallback *cb)
Definition: htmlscript.c:385
smooth NULL
Definition: ftsmooth.c:416
static HRESULT HTMLScriptElement_get_readystate(HTMLDOMNode *iface, BSTR *p)
Definition: htmlscript.c:378
void HTMLElement_destructor(HTMLDOMNode *iface)
Definition: htmlelem.c:3764
static void HTMLScriptElement_unlink(HTMLDOMNode *iface)
Definition: htmlscript.c:393
HRESULT HTMLElement_clone(HTMLDOMNode *iface, nsIDOMNode *nsnode, HTMLDOMNode **ret)
Definition: htmlelem.c:3793
static HRESULT HTMLScriptElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
Definition: htmlscript.c:353

Definition at line 405 of file htmlscript.c.

Referenced by HTMLScriptElement_Create(), and script_elem_from_nsscript().

◆ HTMLScriptElementVtbl

const IHTMLScriptElementVtbl HTMLScriptElementVtbl
static
Initial value:
= {
}
static HRESULT WINAPI HTMLScriptElement_put_src(IHTMLScriptElement *iface, BSTR v)
Definition: htmlscript.c:80
static ULONG WINAPI HTMLScriptElement_Release(IHTMLScriptElement *iface)
Definition: htmlscript.c:41
static HRESULT WINAPI HTMLScriptElement_get_readyState(IHTMLScriptElement *iface, BSTR *p)
Definition: htmlscript.c:266
static HRESULT WINAPI HTMLScriptElement_put_event(IHTMLScriptElement *iface, BSTR v)
Definition: htmlscript.c:163
static HRESULT WINAPI HTMLScriptElement_get_onerror(IHTMLScriptElement *iface, VARIANT *p)
Definition: htmlscript.c:284
static HRESULT WINAPI HTMLScriptElement_GetTypeInfoCount(IHTMLScriptElement *iface, UINT *pctinfo)
Definition: htmlscript.c:48
static HRESULT WINAPI HTMLScriptElement_get_src(IHTMLScriptElement *iface, BSTR *p)
Definition: htmlscript.c:136
static HRESULT WINAPI HTMLScriptElement_GetIDsOfNames(IHTMLScriptElement *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: htmlscript.c:62
static ULONG WINAPI HTMLScriptElement_AddRef(IHTMLScriptElement *iface)
Definition: htmlscript.c:34
static HRESULT WINAPI HTMLScriptElement_put_onerror(IHTMLScriptElement *iface, VARIANT v)
Definition: htmlscript.c:275
static HRESULT WINAPI HTMLScriptElement_get_type(IHTMLScriptElement *iface, BSTR *p)
Definition: htmlscript.c:310
static HRESULT WINAPI HTMLScriptElement_put_type(IHTMLScriptElement *iface, BSTR v)
Definition: htmlscript.c:293
static HRESULT WINAPI HTMLScriptElement_put_htmlFor(IHTMLScriptElement *iface, BSTR v)
Definition: htmlscript.c:149
static HRESULT WINAPI HTMLScriptElement_get_event(IHTMLScriptElement *iface, BSTR *p)
Definition: htmlscript.c:170
static HRESULT WINAPI HTMLScriptElement_GetTypeInfo(IHTMLScriptElement *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: htmlscript.c:54
static HRESULT WINAPI HTMLScriptElement_get_text(IHTMLScriptElement *iface, BSTR *p)
Definition: htmlscript.c:214
static HRESULT WINAPI HTMLScriptElement_put_text(IHTMLScriptElement *iface, BSTR v)
Definition: htmlscript.c:177
static HRESULT WINAPI HTMLScriptElement_get_defer(IHTMLScriptElement *iface, VARIANT_BOOL *p)
Definition: htmlscript.c:244
static HRESULT WINAPI HTMLScriptElement_Invoke(IHTMLScriptElement *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: htmlscript.c:71
static HRESULT WINAPI HTMLScriptElement_QueryInterface(IHTMLScriptElement *iface, REFIID riid, void **ppv)
Definition: htmlscript.c:26
static HRESULT WINAPI HTMLScriptElement_put_defer(IHTMLScriptElement *iface, VARIANT_BOOL v)
Definition: htmlscript.c:227
static HRESULT WINAPI HTMLScriptElement_get_htmlFor(IHTMLScriptElement *iface, BSTR *p)
Definition: htmlscript.c:156

Definition at line 323 of file htmlscript.c.

Referenced by HTMLScriptElement_Create().