ReactOS  0.4.14-dev-317-g96040ec
mutation.c
Go to the documentation of this file.
1 /*
2  * Copyright 2008 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 
21 #define IE_MAJOR_VERSION 7
22 #define IE_MINOR_VERSION 0
23 
24 static const IID NS_ICONTENTUTILS_CID =
25  {0x762C4AE7,0xB923,0x422F,{0xB9,0x7E,0xB9,0xBF,0xC1,0xEF,0x7B,0xF0}};
26 
28 
30 {
31  int majorv = 0, minorv = 0;
32  const PRUnichar *ptr, *end;
33  PRUnichar *buf;
34  DWORD len;
35 
36  enum {
37  CMP_EQ,
38  CMP_LT,
39  CMP_LTE,
40  CMP_GT,
41  CMP_GTE
42  } cmpt = CMP_EQ;
43 
44  static const PRUnichar endifW[] = {'<','!','[','e','n','d','i','f',']'};
45 
46  if(comment[0] != '[' || comment[1] != 'i' || comment[2] != 'f')
47  return NULL;
48 
49  ptr = comment+3;
50  while(isspaceW(*ptr))
51  ptr++;
52 
53  if(ptr[0] == 'l' && ptr[1] == 't') {
54  ptr += 2;
55  if(*ptr == 'e') {
56  cmpt = CMP_LTE;
57  ptr++;
58  }else {
59  cmpt = CMP_LT;
60  }
61  }else if(ptr[0] == 'g' && ptr[1] == 't') {
62  ptr += 2;
63  if(*ptr == 'e') {
64  cmpt = CMP_GTE;
65  ptr++;
66  }else {
67  cmpt = CMP_GT;
68  }
69  }
70 
71  if(!isspaceW(*ptr++))
72  return NULL;
73  while(isspaceW(*ptr))
74  ptr++;
75 
76  if(ptr[0] != 'I' || ptr[1] != 'E')
77  return NULL;
78 
79  ptr +=2;
80  if(!isspaceW(*ptr++))
81  return NULL;
82  while(isspaceW(*ptr))
83  ptr++;
84 
85  if(!isdigitW(*ptr))
86  return NULL;
87  while(isdigitW(*ptr))
88  majorv = majorv*10 + (*ptr++ - '0');
89 
90  if(*ptr == '.') {
91  ptr++;
92  if(!isdigitW(*ptr))
93  return NULL;
94  while(isdigitW(*ptr))
95  minorv = minorv*10 + (*ptr++ - '0');
96  }
97 
98  while(isspaceW(*ptr))
99  ptr++;
100  if(ptr[0] != ']' || ptr[1] != '>')
101  return NULL;
102  ptr += 2;
103 
104  len = strlenW(ptr);
105  if(len < sizeof(endifW)/sizeof(WCHAR))
106  return NULL;
107 
108  end = ptr + len-sizeof(endifW)/sizeof(WCHAR);
109  if(memcmp(end, endifW, sizeof(endifW)))
110  return NULL;
111 
112  switch(cmpt) {
113  case CMP_EQ:
114  if(majorv == IE_MAJOR_VERSION && minorv == IE_MINOR_VERSION)
115  break;
116  return NULL;
117  case CMP_LT:
118  if(majorv > IE_MAJOR_VERSION)
119  break;
120  if(majorv == IE_MAJOR_VERSION && minorv > IE_MINOR_VERSION)
121  break;
122  return NULL;
123  case CMP_LTE:
124  if(majorv > IE_MAJOR_VERSION)
125  break;
126  if(majorv == IE_MAJOR_VERSION && minorv >= IE_MINOR_VERSION)
127  break;
128  return NULL;
129  case CMP_GT:
130  if(majorv < IE_MAJOR_VERSION)
131  break;
132  if(majorv == IE_MAJOR_VERSION && minorv < IE_MINOR_VERSION)
133  break;
134  return NULL;
135  case CMP_GTE:
136  if(majorv < IE_MAJOR_VERSION)
137  break;
138  if(majorv == IE_MAJOR_VERSION && minorv <= IE_MINOR_VERSION)
139  break;
140  return NULL;
141  }
142 
143  buf = heap_alloc((end-ptr+1)*sizeof(WCHAR));
144  if(!buf)
145  return NULL;
146 
147  memcpy(buf, ptr, (end-ptr)*sizeof(WCHAR));
148  buf[end-ptr] = 0;
149 
150  return buf;
151 }
152 
154 {
155  const PRUnichar *comment;
156  nsIDOMComment *nscomment;
157  PRUnichar *replace_html;
158  nsAString comment_str;
159  nsresult nsres;
160 
161  nsres = nsISupports_QueryInterface(comment_iface, &IID_nsIDOMComment, (void**)&nscomment);
162  if(NS_FAILED(nsres)) {
163  ERR("Could not get nsIDOMComment iface:%08x\n", nsres);
164  return nsres;
165  }
166 
167  nsAString_Init(&comment_str, NULL);
168  nsres = nsIDOMComment_GetData(nscomment, &comment_str);
169  if(NS_FAILED(nsres))
170  return nsres;
171 
172  nsAString_GetData(&comment_str, &comment);
173  replace_html = handle_insert_comment(doc, comment);
174  nsAString_Finish(&comment_str);
175 
176  if(replace_html) {
177  HRESULT hres;
178 
179  hres = replace_node_by_html(doc->nsdoc, (nsIDOMNode*)nscomment, replace_html);
180  heap_free(replace_html);
181  if(FAILED(hres))
182  nsres = NS_ERROR_FAILURE;
183  }
184 
185 
186  nsIDOMComment_Release(nscomment);
187  return nsres;
188 }
189 
191 {
192  nsIDOMNode *nsnode;
193  HTMLDOMNode *node;
194  nsresult nsres;
195  HRESULT hres;
196 
197  TRACE("(%p)->(%p)\n", doc, nsiface);
198 
199  nsres = nsISupports_QueryInterface(nsiface, &IID_nsIDOMNode, (void**)&nsnode);
200  if(NS_FAILED(nsres))
201  return nsres;
202 
203  hres = get_node(doc, nsnode, TRUE, &node);
204  nsIDOMNode_Release(nsnode);
205  if(FAILED(hres)) {
206  ERR("Could not get node\n");
207  return nsres;
208  }
209 
210  if(node->vtbl->bind_to_tree)
211  node->vtbl->bind_to_tree(node);
212 
214  return nsres;
215 }
216 
217 /* Calls undocumented 69 cmd of CGID_Explorer */
219 {
220  IOleCommandTarget *olecmd;
221  VARIANT var;
222  HRESULT hres;
223 
224  if(!doc->client)
225  return;
226 
227  hres = IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&olecmd);
228  if(FAILED(hres))
229  return;
230 
231  VariantInit(&var);
232  hres = IOleCommandTarget_Exec(olecmd, &CGID_Explorer, 69, 0, NULL, &var);
233  IOleCommandTarget_Release(olecmd);
234  if(SUCCEEDED(hres) && V_VT(&var) != VT_NULL)
235  FIXME("handle result\n");
236 }
237 
239 {
240  TRACE("(%p)\n", doc);
241 
242  if(doc->usermode == EDITMODE)
243  init_editor(&doc->basedoc);
244 
245  call_explorer_69(doc);
246  if(doc->view_sink)
247  IAdviseSink_OnViewChange(doc->view_sink, DVASPECT_CONTENT, -1);
249  call_explorer_69(doc);
250 
251  if(doc->webbrowser && doc->usermode != EDITMODE && !(doc->basedoc.window->load_flags & BINDING_REFRESH))
252  IDocObjectService_FireNavigateComplete2(doc->doc_object_service, &doc->basedoc.window->base.IHTMLWindow2_iface, 0);
253 
254  /* FIXME: IE7 calls EnableModelless(TRUE), EnableModelless(FALSE) and sets interactive state here */
255 }
256 
258 {
259  TRACE("(%p)\n", This);
260 
261  if(!This->basedoc.doc_obj)
262  return NS_OK;
263 
264  if(This == This->basedoc.doc_obj->basedoc.doc_node) {
265  /*
266  * This should be done in the worker thread that parses HTML,
267  * but we don't have such thread (Gecko parses HTML for us).
268  */
269  parse_complete(This->basedoc.doc_obj);
270  }
271 
273  set_ready_state(This->basedoc.window, READYSTATE_INTERACTIVE);
274  return NS_OK;
275 }
276 
277 static nsresult run_insert_script(HTMLDocumentNode *doc, nsISupports *script_iface, nsISupports *parser_iface)
278 {
279  nsIDOMHTMLScriptElement *nsscript;
280  HTMLScriptElement *script_elem;
281  nsIParser *nsparser = NULL;
282  script_queue_entry_t *iter;
284  nsresult nsres;
285  HRESULT hres;
286 
287  TRACE("(%p)->(%p)\n", doc, script_iface);
288 
289  window = doc->window;
290  if(!window)
291  return NS_OK;
292 
293  nsres = nsISupports_QueryInterface(script_iface, &IID_nsIDOMHTMLScriptElement, (void**)&nsscript);
294  if(NS_FAILED(nsres)) {
295  ERR("Could not get nsIDOMHTMLScriptElement: %08x\n", nsres);
296  return nsres;
297  }
298 
299  if(parser_iface) {
300  nsres = nsISupports_QueryInterface(parser_iface, &IID_nsIParser, (void**)&nsparser);
301  if(NS_FAILED(nsres)) {
302  ERR("Could not get nsIParser iface: %08x\n", nsres);
303  nsparser = NULL;
304  }
305  }
306 
307  hres = script_elem_from_nsscript(doc, nsscript, &script_elem);
308  nsIDOMHTMLScriptElement_Release(nsscript);
309  if(FAILED(hres))
310  return NS_ERROR_FAILURE;
311 
312  if(nsparser) {
313  nsIParser_BeginEvaluatingParserInsertedScript(nsparser);
314  window->parser_callback_cnt++;
315  }
316 
317  IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface);
318 
319  doc_insert_script(window, script_elem);
320 
321  while(!list_empty(&window->script_queue)) {
322  iter = LIST_ENTRY(list_head(&window->script_queue), script_queue_entry_t, entry);
323  list_remove(&iter->entry);
324  if(!iter->script->parsed)
326  IHTMLScriptElement_Release(&iter->script->IHTMLScriptElement_iface);
327  heap_free(iter);
328  }
329 
330  IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface);
331 
332  if(nsparser) {
333  window->parser_callback_cnt--;
334  nsIParser_EndEvaluatingParserInsertedScript(nsparser);
335  nsIParser_Release(nsparser);
336  }
337 
338  IHTMLScriptElement_Release(&script_elem->IHTMLScriptElement_iface);
339 
340  return NS_OK;
341 }
342 
343 typedef struct nsRunnable nsRunnable;
344 
346 
347 struct nsRunnable {
349 
351 
353 
357 };
358 
360 {
361  return CONTAINING_RECORD(iface, nsRunnable, nsIRunnable_iface);
362 }
363 
365  nsIIDRef riid, void **result)
366 {
368 
369  if(IsEqualGUID(riid, &IID_nsISupports)) {
370  TRACE("(%p)->(IID_nsISupports %p)\n", This, result);
371  *result = &This->nsIRunnable_iface;
372  }else if(IsEqualGUID(riid, &IID_nsIRunnable)) {
373  TRACE("(%p)->(IID_nsIRunnable %p)\n", This, result);
374  *result = &This->nsIRunnable_iface;
375  }else {
376  *result = NULL;
377  WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), result);
378  return NS_NOINTERFACE;
379  }
380 
381  nsISupports_AddRef((nsISupports*)*result);
382  return NS_OK;
383 }
384 
386 {
389 
390  TRACE("(%p) ref=%d\n", This, ref);
391 
392  return ref;
393 }
394 
396 {
399 
400  TRACE("(%p) ref=%d\n", This, ref);
401 
402  if(!ref) {
403  htmldoc_release(&This->doc->basedoc);
404  if(This->arg1)
405  nsISupports_Release(This->arg1);
406  if(This->arg2)
407  nsISupports_Release(This->arg2);
408  heap_free(This);
409  }
410 
411  return ref;
412 }
413 
415 {
417 
418  return This->proc(This->doc, This->arg1, This->arg2);
419 }
420 
421 static const nsIRunnableVtbl nsRunnableVtbl = {
426 };
427 
429 {
431 
432  runnable = heap_alloc_zero(sizeof(*runnable));
433  if(!runnable)
434  return;
435 
436  runnable->nsIRunnable_iface.lpVtbl = &nsRunnableVtbl;
437  runnable->ref = 1;
438 
439  htmldoc_addref(&This->basedoc);
440  runnable->doc = This;
441  runnable->proc = proc;
442 
443  if(arg1)
444  nsISupports_AddRef(arg1);
445  runnable->arg1 = arg1;
446 
447  if(arg2)
448  nsISupports_AddRef(arg2);
449  runnable->arg2 = arg2;
450 
451  nsIContentUtils_AddScriptRunner(content_utils, &runnable->nsIRunnable_iface);
452 
453  nsIRunnable_Release(&runnable->nsIRunnable_iface);
454 }
455 
457 {
458  return CONTAINING_RECORD(iface, HTMLDocumentNode, nsIDocumentObserver_iface);
459 }
460 
462  nsIIDRef riid, void **result)
463 {
465 
466  if(IsEqualGUID(&IID_nsISupports, riid)) {
467  TRACE("(%p)->(IID_nsISupports, %p)\n", This, result);
468  *result = &This->nsIDocumentObserver_iface;
469  }else if(IsEqualGUID(&IID_nsIMutationObserver, riid)) {
470  TRACE("(%p)->(IID_nsIMutationObserver %p)\n", This, result);
471  *result = &This->nsIDocumentObserver_iface;
472  }else if(IsEqualGUID(&IID_nsIDocumentObserver, riid)) {
473  TRACE("(%p)->(IID_nsIDocumentObserver %p)\n", This, result);
474  *result = &This->nsIDocumentObserver_iface;
475  }else {
476  *result = NULL;
477  TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), result);
478  return NS_NOINTERFACE;
479  }
480 
481  htmldoc_addref(&This->basedoc);
482  return NS_OK;
483 }
484 
486 {
488  return htmldoc_addref(&This->basedoc);
489 }
490 
492 {
494  return htmldoc_release(&This->basedoc);
495 }
496 
498  nsIDocument *aDocument, nsIContent *aContent, void /*CharacterDataChangeInfo*/ *aInfo)
499 {
500 }
501 
503  nsIDocument *aDocument, nsIContent *aContent, void /*CharacterDataChangeInfo*/ *aInfo)
504 {
505 }
506 
508  nsIContent *aContent, LONG aNameSpaceID, nsIAtom *aAttribute, LONG aModType)
509 {
510 }
511 
513  nsIContent *aContent, LONG aNameSpaceID, nsIAtom *aAttribute, LONG aModType)
514 {
515 }
516 
518  void *aElement, LONG aNameSpaceID, nsIAtom *aAttribute)
519 {
520 }
521 
523  nsIContent *aContainer, nsIContent *aFirstNewContent, LONG aNewIndexInContainer)
524 {
525 }
526 
528  nsIContent *aContainer, nsIContent *aChild, LONG aIndexInContainer)
529 {
530 }
531 
533  nsIContent *aContainer, nsIContent *aChild, LONG aIndexInContainer,
534  nsIContent *aProviousSibling)
535 {
536 }
537 
539 {
540 }
541 
543 {
544 }
545 
547  nsUpdateType aUpdateType)
548 {
549 }
550 
552  nsUpdateType aUpdateType)
553 {
554 }
555 
557 {
558 }
559 
561 {
563 
564  TRACE("(%p)\n", This);
565 
566  if(This->skip_mutation_notif)
567  return;
568 
569  This->content_ready = TRUE;
571 }
572 
574  nsIContent *aContent, EventStates aStateMask)
575 {
576 }
577 
579  EventStates aStateMask)
580 {
581 }
582 
584  nsIStyleSheet *aStyleSheet, cpp_bool aDocumentSheet)
585 {
586 }
587 
589  nsIStyleSheet *aStyleSheet, cpp_bool aDocumentSheet)
590 {
591 }
592 
594  nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, cpp_bool aApplicable)
595 {
596 }
597 
599  nsIStyleSheet *aStyleSheet, nsIStyleRule *aOldStyleRule, nsIStyleSheet *aNewStyleRule)
600 {
601 }
602 
604  nsIStyleSheet *aStyleSheet, nsIStyleRule *aStyleRule)
605 {
606 }
607 
609  nsIStyleSheet *aStyleSheet, nsIStyleRule *aStyleRule)
610 {
611 }
612 
614  nsIContent *aContent)
615 {
617  nsIDOMHTMLIFrameElement *nsiframe;
618  nsIDOMHTMLFrameElement *nsframe;
619  nsIDOMHTMLScriptElement *nsscript;
620  nsIDOMHTMLElement *nselem;
621  nsIDOMComment *nscomment;
622  nsresult nsres;
623 
624  TRACE("(%p)->(%p %p)\n", This, aDocument, aContent);
625 
626  nsres = nsIContent_QueryInterface(aContent, &IID_nsIDOMHTMLElement, (void**)&nselem);
627  if(NS_SUCCEEDED(nsres)) {
628  check_event_attr(This, nselem);
629  nsIDOMHTMLElement_Release(nselem);
630  }
631 
632  nsres = nsIContent_QueryInterface(aContent, &IID_nsIDOMComment, (void**)&nscomment);
633  if(NS_SUCCEEDED(nsres)) {
634  TRACE("comment node\n");
635 
637  nsIDOMComment_Release(nscomment);
638  return;
639  }
640 
641  nsres = nsIContent_QueryInterface(aContent, &IID_nsIDOMHTMLIFrameElement, (void**)&nsiframe);
642  if(NS_SUCCEEDED(nsres)) {
643  TRACE("iframe node\n");
644 
646  nsIDOMHTMLIFrameElement_Release(nsiframe);
647  return;
648  }
649 
650  nsres = nsIContent_QueryInterface(aContent, &IID_nsIDOMHTMLFrameElement, (void**)&nsframe);
651  if(NS_SUCCEEDED(nsres)) {
652  TRACE("frame node\n");
653 
655  nsIDOMHTMLFrameElement_Release(nsframe);
656  return;
657  }
658 
659  nsres = nsIContent_QueryInterface(aContent, &IID_nsIDOMHTMLScriptElement, (void**)&nsscript);
660  if(NS_SUCCEEDED(nsres)) {
661  HTMLScriptElement *script_elem;
662  HRESULT hres;
663 
664  TRACE("script element\n");
665 
666  hres = script_elem_from_nsscript(This, nsscript, &script_elem);
667  nsIDOMHTMLScriptElement_Release(nsscript);
668  if(FAILED(hres))
669  return;
670 
671  if(script_elem->parse_on_bind)
673 
674  IHTMLScriptElement_Release(&script_elem->IHTMLScriptElement_iface);
675  }
676 }
677 
679  nsIParser *aParser, cpp_bool *aBlock)
680 {
682  nsIDOMHTMLScriptElement *nsscript;
683  nsresult nsres;
684 
685  TRACE("(%p)->(%p %p %p)\n", This, aContent, aParser, aBlock);
686 
687  nsres = nsIContent_QueryInterface(aContent, &IID_nsIDOMHTMLScriptElement, (void**)&nsscript);
688  if(NS_SUCCEEDED(nsres)) {
689  TRACE("script node\n");
690 
692  nsIDOMHTMLScriptElement_Release(nsscript);
693  }
694 }
695 
696 static const nsIDocumentObserverVtbl nsDocumentObserverVtbl = {
724 };
725 
727 {
728  nsIDocument *nsdoc;
729  nsresult nsres;
730 
732 
733  nsres = nsIDOMHTMLDocument_QueryInterface(doc->nsdoc, &IID_nsIDocument, (void**)&nsdoc);
734  if(NS_FAILED(nsres)) {
735  ERR("Could not get nsIDocument: %08x\n", nsres);
736  return;
737  }
738 
739  nsIContentUtils_AddDocumentObserver(content_utils, nsdoc, &doc->nsIDocumentObserver_iface);
740  nsIDocument_Release(nsdoc);
741 }
742 
744 {
745  nsIDocument *nsdoc;
746  nsresult nsres;
747 
748  nsres = nsIDOMHTMLDocument_QueryInterface(doc->nsdoc, &IID_nsIDocument, (void**)&nsdoc);
749  if(NS_FAILED(nsres)) {
750  ERR("Could not get nsIDocument: %08x\n", nsres);
751  return;
752  }
753 
754  nsIContentUtils_RemoveDocumentObserver(content_utils, nsdoc, &doc->nsIDocumentObserver_iface);
755  nsIDocument_Release(nsdoc);
756 }
757 
759 {
760  nsIDocument *doc;
761  JSContext *ctx;
762  nsresult nsres;
763 
764  nsres = nsIDOMHTMLDocument_QueryInterface(nsdoc, &IID_nsIDocument, (void**)&doc);
765  assert(nsres == NS_OK);
766 
767  ctx = nsIContentUtils_GetContextFromDocument(content_utils, doc);
768  nsIDocument_Release(doc);
769 
770  TRACE("ret %p\n", ctx);
771  return ctx;
772 }
773 
774 void init_mutation(nsIComponentManager *component_manager)
775 {
777  nsresult nsres;
778 
779  if(!component_manager) {
780  if(content_utils) {
781  nsIContentUtils_Release(content_utils);
783  }
784  return;
785  }
786 
787  nsres = nsIComponentManager_GetClassObject(component_manager, &NS_ICONTENTUTILS_CID,
788  &IID_nsIFactory, (void**)&factory);
789  if(NS_FAILED(nsres)) {
790  ERR("Could not create nsIContentUtils service: %08x\n", nsres);
791  return;
792  }
793 
794  nsres = nsIFactory_CreateInstance(factory, NULL, &IID_nsIContentUtils, (void**)&content_utils);
795  nsIFactory_Release(factory);
796  if(NS_FAILED(nsres))
797  ERR("Could not create nsIContentUtils instance: %08x\n", nsres);
798 }
static nsrefcnt NSAPI nsDocumentObserver_Release(nsIDocumentObserver *iface)
Definition: mutation.c:491
static nsresult run_bind_to_tree(HTMLDocumentNode *doc, nsISupports *nsiface, nsISupports *arg2)
Definition: mutation.c:190
nsresult(* runnable_proc_t)(HTMLDocumentNode *, nsISupports *, nsISupports *)
Definition: mutation.c:345
static void parse_complete(HTMLDocumentObj *doc)
Definition: mutation.c:238
IHTMLScriptElement IHTMLScriptElement_iface
Definition: htmlscript.h:24
static void call_explorer_69(HTMLDocumentObj *doc)
Definition: mutation.c:218
#define TRUE
Definition: types.h:120
nsISupports * arg2
Definition: mutation.c:356
static void NSAPI nsDocumentObserver_ContentAppended(nsIDocumentObserver *iface, nsIDocument *aDocument, nsIContent *aContainer, nsIContent *aFirstNewContent, LONG aNewIndexInContainer)
Definition: mutation.c:522
HRESULT script_elem_from_nsscript(HTMLDocumentNode *doc, nsIDOMHTMLScriptElement *nsscript, HTMLScriptElement **ret)
Definition: htmlscript.c:425
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
nsIDOMHTMLDocument * nsdoc
static const IID NS_ICONTENTUTILS_CID
Definition: mutation.c:24
void release_document_mutation(HTMLDocumentNode *doc)
Definition: mutation.c:743
void init_document_mutation(HTMLDocumentNode *doc)
Definition: mutation.c:726
static void NSAPI nsDocumentObserver_StyleRuleChanged(nsIDocumentObserver *iface, nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, nsIStyleRule *aOldStyleRule, nsIStyleSheet *aNewStyleRule)
Definition: mutation.c:598
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static void NSAPI nsDocumentObserver_ParentChainChanged(nsIDocumentObserver *iface, nsIContent *aContent)
Definition: mutation.c:542
IOleClientSite * client
static nsrefcnt NSAPI nsRunnable_Release(nsIRunnable *iface)
Definition: mutation.c:395
#define NSAPI
REFIID riid
Definition: precomp.h:44
static void NSAPI nsDocumentObserver_AttributeWillChange(nsIDocumentObserver *iface, nsIDocument *aDocument, nsIContent *aContent, LONG aNameSpaceID, nsIAtom *aAttribute, LONG aModType)
Definition: mutation.c:507
nsIDocumentObserver nsIDocumentObserver_iface
HTMLInnerWindow * window
void init_mutation(nsIComponentManager *component_manager)
Definition: mutation.c:774
WINE_UNICODE_INLINE int isspaceW(WCHAR wc)
Definition: unicode.h:165
static void NSAPI nsDocumentObserver_BeginLoad(nsIDocumentObserver *iface, nsIDocument *aDocument)
Definition: mutation.c:556
#define WARN(fmt,...)
Definition: debug.h:111
HTMLOuterWindow * window
REFIID nsIIDRef
Definition: nsiface.idl:45
static nsresult run_end_load(HTMLDocumentNode *This, nsISupports *arg1, nsISupports *arg2)
Definition: mutation.c:257
nsISupports * arg1
Definition: mutation.c:355
#define assert(x)
Definition: debug.h:53
static void NSAPI nsDocumentObserver_ContentInserted(nsIDocumentObserver *iface, nsIDocument *aDocument, nsIContent *aContainer, nsIContent *aChild, LONG aIndexInContainer)
Definition: mutation.c:527
static nsresult run_insert_comment(HTMLDocumentNode *doc, nsISupports *comment_iface, nsISupports *arg2)
Definition: mutation.c:153
GLuint GLuint end
Definition: gl.h:1545
static HANDLE proc()
Definition: pdb.c:32
Definition: htmlscript.h:33
static PRUnichar * handle_insert_comment(HTMLDocumentNode *doc, const PRUnichar *comment)
Definition: mutation.c:29
static void NSAPI nsDocumentObserver_ContentRemoved(nsIDocumentObserver *iface, nsIDocument *aDocument, nsIContent *aContainer, nsIContent *aChild, LONG aIndexInContainer, nsIContent *aProviousSibling)
Definition: mutation.c:532
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:571
static nsIContentUtils * content_utils
Definition: mutation.c:27
void call_property_onchanged(ConnectionPointContainer *container, DISPID dispid)
Definition: conpoint.c:342
static IRunnableObject * runnable
Definition: ole2.c:76
static void NSAPI nsDocumentObserver_BeginUpdate(nsIDocumentObserver *iface, nsIDocument *aDocument, nsUpdateType aUpdateType)
Definition: mutation.c:546
static HTMLDocumentNode * impl_from_nsIDocumentObserver(nsIDocumentObserver *iface)
Definition: mutation.c:456
static nsresult NSAPI nsDocumentObserver_QueryInterface(nsIDocumentObserver *iface, nsIIDRef riid, void **result)
Definition: mutation.c:461
Definition: send.c:47
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
__WINE_SERVER_LIST_INLINE struct list * list_head(const struct list *list)
Definition: list.h:131
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
Definition: glext.h:9514
#define NS_OK
struct node node
struct list entry
Definition: htmlscript.h:34
static void NSAPI nsDocumentObserver_EndUpdate(nsIDocumentObserver *iface, nsIDocument *aDocument, nsUpdateType aUpdateType)
Definition: mutation.c:551
static void node_release(HTMLDOMNode *node)
static void NSAPI nsDocumentObserver_StyleRuleRemoved(nsIDocumentObserver *iface, nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, nsIStyleRule *aStyleRule)
Definition: mutation.c:608
long LONG
Definition: pedump.c:60
Definition: main.c:440
GLuint GLuint GLuint GLuint arg1
Definition: glext.h:9513
GLenum GLint ref
Definition: glext.h:6028
#define FIXME(fmt,...)
Definition: debug.h:110
static PVOID ptr
Definition: dispmode.c:27
HTMLScriptElement * script
Definition: htmlscript.h:35
static nsresult run_insert_script(HTMLDocumentNode *doc, nsISupports *script_iface, nsISupports *parser_iface)
Definition: mutation.c:277
static nsresult NSAPI nsRunnable_QueryInterface(nsIRunnable *iface, nsIIDRef riid, void **result)
Definition: mutation.c:364
smooth NULL
Definition: ftsmooth.c:416
static void NSAPI nsDocumentObserver_CharacterDataWillChange(nsIDocumentObserver *iface, nsIDocument *aDocument, nsIContent *aContent, void *aInfo)
Definition: mutation.c:497
static nsrefcnt NSAPI nsDocumentObserver_AddRef(nsIDocumentObserver *iface)
Definition: mutation.c:485
#define debugstr_guid
Definition: kernel32.h:35
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
JSContext * get_context_from_document(nsIDOMHTMLDocument *nsdoc)
Definition: mutation.c:758
static void NSAPI nsDocumentObserver_StyleSheetApplicableStateChanged(nsIDocumentObserver *iface, nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, cpp_bool aApplicable)
Definition: mutation.c:593
static const nsIRunnableVtbl nsRunnableVtbl
Definition: mutation.c:421
static void NSAPI nsDocumentObserver_CharacterDataChanged(nsIDocumentObserver *iface, nsIDocument *aDocument, nsIContent *aContent, void *aInfo)
Definition: mutation.c:502
#define NS_FAILED(res)
IUnknown * webbrowser
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
#define NS_ERROR_FAILURE
unsigned char cpp_bool
Definition: atl.c:38
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
static void NSAPI nsDocumentObserver_StyleSheetAdded(nsIDocumentObserver *iface, nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, cpp_bool aDocumentSheet)
Definition: mutation.c:583
HTMLDocument basedoc
static void NSAPI nsDocumentObserver_BindToDocument(nsIDocumentObserver *iface, nsIDocument *aDocument, nsIContent *aContent)
Definition: mutation.c:613
unsigned long DWORD
Definition: ntddk_ex.h:95
nsIRunnable nsIRunnable_iface
Definition: mutation.c:348
#define IE_MINOR_VERSION
Definition: mutation.c:22
#define NS_SUCCEEDED(res)
ConnectionPointContainer cp_container
static void NSAPI nsDocumentObserver_AttributeSetToCurrentValue(nsIDocumentObserver *iface, nsIDocument *aDocument, void *aElement, LONG aNameSpaceID, nsIAtom *aAttribute)
Definition: mutation.c:517
static void NSAPI nsDocumentObserver_StyleSheetRemoved(nsIDocumentObserver *iface, nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, cpp_bool aDocumentSheet)
Definition: mutation.c:588
#define InterlockedDecrement
Definition: armddk.h:52
#define V_VT(A)
Definition: oleauto.h:211
Definition: id3.c:18
uint32_t entry
Definition: isohybrid.c:63
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
UINT32 nsAString_GetData(const nsAString *, const PRUnichar **) DECLSPEC_HIDDEN
Definition: nsembed.c:831
static IHTMLWindow2 * window
Definition: events.c:77
static ULONG htmldoc_release(HTMLDocument *This)
static nsrefcnt NSAPI nsRunnable_AddRef(nsIRunnable *iface)
Definition: mutation.c:385
LONG ref
Definition: mutation.c:350
#define IE_MAJOR_VERSION
Definition: mutation.c:21
#define BINDING_REFRESH
Definition: binding.h:130
static void NSAPI nsDocumentObserver_StyleRuleAdded(nsIDocumentObserver *iface, nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, nsIStyleRule *aStyleRule)
Definition: mutation.c:603
#define ERR(fmt,...)
Definition: debug.h:109
HRESULT replace_node_by_html(nsIDOMHTMLDocument *nsdoc, nsIDOMNode *nsnode, const WCHAR *html)
Definition: htmlelem.c:98
__WINE_SERVER_LIST_INLINE int list_empty(const struct list *list)
Definition: list.h:143
IAdviseSink * view_sink
#define InterlockedIncrement
Definition: armddk.h:53
static void NSAPI nsDocumentObserver_DocumentStatesChanged(nsIDocumentObserver *iface, nsIDocument *aDocument, EventStates aStateMask)
Definition: mutation.c:578
IDocObjectService * doc_object_service
static nsRunnable * impl_from_nsIRunnable(nsIRunnable *iface)
Definition: mutation.c:359
HRESULT get_node(HTMLDocumentNode *This, nsIDOMNode *nsnode, BOOL create, HTMLDOMNode **ret)
Definition: htmlnode.c:1339
#define NS_NOINTERFACE
WINE_UNICODE_INLINE int isdigitW(WCHAR wc)
Definition: unicode.h:170
static ULONG htmldoc_addref(HTMLDocument *This)
static void NSAPI nsDocumentObserver_AttributeChanged(nsIDocumentObserver *iface, nsIDocument *aDocument, nsIContent *aContent, LONG aNameSpaceID, nsIAtom *aAttribute, LONG aModType)
Definition: mutation.c:512
void set_ready_state(HTMLOuterWindow *, READYSTATE) DECLSPEC_HIDDEN
Definition: persist.c:450
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
void doc_insert_script(HTMLInnerWindow *, HTMLScriptElement *) DECLSPEC_HIDDEN
Definition: script.c:1172
static void NSAPI nsDocumentObserver_ContentStatesChanged(nsIDocumentObserver *iface, nsIDocument *aDocument, nsIContent *aContent, EventStates aStateMask)
Definition: mutation.c:573
static void NSAPI nsDocumentObserver_AttemptToExecuteScript(nsIDocumentObserver *iface, nsIContent *aContent, nsIParser *aParser, cpp_bool *aBlock)
Definition: mutation.c:678
BOOL nsAString_Init(nsAString *, const PRUnichar *) DECLSPEC_HIDDEN
Definition: nsembed.c:817
static nsresult NSAPI nsRunnable_Run(nsIRunnable *iface)
Definition: mutation.c:414
void nsAString_Finish(nsAString *) DECLSPEC_HIDDEN
Definition: nsembed.c:836
static const nsIDocumentObserverVtbl nsDocumentObserverVtbl
Definition: mutation.c:696
IHTMLWindow2 IHTMLWindow2_iface
HRESULT nsresult
Definition: nsiface.idl:39
WCHAR PRUnichar
Definition: nsiface.idl:48
static ClassFactoryImpl factory
Definition: ole_server.c:234
static void NSAPI nsDocumentObserver_EndLoad(nsIDocumentObserver *iface, nsIDocument *aDocument)
Definition: mutation.c:560
static void NSAPI nsDocumentObserver_NodeWillBeDestroyed(nsIDocumentObserver *iface, const nsINode *aNode)
Definition: mutation.c:538
#define LIST_ENTRY(type)
Definition: queue.h:175
runnable_proc_t proc
Definition: mutation.c:352
void check_event_attr(HTMLDocumentNode *doc, nsIDOMHTMLElement *nselem)
Definition: htmlevent.c:1559
GLuint64EXT * result
Definition: glext.h:11304
void init_editor(HTMLDocument *This)
Definition: editor.c:1202
static void add_script_runner(HTMLDocumentNode *This, runnable_proc_t proc, nsISupports *arg1, nsISupports *arg2)
Definition: mutation.c:428
HTMLDocumentNode * doc
Definition: mutation.c:354
#define SUCCEEDED(hr)
Definition: intsafe.h:57
ULONG nsrefcnt
Definition: nsiface.idl:40
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
Definition: dlist.c:348
void bind_event_scripts(HTMLDocumentNode *) DECLSPEC_HIDDEN
Definition: script.c:1423