Index: GNUmakefile.am
===================================================================
--- GNUmakefile.am	(revision 35758)
+++ GNUmakefile.am	(working copy)
@@ -101,7 +101,8 @@
 	-I$(srcdir)/JavaScriptCore/ForwardingHeaders \
 	-I$(srcdir)/JavaScriptCore/wtf \
 	-I$(srcdir)/JavaScriptCore/kjs \
-	-I$(top_builddir)/DerivedSources
+	-I$(top_builddir)/DerivedSources \
+	-I$(top_builddir)/WebCore/bindings/gdom
 
 # The variables above are already included below so no need to touch
 # these variables unless you really have to
@@ -220,6 +221,7 @@
 
 # WebKit
 webkitgtk_h_api :=
+gdomgtk_h_api :=
 webkitgtk_sources :=
 webkitgtk_cppflags :=
 webkitgtk_built_sources :=
@@ -232,8 +234,13 @@
 libwebkit_1_0_ladir = $(prefix)/include/webkit-1.0/webkit
 libwebkit_1_0_la_HEADERS = \
 	$(webkitgtk_h_api) \
-	WebKit/gtk/webkit/webkitenumtypes.h
+	$(gdomgtk_h_api) \
+	WebKit/gtk/webkit/webkitenumtypes.h \
+	WebKit/gtk/webkit/gdom.h 
 
+#WebKit/gtk/webkit/gdomenumtypes.h
+#WebKit/gtk/webkit/gdomdefines.h
+
 libwebkit_1_0_la_SOURCES = \
 	$(webkitgtk_sources)
 
@@ -304,6 +311,342 @@
 webcore_libadd += -lgstinterfaces-0.10 -lgstvideo-0.10
 endif
 
+WebKit/gtk/webkit/webkitwebframe.h: WebKit/gtk/webkit/GdomDocument.h \
+                                    WebKit/gtk/webkit/GdomXMLHttpRequest.h
+
+WebKit/gtk/webkit/GdomXMLHttpRequest.h: DerivedSources/GdomXMLHttpRequest.h
+	cp DerivedSources/GdomXMLHttpRequest.h WebKit/gtk/webkit/GdomXMLHttpRequest.h
+
+WebKit/gtk/webkit/GdomDocument.h: DerivedSources/GdomDocument.h
+	cp DerivedSources/GdomDocument.h WebKit/gtk/webkit/GdomDocument.h
+
+WebKit/gtk/webkit/GdomDOMObject.h: WebCore/bindings/gdom/GdomDOMObject.h
+	cp WebCore/bindings/gdom/GdomDOMObject.h WebKit/gtk/webkit/GdomDOMObject.h
+
+WebKit/gtk/webkit/GdomEventTargetNode.h: WebCore/bindings/gdom/GdomEventTargetNode.h
+	cp WebCore/bindings/gdom/GdomEventTargetNode.h WebKit/gtk/webkit/GdomEventTargetNode.h
+
+
+gdomgtk_h_api += \
+	WebKit/gtk/webkit/GdomDocument.h\
+	WebKit/gtk/webkit/GdomEventTargetNode.h\
+	WebKit/gtk/webkit/GdomDOMObject.h\
+	DerivedSources/GdomAttr.h\
+	DerivedSources/GdomAttrprops.h\
+	DerivedSources/GdomBarInfo.h\
+	DerivedSources/GdomBarInfoprops.h\
+	DerivedSources/GdomCanvasGradient.h\
+	DerivedSources/GdomCanvasGradientprops.h\
+	DerivedSources/GdomCanvasPattern.h\
+	DerivedSources/GdomCanvasPatternprops.h\
+	DerivedSources/GdomCanvasPixelArray.h\
+	DerivedSources/GdomCanvasPixelArrayprops.h\
+	DerivedSources/GdomCanvasRenderingContext2D.h\
+	DerivedSources/GdomCanvasRenderingContext2Dprops.h\
+	DerivedSources/GdomCDATASection.h\
+	DerivedSources/GdomCDATASectionprops.h\
+	DerivedSources/GdomCharacterData.h\
+	DerivedSources/GdomCharacterDataprops.h\
+	DerivedSources/GdomClipboard.h\
+	DerivedSources/GdomClipboardprops.h\
+	DerivedSources/GdomComment.h\
+	DerivedSources/GdomCommentprops.h\
+	DerivedSources/GdomConsole.h\
+	DerivedSources/GdomConsoleprops.h\
+	DerivedSources/GdomCounter.h\
+	DerivedSources/GdomCounterprops.h\
+	DerivedSources/GdomCSSCharsetRule.h\
+	DerivedSources/GdomCSSCharsetRuleprops.h\
+	DerivedSources/GdomCSSFontFaceRule.h\
+	DerivedSources/GdomCSSFontFaceRuleprops.h\
+	DerivedSources/GdomCSSImportRule.h\
+	DerivedSources/GdomCSSImportRuleprops.h\
+	DerivedSources/GdomCSSMediaRule.h\
+	DerivedSources/GdomCSSMediaRuleprops.h\
+	DerivedSources/GdomCSSPageRule.h\
+	DerivedSources/GdomCSSPageRuleprops.h\
+	DerivedSources/GdomCSSPrimitiveValue.h\
+	DerivedSources/GdomCSSPrimitiveValueprops.h\
+	DerivedSources/GdomCSSRule.h\
+	DerivedSources/GdomCSSRuleList.h\
+	DerivedSources/GdomCSSRuleListprops.h\
+	DerivedSources/GdomCSSRuleprops.h\
+	DerivedSources/GdomCSSStyleDeclaration.h\
+	DerivedSources/GdomCSSStyleDeclarationprops.h\
+	DerivedSources/GdomCSSStyleRule.h\
+	DerivedSources/GdomCSSStyleRuleprops.h\
+	DerivedSources/GdomCSSStyleSheet.h\
+	DerivedSources/GdomCSSStyleSheetprops.h\
+	DerivedSources/GdomCSSValue.h\
+	DerivedSources/GdomCSSValueList.h\
+	DerivedSources/GdomCSSValueListprops.h\
+	DerivedSources/GdomCSSValueprops.h\
+	DerivedSources/GdomCSSVariablesDeclaration.h\
+	DerivedSources/GdomCSSVariablesDeclarationprops.h\
+	DerivedSources/GdomCSSVariablesRule.h\
+	DerivedSources/GdomCSSVariablesRuleprops.h\
+	DerivedSources/GdomDatabase.h\
+	DerivedSources/GdomDatabaseprops.h\
+	DerivedSources/GdomDocumentFragment.h\
+	DerivedSources/GdomDocumentFragmentprops.h\
+	DerivedSources/GdomDocumentprops.h\
+	DerivedSources/GdomDocumentType.h\
+	DerivedSources/GdomDocumentTypeprops.h\
+	DerivedSources/GdomDOMApplicationCache.h\
+	DerivedSources/GdomDOMApplicationCacheprops.h\
+	DerivedSources/GdomDOMCoreException.h\
+	DerivedSources/GdomDOMCoreExceptionprops.h\
+	DerivedSources/GdomDOMImplementation.h\
+	DerivedSources/GdomDOMImplementationprops.h\
+	DerivedSources/GdomDOMParser.h\
+	DerivedSources/GdomDOMParserprops.h\
+	DerivedSources/GdomDOMSelection.h\
+	DerivedSources/GdomDOMSelectionprops.h\
+	DerivedSources/GdomDOMWindow.h\
+	DerivedSources/GdomDOMWindowprops.h\
+	DerivedSources/GdomElement.h\
+	DerivedSources/GdomElementprops.h\
+	DerivedSources/GdomEntity.h\
+	DerivedSources/GdomEntityprops.h\
+	DerivedSources/GdomEntityReference.h\
+	DerivedSources/GdomEntityReferenceprops.h\
+	DerivedSources/GdomEventException.h\
+	DerivedSources/GdomEventExceptionprops.h\
+	DerivedSources/GdomEvent.h\
+	DerivedSources/GdomEventprops.h\
+	DerivedSources/GdomFile.h\
+	DerivedSources/GdomFileList.h\
+	DerivedSources/GdomFileListprops.h\
+	DerivedSources/GdomFileprops.h\
+	DerivedSources/GdomHistory.h\
+	DerivedSources/GdomHistoryprops.h\
+	DerivedSources/GdomHTMLAnchorElement.h\
+	DerivedSources/GdomHTMLAnchorElementprops.h\
+	DerivedSources/GdomHTMLAppletElement.h\
+	DerivedSources/GdomHTMLAppletElementprops.h\
+	DerivedSources/GdomHTMLAreaElement.h\
+	DerivedSources/GdomHTMLAreaElementprops.h\
+	DerivedSources/GdomHTMLBaseElement.h\
+	DerivedSources/GdomHTMLBaseElementprops.h\
+	DerivedSources/GdomHTMLBaseFontElement.h\
+	DerivedSources/GdomHTMLBaseFontElementprops.h\
+	DerivedSources/GdomHTMLBlockquoteElement.h\
+	DerivedSources/GdomHTMLBlockquoteElementprops.h\
+	DerivedSources/GdomHTMLBodyElement.h\
+	DerivedSources/GdomHTMLBodyElementprops.h\
+	DerivedSources/GdomHTMLBRElement.h\
+	DerivedSources/GdomHTMLBRElementprops.h\
+	DerivedSources/GdomHTMLButtonElement.h\
+	DerivedSources/GdomHTMLButtonElementprops.h\
+	DerivedSources/GdomHTMLCanvasElement.h\
+	DerivedSources/GdomHTMLCanvasElementprops.h\
+	DerivedSources/GdomHTMLCollection.h\
+	DerivedSources/GdomHTMLCollectionprops.h\
+	DerivedSources/GdomHTMLDirectoryElement.h\
+	DerivedSources/GdomHTMLDirectoryElementprops.h\
+	DerivedSources/GdomHTMLDivElement.h\
+	DerivedSources/GdomHTMLDivElementprops.h\
+	DerivedSources/GdomHTMLDListElement.h\
+	DerivedSources/GdomHTMLDListElementprops.h\
+	DerivedSources/GdomHTMLDocument.h\
+	DerivedSources/GdomHTMLDocumentprops.h\
+	DerivedSources/GdomHTMLElement.h\
+	DerivedSources/GdomHTMLElementprops.h\
+	DerivedSources/GdomHTMLEmbedElement.h\
+	DerivedSources/GdomHTMLEmbedElementprops.h\
+	DerivedSources/GdomHTMLFieldSetElement.h\
+	DerivedSources/GdomHTMLFieldSetElementprops.h\
+	DerivedSources/GdomHTMLFontElement.h\
+	DerivedSources/GdomHTMLFontElementprops.h\
+	DerivedSources/GdomHTMLFormElement.h\
+	DerivedSources/GdomHTMLFormElementprops.h\
+	DerivedSources/GdomHTMLFrameElement.h\
+	DerivedSources/GdomHTMLFrameElementprops.h\
+	DerivedSources/GdomHTMLFrameSetElement.h\
+	DerivedSources/GdomHTMLFrameSetElementprops.h\
+	DerivedSources/GdomHTMLHeadElement.h\
+	DerivedSources/GdomHTMLHeadElementprops.h\
+	DerivedSources/GdomHTMLHeadingElement.h\
+	DerivedSources/GdomHTMLHeadingElementprops.h\
+	DerivedSources/GdomHTMLHRElement.h\
+	DerivedSources/GdomHTMLHRElementprops.h\
+	DerivedSources/GdomHTMLHtmlElement.h\
+	DerivedSources/GdomHTMLHtmlElementprops.h\
+	DerivedSources/GdomHTMLIFrameElement.h\
+	DerivedSources/GdomHTMLIFrameElementprops.h\
+	DerivedSources/GdomHTMLImageElement.h\
+	DerivedSources/GdomHTMLImageElementprops.h\
+	DerivedSources/GdomHTMLInputElement.h\
+	DerivedSources/GdomHTMLInputElementprops.h\
+	DerivedSources/GdomHTMLIsIndexElement.h\
+	DerivedSources/GdomHTMLIsIndexElementprops.h\
+	DerivedSources/GdomHTMLLabelElement.h\
+	DerivedSources/GdomHTMLLabelElementprops.h\
+	DerivedSources/GdomHTMLLegendElement.h\
+	DerivedSources/GdomHTMLLegendElementprops.h\
+	DerivedSources/GdomHTMLLIElement.h\
+	DerivedSources/GdomHTMLLIElementprops.h\
+	DerivedSources/GdomHTMLLinkElement.h\
+	DerivedSources/GdomHTMLLinkElementprops.h\
+	DerivedSources/GdomHTMLMapElement.h\
+	DerivedSources/GdomHTMLMapElementprops.h\
+	DerivedSources/GdomHTMLMarqueeElement.h\
+	DerivedSources/GdomHTMLMarqueeElementprops.h\
+	DerivedSources/GdomHTMLMenuElement.h\
+	DerivedSources/GdomHTMLMenuElementprops.h\
+	DerivedSources/GdomHTMLMetaElement.h\
+	DerivedSources/GdomHTMLMetaElementprops.h\
+	DerivedSources/GdomHTMLModElement.h\
+	DerivedSources/GdomHTMLModElementprops.h\
+	DerivedSources/GdomHTMLObjectElement.h\
+	DerivedSources/GdomHTMLObjectElementprops.h\
+	DerivedSources/GdomHTMLOListElement.h\
+	DerivedSources/GdomHTMLOListElementprops.h\
+	DerivedSources/GdomHTMLOptGroupElement.h\
+	DerivedSources/GdomHTMLOptGroupElementprops.h\
+	DerivedSources/GdomHTMLOptionElement.h\
+	DerivedSources/GdomHTMLOptionElementprops.h\
+	DerivedSources/GdomHTMLOptionsCollection.h\
+	DerivedSources/GdomHTMLOptionsCollectionprops.h\
+	DerivedSources/GdomHTMLParagraphElement.h\
+	DerivedSources/GdomHTMLParagraphElementprops.h\
+	DerivedSources/GdomHTMLParamElement.h\
+	DerivedSources/GdomHTMLParamElementprops.h\
+	DerivedSources/GdomHTMLPreElement.h\
+	DerivedSources/GdomHTMLPreElementprops.h\
+	DerivedSources/GdomHTMLQuoteElement.h\
+	DerivedSources/GdomHTMLQuoteElementprops.h\
+	DerivedSources/GdomHTMLScriptElement.h\
+	DerivedSources/GdomHTMLScriptElementprops.h\
+	DerivedSources/GdomHTMLSelectElement.h\
+	DerivedSources/GdomHTMLSelectElementprops.h\
+	DerivedSources/GdomHTMLStyleElement.h\
+	DerivedSources/GdomHTMLStyleElementprops.h\
+	DerivedSources/GdomHTMLTableCaptionElement.h\
+	DerivedSources/GdomHTMLTableCaptionElementprops.h\
+	DerivedSources/GdomHTMLTableCellElement.h\
+	DerivedSources/GdomHTMLTableCellElementprops.h\
+	DerivedSources/GdomHTMLTableColElement.h\
+	DerivedSources/GdomHTMLTableColElementprops.h\
+	DerivedSources/GdomHTMLTableElement.h\
+	DerivedSources/GdomHTMLTableElementprops.h\
+	DerivedSources/GdomHTMLTableRowElement.h\
+	DerivedSources/GdomHTMLTableRowElementprops.h\
+	DerivedSources/GdomHTMLTableSectionElement.h\
+	DerivedSources/GdomHTMLTableSectionElementprops.h\
+	DerivedSources/GdomHTMLTextAreaElement.h\
+	DerivedSources/GdomHTMLTextAreaElementprops.h\
+	DerivedSources/GdomHTMLTitleElement.h\
+	DerivedSources/GdomHTMLTitleElementprops.h\
+	DerivedSources/GdomHTMLUListElement.h\
+	DerivedSources/GdomHTMLUListElementprops.h\
+	DerivedSources/GdomImageData.h\
+	DerivedSources/GdomImageDataprops.h\
+	DerivedSources/GdomJavaScriptCallFrame.h\
+	DerivedSources/GdomJavaScriptCallFrameprops.h\
+	DerivedSources/GdomKeyboardEvent.h\
+	DerivedSources/GdomKeyboardEventprops.h\
+	DerivedSources/GdomLocation.h\
+	DerivedSources/GdomLocationprops.h\
+	DerivedSources/GdomMediaList.h\
+	DerivedSources/GdomMediaListprops.h\
+	DerivedSources/GdomMessageEvent.h\
+	DerivedSources/GdomMessageEventprops.h\
+	DerivedSources/GdomMimeTypeArray.h\
+	DerivedSources/GdomMimeTypeArrayprops.h\
+	DerivedSources/GdomMimeType.h\
+	DerivedSources/GdomMimeTypeprops.h\
+	DerivedSources/GdomMouseEvent.h\
+	DerivedSources/GdomMouseEventprops.h\
+	DerivedSources/GdomMutationEvent.h\
+	DerivedSources/GdomMutationEventprops.h\
+	DerivedSources/GdomNamedNodeMap.h\
+	DerivedSources/GdomNamedNodeMapprops.h\
+	DerivedSources/GdomNavigator.h\
+	DerivedSources/GdomNavigatorprops.h\
+	DerivedSources/GdomNodeFilter.h\
+	DerivedSources/GdomNodeFilterprops.h\
+	DerivedSources/GdomNode.h\
+	DerivedSources/GdomNodeIterator.h\
+	DerivedSources/GdomNodeIteratorprops.h\
+	DerivedSources/GdomNodeList.h\
+	DerivedSources/GdomNodeListprops.h\
+	DerivedSources/GdomNodeprops.h\
+	DerivedSources/GdomNotation.h\
+	DerivedSources/GdomNotationprops.h\
+	DerivedSources/GdomOverflowEvent.h\
+	DerivedSources/GdomOverflowEventprops.h\
+	DerivedSources/GdomPluginArray.h\
+	DerivedSources/GdomPluginArrayprops.h\
+	DerivedSources/GdomPlugin.h\
+	DerivedSources/GdomPluginprops.h\
+	DerivedSources/GdomProcessingInstruction.h\
+	DerivedSources/GdomProcessingInstructionprops.h\
+	DerivedSources/GdomProgressEvent.h\
+	DerivedSources/GdomProgressEventprops.h\
+	DerivedSources/GdomRangeException.h\
+	DerivedSources/GdomRangeExceptionprops.h\
+	DerivedSources/GdomRange.h\
+	DerivedSources/GdomRangeprops.h\
+	DerivedSources/GdomRect.h\
+	DerivedSources/GdomRectprops.h\
+	DerivedSources/GdomScreen.h\
+	DerivedSources/GdomScreenprops.h\
+	DerivedSources/GdomSQLError.h\
+	DerivedSources/GdomSQLErrorprops.h\
+	DerivedSources/GdomSQLResultSet.h\
+	DerivedSources/GdomSQLResultSetprops.h\
+	DerivedSources/GdomSQLResultSetRowList.h\
+	DerivedSources/GdomSQLResultSetRowListprops.h\
+	DerivedSources/GdomSQLTransaction.h\
+	DerivedSources/GdomSQLTransactionprops.h\
+	DerivedSources/GdomStorageEvent.h\
+	DerivedSources/GdomStorageEventprops.h\
+	DerivedSources/GdomStorage.h\
+	DerivedSources/GdomStorageprops.h\
+	DerivedSources/GdomStyleSheet.h\
+	DerivedSources/GdomStyleSheetList.h\
+	DerivedSources/GdomStyleSheetListprops.h\
+	DerivedSources/GdomStyleSheetprops.h\
+	DerivedSources/GdomTextEvent.h\
+	DerivedSources/GdomTextEventprops.h\
+	DerivedSources/GdomText.h\
+	DerivedSources/GdomTextprops.h\
+	DerivedSources/GdomTreeWalker.h\
+	DerivedSources/GdomTreeWalkerprops.h\
+	DerivedSources/GdomUIEvent.h\
+	DerivedSources/GdomUIEventprops.h\
+	DerivedSources/GdomWebKitAnimationEvent.h\
+	DerivedSources/GdomWebKitAnimationEventprops.h\
+	DerivedSources/GdomWebKitCSSTransformValue.h\
+	DerivedSources/GdomWebKitCSSTransformValueprops.h\
+	DerivedSources/GdomWebKitTransitionEvent.h\
+	DerivedSources/GdomWebKitTransitionEventprops.h\
+	DerivedSources/GdomWheelEvent.h\
+	DerivedSources/GdomWheelEventprops.h\
+	DerivedSources/GdomXMLHttpRequestException.h\
+	DerivedSources/GdomXMLHttpRequestExceptionprops.h\
+	DerivedSources/GdomXMLHttpRequest.h\
+	DerivedSources/GdomXMLHttpRequestProgressEvent.h\
+	DerivedSources/GdomXMLHttpRequestProgressEventprops.h\
+	DerivedSources/GdomXMLHttpRequestprops.h\
+	DerivedSources/GdomXMLHttpRequestUpload.h\
+	DerivedSources/GdomXMLHttpRequestUploadprops.h\
+	DerivedSources/GdomXMLSerializer.h\
+	DerivedSources/GdomXMLSerializerprops.h\
+	DerivedSources/GdomXPathEvaluator.h\
+	DerivedSources/GdomXPathEvaluatorprops.h\
+	DerivedSources/GdomXPathException.h\
+	DerivedSources/GdomXPathExceptionprops.h\
+	DerivedSources/GdomXPathExpression.h\
+	DerivedSources/GdomXPathExpressionprops.h\
+	DerivedSources/GdomXPathNSResolver.h\
+	DerivedSources/GdomXPathNSResolverprops.h\
+	DerivedSources/GdomXPathResult.h\
+	DerivedSources/GdomXPathResultprops.h\
+	DerivedSources/GdomXSLTProcessor.h\
+	DerivedSources/GdomXSLTProcessorprops.h
+
 webkitgtk_h_api += \
 	WebKit/gtk/webkit/webkit.h \
 	WebKit/gtk/webkit/webkitdefines.h \
@@ -315,12 +658,17 @@
 	WebKit/gtk/webkit/webkitwebsettings.h \
 	WebKit/gtk/webkit/webkitwebview.h
 
+# WebKit/gtk/webkit/webkitgdomdefines.h
+
 webkitgtk_built_sources += \
 	DerivedSources/webkitenumtypes.cpp \
 	DerivedSources/webkitmarshal.cpp \
 	DerivedSources/webkitmarshal.h \
 	WebKit/gtk/webkit/webkitenumtypes.h
 
+#	DerivedSources/gdomenumtypes.cpp 
+#	WebKit/gtk/webkit/gdomenumtypes.h
+
 webkitgtk_sources += \
 	WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp \
 	WebKit/gtk/WebCoreSupport/ChromeClientGtk.h \
@@ -344,7 +692,9 @@
 	WebKit/gtk/webkit/webkitwebframe.cpp \
 	WebKit/gtk/webkit/webkitwebhistoryitem.cpp \
 	WebKit/gtk/webkit/webkitwebsettings.cpp \
-	WebKit/gtk/webkit/webkitwebview.cpp
+	WebKit/gtk/webkit/webkitwebview.cpp \
+	WebKit/gtk/webkit/webkitevent.cpp  \
+	WebKit/gtk/webkit/webkitevent.h 
 
 webkitgtk_cppflags += \
 	-DBUILDING_WEBKIT \
@@ -366,6 +716,9 @@
 	stamp-webkitenumtypes.cpp \
 	stamp-webkitenumtypes.h
 
+#	stamp-gdomenumtypes.cpp 
+#	stamp-gdomenumtypes.h 
+
 WEBKIT_MARSHAL = $(GENSOURCES)/webkitmarshal
 WEBKIT_MARSHAL_LIST = $(WEBKIT_MARSHAL).list
 
@@ -442,6 +795,54 @@
 	&& cp xgen-gtc $@ \
 	&& rm -f xgen-gtc
 
+WebKit/gtk/webkit/gdomenumtypes.h: stamp-gdomenumtypes.h
+	@true
+stamp-gdomenumtypes.h: $(gdomgtk_h_api) GNUmakefile
+	(cd $(srcdir) \
+	&& glib-mkenums \
+			--fhead "#ifndef GDOM_ENUM_TYPES_H\n" \
+			--fhead "#define GDOM_ENUM_TYPES_H\n\n" \
+			--fhead "#include <glib-object.h>\n\n" \
+			--fhead "G_BEGIN_DECLS\n\n" \
+			--ftail "G_END_DECLS\n\n" \
+			--ftail "#endif\n" \
+			--fprod "#include <@filename@>\n\n" \
+			--eprod "#define GDOM_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n\n" \
+			--eprod "WEBKIT_API GType\n@enum_name@_get_type(void);\n\n" \
+			$(gdomgtk_h_api) | \
+			sed 's,WebKit/gtk/,,' | \
+		sed 's,web_kit,gdom,' | \
+		sed 's,GDOM_TYPE_KIT,GDOM_TYPE,' \
+		) > xgen-cgth \
+	&& (cmp -s xgen-cgth WebKit/gtk/webkit/gdomenumtypes.h || cp xgen-cgth WebKit/gtk/webkit/gdomenumtypes.h) \
+	&& rm -f xgen-cgth \
+	&& echo timestamp > $(@F)
+
+#              --fhead "#include <webkit/gdomdefines.h>\n\n" 
+
+DerivedSources/gdomenumtypes.cpp: $(gdomgtk_h_api) GNUmakefile
+	(cd $(srcdir) \
+	&& glib-mkenums \
+			--fhead "#include <config.h>\n" \
+			--fhead "#include <glib-object.h>\n" \
+			--fhead "#include \"$(top_builddir)/WebKit/gtk/webkit/gdomenumtypes.h\"\n\n" \
+			--fhead "extern \"C\" {\n\n" \
+			--fprod "\n/* enumerations from \"@filename@\" */" \
+			--vhead "static const G@Type@Value _@enum_name@_values[] = {" \
+			--vprod "    { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
+			--vtail "    { 0, NULL, NULL }\n};\n\n" \
+			--vtail "GType @enum_name@_get_type(void)\n{\n" \
+			--vtail "    static GType type = 0;\n\n" \
+			--vtail "    if (!type)\n" \
+			--vtail "        type = g_@type@_register_static(\"@EnumName@\", _@enum_name@_values);\n\n" \
+			--vtail "    return type;\n}\n\n" \
+			--ftail "}\n" \
+		$(gdomgtk_h_api) | \
+		sed 's,web_kit,gdom,' \
+		) > xgen-cgtc \
+	&& cp xgen-cgtc $@ \
+	&& rm -f xgen-cgtc
+
 # END WEBKIT GTK+
 #
 # Files that will be distributed
Index: WebKit/gtk/webkit/webkitwebframe.cpp
===================================================================
--- WebKit/gtk/webkit/webkitwebframe.cpp	(revision 36015)
+++ WebKit/gtk/webkit/webkitwebframe.cpp	(working copy)
@@ -1,11 +1,13 @@
 /*
  * Copyright (C) 2007, 2008 Holger Hans Peter Freyther
+ * Copyright (C) 2008 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
  * Copyright (C) 2007 Alp Toker <alp@atoker.com>
  * Copyright (C) 2007 Apple Inc.
  * Copyright (C) 2008 Christian Dywan <christian@imendio.com>
  * Copyright (C) 2008 Collabora Ltd.
  * Copyright (C) 2008 Nuanti Ltd.
  *
+ *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
  * License as published by the Free Software Foundation; either
@@ -42,6 +44,15 @@
 #include "RenderTreeAsText.h"
 #include "JSDOMBinding.h"
 #include "ScriptController.h"
+#include "GdomDocument.h"
+#include "GdomXMLHttpRequest.h"
+#include "GDOMObject.h"
+#include "PrivateIntGdomXMLHttpRequest.h"
+#include "PrivateGdomXMLHttpRequest.h"
+#include "PrivateIntGdomDocument.h"
+#include "PrivateGdomDocument.h"
+#include "GdomEvent.h"
+#include "EventListenerWindow.h"
 
 #include <JavaScriptCore/APICast.h>
 
@@ -49,6 +60,11 @@
 using namespace WebCore;
 using namespace std;
 
+namespace WebCore {
+	gpointer toGDOM(Document* doc);
+	gpointer toGDOM(XMLHttpRequest* obj);
+}
+
 extern "C" {
 
 enum {
@@ -57,6 +73,7 @@
     LOAD_DONE,
     TITLE_CHANGED,
     HOVERING_OVER_LINK,
+    BROWSER_EVENT,
     LAST_SIGNAL
 };
 
@@ -162,6 +179,16 @@
             G_TYPE_NONE, 2,
             G_TYPE_STRING, G_TYPE_STRING);
 
+    webkit_web_frame_signals[BROWSER_EVENT] = g_signal_new("browser-event",
+            G_TYPE_FROM_CLASS(frameClass),
+            (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
+            0,
+            NULL,
+            NULL,
+            webkit_marshal_VOID__OBJECT_BOOLEAN,
+            G_TYPE_NONE, 2,
+            GDOM_TYPE_EVENT, G_TYPE_BOOLEAN);
+
     /*
      * implementations of virtual methods
      */
@@ -294,6 +321,112 @@
 }
 
 /**
+ * webkit_web_frame_get_xml_http_request:
+ * @frame: a #WebKitWebFrame
+ *
+ * returns a Gdom wrapper around an XMLHttpRequest
+ *
+ * Return value: a GdomXMLHttpRequest
+ */
+GdomXMLHttpRequest* webkit_web_frame_get_xml_http_request(WebKitWebFrame* frame)
+{
+    g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), NULL);
+
+    //WebKitWebFramePrivate* priv = frame->priv;
+
+    Frame* coreFrame = core(frame);
+    ASSERT(coreFrame);
+	return GDOM_XML_HTTP_REQUEST(WebCore::toGDOM(XMLHttpRequest::create(coreFrame->document()).get()));
+}
+
+/**
+ * webkit_web_frame_create_xhtml_dom_document:
+ * @frame: a #WebKitWebFrame
+ *
+ * returns a Gdom wrapper around a new Document, XHTML formatted
+ *
+ * Return value: a GdomDocument
+ */
+GdomDocument* webkit_web_frame_create_xhtml_dom_document(WebKitWebFrame* frame)
+{
+    g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), NULL);
+
+    //WebKitWebFramePrivate* priv = frame->priv;
+
+    Frame* coreFrame = core(frame);
+    ASSERT(coreFrame);
+	PassRefPtr<Document> doc = Document::createXHTML(coreFrame);
+	return GDOM_DOCUMENT(WebCore::toGDOM(doc.get()));
+}
+
+/**
+ * webkit_web_frame_create_dom_document:
+ * @frame: a #WebKitWebFrame
+ *
+ * returns a Gdom wrapper around a new Document 
+ *
+ * Return value: a GdomDocument
+ */
+GdomDocument* webkit_web_frame_create_dom_document(WebKitWebFrame* frame)
+{
+    g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), NULL);
+
+    //WebKitWebFramePrivate* priv = frame->priv;
+
+    Frame* coreFrame = core(frame);
+    ASSERT(coreFrame);
+	PassRefPtr<Document> doc = Document::create(coreFrame);
+	return GDOM_DOCUMENT(WebCore::toGDOM(doc.get()));
+}
+
+/**
+ * webkit_web_frame_get_dom_document:
+ * @frame: a #WebKitWebFrame
+ *
+ * returns a Gdom wrapper around a Document 
+ *
+ * Return value: a GdomDocument
+ */
+GdomDocument* webkit_web_frame_get_dom_document(WebKitWebFrame* frame)
+{
+    g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), NULL);
+
+    //WebKitWebFramePrivate* priv = frame->priv;
+
+    Frame* coreFrame = core(frame);
+    ASSERT(coreFrame);
+	return GDOM_DOCUMENT(WebCore::toGDOM(coreFrame->document()));
+}
+
+/* XXX TODO: make this not take frame* as an argument,
+ * and make it return a GdomEventListener class */
+extern "C" {
+WEBKIT_API gboolean
+add_window_event_listener(WebKitWebFrame* wf, Frame *frame, const char *name);
+}
+
+/**
+ * webkit_web_frame_add_event_listener:
+ * @frame: a #WebKitWebFrame
+ *
+ * adds an event listener to the frame's document
+ *
+ * Return value: the name of @frame
+ */
+gboolean webkit_web_frame_add_event_listener(WebKitWebFrame* frame,
+                                             const gchar* event_type)
+{
+    g_return_val_if_fail(WEBKIT_IS_WEB_FRAME(frame), FALSE);
+
+    //WebKitWebFramePrivate* priv = frame->priv;
+
+    Frame* coreFrame = core(frame);
+    ASSERT(coreFrame);
+
+	return add_window_event_listener(frame, coreFrame, event_type);
+}
+
+/**
  * webkit_web_frame_get_name:
  * @frame: a #WebKitWebFrame
  *
Index: WebKit/gtk/webkit/EventListenerNode.h
===================================================================
--- WebKit/gtk/webkit/EventListenerNode.h	(revision 0)
+++ WebKit/gtk/webkit/EventListenerNode.h	(revision 0)
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2008 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+
+#ifndef JS_DOM_EVENT_LISTENER_NODE_H
+#define JS_DOM_EVENT_LISTENER_NODE_H
+
+#include <glib.h>
+#include <webkit/webkitdefines.h>
+
+
+#include "GdomEventTargetNode.h"
+
+/* TODO: return the actual event listener created, which requires
+ * a glib wrapper object to be created.
+ * TODO: provide a 'remove_event_listener' which takes that glib
+ * object as an argument */
+extern "C" {
+WEBKIT_API
+gboolean add_event_listener(GdomEventTargetNode *wf, const char *name,
+                            gboolean useCapture);
+}
+
+#endif /*JS_DOM_EVENT_LISTENER_NODE_H */
Index: WebKit/gtk/webkit/webkitwebframe.h
===================================================================
--- WebKit/gtk/webkit/webkitwebframe.h	(revision 36015)
+++ WebKit/gtk/webkit/webkitwebframe.h	(working copy)
@@ -1,6 +1,7 @@
 /*
  * Copyright (C) 2007 Holger Hans Peter Freyther
  * Copyright (C) 2007 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2008 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -26,6 +27,8 @@
 
 #include <webkit/webkitdefines.h>
 #include <webkit/webkitnetworkrequest.h>
+#include <webkit/GdomDocument.h>
+#include <webkit/GdomXMLHttpRequest.h>
 
 G_BEGIN_DECLS
 
@@ -61,6 +64,18 @@
 WEBKIT_API WebKitWebFrame *
 webkit_web_frame_new                (WebKitWebView        *web_view);
 
+WEBKIT_API GdomXMLHttpRequest *
+webkit_web_frame_get_xml_http_request       (WebKitWebFrame       *frame);
+
+WEBKIT_API GdomDocument *
+webkit_web_frame_get_dom_document       (WebKitWebFrame       *frame);
+
+WEBKIT_API GdomDocument *
+webkit_web_frame_create_dom_document       (WebKitWebFrame       *frame);
+
+WEBKIT_API GdomDocument *
+webkit_web_frame_create_xhtml_dom_document       (WebKitWebFrame       *frame);
+
 WEBKIT_API WebKitWebView *
 webkit_web_frame_get_web_view       (WebKitWebFrame       *frame);
 
@@ -93,6 +108,10 @@
 WEBKIT_API JSGlobalContextRef
 webkit_web_frame_get_global_context (WebKitWebFrame       *frame);
 
+WEBKIT_API gboolean
+webkit_web_frame_add_event_listener(WebKitWebFrame* frame,
+                                     const gchar          *name);
+
 G_END_DECLS
 
 #endif
Index: WebKit/gtk/webkit/EventListenerWindow.h
===================================================================
--- WebKit/gtk/webkit/EventListenerWindow.h	(revision 0)
+++ WebKit/gtk/webkit/EventListenerWindow.h	(revision 0)
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2008 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+
+#ifndef JS_DOM_EVENT_LISTENER_WINDOW_H
+#define JS_DOM_EVENT_LISTENER_WINDOW_H
+
+#include <glib.h>
+#include <webkit/webkitdefines.h>
+
+
+extern "C" {
+/* TODO: make a GdomEventListener class, to be returned here */
+}
+
+#endif /*JS_DOM_EVENT_LISTENER_WINDOW_H */
Index: WebKit/gtk/webkit/EventListenerXMLHttpRequest.h
===================================================================
--- WebKit/gtk/webkit/EventListenerXMLHttpRequest.h	(revision 0)
+++ WebKit/gtk/webkit/EventListenerXMLHttpRequest.h	(revision 0)
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2008 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+
+#ifndef JS_DOM_EVENT_LISTENER_XML_HTTP_REQUEST_H
+#define JS_DOM_EVENT_LISTENER_XML_HTTP_REQUEST_H
+
+#include <glib.h>
+#include <webkit/webkitdefines.h>
+
+
+#include "GdomXMLHttpRequest.h"
+
+/* TODO: return the actual event listener created, which requires
+ * a glib wrapper object to be created.
+ * TODO: provide a 'remove_event_listener' which takes that glib
+ * object as an argument */
+extern "C" {
+WEBKIT_API
+gboolean add_xml_http_request_event_listener(GdomXMLHttpRequest *wf,
+               const char *name);
+}
+
+#endif /*JS_DOM_EVENT_LISTENER_XML_HTTP_REQUEST_H */
Index: WebKit/gtk/webkit/webkitevent.cpp
===================================================================
--- WebKit/gtk/webkit/webkitevent.cpp	(revision 0)
+++ WebKit/gtk/webkit/webkitevent.cpp	(revision 0)
@@ -0,0 +1,260 @@
+/*
+ * Copyright (C) 2007 Holger Hans Peter Freyther
+ * Copyright (C) 2008 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+
+#include "Event.h"
+#include "Event.h"
+#include "CString.h"
+#include "StringImpl.h"
+
+
+#include "config.h"
+#include "HTMLDocument.h"
+
+
+#include "DocumentLoader.h"
+#include "Element.h"
+#include "EventListener.h"
+#include "EventNames.h"
+#include "FrameLoader.h"
+#include "FrameView.h"
+#include "HTMLNames.h"
+#include "Settings.h"
+#include "Node.h"
+#include "XMLHttpRequest.h"
+#include "Frame.h"
+#include "EventListenerXMLHttpRequest.h"
+#include "EventListenerWindow.h"
+#include "EventListenerNode.h"
+#include "EventTargetNode.h"
+#include "HTMLDocument.h"
+#include "CString.h"
+#include "StringImpl.h"
+#include "GdomEvent.h"
+#include "GDOMObject.h"
+#include "PrivateGdomDOMObject.h"
+#include "webkitevent.h"
+#include "PrivateGdomEventTargetNode.h"
+#include "GdomXMLHttpRequest.h"
+#include "PrivateGdomXMLHttpRequest.h"
+
+
+#include <glib-object.h>
+
+
+using namespace WebCore;
+
+namespace WebCore {
+    gpointer toGDOM(Event* doc);
+    gpointer toGDOM(EventTargetNode* node);
+    gpointer toGDOM(XMLHttpRequest* node);
+}
+
+extern "C" {
+
+G_DEFINE_TYPE(WebKitEvent, webkit_event, G_TYPE_OBJECT);
+
+struct _WebKitEventPrivate {
+    Event* event;
+};
+
+#define WEBKIT_EVENT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_EVENT, WebKitEventPrivate))
+
+static void webkit_event_finalize(GObject* object)
+{
+    //WebKitEvent* request = WEBKIT_EVENT(object);
+    //WebKitEventPrivate* priv = request->priv;
+
+    //g_free(priv->uri);
+
+    G_OBJECT_CLASS(webkit_event_parent_class)->finalize(object);
+}
+
+static void webkit_event_class_init(WebKitEventClass* requestClass)
+{
+    G_OBJECT_CLASS(requestClass)->finalize = webkit_event_finalize;
+
+    g_type_class_add_private(requestClass, sizeof(WebKitEventPrivate));
+}
+
+static void webkit_event_init(WebKitEvent* request)
+{
+    WebKitEventPrivate* priv = WEBKIT_EVENT_GET_PRIVATE(request);
+    request->priv = priv;
+}
+
+WebKitEvent* webkit_event_new(void)
+{
+    WebKitEvent* request = WEBKIT_EVENT(g_object_new(WEBKIT_TYPE_EVENT, NULL));
+    //priv->event = event;
+
+    return request;
+}
+
+/*
+void webkit_event_set_uri(WebKitEvent* request, const gchar* uri)
+{
+    g_return_if_fail(WEBKIT_IS_EVENT(request));
+    g_return_if_fail(uri);
+
+    WebKitEventPrivate* priv = request->priv;
+
+    g_free(priv->uri);
+    priv->uri = g_strdup(uri);
+}
+*/
+G_CONST_RETURN gchar* webkit_event_get_event_type(WebKitEvent* request)
+{
+    g_return_val_if_fail(WEBKIT_IS_EVENT(request), NULL);
+
+    WebKitEventPrivate* priv = request->priv;
+    return g_strdup(priv->event->type().string().utf8().data());
+}
+
+void webkit_event_cancel_bubble  (WebKitEvent *request, gboolean cancel)
+{
+    WebKitEventPrivate* priv = request->priv;
+    priv->event->setCancelBubble(cancel);
+}
+
+void webkit_event_prevent_default  (WebKitEvent *request)
+{
+    WebKitEventPrivate* priv = request->priv;
+    priv->event->preventDefault();
+}
+
+void webkit_event_stop_propagation  (WebKitEvent *request)
+{
+    WebKitEventPrivate* priv = request->priv;
+    priv->event->stopPropagation();
+}
+
+WEBKIT_API gboolean
+add_window_event_listener(WebKitWebFrame* wf, Frame *frame, const char *name);
+
+} // extern "C"
+
+class XMLHttpRequestEventListener : public EventListener {
+public:
+    static PassRefPtr<XMLHttpRequestEventListener> create(GdomXMLHttpRequest* wf)
+    { return adoptRef(new XMLHttpRequestEventListener(wf)); }
+    virtual void handleEvent(Event*, bool useCapture);
+
+    private:
+    XMLHttpRequestEventListener(GdomXMLHttpRequest* wf) : m_wf(wf) { }
+    GdomXMLHttpRequest* m_wf;
+};
+
+void XMLHttpRequestEventListener::handleEvent(Event* event, bool useCapture)
+{
+    gboolean retval;
+    /* TODO: see JSEventListener.cpp's handleEvent - some weird stuff... */
+    printf("XMLHttpRequest handleEvent %s\n", event->type().string().utf8().data());
+    GdomEvent *wev = GDOM_EVENT(WebCore::toGDOM(event));
+    g_signal_emit_by_name(m_wf, "browser-event", wev, useCapture, &retval);
+}
+
+class NodeEventListener : public EventListener {
+public:
+    static PassRefPtr<NodeEventListener> create(GdomEventTargetNode* wf)
+    { return adoptRef(new NodeEventListener(wf)); }
+    virtual void handleEvent(Event*, bool useCapture);
+
+    private:
+    NodeEventListener(GdomEventTargetNode* wf) : m_wf(wf) { }
+    GdomEventTargetNode* m_wf;
+};
+
+void NodeEventListener::handleEvent(Event* event, bool useCapture)
+{
+    gboolean retval;
+    printf("node handleEvent %s\n", event->type().string().utf8().data());
+    GdomEvent *wev = GDOM_EVENT(WebCore::toGDOM(event));
+    g_signal_emit_by_name(m_wf, "browser-event", wev, useCapture, &retval);
+}
+
+class WindowEventListener : public EventListener {
+public:
+    static PassRefPtr<WindowEventListener> create(WebKitWebFrame* wf) 
+    { return adoptRef(new WindowEventListener(wf)); }
+    virtual void handleEvent(Event*, bool isWindowEvent);
+
+    private:
+    WindowEventListener(WebKitWebFrame* wf) : m_wf(wf) { }
+    WebKitWebFrame* m_wf;
+};
+
+void WindowEventListener::handleEvent(Event* event, bool isWindowEvent)
+{
+    gboolean retval;
+    printf("window handleEvent %s\n", event->type().string().utf8().data());
+    GdomEvent *wev = GDOM_EVENT(WebCore::toGDOM(event));
+    g_signal_emit_by_name(m_wf, "browser-event", wev, isWindowEvent, &retval);
+}
+
+gboolean add_xml_http_request_event_listener(GdomXMLHttpRequest *wf,
+                            const char *name)
+{
+    WebCore::XMLHttpRequest *req = gdom_xml_http_request_get_private(wf);
+    if (name == NULL)
+        return FALSE;
+    if (req == NULL)
+        return FALSE;
+
+    if (strcmp(name, "onreadystatechange") == 0)
+    {
+        RefPtr<XMLHttpRequestEventListener> listener;
+        listener = XMLHttpRequestEventListener::create(wf);
+        req->setOnReadyStateChangeListener(listener);
+        return TRUE;
+    }
+    return FALSE;
+} 
+
+gboolean add_event_listener(GdomEventTargetNode *wf, const char *name,
+                            gboolean useCapture)
+{
+    WebCore::Node *node = gdom_event_target_node_get_private(wf);
+    if (node == NULL || !node->isEventTargetNode())
+        return FALSE;
+    WebCore::EventTargetNode * etn = (static_cast<WebCore::EventTargetNode *>(node))->toNode();
+    if (etn == NULL)
+        return FALSE;
+
+    RefPtr<NodeEventListener> listener = NodeEventListener::create(wf);
+    etn->addEventListener(name, listener, useCapture);
+
+    return TRUE;
+
+} 
+
+gboolean add_window_event_listener(WebKitWebFrame *wf, Frame *frame,
+                                   const char *name)
+{
+    Document* doc = frame->document();
+
+    RefPtr<WindowEventListener> listener = WindowEventListener::create(wf);
+    doc->addWindowEventListener(name, listener, true);
+
+    return TRUE;
+
+} 
+
Index: WebKit/gtk/webkit/webkitdefines.h
===================================================================
--- WebKit/gtk/webkit/webkitdefines.h	(revision 35758)
+++ WebKit/gtk/webkit/webkitdefines.h	(working copy)
@@ -40,6 +40,9 @@
 
 G_BEGIN_DECLS
 
+typedef struct _WebKitEvent WebKitEvent;
+typedef struct _WebKitEventClass WebKitEventClass;
+
 typedef struct _WebKitNetworkRequest WebKitNetworkRequest;
 typedef struct _WebKitNetworkRequestClass WebKitNetworkRequestClass;
 
Index: WebKit/gtk/webkit/gdomdefines.h
===================================================================
--- WebKit/gtk/webkit/gdomdefines.h	(revision 0)
+++ WebKit/gtk/webkit/gdomdefines.h	(revision 0)
@@ -0,0 +1,529 @@
+/*
+ * Copyright (C) 2008 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
+ * Copyright (C) 2007 Holger Hans Peter Freyther
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef WEBKIT_GDOM_DEFINES_H
+#define WEBKIT_GDOM_DEFINES_H
+
+#include <glib.h>
+
+#ifdef G_OS_WIN32
+    #ifdef BUILDING_WEBKIT_GDOM
+        #define WEBKIT_GDOM_API __declspec(dllexport)
+    #else
+        #define WEBKIT_GDOM_API __declspec(dllimport)
+    #endif
+    #define WEBKIT_GDOM_OBSOLETE_API WEBKIT_GDOM_API
+#else
+    #define WEBKIT_GDOM_API __attribute__((visibility("default")))
+    #define WEBKIT_GDOM_OBSOLETE_API WEBKIT_GDOM_API __attribute__((deprecated))
+#endif
+
+#ifndef WEBKIT_GDOM_API
+    #define WEBKIT_GDOM_API
+#endif
+
+G_BEGIN_DECLS
+
+typedef struct _GdomEventTargetNode GdomEventTargetNode;
+typedef struct _GdomEventTargetNodeClass GdomEventTargetNodeClass;
+typedef struct _GdomDOMObject GdomDOMObject;
+typedef struct _GdomDOMObjectClass GdomDOMObjectClass;
+
+typedef struct _GdomAttr GdomAttr;
+typedef struct _GdomAttrClass GdomAttrClass;
+typedef struct _GdomBarInfo GdomBarInfo;
+typedef struct _GdomBarInfoClass GdomBarInfoClass;
+typedef struct _GdomCanvasGradient GdomCanvasGradient;
+typedef struct _GdomCanvasGradientClass GdomCanvasGradientClass;
+typedef struct _GdomCanvasPattern GdomCanvasPattern;
+typedef struct _GdomCanvasPatternClass GdomCanvasPatternClass;
+typedef struct _GdomCanvasPixelArray GdomCanvasPixelArray;
+typedef struct _GdomCanvasPixelArrayClass GdomCanvasPixelArrayClass;
+typedef struct _GdomCanvasRenderingContext2D GdomCanvasRenderingContext2D;
+typedef struct _GdomCanvasRenderingContext2DClass GdomCanvasRenderingContext2DClass;
+typedef struct _GdomCDATASection GdomCDATASection;
+typedef struct _GdomCDATASectionClass GdomCDATASectionClass;
+typedef struct _GdomCharacterData GdomCharacterData;
+typedef struct _GdomCharacterDataClass GdomCharacterDataClass;
+typedef struct _GdomClipboard GdomClipboard;
+typedef struct _GdomClipboardClass GdomClipboardClass;
+typedef struct _GdomComment GdomComment;
+typedef struct _GdomCommentClass GdomCommentClass;
+typedef struct _GdomConsole GdomConsole;
+typedef struct _GdomConsoleClass GdomConsoleClass;
+typedef struct _GdomCounter GdomCounter;
+typedef struct _GdomCounterClass GdomCounterClass;
+typedef struct _GdomCSSCharsetRule GdomCSSCharsetRule;
+typedef struct _GdomCSSCharsetRuleClass GdomCSSCharsetRuleClass;
+typedef struct _GdomCSSFontFaceRule GdomCSSFontFaceRule;
+typedef struct _GdomCSSFontFaceRuleClass GdomCSSFontFaceRuleClass;
+typedef struct _GdomCSSImportRule GdomCSSImportRule;
+typedef struct _GdomCSSImportRuleClass GdomCSSImportRuleClass;
+typedef struct _GdomCSSMediaRule GdomCSSMediaRule;
+typedef struct _GdomCSSMediaRuleClass GdomCSSMediaRuleClass;
+typedef struct _GdomCSSPageRule GdomCSSPageRule;
+typedef struct _GdomCSSPageRuleClass GdomCSSPageRuleClass;
+typedef struct _GdomCSSPrimitiveValue GdomCSSPrimitiveValue;
+typedef struct _GdomCSSPrimitiveValueClass GdomCSSPrimitiveValueClass;
+typedef struct _GdomCSSRule GdomCSSRule;
+typedef struct _GdomCSSRuleClass GdomCSSRuleClass;
+typedef struct _GdomCSSRuleList GdomCSSRuleList;
+typedef struct _GdomCSSRuleListClass GdomCSSRuleListClass;
+typedef struct _GdomCSSStyleDeclaration GdomCSSStyleDeclaration;
+typedef struct _GdomCSSStyleDeclarationClass GdomCSSStyleDeclarationClass;
+typedef struct _GdomCSSStyleRule GdomCSSStyleRule;
+typedef struct _GdomCSSStyleRuleClass GdomCSSStyleRuleClass;
+typedef struct _GdomCSSStyleSheet GdomCSSStyleSheet;
+typedef struct _GdomCSSStyleSheetClass GdomCSSStyleSheetClass;
+typedef struct _GdomCSSValue GdomCSSValue;
+typedef struct _GdomCSSValueClass GdomCSSValueClass;
+typedef struct _GdomCSSValueList GdomCSSValueList;
+typedef struct _GdomCSSValueListClass GdomCSSValueListClass;
+typedef struct _GdomCSSVariablesDeclaration GdomCSSVariablesDeclaration;
+typedef struct _GdomCSSVariablesDeclarationClass GdomCSSVariablesDeclarationClass;
+typedef struct _GdomCSSVariablesRule GdomCSSVariablesRule;
+typedef struct _GdomCSSVariablesRuleClass GdomCSSVariablesRuleClass;
+typedef struct _GdomDatabase GdomDatabase;
+typedef struct _GdomDatabaseClass GdomDatabaseClass;
+typedef struct _GdomDocumentFragment GdomDocumentFragment;
+typedef struct _GdomDocumentFragmentClass GdomDocumentFragmentClass;
+typedef struct _GdomDocument GdomDocument;
+typedef struct _GdomDocumentClass GdomDocumentClass;
+typedef struct _GdomDocumentType GdomDocumentType;
+typedef struct _GdomDocumentTypeClass GdomDocumentTypeClass;
+typedef struct _GdomDOMApplicationCache GdomDOMApplicationCache;
+typedef struct _GdomDOMApplicationCacheClass GdomDOMApplicationCacheClass;
+typedef struct _GdomDOMCoreException GdomDOMCoreException;
+typedef struct _GdomDOMCoreExceptionClass GdomDOMCoreExceptionClass;
+typedef struct _GdomDOMImplementation GdomDOMImplementation;
+typedef struct _GdomDOMImplementationClass GdomDOMImplementationClass;
+typedef struct _GdomDOMParser GdomDOMParser;
+typedef struct _GdomDOMParserClass GdomDOMParserClass;
+typedef struct _GdomDOMSelection GdomDOMSelection;
+typedef struct _GdomDOMSelectionClass GdomDOMSelectionClass;
+typedef struct _GdomDOMWindow GdomDOMWindow;
+typedef struct _GdomDOMWindowClass GdomDOMWindowClass;
+typedef struct _GdomElement GdomElement;
+typedef struct _GdomElementClass GdomElementClass;
+typedef struct _GdomEntity GdomEntity;
+typedef struct _GdomEntityClass GdomEntityClass;
+typedef struct _GdomEntityReference GdomEntityReference;
+typedef struct _GdomEntityReferenceClass GdomEntityReferenceClass;
+typedef struct _GdomEventException GdomEventException;
+typedef struct _GdomEventExceptionClass GdomEventExceptionClass;
+typedef struct _GdomEvent GdomEvent;
+typedef struct _GdomEventClass GdomEventClass;
+typedef struct _GdomFile GdomFile;
+typedef struct _GdomFileClass GdomFileClass;
+typedef struct _GdomFileList GdomFileList;
+typedef struct _GdomFileListClass GdomFileListClass;
+typedef struct _GdomHistory GdomHistory;
+typedef struct _GdomHistoryClass GdomHistoryClass;
+typedef struct _GdomHTMLAnchorElement GdomHTMLAnchorElement;
+typedef struct _GdomHTMLAnchorElementClass GdomHTMLAnchorElementClass;
+typedef struct _GdomHTMLAppletElement GdomHTMLAppletElement;
+typedef struct _GdomHTMLAppletElementClass GdomHTMLAppletElementClass;
+typedef struct _GdomHTMLAreaElement GdomHTMLAreaElement;
+typedef struct _GdomHTMLAreaElementClass GdomHTMLAreaElementClass;
+typedef struct _GdomHTMLBaseElement GdomHTMLBaseElement;
+typedef struct _GdomHTMLBaseElementClass GdomHTMLBaseElementClass;
+typedef struct _GdomHTMLBaseFontElement GdomHTMLBaseFontElement;
+typedef struct _GdomHTMLBaseFontElementClass GdomHTMLBaseFontElementClass;
+typedef struct _GdomHTMLBlockquoteElement GdomHTMLBlockquoteElement;
+typedef struct _GdomHTMLBlockquoteElementClass GdomHTMLBlockquoteElementClass;
+typedef struct _GdomHTMLBodyElement GdomHTMLBodyElement;
+typedef struct _GdomHTMLBodyElementClass GdomHTMLBodyElementClass;
+typedef struct _GdomHTMLBRElement GdomHTMLBRElement;
+typedef struct _GdomHTMLBRElementClass GdomHTMLBRElementClass;
+typedef struct _GdomHTMLButtonElement GdomHTMLButtonElement;
+typedef struct _GdomHTMLButtonElementClass GdomHTMLButtonElementClass;
+typedef struct _GdomHTMLCanvasElement GdomHTMLCanvasElement;
+typedef struct _GdomHTMLCanvasElementClass GdomHTMLCanvasElementClass;
+typedef struct _GdomHTMLCollection GdomHTMLCollection;
+typedef struct _GdomHTMLCollectionClass GdomHTMLCollectionClass;
+typedef struct _GdomHTMLDirectoryElement GdomHTMLDirectoryElement;
+typedef struct _GdomHTMLDirectoryElementClass GdomHTMLDirectoryElementClass;
+typedef struct _GdomHTMLDivElement GdomHTMLDivElement;
+typedef struct _GdomHTMLDivElementClass GdomHTMLDivElementClass;
+typedef struct _GdomHTMLDListElement GdomHTMLDListElement;
+typedef struct _GdomHTMLDListElementClass GdomHTMLDListElementClass;
+typedef struct _GdomHTMLDocument GdomHTMLDocument;
+typedef struct _GdomHTMLDocumentClass GdomHTMLDocumentClass;
+typedef struct _GdomHTMLElement GdomHTMLElement;
+typedef struct _GdomHTMLElementClass GdomHTMLElementClass;
+typedef struct _GdomHTMLEmbedElement GdomHTMLEmbedElement;
+typedef struct _GdomHTMLEmbedElementClass GdomHTMLEmbedElementClass;
+typedef struct _GdomHTMLFieldSetElement GdomHTMLFieldSetElement;
+typedef struct _GdomHTMLFieldSetElementClass GdomHTMLFieldSetElementClass;
+typedef struct _GdomHTMLFontElement GdomHTMLFontElement;
+typedef struct _GdomHTMLFontElementClass GdomHTMLFontElementClass;
+typedef struct _GdomHTMLFormElement GdomHTMLFormElement;
+typedef struct _GdomHTMLFormElementClass GdomHTMLFormElementClass;
+typedef struct _GdomHTMLFrameElement GdomHTMLFrameElement;
+typedef struct _GdomHTMLFrameElementClass GdomHTMLFrameElementClass;
+typedef struct _GdomHTMLFrameSetElement GdomHTMLFrameSetElement;
+typedef struct _GdomHTMLFrameSetElementClass GdomHTMLFrameSetElementClass;
+typedef struct _GdomHTMLHeadElement GdomHTMLHeadElement;
+typedef struct _GdomHTMLHeadElementClass GdomHTMLHeadElementClass;
+typedef struct _GdomHTMLHeadingElement GdomHTMLHeadingElement;
+typedef struct _GdomHTMLHeadingElementClass GdomHTMLHeadingElementClass;
+typedef struct _GdomHTMLHRElement GdomHTMLHRElement;
+typedef struct _GdomHTMLHRElementClass GdomHTMLHRElementClass;
+typedef struct _GdomHTMLHtmlElement GdomHTMLHtmlElement;
+typedef struct _GdomHTMLHtmlElementClass GdomHTMLHtmlElementClass;
+typedef struct _GdomHTMLIFrameElement GdomHTMLIFrameElement;
+typedef struct _GdomHTMLIFrameElementClass GdomHTMLIFrameElementClass;
+typedef struct _GdomHTMLImageElement GdomHTMLImageElement;
+typedef struct _GdomHTMLImageElementClass GdomHTMLImageElementClass;
+typedef struct _GdomHTMLInputElement GdomHTMLInputElement;
+typedef struct _GdomHTMLInputElementClass GdomHTMLInputElementClass;
+typedef struct _GdomHTMLIsIndexElement GdomHTMLIsIndexElement;
+typedef struct _GdomHTMLIsIndexElementClass GdomHTMLIsIndexElementClass;
+typedef struct _GdomHTMLLabelElement GdomHTMLLabelElement;
+typedef struct _GdomHTMLLabelElementClass GdomHTMLLabelElementClass;
+typedef struct _GdomHTMLLegendElement GdomHTMLLegendElement;
+typedef struct _GdomHTMLLegendElementClass GdomHTMLLegendElementClass;
+typedef struct _GdomHTMLLIElement GdomHTMLLIElement;
+typedef struct _GdomHTMLLIElementClass GdomHTMLLIElementClass;
+typedef struct _GdomHTMLLinkElement GdomHTMLLinkElement;
+typedef struct _GdomHTMLLinkElementClass GdomHTMLLinkElementClass;
+typedef struct _GdomHTMLMapElement GdomHTMLMapElement;
+typedef struct _GdomHTMLMapElementClass GdomHTMLMapElementClass;
+typedef struct _GdomHTMLMarqueeElement GdomHTMLMarqueeElement;
+typedef struct _GdomHTMLMarqueeElementClass GdomHTMLMarqueeElementClass;
+typedef struct _GdomHTMLMenuElement GdomHTMLMenuElement;
+typedef struct _GdomHTMLMenuElementClass GdomHTMLMenuElementClass;
+typedef struct _GdomHTMLMetaElement GdomHTMLMetaElement;
+typedef struct _GdomHTMLMetaElementClass GdomHTMLMetaElementClass;
+typedef struct _GdomHTMLModElement GdomHTMLModElement;
+typedef struct _GdomHTMLModElementClass GdomHTMLModElementClass;
+typedef struct _GdomHTMLObjectElement GdomHTMLObjectElement;
+typedef struct _GdomHTMLObjectElementClass GdomHTMLObjectElementClass;
+typedef struct _GdomHTMLOListElement GdomHTMLOListElement;
+typedef struct _GdomHTMLOListElementClass GdomHTMLOListElementClass;
+typedef struct _GdomHTMLOptGroupElement GdomHTMLOptGroupElement;
+typedef struct _GdomHTMLOptGroupElementClass GdomHTMLOptGroupElementClass;
+typedef struct _GdomHTMLOptionElement GdomHTMLOptionElement;
+typedef struct _GdomHTMLOptionElementClass GdomHTMLOptionElementClass;
+typedef struct _GdomHTMLOptionsCollection GdomHTMLOptionsCollection;
+typedef struct _GdomHTMLOptionsCollectionClass GdomHTMLOptionsCollectionClass;
+typedef struct _GdomHTMLParagraphElement GdomHTMLParagraphElement;
+typedef struct _GdomHTMLParagraphElementClass GdomHTMLParagraphElementClass;
+typedef struct _GdomHTMLParamElement GdomHTMLParamElement;
+typedef struct _GdomHTMLParamElementClass GdomHTMLParamElementClass;
+typedef struct _GdomHTMLPreElement GdomHTMLPreElement;
+typedef struct _GdomHTMLPreElementClass GdomHTMLPreElementClass;
+typedef struct _GdomHTMLQuoteElement GdomHTMLQuoteElement;
+typedef struct _GdomHTMLQuoteElementClass GdomHTMLQuoteElementClass;
+typedef struct _GdomHTMLScriptElement GdomHTMLScriptElement;
+typedef struct _GdomHTMLScriptElementClass GdomHTMLScriptElementClass;
+typedef struct _GdomHTMLSelectElement GdomHTMLSelectElement;
+typedef struct _GdomHTMLSelectElementClass GdomHTMLSelectElementClass;
+typedef struct _GdomHTMLStyleElement GdomHTMLStyleElement;
+typedef struct _GdomHTMLStyleElementClass GdomHTMLStyleElementClass;
+typedef struct _GdomHTMLTableCaptionElement GdomHTMLTableCaptionElement;
+typedef struct _GdomHTMLTableCaptionElementClass GdomHTMLTableCaptionElementClass;
+typedef struct _GdomHTMLTableCellElement GdomHTMLTableCellElement;
+typedef struct _GdomHTMLTableCellElementClass GdomHTMLTableCellElementClass;
+typedef struct _GdomHTMLTableColElement GdomHTMLTableColElement;
+typedef struct _GdomHTMLTableColElementClass GdomHTMLTableColElementClass;
+typedef struct _GdomHTMLTableElement GdomHTMLTableElement;
+typedef struct _GdomHTMLTableElementClass GdomHTMLTableElementClass;
+typedef struct _GdomHTMLTableRowElement GdomHTMLTableRowElement;
+typedef struct _GdomHTMLTableRowElementClass GdomHTMLTableRowElementClass;
+typedef struct _GdomHTMLTableSectionElement GdomHTMLTableSectionElement;
+typedef struct _GdomHTMLTableSectionElementClass GdomHTMLTableSectionElementClass;
+typedef struct _GdomHTMLTextAreaElement GdomHTMLTextAreaElement;
+typedef struct _GdomHTMLTextAreaElementClass GdomHTMLTextAreaElementClass;
+typedef struct _GdomHTMLTitleElement GdomHTMLTitleElement;
+typedef struct _GdomHTMLTitleElementClass GdomHTMLTitleElementClass;
+typedef struct _GdomHTMLUListElement GdomHTMLUListElement;
+typedef struct _GdomHTMLUListElementClass GdomHTMLUListElementClass;
+typedef struct _GdomImageData GdomImageData;
+typedef struct _GdomImageDataClass GdomImageDataClass;
+typedef struct _GdomJavaScriptCallFrame GdomJavaScriptCallFrame;
+typedef struct _GdomJavaScriptCallFrameClass GdomJavaScriptCallFrameClass;
+typedef struct _GdomKeyboardEvent GdomKeyboardEvent;
+typedef struct _GdomKeyboardEventClass GdomKeyboardEventClass;
+typedef struct _GdomLocation GdomLocation;
+typedef struct _GdomLocationClass GdomLocationClass;
+typedef struct _GdomMediaList GdomMediaList;
+typedef struct _GdomMediaListClass GdomMediaListClass;
+typedef struct _GdomMessageEvent GdomMessageEvent;
+typedef struct _GdomMessageEventClass GdomMessageEventClass;
+typedef struct _GdomMimeTypeArray GdomMimeTypeArray;
+typedef struct _GdomMimeTypeArrayClass GdomMimeTypeArrayClass;
+typedef struct _GdomMimeType GdomMimeType;
+typedef struct _GdomMimeTypeClass GdomMimeTypeClass;
+typedef struct _GdomMouseEvent GdomMouseEvent;
+typedef struct _GdomMouseEventClass GdomMouseEventClass;
+typedef struct _GdomMutationEvent GdomMutationEvent;
+typedef struct _GdomMutationEventClass GdomMutationEventClass;
+typedef struct _GdomNamedNodeMap GdomNamedNodeMap;
+typedef struct _GdomNamedNodeMapClass GdomNamedNodeMapClass;
+typedef struct _GdomNavigator GdomNavigator;
+typedef struct _GdomNavigatorClass GdomNavigatorClass;
+typedef struct _GdomNodeFilter GdomNodeFilter;
+typedef struct _GdomNodeFilterClass GdomNodeFilterClass;
+typedef struct _GdomNode GdomNode;
+typedef struct _GdomNodeClass GdomNodeClass;
+typedef struct _GdomNodeIterator GdomNodeIterator;
+typedef struct _GdomNodeIteratorClass GdomNodeIteratorClass;
+typedef struct _GdomNodeList GdomNodeList;
+typedef struct _GdomNodeListClass GdomNodeListClass;
+typedef struct _GdomNotation GdomNotation;
+typedef struct _GdomNotationClass GdomNotationClass;
+typedef struct _GdomOverflowEvent GdomOverflowEvent;
+typedef struct _GdomOverflowEventClass GdomOverflowEventClass;
+typedef struct _GdomPluginArray GdomPluginArray;
+typedef struct _GdomPluginArrayClass GdomPluginArrayClass;
+typedef struct _GdomPlugin GdomPlugin;
+typedef struct _GdomPluginClass GdomPluginClass;
+typedef struct _GdomProcessingInstruction GdomProcessingInstruction;
+typedef struct _GdomProcessingInstructionClass GdomProcessingInstructionClass;
+typedef struct _GdomProgressEvent GdomProgressEvent;
+typedef struct _GdomProgressEventClass GdomProgressEventClass;
+typedef struct _GdomRangeException GdomRangeException;
+typedef struct _GdomRangeExceptionClass GdomRangeExceptionClass;
+typedef struct _GdomRange GdomRange;
+typedef struct _GdomRangeClass GdomRangeClass;
+typedef struct _GdomRect GdomRect;
+typedef struct _GdomRectClass GdomRectClass;
+typedef struct _GdomScreen GdomScreen;
+typedef struct _GdomScreenClass GdomScreenClass;
+typedef struct _GdomSQLError GdomSQLError;
+typedef struct _GdomSQLErrorClass GdomSQLErrorClass;
+typedef struct _GdomSQLResultSet GdomSQLResultSet;
+typedef struct _GdomSQLResultSetClass GdomSQLResultSetClass;
+typedef struct _GdomSQLResultSetRowList GdomSQLResultSetRowList;
+typedef struct _GdomSQLResultSetRowListClass GdomSQLResultSetRowListClass;
+typedef struct _GdomSQLTransaction GdomSQLTransaction;
+typedef struct _GdomSQLTransactionClass GdomSQLTransactionClass;
+typedef struct _GdomStorageEvent GdomStorageEvent;
+typedef struct _GdomStorageEventClass GdomStorageEventClass;
+typedef struct _GdomStorage GdomStorage;
+typedef struct _GdomStorageClass GdomStorageClass;
+typedef struct _GdomStyleSheet GdomStyleSheet;
+typedef struct _GdomStyleSheetClass GdomStyleSheetClass;
+typedef struct _GdomStyleSheetList GdomStyleSheetList;
+typedef struct _GdomStyleSheetListClass GdomStyleSheetListClass;
+typedef struct _GdomTextEvent GdomTextEvent;
+typedef struct _GdomTextEventClass GdomTextEventClass;
+typedef struct _GdomText GdomText;
+typedef struct _GdomTextClass GdomTextClass;
+typedef struct _GdomTreeWalker GdomTreeWalker;
+typedef struct _GdomTreeWalkerClass GdomTreeWalkerClass;
+typedef struct _GdomUIEvent GdomUIEvent;
+typedef struct _GdomUIEventClass GdomUIEventClass;
+typedef struct _GdomWebKitAnimationEvent GdomWebKitAnimationEvent;
+typedef struct _GdomWebKitAnimationEventClass GdomWebKitAnimationEventClass;
+typedef struct _GdomWebKitCSSTransformValue GdomWebKitCSSTransformValue;
+typedef struct _GdomWebKitCSSTransformValueClass GdomWebKitCSSTransformValueClass;
+typedef struct _GdomWebKitTransitionEvent GdomWebKitTransitionEvent;
+typedef struct _GdomWebKitTransitionEventClass GdomWebKitTransitionEventClass;
+typedef struct _GdomWheelEvent GdomWheelEvent;
+typedef struct _GdomWheelEventClass GdomWheelEventClass;
+typedef struct _GdomXMLHttpRequestException GdomXMLHttpRequestException;
+typedef struct _GdomXMLHttpRequestExceptionClass GdomXMLHttpRequestExceptionClass;
+typedef struct _GdomXMLHttpRequest GdomXMLHttpRequest;
+typedef struct _GdomXMLHttpRequestClass GdomXMLHttpRequestClass;
+typedef struct _GdomXMLHttpRequestProgressEvent GdomXMLHttpRequestProgressEvent;
+typedef struct _GdomXMLHttpRequestProgressEventClass GdomXMLHttpRequestProgressEventClass;
+typedef struct _GdomXMLHttpRequestUpload GdomXMLHttpRequestUpload;
+typedef struct _GdomXMLHttpRequestUploadClass GdomXMLHttpRequestUploadClass;
+typedef struct _GdomXMLSerializer GdomXMLSerializer;
+typedef struct _GdomXMLSerializerClass GdomXMLSerializerClass;
+typedef struct _GdomXPathEvaluator GdomXPathEvaluator;
+typedef struct _GdomXPathEvaluatorClass GdomXPathEvaluatorClass;
+typedef struct _GdomXPathException GdomXPathException;
+typedef struct _GdomXPathExceptionClass GdomXPathExceptionClass;
+typedef struct _GdomXPathExpression GdomXPathExpression;
+typedef struct _GdomXPathExpressionClass GdomXPathExpressionClass;
+typedef struct _GdomXPathNSResolver GdomXPathNSResolver;
+typedef struct _GdomXPathNSResolverClass GdomXPathNSResolverClass;
+typedef struct _GdomXPathResult GdomXPathResult;
+typedef struct _GdomXPathResultClass GdomXPathResultClass;
+typedef struct _GdomXSLTProcessor GdomXSLTProcessor;
+typedef struct _GdomXSLTProcessorClass GdomXSLTProcessorClass;
+
+
+#define GDOM_TYPE_DOM_OBJECT            (gdom_dom_object_get_type())
+#define GDOM_TYPE_EVENT_TARGET_NODE            (gdom_event_target_node_get_type())
+#define GDOM_TYPE_ATTR            (gdom_attr_get_type())
+#define GDOM_TYPE_BAR_INFO            (gdom_bar_info_get_type())
+#define GDOM_TYPE_CANVAS_GRADIENT            (gdom_canvas_gradient_get_type())
+#define GDOM_TYPE_CANVAS_PATTERN            (gdom_canvas_pattern_get_type())
+#define GDOM_TYPE_CANVAS_PIXEL_ARRAY            (gdom_canvas_pixel_array_get_type())
+#define GDOM_TYPE_CANVAS_RENDERING_CONTEXT2D            (gdom_canvas_rendering_context2d_get_type())
+#define GDOM_TYPE_CDATA_SECTION            (gdom_cdata_section_get_type())
+#define GDOM_TYPE_CHARACTER_DATA            (gdom_character_data_get_type())
+#define GDOM_TYPE_CLIPBOARD            (gdom_clipboard_get_type())
+#define GDOM_TYPE_COMMENT            (gdom_comment_get_type())
+#define GDOM_TYPE_CONSOLE            (gdom_console_get_type())
+#define GDOM_TYPE_COUNTER            (gdom_counter_get_type())
+#define GDOM_TYPE_CSS_CHARSET_RULE            (gdom_css_charset_rule_get_type())
+#define GDOM_TYPE_CSS_FONT_FACE_RULE            (gdom_css_font_face_rule_get_type())
+#define GDOM_TYPE_CSS_IMPORT_RULE            (gdom_css_import_rule_get_type())
+#define GDOM_TYPE_CSS_MEDIA_RULE            (gdom_css_media_rule_get_type())
+#define GDOM_TYPE_CSS_PAGE_RULE            (gdom_css_page_rule_get_type())
+#define GDOM_TYPE_CSS_PRIMITIVE_VALUE            (gdom_css_primitive_value_get_type())
+#define GDOM_TYPE_CSS_RULE            (gdom_css_rule_get_type())
+#define GDOM_TYPE_CSS_RULE_LIST            (gdom_css_rule_list_get_type())
+#define GDOM_TYPE_CSS_STYLE_DECLARATION            (gdom_css_style_declaration_get_type())
+#define GDOM_TYPE_CSS_STYLE_RULE            (gdom_css_style_rule_get_type())
+#define GDOM_TYPE_CSS_STYLE_SHEET            (gdom_css_style_sheet_get_type())
+#define GDOM_TYPE_CSS_VALUE            (gdom_css_value_get_type())
+#define GDOM_TYPE_CSS_VALUE_LIST            (gdom_css_value_list_get_type())
+#define GDOM_TYPE_CSS_VARIABLES_DECLARATION            (gdom_css_variables_declaration_get_type())
+#define GDOM_TYPE_CSS_VARIABLES_RULE            (gdom_css_variables_rule_get_type())
+#define GDOM_TYPE_DATABASE            (gdom_database_get_type())
+#define GDOM_TYPE_DOCUMENT_FRAGMENT            (gdom_document_fragment_get_type())
+#define GDOM_TYPE_DOCUMENT            (gdom_document_get_type())
+#define GDOM_TYPE_DOCUMENT_TYPE            (gdom_document_type_get_type())
+#define GDOM_TYPE_DOM_APPLICATION_CACHE            (gdom_dom_application_cache_get_type())
+#define GDOM_TYPE_DOM_CORE_EXCEPTION            (gdom_dom_core_exception_get_type())
+#define GDOM_TYPE_DOM_IMPLEMENTATION            (gdom_dom_implementation_get_type())
+#define GDOM_TYPE_DOM_PARSER            (gdom_dom_parser_get_type())
+#define GDOM_TYPE_DOM_SELECTION            (gdom_dom_selection_get_type())
+#define GDOM_TYPE_DOM_WINDOW            (gdom_dom_window_get_type())
+#define GDOM_TYPE_ELEMENT            (gdom_element_get_type())
+#define GDOM_TYPE_ENTITY            (gdom_entity_get_type())
+#define GDOM_TYPE_ENTITY_REFERENCE            (gdom_entity_reference_get_type())
+#define GDOM_TYPE_EVENT_EXCEPTION            (gdom_event_exception_get_type())
+#define GDOM_TYPE_EVENT            (gdom_event_get_type())
+#define GDOM_TYPE_FILE            (gdom_file_get_type())
+#define GDOM_TYPE_FILE_LIST            (gdom_file_list_get_type())
+#define GDOM_TYPE_HISTORY            (gdom_history_get_type())
+#define GDOM_TYPE_HTML_ANCHOR_ELEMENT            (gdom_html_anchor_element_get_type())
+#define GDOM_TYPE_HTML_APPLET_ELEMENT            (gdom_html_applet_element_get_type())
+#define GDOM_TYPE_HTML_AREA_ELEMENT            (gdom_html_area_element_get_type())
+#define GDOM_TYPE_HTML_BASE_ELEMENT            (gdom_html_base_element_get_type())
+#define GDOM_TYPE_HTML_BASE_FONT_ELEMENT            (gdom_html_base_font_element_get_type())
+#define GDOM_TYPE_HTML_BLOCKQUOTE_ELEMENT            (gdom_html_blockquote_element_get_type())
+#define GDOM_TYPE_HTML_BODY_ELEMENT            (gdom_html_body_element_get_type())
+#define GDOM_TYPE_HTMLBR_ELEMENT            (gdom_htmlbr_element_get_type())
+#define GDOM_TYPE_HTML_BUTTON_ELEMENT            (gdom_html_button_element_get_type())
+#define GDOM_TYPE_HTML_CANVAS_ELEMENT            (gdom_html_canvas_element_get_type())
+#define GDOM_TYPE_HTML_COLLECTION            (gdom_html_collection_get_type())
+#define GDOM_TYPE_HTML_DIRECTORY_ELEMENT            (gdom_html_directory_element_get_type())
+#define GDOM_TYPE_HTML_DIV_ELEMENT            (gdom_html_div_element_get_type())
+#define GDOM_TYPE_HTMLD_LIST_ELEMENT            (gdom_htmld_list_element_get_type())
+#define GDOM_TYPE_HTML_DOCUMENT            (gdom_html_document_get_type())
+#define GDOM_TYPE_HTML_ELEMENT            (gdom_html_element_get_type())
+#define GDOM_TYPE_HTML_EMBED_ELEMENT            (gdom_html_embed_element_get_type())
+#define GDOM_TYPE_HTML_FIELD_SET_ELEMENT            (gdom_html_field_set_element_get_type())
+#define GDOM_TYPE_HTML_FONT_ELEMENT            (gdom_html_font_element_get_type())
+#define GDOM_TYPE_HTML_FORM_ELEMENT            (gdom_html_form_element_get_type())
+#define GDOM_TYPE_HTML_FRAME_ELEMENT            (gdom_html_frame_element_get_type())
+#define GDOM_TYPE_HTML_FRAME_SET_ELEMENT            (gdom_html_frame_set_element_get_type())
+#define GDOM_TYPE_HTML_HEAD_ELEMENT            (gdom_html_head_element_get_type())
+#define GDOM_TYPE_HTML_HEADING_ELEMENT            (gdom_html_heading_element_get_type())
+#define GDOM_TYPE_HTMLHR_ELEMENT            (gdom_htmlhr_element_get_type())
+#define GDOM_TYPE_HTML_HTML_ELEMENT            (gdom_html_html_element_get_type())
+#define GDOM_TYPE_HTMLI_FRAME_ELEMENT            (gdom_htmli_frame_element_get_type())
+#define GDOM_TYPE_HTML_IMAGE_ELEMENT            (gdom_html_image_element_get_type())
+#define GDOM_TYPE_HTML_INPUT_ELEMENT            (gdom_html_input_element_get_type())
+#define GDOM_TYPE_HTML_IS_INDEX_ELEMENT            (gdom_html_is_index_element_get_type())
+#define GDOM_TYPE_HTML_LABEL_ELEMENT            (gdom_html_label_element_get_type())
+#define GDOM_TYPE_HTML_LEGEND_ELEMENT            (gdom_html_legend_element_get_type())
+#define GDOM_TYPE_HTMLLI_ELEMENT            (gdom_htmlli_element_get_type())
+#define GDOM_TYPE_HTML_LINK_ELEMENT            (gdom_html_link_element_get_type())
+#define GDOM_TYPE_HTML_MAP_ELEMENT            (gdom_html_map_element_get_type())
+#define GDOM_TYPE_HTML_MARQUEE_ELEMENT            (gdom_html_marquee_element_get_type())
+#define GDOM_TYPE_HTML_MENU_ELEMENT            (gdom_html_menu_element_get_type())
+#define GDOM_TYPE_HTML_META_ELEMENT            (gdom_html_meta_element_get_type())
+#define GDOM_TYPE_HTML_MOD_ELEMENT            (gdom_html_mod_element_get_type())
+#define GDOM_TYPE_HTML_OBJECT_ELEMENT            (gdom_html_object_element_get_type())
+#define GDOM_TYPE_HTMLO_LIST_ELEMENT            (gdom_htmlo_list_element_get_type())
+#define GDOM_TYPE_HTML_OPT_GROUP_ELEMENT            (gdom_html_opt_group_element_get_type())
+#define GDOM_TYPE_HTML_OPTION_ELEMENT            (gdom_html_option_element_get_type())
+#define GDOM_TYPE_HTML_OPTIONS_COLLECTION            (gdom_html_options_collection_get_type())
+#define GDOM_TYPE_HTML_PARAGRAPH_ELEMENT            (gdom_html_paragraph_element_get_type())
+#define GDOM_TYPE_HTML_PARAM_ELEMENT            (gdom_html_param_element_get_type())
+#define GDOM_TYPE_HTML_PRE_ELEMENT            (gdom_html_pre_element_get_type())
+#define GDOM_TYPE_HTML_QUOTE_ELEMENT            (gdom_html_quote_element_get_type())
+#define GDOM_TYPE_HTML_SCRIPT_ELEMENT            (gdom_html_script_element_get_type())
+#define GDOM_TYPE_HTML_SELECT_ELEMENT            (gdom_html_select_element_get_type())
+#define GDOM_TYPE_HTML_STYLE_ELEMENT            (gdom_html_style_element_get_type())
+#define GDOM_TYPE_HTML_TABLE_CAPTION_ELEMENT            (gdom_html_table_caption_element_get_type())
+#define GDOM_TYPE_HTML_TABLE_CELL_ELEMENT            (gdom_html_table_cell_element_get_type())
+#define GDOM_TYPE_HTML_TABLE_COL_ELEMENT            (gdom_html_table_col_element_get_type())
+#define GDOM_TYPE_HTML_TABLE_ELEMENT            (gdom_html_table_element_get_type())
+#define GDOM_TYPE_HTML_TABLE_ROW_ELEMENT            (gdom_html_table_row_element_get_type())
+#define GDOM_TYPE_HTML_TABLE_SECTION_ELEMENT            (gdom_html_table_section_element_get_type())
+#define GDOM_TYPE_HTML_TEXT_AREA_ELEMENT            (gdom_html_text_area_element_get_type())
+#define GDOM_TYPE_HTML_TITLE_ELEMENT            (gdom_html_title_element_get_type())
+#define GDOM_TYPE_HTMLU_LIST_ELEMENT            (gdom_htmlu_list_element_get_type())
+#define GDOM_TYPE_IMAGE_DATA            (gdom_image_data_get_type())
+#define GDOM_TYPE_JAVA_SCRIPT_CALL_FRAME            (gdom_java_script_call_frame_get_type())
+#define GDOM_TYPE_KEYBOARD_EVENT            (gdom_keyboard_event_get_type())
+#define GDOM_TYPE_LOCATION            (gdom_location_get_type())
+#define GDOM_TYPE_MEDIA_LIST            (gdom_media_list_get_type())
+#define GDOM_TYPE_MESSAGE_EVENT            (gdom_message_event_get_type())
+#define GDOM_TYPE_MIME_TYPE_ARRAY            (gdom_mime_type_array_get_type())
+#define GDOM_TYPE_MIME_TYPE            (gdom_mime_type_get_type())
+#define GDOM_TYPE_MOUSE_EVENT            (gdom_mouse_event_get_type())
+#define GDOM_TYPE_MUTATION_EVENT            (gdom_mutation_event_get_type())
+#define GDOM_TYPE_NAMED_NODE_MAP            (gdom_named_node_map_get_type())
+#define GDOM_TYPE_NAVIGATOR            (gdom_navigator_get_type())
+#define GDOM_TYPE_NODE_FILTER            (gdom_node_filter_get_type())
+#define GDOM_TYPE_NODE            (gdom_node_get_type())
+#define GDOM_TYPE_NODE_ITERATOR            (gdom_node_iterator_get_type())
+#define GDOM_TYPE_NODE_LIST            (gdom_node_list_get_type())
+#define GDOM_TYPE_NOTATION            (gdom_notation_get_type())
+#define GDOM_TYPE_OVERFLOW_EVENT            (gdom_overflow_event_get_type())
+#define GDOM_TYPE_PLUGIN_ARRAY            (gdom_plugin_array_get_type())
+#define GDOM_TYPE_PLUGIN            (gdom_plugin_get_type())
+#define GDOM_TYPE_PROCESSING_INSTRUCTION            (gdom_processing_instruction_get_type())
+#define GDOM_TYPE_PROGRESS_EVENT            (gdom_progress_event_get_type())
+#define GDOM_TYPE_RANGE_EXCEPTION            (gdom_range_exception_get_type())
+#define GDOM_TYPE_RANGE            (gdom_range_get_type())
+#define GDOM_TYPE_RECT            (gdom_rect_get_type())
+#define GDOM_TYPE_SCREEN            (gdom_screen_get_type())
+#define GDOM_TYPE_SQL_ERROR            (gdom_sql_error_get_type())
+#define GDOM_TYPE_SQL_RESULT_SET            (gdom_sql_result_set_get_type())
+#define GDOM_TYPE_SQL_RESULT_SET_ROW_LIST            (gdom_sql_result_set_row_list_get_type())
+#define GDOM_TYPE_SQL_TRANSACTION            (gdom_sql_transaction_get_type())
+#define GDOM_TYPE_STORAGE_EVENT            (gdom_storage_event_get_type())
+#define GDOM_TYPE_STORAGE            (gdom_storage_get_type())
+#define GDOM_TYPE_STYLE_SHEET            (gdom_style_sheet_get_type())
+#define GDOM_TYPE_STYLE_SHEET_LIST            (gdom_style_sheet_list_get_type())
+#define GDOM_TYPE_TEXT_EVENT            (gdom_text_event_get_type())
+#define GDOM_TYPE_TEXT            (gdom_text_get_type())
+#define GDOM_TYPE_TREE_WALKER            (gdom_tree_walker_get_type())
+#define GDOM_TYPE_UI_EVENT            (gdom_ui_event_get_type())
+#define GDOM_TYPE_WEB_KIT_ANIMATION_EVENT            (gdom_web_kit_animation_event_get_type())
+#define GDOM_TYPE_WEB_KIT_CSS_TRANSFORM_VALUE            (gdom_web_kit_css_transform_value_get_type())
+#define GDOM_TYPE_WEB_KIT_TRANSITION_EVENT            (gdom_web_kit_transition_event_get_type())
+#define GDOM_TYPE_WHEEL_EVENT            (gdom_wheel_event_get_type())
+#define GDOM_TYPE_XML_HTTP_REQUEST_EXCEPTION            (gdom_xml_http_request_exception_get_type())
+#define GDOM_TYPE_XML_HTTP_REQUEST            (gdom_xml_http_request_get_type())
+#define GDOM_TYPE_XML_HTTP_REQUEST_PROGRESS_EVENT            (gdom_xml_http_request_progress_event_get_type())
+#define GDOM_TYPE_XML_HTTP_REQUEST_UPLOAD            (gdom_xml_http_request_upload_get_type())
+#define GDOM_TYPE_XML_SERIALIZER            (gdom_xml_serializer_get_type())
+#define GDOM_TYPE_X_PATH_EVALUATOR            (gdom_x_path_evaluator_get_type())
+#define GDOM_TYPE_X_PATH_EXCEPTION            (gdom_x_path_exception_get_type())
+#define GDOM_TYPE_X_PATH_EXPRESSION            (gdom_x_path_expression_get_type())
+#define GDOM_TYPE_X_PATH_NS_RESOLVER            (gdom_x_path_ns_resolver_get_type())
+#define GDOM_TYPE_X_PATH_RESULT            (gdom_x_path_result_get_type())
+#define GDOM_TYPE_XSLT_PROCESSOR            (gdom_xslt_processor_get_type())
+G_END_DECLS
+
+#endif
Index: WebKit/gtk/webkit/gdom.h
===================================================================
--- WebKit/gtk/webkit/gdom.h	(revision 0)
+++ WebKit/gtk/webkit/gdom.h	(revision 0)
@@ -0,0 +1,160 @@
+#include <webkit/GdomEventTargetNode.h>
+#include <webkit/GdomDOMObject.h>
+#include <webkit/GdomAttr.h>
+#include <webkit/GdomBarInfo.h>
+#include <webkit/GdomCanvasGradient.h>
+#include <webkit/GdomCanvasPattern.h>
+#include <webkit/GdomCanvasPixelArray.h>
+#include <webkit/GdomCanvasRenderingContext2D.h>
+#include <webkit/GdomCDATASection.h>
+#include <webkit/GdomCharacterData.h>
+#include <webkit/GdomClipboard.h>
+#include <webkit/GdomComment.h>
+#include <webkit/GdomConsole.h>
+#include <webkit/GdomCounter.h>
+#include <webkit/GdomCSSCharsetRule.h>
+#include <webkit/GdomCSSFontFaceRule.h>
+#include <webkit/GdomCSSImportRule.h>
+#include <webkit/GdomCSSMediaRule.h>
+#include <webkit/GdomCSSPageRule.h>
+#include <webkit/GdomCSSPrimitiveValue.h>
+#include <webkit/GdomCSSRule.h>
+#include <webkit/GdomCSSRuleList.h>
+#include <webkit/GdomCSSStyleDeclaration.h>
+#include <webkit/GdomCSSStyleRule.h>
+#include <webkit/GdomCSSStyleSheet.h>
+#include <webkit/GdomCSSValue.h>
+#include <webkit/GdomCSSValueList.h>
+#include <webkit/GdomCSSVariablesDeclaration.h>
+#include <webkit/GdomCSSVariablesRule.h>
+#include <webkit/GdomDatabase.h>
+#include <webkit/GdomDocumentFragment.h>
+#include <webkit/GdomDocument.h>
+#include <webkit/GdomDocumentType.h>
+#include <webkit/GdomDOMApplicationCache.h>
+#include <webkit/GdomDOMCoreException.h>
+#include <webkit/GdomDOMImplementation.h>
+#include <webkit/GdomDOMParser.h>
+#include <webkit/GdomDOMSelection.h>
+#include <webkit/GdomDOMWindow.h>
+#include <webkit/GdomElement.h>
+#include <webkit/GdomEntity.h>
+#include <webkit/GdomEntityReference.h>
+#include <webkit/GdomEventException.h>
+#include <webkit/GdomEvent.h>
+#include <webkit/GdomFile.h>
+#include <webkit/GdomFileList.h>
+#include <webkit/GdomHistory.h>
+#include <webkit/GdomHTMLAnchorElement.h>
+#include <webkit/GdomHTMLAppletElement.h>
+#include <webkit/GdomHTMLAreaElement.h>
+#include <webkit/GdomHTMLBaseElement.h>
+#include <webkit/GdomHTMLBaseFontElement.h>
+#include <webkit/GdomHTMLBlockquoteElement.h>
+#include <webkit/GdomHTMLBodyElement.h>
+#include <webkit/GdomHTMLBRElement.h>
+#include <webkit/GdomHTMLButtonElement.h>
+#include <webkit/GdomHTMLCanvasElement.h>
+#include <webkit/GdomHTMLCollection.h>
+#include <webkit/GdomHTMLDirectoryElement.h>
+#include <webkit/GdomHTMLDivElement.h>
+#include <webkit/GdomHTMLDListElement.h>
+#include <webkit/GdomHTMLDocument.h>
+#include <webkit/GdomHTMLElement.h>
+#include <webkit/GdomHTMLEmbedElement.h>
+#include <webkit/GdomHTMLFieldSetElement.h>
+#include <webkit/GdomHTMLFontElement.h>
+#include <webkit/GdomHTMLFormElement.h>
+#include <webkit/GdomHTMLFrameElement.h>
+#include <webkit/GdomHTMLFrameSetElement.h>
+#include <webkit/GdomHTMLHeadElement.h>
+#include <webkit/GdomHTMLHeadingElement.h>
+#include <webkit/GdomHTMLHRElement.h>
+#include <webkit/GdomHTMLHtmlElement.h>
+#include <webkit/GdomHTMLIFrameElement.h>
+#include <webkit/GdomHTMLImageElement.h>
+#include <webkit/GdomHTMLInputElement.h>
+#include <webkit/GdomHTMLIsIndexElement.h>
+#include <webkit/GdomHTMLLabelElement.h>
+#include <webkit/GdomHTMLLegendElement.h>
+#include <webkit/GdomHTMLLIElement.h>
+#include <webkit/GdomHTMLLinkElement.h>
+#include <webkit/GdomHTMLMapElement.h>
+#include <webkit/GdomHTMLMarqueeElement.h>
+#include <webkit/GdomHTMLMenuElement.h>
+#include <webkit/GdomHTMLMetaElement.h>
+#include <webkit/GdomHTMLModElement.h>
+#include <webkit/GdomHTMLObjectElement.h>
+#include <webkit/GdomHTMLOListElement.h>
+#include <webkit/GdomHTMLOptGroupElement.h>
+#include <webkit/GdomHTMLOptionElement.h>
+#include <webkit/GdomHTMLOptionsCollection.h>
+#include <webkit/GdomHTMLParagraphElement.h>
+#include <webkit/GdomHTMLParamElement.h>
+#include <webkit/GdomHTMLPreElement.h>
+#include <webkit/GdomHTMLQuoteElement.h>
+#include <webkit/GdomHTMLScriptElement.h>
+#include <webkit/GdomHTMLSelectElement.h>
+#include <webkit/GdomHTMLStyleElement.h>
+#include <webkit/GdomHTMLTableCaptionElement.h>
+#include <webkit/GdomHTMLTableCellElement.h>
+#include <webkit/GdomHTMLTableColElement.h>
+#include <webkit/GdomHTMLTableElement.h>
+#include <webkit/GdomHTMLTableRowElement.h>
+#include <webkit/GdomHTMLTableSectionElement.h>
+#include <webkit/GdomHTMLTextAreaElement.h>
+#include <webkit/GdomHTMLTitleElement.h>
+#include <webkit/GdomHTMLUListElement.h>
+#include <webkit/GdomImageData.h>
+#include <webkit/GdomJavaScriptCallFrame.h>
+#include <webkit/GdomKeyboardEvent.h>
+#include <webkit/GdomLocation.h>
+#include <webkit/GdomMediaList.h>
+#include <webkit/GdomMessageEvent.h>
+#include <webkit/GdomMimeTypeArray.h>
+#include <webkit/GdomMimeType.h>
+#include <webkit/GdomMouseEvent.h>
+#include <webkit/GdomMutationEvent.h>
+#include <webkit/GdomNamedNodeMap.h>
+#include <webkit/GdomNavigator.h>
+#include <webkit/GdomNodeFilter.h>
+#include <webkit/GdomNode.h>
+#include <webkit/GdomNodeIterator.h>
+#include <webkit/GdomNodeList.h>
+#include <webkit/GdomNotation.h>
+#include <webkit/GdomOverflowEvent.h>
+#include <webkit/GdomPluginArray.h>
+#include <webkit/GdomPlugin.h>
+#include <webkit/GdomProcessingInstruction.h>
+#include <webkit/GdomProgressEvent.h>
+#include <webkit/GdomRangeException.h>
+#include <webkit/GdomRange.h>
+#include <webkit/GdomRect.h>
+#include <webkit/GdomScreen.h>
+#include <webkit/GdomSQLError.h>
+#include <webkit/GdomSQLResultSet.h>
+#include <webkit/GdomSQLResultSetRowList.h>
+#include <webkit/GdomSQLTransaction.h>
+#include <webkit/GdomStorageEvent.h>
+#include <webkit/GdomStorage.h>
+#include <webkit/GdomStyleSheet.h>
+#include <webkit/GdomStyleSheetList.h>
+#include <webkit/GdomTextEvent.h>
+#include <webkit/GdomText.h>
+#include <webkit/GdomTreeWalker.h>
+#include <webkit/GdomUIEvent.h>
+#include <webkit/GdomWebKitAnimationEvent.h>
+#include <webkit/GdomWebKitCSSTransformValue.h>
+#include <webkit/GdomWebKitTransitionEvent.h>
+#include <webkit/GdomWheelEvent.h>
+#include <webkit/GdomXMLHttpRequestException.h>
+#include <webkit/GdomXMLHttpRequest.h>
+#include <webkit/GdomXMLHttpRequestProgressEvent.h>
+#include <webkit/GdomXMLHttpRequestUpload.h>
+#include <webkit/GdomXMLSerializer.h>
+#include <webkit/GdomXPathEvaluator.h>
+#include <webkit/GdomXPathException.h>
+#include <webkit/GdomXPathExpression.h>
+#include <webkit/GdomXPathNSResolver.h>
+#include <webkit/GdomXPathResult.h>
+#include <webkit/GdomXSLTProcessor.h>
Index: WebKit/gtk/webkit/webkitevent.h
===================================================================
--- WebKit/gtk/webkit/webkitevent.h	(revision 0)
+++ WebKit/gtk/webkit/webkitevent.h	(revision 0)
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2007 Holger Hans Peter Freyther
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef WEBKIT_EVENT_H
+#define WEBKIT_EVENT_H
+
+#include <glib-object.h>
+
+#include <webkit/webkitdefines.h>
+
+G_BEGIN_DECLS
+
+#define WEBKIT_TYPE_EVENT            (webkit_event_get_type())
+#define WEBKIT_EVENT(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_EVENT, WebKitEvent))
+#define WEBKIT_EVENT_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),  WEBKIT_TYPE_EVENT, WebKitEventClass))
+#define WEBKIT_IS_EVENT(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_EVENT))
+#define WEBKIT_IS_EVENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),  WEBKIT_TYPE_EVENT))
+#define WEBKIT_EVENT_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),  WEBKIT_TYPE_EVENT, WebKitEventClass))
+
+typedef struct _WebKitEventPrivate WebKitEventPrivate;
+
+struct _WebKitEvent {
+    GObject parent_instance;
+
+    WebKitEventPrivate *priv;
+};
+
+struct _WebKitEventClass {
+    GObjectClass parent_class;
+};
+
+WEBKIT_API GType
+webkit_event_get_type (void);
+
+WEBKIT_API WebKitEvent *
+webkit_event_new      (void);
+
+/*WEBKIT_API void
+webkit_event_set_uri  (WebKitEvent *request,
+                                 const gchar*          uri);*/
+
+G_END_DECLS
+
+#endif
Index: WebCore/GNUmakefile.am
===================================================================
--- WebCore/GNUmakefile.am	(revision 35758)
+++ WebCore/GNUmakefile.am	(working copy)
@@ -2,6 +2,7 @@
 WebCore := $(srcdir)/WebCore
 
 FEATURE_DEFINES_JAVASCRIPT := LANGUAGE_JAVASCRIPT=1
+FEATURE_DEFINES_GDOM := LANGUAGE_GOBJECT=1
 SVG_FEATURES :=
 HTML_FEATURES :=
 
@@ -9,6 +10,7 @@
 WEBCORE_CSS_VALUE_KEYWORDS := $(WebCore)/css/CSSValueKeywords.in
 
 webcore_cppflags += \
+	-I$(srcdir)/WebKit/gtk \
 	-I$(srcdir)/WebCore \
 	-I$(srcdir)/WebCore/platform \
 	-I$(srcdir)/WebCore/platform/network \
@@ -29,6 +31,7 @@
 	-I$(srcdir)/WebCore/xml \
 	-I$(srcdir)/WebCore/html \
 	-I$(srcdir)/WebCore/bindings/js \
+	-I$(srcdir)/WebCore/bindings/gdom \
 	-I$(srcdir)/WebCore/platform/image-decoders \
 	-I$(srcdir)/WebCore/platform/image-decoders/bmp \
 	-I$(srcdir)/WebCore/platform/image-decoders/gif \
@@ -55,7 +58,7 @@
 	WebCore/bindings/js/JSDOMWindowBase.lut.h \
 	WebCore/bindings/js/JSEventTargetBase.lut.h \
 	WebCore/bindings/js/JSRGBColor.lut.h \
-	WebCore/bindings/js/JSHTMLInputElementBaseTable.cpp
+	WebCore/bindings/js/JSHTMLInputElementBaseTable.cpp 
 
 webcore_built_sources += \
 	DerivedSources/CSSGrammar.cpp \
@@ -358,7 +361,587 @@
 	DerivedSources/UserAgentStyleSheets.h \
 	DerivedSources/UserAgentStyleSheetsData.cpp \
 	DerivedSources/XMLNames.cpp \
-	DerivedSources/XMLNames.h
+	DerivedSources/XMLNames.h \
+	DerivedSources/GdomAttr.cpp \
+	DerivedSources/GdomAttr.h \
+	DerivedSources/GdomBarInfo.cpp \
+	DerivedSources/GdomBarInfo.h \
+	DerivedSources/GdomCDATASection.cpp \
+	DerivedSources/GdomCDATASection.h \
+	DerivedSources/GdomCSSCharsetRule.cpp \
+	DerivedSources/GdomCSSCharsetRule.h \
+	DerivedSources/GdomCSSFontFaceRule.cpp \
+	DerivedSources/GdomCSSFontFaceRule.h \
+	DerivedSources/GdomCSSImportRule.cpp \
+	DerivedSources/GdomCSSImportRule.h \
+	DerivedSources/GdomCSSMediaRule.cpp \
+	DerivedSources/GdomCSSMediaRule.h \
+	DerivedSources/GdomCSSPageRule.cpp \
+	DerivedSources/GdomCSSPageRule.h \
+	DerivedSources/GdomCSSPrimitiveValue.cpp \
+	DerivedSources/GdomCSSPrimitiveValue.h \
+	DerivedSources/GdomCSSRule.cpp \
+	DerivedSources/GdomCSSRule.h \
+	DerivedSources/GdomCSSRuleList.cpp \
+	DerivedSources/GdomCSSRuleList.h \
+	DerivedSources/GdomCSSStyleDeclaration.cpp \
+	DerivedSources/GdomCSSStyleDeclaration.h \
+	DerivedSources/GdomCSSStyleRule.cpp \
+	DerivedSources/GdomCSSStyleRule.h \
+	DerivedSources/GdomCSSStyleSheet.cpp \
+	DerivedSources/GdomCSSStyleSheet.h \
+	DerivedSources/GdomCSSValue.cpp \
+	DerivedSources/GdomCSSValue.h \
+	DerivedSources/GdomCSSValueList.cpp \
+	DerivedSources/GdomCSSValueList.h \
+	DerivedSources/GdomCSSVariablesDeclaration.cpp \
+	DerivedSources/GdomCSSVariablesDeclaration.h \
+	DerivedSources/GdomCSSVariablesRule.cpp \
+	DerivedSources/GdomCSSVariablesRule.h \
+	DerivedSources/GdomCanvasGradient.cpp \
+	DerivedSources/GdomCanvasGradient.h \
+	DerivedSources/GdomCanvasPattern.cpp \
+	DerivedSources/GdomCanvasPattern.h \
+	DerivedSources/GdomCanvasPixelArray.cpp \
+	DerivedSources/GdomCanvasPixelArray.h \
+	DerivedSources/GdomCanvasRenderingContext2D.cpp \
+	DerivedSources/GdomCanvasRenderingContext2D.h \
+	DerivedSources/GdomCharacterData.cpp \
+	DerivedSources/GdomCharacterData.h \
+	DerivedSources/GdomClipboard.cpp \
+	DerivedSources/GdomClipboard.h \
+	DerivedSources/GdomComment.cpp \
+	DerivedSources/GdomComment.h \
+	DerivedSources/GdomConsole.cpp \
+	DerivedSources/GdomConsole.h \
+	DerivedSources/GdomCounter.cpp \
+	DerivedSources/GdomCounter.h \
+	DerivedSources/GdomDOMCoreException.cpp \
+	DerivedSources/GdomDOMCoreException.h \
+	DerivedSources/GdomDOMImplementation.cpp \
+	DerivedSources/GdomDOMImplementation.h \
+	DerivedSources/GdomDOMParser.cpp \
+	DerivedSources/GdomDOMParser.h \
+	DerivedSources/GdomDOMSelection.cpp \
+	DerivedSources/GdomDOMSelection.h \
+	DerivedSources/GdomDOMWindow.cpp \
+	DerivedSources/GdomDOMWindow.h \
+	DerivedSources/GdomDocument.cpp \
+	DerivedSources/GdomDocument.h \
+	DerivedSources/GdomDocumentFragment.cpp \
+	DerivedSources/GdomDocumentFragment.h \
+	DerivedSources/GdomDocumentType.cpp \
+	DerivedSources/GdomDocumentType.h \
+	DerivedSources/GdomElement.cpp \
+	DerivedSources/GdomElement.h \
+	DerivedSources/GdomEntity.cpp \
+	DerivedSources/GdomEntity.h \
+	DerivedSources/GdomEntityReference.cpp \
+	DerivedSources/GdomEntityReference.h \
+	DerivedSources/GdomEvent.cpp \
+	DerivedSources/GdomEvent.h \
+	DerivedSources/GdomEventException.cpp \
+	DerivedSources/GdomEventException.h \
+	DerivedSources/GdomFile.cpp \
+	DerivedSources/GdomFile.h \
+	DerivedSources/GdomFileList.cpp \
+	DerivedSources/GdomFileList.h \
+	DerivedSources/GdomHTMLAnchorElement.cpp \
+	DerivedSources/GdomHTMLAnchorElement.h \
+	DerivedSources/GdomHTMLAppletElement.cpp \
+	DerivedSources/GdomHTMLAppletElement.h \
+	DerivedSources/GdomHTMLAreaElement.cpp \
+	DerivedSources/GdomHTMLAreaElement.h \
+	DerivedSources/GdomHTMLBRElement.cpp \
+	DerivedSources/GdomHTMLBRElement.h \
+	DerivedSources/GdomHTMLBaseElement.cpp \
+	DerivedSources/GdomHTMLBaseElement.h \
+	DerivedSources/GdomHTMLBaseFontElement.cpp \
+	DerivedSources/GdomHTMLBaseFontElement.h \
+	DerivedSources/GdomHTMLBlockquoteElement.cpp \
+	DerivedSources/GdomHTMLBlockquoteElement.h \
+	DerivedSources/GdomHTMLBodyElement.cpp \
+	DerivedSources/GdomHTMLBodyElement.h \
+	DerivedSources/GdomHTMLButtonElement.cpp \
+	DerivedSources/GdomHTMLButtonElement.h \
+	DerivedSources/GdomHTMLCanvasElement.cpp \
+	DerivedSources/GdomHTMLCanvasElement.h \
+	DerivedSources/GdomHTMLCollection.cpp \
+	DerivedSources/GdomHTMLCollection.h \
+	DerivedSources/GdomHTMLDListElement.cpp \
+	DerivedSources/GdomHTMLDListElement.h \
+	DerivedSources/GdomHTMLDirectoryElement.cpp \
+	DerivedSources/GdomHTMLDirectoryElement.h \
+	DerivedSources/GdomHTMLDivElement.cpp \
+	DerivedSources/GdomHTMLDivElement.h \
+	DerivedSources/GdomHTMLDocument.cpp \
+	DerivedSources/GdomHTMLDocument.h \
+	DerivedSources/GdomHTMLElement.cpp \
+	DerivedSources/GdomHTMLElement.h \
+	DerivedSources/GdomHTMLEmbedElement.cpp \
+	DerivedSources/GdomHTMLEmbedElement.h \
+	DerivedSources/GdomHTMLFieldSetElement.cpp \
+	DerivedSources/GdomHTMLFieldSetElement.h \
+	DerivedSources/GdomHTMLFontElement.cpp \
+	DerivedSources/GdomHTMLFontElement.h \
+	DerivedSources/GdomHTMLFormElement.cpp \
+	DerivedSources/GdomHTMLFormElement.h \
+	DerivedSources/GdomHTMLFrameElement.cpp \
+	DerivedSources/GdomHTMLFrameElement.h \
+	DerivedSources/GdomHTMLFrameSetElement.cpp \
+	DerivedSources/GdomHTMLFrameSetElement.h \
+	DerivedSources/GdomHTMLHRElement.cpp \
+	DerivedSources/GdomHTMLHRElement.h \
+	DerivedSources/GdomHTMLHeadElement.cpp \
+	DerivedSources/GdomHTMLHeadElement.h \
+	DerivedSources/GdomHTMLHeadingElement.cpp \
+	DerivedSources/GdomHTMLHeadingElement.h \
+	DerivedSources/GdomHTMLHtmlElement.cpp \
+	DerivedSources/GdomHTMLHtmlElement.h \
+	DerivedSources/GdomHTMLIFrameElement.cpp \
+	DerivedSources/GdomHTMLIFrameElement.h \
+	DerivedSources/GdomHTMLImageElement.cpp \
+	DerivedSources/GdomHTMLImageElement.h \
+	DerivedSources/GdomHTMLInputElement.cpp \
+	DerivedSources/GdomHTMLInputElement.h \
+	DerivedSources/GdomHTMLIsIndexElement.cpp \
+	DerivedSources/GdomHTMLIsIndexElement.h \
+	DerivedSources/GdomHTMLLIElement.cpp \
+	DerivedSources/GdomHTMLLIElement.h \
+	DerivedSources/GdomHTMLLabelElement.cpp \
+	DerivedSources/GdomHTMLLabelElement.h \
+	DerivedSources/GdomHTMLLegendElement.cpp \
+	DerivedSources/GdomHTMLLegendElement.h \
+	DerivedSources/GdomHTMLLinkElement.cpp \
+	DerivedSources/GdomHTMLLinkElement.h \
+	DerivedSources/GdomHTMLMapElement.cpp \
+	DerivedSources/GdomHTMLMapElement.h \
+	DerivedSources/GdomHTMLMarqueeElement.cpp \
+	DerivedSources/GdomHTMLMarqueeElement.h \
+	DerivedSources/GdomHTMLMenuElement.cpp \
+	DerivedSources/GdomHTMLMenuElement.h \
+	DerivedSources/GdomHTMLMetaElement.cpp \
+	DerivedSources/GdomHTMLMetaElement.h \
+	DerivedSources/GdomHTMLModElement.cpp \
+	DerivedSources/GdomHTMLModElement.h \
+	DerivedSources/GdomHTMLOListElement.cpp \
+	DerivedSources/GdomHTMLOListElement.h \
+	DerivedSources/GdomHTMLObjectElement.cpp \
+	DerivedSources/GdomHTMLObjectElement.h \
+	DerivedSources/GdomHTMLOptGroupElement.cpp \
+	DerivedSources/GdomHTMLOptGroupElement.h \
+	DerivedSources/GdomHTMLOptionElement.cpp \
+	DerivedSources/GdomHTMLOptionElement.h \
+	DerivedSources/GdomHTMLOptionsCollection.cpp \
+	DerivedSources/GdomHTMLOptionsCollection.h \
+	DerivedSources/GdomHTMLParagraphElement.cpp \
+	DerivedSources/GdomHTMLParagraphElement.h \
+	DerivedSources/GdomHTMLParamElement.cpp \
+	DerivedSources/GdomHTMLParamElement.h \
+	DerivedSources/GdomHTMLPreElement.cpp \
+	DerivedSources/GdomHTMLPreElement.h \
+	DerivedSources/GdomHTMLQuoteElement.cpp \
+	DerivedSources/GdomHTMLQuoteElement.h \
+	DerivedSources/GdomHTMLScriptElement.cpp \
+	DerivedSources/GdomHTMLScriptElement.h \
+	DerivedSources/GdomHTMLSelectElement.cpp \
+	DerivedSources/GdomHTMLSelectElement.h \
+	DerivedSources/GdomHTMLStyleElement.cpp \
+	DerivedSources/GdomHTMLStyleElement.h \
+	DerivedSources/GdomHTMLTableCaptionElement.cpp \
+	DerivedSources/GdomHTMLTableCaptionElement.h \
+	DerivedSources/GdomHTMLTableCellElement.cpp \
+	DerivedSources/GdomHTMLTableCellElement.h \
+	DerivedSources/GdomHTMLTableColElement.cpp \
+	DerivedSources/GdomHTMLTableColElement.h \
+	DerivedSources/GdomHTMLTableElement.cpp \
+	DerivedSources/GdomHTMLTableElement.h \
+	DerivedSources/GdomHTMLTableRowElement.cpp \
+	DerivedSources/GdomHTMLTableRowElement.h \
+	DerivedSources/GdomHTMLTableSectionElement.cpp \
+	DerivedSources/GdomHTMLTableSectionElement.h \
+	DerivedSources/GdomHTMLTextAreaElement.cpp \
+	DerivedSources/GdomHTMLTextAreaElement.h \
+	DerivedSources/GdomHTMLTitleElement.cpp \
+	DerivedSources/GdomHTMLTitleElement.h \
+	DerivedSources/GdomHTMLUListElement.cpp \
+	DerivedSources/GdomHTMLUListElement.h \
+	DerivedSources/GdomHistory.cpp \
+	DerivedSources/GdomHistory.h \
+	DerivedSources/GdomImageData.cpp \
+	DerivedSources/GdomImageData.h \
+	DerivedSources/GdomJavaScriptCallFrame.cpp \
+	DerivedSources/GdomJavaScriptCallFrame.h \
+	DerivedSources/GdomKeyboardEvent.cpp \
+	DerivedSources/GdomKeyboardEvent.h \
+	DerivedSources/GdomLocation.cpp \
+	DerivedSources/GdomLocation.h \
+	DerivedSources/GdomMediaList.cpp \
+	DerivedSources/GdomMediaList.h \
+	DerivedSources/GdomMessageEvent.cpp \
+	DerivedSources/GdomMessageEvent.h \
+	DerivedSources/GdomMimeType.cpp \
+	DerivedSources/GdomMimeType.h \
+	DerivedSources/GdomMimeTypeArray.cpp \
+	DerivedSources/GdomMimeTypeArray.h \
+	DerivedSources/GdomMouseEvent.cpp \
+	DerivedSources/GdomMouseEvent.h \
+	DerivedSources/GdomMutationEvent.cpp \
+	DerivedSources/GdomMutationEvent.h \
+	DerivedSources/GdomNamedNodeMap.cpp \
+	DerivedSources/GdomNamedNodeMap.h \
+	DerivedSources/GdomNavigator.cpp \
+	DerivedSources/GdomNavigator.h \
+	DerivedSources/GdomNode.cpp \
+	DerivedSources/GdomNode.h \
+	DerivedSources/GdomNodeFilter.cpp \
+	DerivedSources/GdomNodeFilter.h \
+	DerivedSources/GdomNodeIterator.cpp \
+	DerivedSources/GdomNodeIterator.h \
+	DerivedSources/GdomNodeList.cpp \
+	DerivedSources/GdomNodeList.h \
+	DerivedSources/GdomNotation.cpp \
+	DerivedSources/GdomNotation.h \
+	DerivedSources/GdomOverflowEvent.cpp \
+	DerivedSources/GdomOverflowEvent.h \
+	DerivedSources/GdomPlugin.cpp \
+	DerivedSources/GdomPlugin.h \
+	DerivedSources/GdomPluginArray.cpp \
+	DerivedSources/GdomPluginArray.h \
+	DerivedSources/GdomProcessingInstruction.cpp \
+	DerivedSources/GdomProcessingInstruction.h \
+	DerivedSources/GdomProgressEvent.cpp \
+	DerivedSources/GdomProgressEvent.h \
+	DerivedSources/GdomRange.cpp \
+	DerivedSources/GdomRange.h \
+	DerivedSources/GdomRangeException.cpp \
+	DerivedSources/GdomRangeException.h \
+	DerivedSources/GdomRect.cpp \
+	DerivedSources/GdomRect.h \
+	DerivedSources/GdomScreen.cpp \
+	DerivedSources/GdomScreen.h \
+	DerivedSources/GdomStyleSheet.cpp \
+	DerivedSources/GdomStyleSheet.h \
+	DerivedSources/GdomStyleSheetList.cpp \
+	DerivedSources/GdomStyleSheetList.h \
+	DerivedSources/GdomText.cpp \
+	DerivedSources/GdomText.h \
+	DerivedSources/GdomTextEvent.cpp \
+	DerivedSources/GdomTextEvent.h \
+	DerivedSources/GdomTreeWalker.cpp \
+	DerivedSources/GdomTreeWalker.h \
+	DerivedSources/GdomUIEvent.cpp \
+	DerivedSources/GdomUIEvent.h \
+	DerivedSources/GdomWebKitAnimationEvent.cpp \
+	DerivedSources/GdomWebKitAnimationEvent.h \
+	DerivedSources/GdomWebKitCSSTransformValue.cpp \
+	DerivedSources/GdomWebKitCSSTransformValue.h \
+	DerivedSources/GdomWebKitTransitionEvent.cpp \
+	DerivedSources/GdomWebKitTransitionEvent.h \
+	DerivedSources/GdomWheelEvent.cpp \
+	DerivedSources/GdomWheelEvent.h \
+	DerivedSources/GdomXMLHttpRequest.cpp \
+	DerivedSources/GdomXMLHttpRequest.h \
+	DerivedSources/GdomXMLHttpRequestException.cpp \
+	DerivedSources/GdomXMLHttpRequestException.h \
+	DerivedSources/GdomXMLHttpRequestProgressEvent.cpp \
+	DerivedSources/GdomXMLHttpRequestUpload.cpp \
+	DerivedSources/GdomXMLHttpRequestUpload.h \
+	DerivedSources/GdomXMLSerializer.cpp \
+	DerivedSources/GdomXMLSerializer.h \
+	DerivedSources/GdomXSLTProcessor.cpp \
+	DerivedSources/GdomXSLTProcessor.h \
+	DerivedSources/PrivateGdomAttr.cpp \
+	DerivedSources/PrivateGdomAttr.h \
+	DerivedSources/PrivateGdomBarInfo.cpp \
+	DerivedSources/PrivateGdomBarInfo.h \
+	DerivedSources/PrivateGdomCDATASection.cpp \
+	DerivedSources/PrivateGdomCDATASection.h \
+	DerivedSources/PrivateGdomCSSCharsetRule.cpp \
+	DerivedSources/PrivateGdomCSSCharsetRule.h \
+	DerivedSources/PrivateGdomCSSFontFaceRule.cpp \
+	DerivedSources/PrivateGdomCSSFontFaceRule.h \
+	DerivedSources/PrivateGdomCSSImportRule.cpp \
+	DerivedSources/PrivateGdomCSSImportRule.h \
+	DerivedSources/PrivateGdomCSSMediaRule.cpp \
+	DerivedSources/PrivateGdomCSSMediaRule.h \
+	DerivedSources/PrivateGdomCSSPageRule.cpp \
+	DerivedSources/PrivateGdomCSSPageRule.h \
+	DerivedSources/PrivateGdomCSSPrimitiveValue.cpp \
+	DerivedSources/PrivateGdomCSSPrimitiveValue.h \
+	DerivedSources/PrivateGdomCSSRule.cpp \
+	DerivedSources/PrivateGdomCSSRule.h \
+	DerivedSources/PrivateGdomCSSRuleList.cpp \
+	DerivedSources/PrivateGdomCSSRuleList.h \
+	DerivedSources/PrivateGdomCSSStyleDeclaration.cpp \
+	DerivedSources/PrivateGdomCSSStyleDeclaration.h \
+	DerivedSources/PrivateGdomCSSStyleRule.cpp \
+	DerivedSources/PrivateGdomCSSStyleRule.h \
+	DerivedSources/PrivateGdomCSSStyleSheet.cpp \
+	DerivedSources/PrivateGdomCSSStyleSheet.h \
+	DerivedSources/PrivateGdomCSSValue.cpp \
+	DerivedSources/PrivateGdomCSSValue.h \
+	DerivedSources/PrivateGdomCSSValueList.cpp \
+	DerivedSources/PrivateGdomCSSValueList.h \
+	DerivedSources/PrivateGdomCSSVariablesDeclaration.cpp \
+	DerivedSources/PrivateGdomCSSVariablesDeclaration.h \
+	DerivedSources/PrivateGdomCSSVariablesRule.cpp \
+	DerivedSources/PrivateGdomCSSVariablesRule.h \
+	DerivedSources/PrivateGdomCanvasGradient.cpp \
+	DerivedSources/PrivateGdomCanvasGradient.h \
+	DerivedSources/PrivateGdomCanvasPattern.cpp \
+	DerivedSources/PrivateGdomCanvasPattern.h \
+	DerivedSources/PrivateGdomCanvasPixelArray.cpp \
+	DerivedSources/PrivateGdomCanvasPixelArray.h \
+	DerivedSources/PrivateGdomCanvasRenderingContext2D.cpp \
+	DerivedSources/PrivateGdomCanvasRenderingContext2D.h \
+	DerivedSources/PrivateGdomCharacterData.cpp \
+	DerivedSources/PrivateGdomCharacterData.h \
+	DerivedSources/PrivateGdomClipboard.cpp \
+	DerivedSources/PrivateGdomClipboard.h \
+	DerivedSources/PrivateGdomComment.cpp \
+	DerivedSources/PrivateGdomComment.h \
+	DerivedSources/PrivateGdomConsole.cpp \
+	DerivedSources/PrivateGdomConsole.h \
+	DerivedSources/PrivateGdomCounter.cpp \
+	DerivedSources/PrivateGdomCounter.h \
+	DerivedSources/PrivateGdomDOMCoreException.cpp \
+	DerivedSources/PrivateGdomDOMCoreException.h \
+	DerivedSources/PrivateGdomDOMImplementation.cpp \
+	DerivedSources/PrivateGdomDOMImplementation.h \
+	DerivedSources/PrivateGdomDOMParser.cpp \
+	DerivedSources/PrivateGdomDOMParser.h \
+	DerivedSources/PrivateGdomDOMSelection.cpp \
+	DerivedSources/PrivateGdomDOMSelection.h \
+	DerivedSources/PrivateGdomDOMWindow.cpp \
+	DerivedSources/PrivateGdomDOMWindow.h \
+	DerivedSources/PrivateGdomDocument.cpp \
+	DerivedSources/PrivateGdomDocument.h \
+	DerivedSources/PrivateGdomDocumentFragment.cpp \
+	DerivedSources/PrivateGdomDocumentFragment.h \
+	DerivedSources/PrivateGdomDocumentType.cpp \
+	DerivedSources/PrivateGdomDocumentType.h \
+	DerivedSources/PrivateGdomElement.cpp \
+	DerivedSources/PrivateGdomElement.h \
+	DerivedSources/PrivateGdomEntity.cpp \
+	DerivedSources/PrivateGdomEntity.h \
+	DerivedSources/PrivateGdomEntityReference.cpp \
+	DerivedSources/PrivateGdomEntityReference.h \
+	DerivedSources/PrivateGdomEvent.cpp \
+	DerivedSources/PrivateGdomEvent.h \
+	DerivedSources/PrivateGdomEventException.cpp \
+	DerivedSources/PrivateGdomEventException.h \
+	DerivedSources/PrivateGdomFile.cpp \
+	DerivedSources/PrivateGdomFile.h \
+	DerivedSources/PrivateGdomFileList.cpp \
+	DerivedSources/PrivateGdomFileList.h \
+	DerivedSources/PrivateGdomHTMLAnchorElement.cpp \
+	DerivedSources/PrivateGdomHTMLAnchorElement.h \
+	DerivedSources/PrivateGdomHTMLAppletElement.cpp \
+	DerivedSources/PrivateGdomHTMLAppletElement.h \
+	DerivedSources/PrivateGdomHTMLAreaElement.cpp \
+	DerivedSources/PrivateGdomHTMLAreaElement.h \
+	DerivedSources/PrivateGdomHTMLBRElement.cpp \
+	DerivedSources/PrivateGdomHTMLBRElement.h \
+	DerivedSources/PrivateGdomHTMLBaseElement.cpp \
+	DerivedSources/PrivateGdomHTMLBaseElement.h \
+	DerivedSources/PrivateGdomHTMLBaseFontElement.cpp \
+	DerivedSources/PrivateGdomHTMLBaseFontElement.h \
+	DerivedSources/PrivateGdomHTMLBlockquoteElement.cpp \
+	DerivedSources/PrivateGdomHTMLBlockquoteElement.h \
+	DerivedSources/PrivateGdomHTMLBodyElement.cpp \
+	DerivedSources/PrivateGdomHTMLBodyElement.h \
+	DerivedSources/PrivateGdomHTMLButtonElement.cpp \
+	DerivedSources/PrivateGdomHTMLButtonElement.h \
+	DerivedSources/PrivateGdomHTMLCanvasElement.cpp \
+	DerivedSources/PrivateGdomHTMLCanvasElement.h \
+	DerivedSources/PrivateGdomHTMLCollection.cpp \
+	DerivedSources/PrivateGdomHTMLCollection.h \
+	DerivedSources/PrivateGdomHTMLDListElement.cpp \
+	DerivedSources/PrivateGdomHTMLDListElement.h \
+	DerivedSources/PrivateGdomHTMLDirectoryElement.cpp \
+	DerivedSources/PrivateGdomHTMLDirectoryElement.h \
+	DerivedSources/PrivateGdomHTMLDivElement.cpp \
+	DerivedSources/PrivateGdomHTMLDivElement.h \
+	DerivedSources/PrivateGdomHTMLDocument.cpp \
+	DerivedSources/PrivateGdomHTMLDocument.h \
+	DerivedSources/PrivateGdomHTMLElement.cpp \
+	DerivedSources/PrivateGdomHTMLElement.h \
+	DerivedSources/PrivateGdomHTMLEmbedElement.cpp \
+	DerivedSources/PrivateGdomHTMLEmbedElement.h \
+	DerivedSources/PrivateGdomHTMLFieldSetElement.cpp \
+	DerivedSources/PrivateGdomHTMLFieldSetElement.h \
+	DerivedSources/PrivateGdomHTMLFontElement.cpp \
+	DerivedSources/PrivateGdomHTMLFontElement.h \
+	DerivedSources/PrivateGdomHTMLFormElement.cpp \
+	DerivedSources/PrivateGdomHTMLFormElement.h \
+	DerivedSources/PrivateGdomHTMLFrameElement.cpp \
+	DerivedSources/PrivateGdomHTMLFrameElement.h \
+	DerivedSources/PrivateGdomHTMLFrameSetElement.cpp \
+	DerivedSources/PrivateGdomHTMLFrameSetElement.h \
+	DerivedSources/PrivateGdomHTMLHRElement.cpp \
+	DerivedSources/PrivateGdomHTMLHRElement.h \
+	DerivedSources/PrivateGdomHTMLHeadElement.cpp \
+	DerivedSources/PrivateGdomHTMLHeadElement.h \
+	DerivedSources/PrivateGdomHTMLHeadingElement.cpp \
+	DerivedSources/PrivateGdomHTMLHeadingElement.h \
+	DerivedSources/PrivateGdomHTMLHtmlElement.cpp \
+	DerivedSources/PrivateGdomHTMLHtmlElement.h \
+	DerivedSources/PrivateGdomHTMLIFrameElement.cpp \
+	DerivedSources/PrivateGdomHTMLIFrameElement.h \
+	DerivedSources/PrivateGdomHTMLImageElement.cpp \
+	DerivedSources/PrivateGdomHTMLImageElement.h \
+	DerivedSources/PrivateGdomHTMLInputElement.cpp \
+	DerivedSources/PrivateGdomHTMLInputElement.h \
+	DerivedSources/PrivateGdomHTMLIsIndexElement.cpp \
+	DerivedSources/PrivateGdomHTMLIsIndexElement.h \
+	DerivedSources/PrivateGdomHTMLLIElement.cpp \
+	DerivedSources/PrivateGdomHTMLLIElement.h \
+	DerivedSources/PrivateGdomHTMLLabelElement.cpp \
+	DerivedSources/PrivateGdomHTMLLabelElement.h \
+	DerivedSources/PrivateGdomHTMLLegendElement.cpp \
+	DerivedSources/PrivateGdomHTMLLegendElement.h \
+	DerivedSources/PrivateGdomHTMLLinkElement.cpp \
+	DerivedSources/PrivateGdomHTMLLinkElement.h \
+	DerivedSources/PrivateGdomHTMLMapElement.cpp \
+	DerivedSources/PrivateGdomHTMLMapElement.h \
+	DerivedSources/PrivateGdomHTMLMarqueeElement.cpp \
+	DerivedSources/PrivateGdomHTMLMarqueeElement.h \
+	DerivedSources/PrivateGdomHTMLMenuElement.cpp \
+	DerivedSources/PrivateGdomHTMLMenuElement.h \
+	DerivedSources/PrivateGdomHTMLMetaElement.cpp \
+	DerivedSources/PrivateGdomHTMLMetaElement.h \
+	DerivedSources/PrivateGdomHTMLModElement.cpp \
+	DerivedSources/PrivateGdomHTMLModElement.h \
+	DerivedSources/PrivateGdomHTMLOListElement.cpp \
+	DerivedSources/PrivateGdomHTMLOListElement.h \
+	DerivedSources/PrivateGdomHTMLObjectElement.cpp \
+	DerivedSources/PrivateGdomHTMLObjectElement.h \
+	DerivedSources/PrivateGdomHTMLOptGroupElement.cpp \
+	DerivedSources/PrivateGdomHTMLOptGroupElement.h \
+	DerivedSources/PrivateGdomHTMLOptionElement.cpp \
+	DerivedSources/PrivateGdomHTMLOptionElement.h \
+	DerivedSources/PrivateGdomHTMLOptionsCollection.cpp \
+	DerivedSources/PrivateGdomHTMLOptionsCollection.h \
+	DerivedSources/PrivateGdomHTMLParagraphElement.cpp \
+	DerivedSources/PrivateGdomHTMLParagraphElement.h \
+	DerivedSources/PrivateGdomHTMLParamElement.cpp \
+	DerivedSources/PrivateGdomHTMLParamElement.h \
+	DerivedSources/PrivateGdomHTMLPreElement.cpp \
+	DerivedSources/PrivateGdomHTMLPreElement.h \
+	DerivedSources/PrivateGdomHTMLQuoteElement.cpp \
+	DerivedSources/PrivateGdomHTMLQuoteElement.h \
+	DerivedSources/PrivateGdomHTMLScriptElement.cpp \
+	DerivedSources/PrivateGdomHTMLScriptElement.h \
+	DerivedSources/PrivateGdomHTMLSelectElement.cpp \
+	DerivedSources/PrivateGdomHTMLSelectElement.h \
+	DerivedSources/PrivateGdomHTMLStyleElement.cpp \
+	DerivedSources/PrivateGdomHTMLStyleElement.h \
+	DerivedSources/PrivateGdomHTMLTableCaptionElement.cpp \
+	DerivedSources/PrivateGdomHTMLTableCaptionElement.h \
+	DerivedSources/PrivateGdomHTMLTableCellElement.cpp \
+	DerivedSources/PrivateGdomHTMLTableCellElement.h \
+	DerivedSources/PrivateGdomHTMLTableColElement.cpp \
+	DerivedSources/PrivateGdomHTMLTableColElement.h \
+	DerivedSources/PrivateGdomHTMLTableElement.cpp \
+	DerivedSources/PrivateGdomHTMLTableElement.h \
+	DerivedSources/PrivateGdomHTMLTableRowElement.cpp \
+	DerivedSources/PrivateGdomHTMLTableRowElement.h \
+	DerivedSources/PrivateGdomHTMLTableSectionElement.cpp \
+	DerivedSources/PrivateGdomHTMLTableSectionElement.h \
+	DerivedSources/PrivateGdomHTMLTextAreaElement.cpp \
+	DerivedSources/PrivateGdomHTMLTextAreaElement.h \
+	DerivedSources/PrivateGdomHTMLTitleElement.cpp \
+	DerivedSources/PrivateGdomHTMLTitleElement.h \
+	DerivedSources/PrivateGdomHTMLUListElement.cpp \
+	DerivedSources/PrivateGdomHTMLUListElement.h \
+	DerivedSources/PrivateGdomHistory.cpp \
+	DerivedSources/PrivateGdomHistory.h \
+	DerivedSources/PrivateGdomImageData.cpp \
+	DerivedSources/PrivateGdomImageData.h \
+	DerivedSources/PrivateGdomJavaScriptCallFrame.cpp \
+	DerivedSources/PrivateGdomJavaScriptCallFrame.h \
+	DerivedSources/PrivateGdomKeyboardEvent.cpp \
+	DerivedSources/PrivateGdomKeyboardEvent.h \
+	DerivedSources/PrivateGdomLocation.cpp \
+	DerivedSources/PrivateGdomLocation.h \
+	DerivedSources/PrivateGdomMediaList.cpp \
+	DerivedSources/PrivateGdomMediaList.h \
+	DerivedSources/PrivateGdomMessageEvent.cpp \
+	DerivedSources/PrivateGdomMessageEvent.h \
+	DerivedSources/PrivateGdomMimeType.cpp \
+	DerivedSources/PrivateGdomMimeType.h \
+	DerivedSources/PrivateGdomMimeTypeArray.cpp \
+	DerivedSources/PrivateGdomMimeTypeArray.h \
+	DerivedSources/PrivateGdomMouseEvent.cpp \
+	DerivedSources/PrivateGdomMouseEvent.h \
+	DerivedSources/PrivateGdomMutationEvent.cpp \
+	DerivedSources/PrivateGdomMutationEvent.h \
+	DerivedSources/PrivateGdomNamedNodeMap.cpp \
+	DerivedSources/PrivateGdomNamedNodeMap.h \
+	DerivedSources/PrivateGdomNavigator.cpp \
+	DerivedSources/PrivateGdomNavigator.h \
+	DerivedSources/PrivateGdomNode.cpp \
+	DerivedSources/PrivateGdomNode.h \
+	DerivedSources/PrivateGdomNodeFilter.cpp \
+	DerivedSources/PrivateGdomNodeFilter.h \
+	DerivedSources/PrivateGdomNodeIterator.cpp \
+	DerivedSources/PrivateGdomNodeIterator.h \
+	DerivedSources/PrivateGdomNodeList.cpp \
+	DerivedSources/PrivateGdomNodeList.h \
+	DerivedSources/PrivateGdomNotation.cpp \
+	DerivedSources/PrivateGdomNotation.h \
+	DerivedSources/PrivateGdomOverflowEvent.cpp \
+	DerivedSources/PrivateGdomOverflowEvent.h \
+	DerivedSources/PrivateGdomPlugin.cpp \
+	DerivedSources/PrivateGdomPlugin.h \
+	DerivedSources/PrivateGdomPluginArray.cpp \
+	DerivedSources/PrivateGdomPluginArray.h \
+	DerivedSources/PrivateGdomProcessingInstruction.cpp \
+	DerivedSources/PrivateGdomProcessingInstruction.h \
+	DerivedSources/PrivateGdomProgressEvent.cpp \
+	DerivedSources/PrivateGdomProgressEvent.h \
+	DerivedSources/PrivateGdomRange.cpp \
+	DerivedSources/PrivateGdomRange.h \
+	DerivedSources/PrivateGdomRangeException.cpp \
+	DerivedSources/PrivateGdomRangeException.h \
+	DerivedSources/PrivateGdomRect.cpp \
+	DerivedSources/PrivateGdomRect.h \
+	DerivedSources/PrivateGdomScreen.cpp \
+	DerivedSources/PrivateGdomScreen.h \
+	DerivedSources/PrivateGdomStyleSheet.cpp \
+	DerivedSources/PrivateGdomStyleSheet.h \
+	DerivedSources/PrivateGdomStyleSheetList.cpp \
+	DerivedSources/PrivateGdomStyleSheetList.h \
+	DerivedSources/PrivateGdomText.cpp \
+	DerivedSources/PrivateGdomText.h \
+	DerivedSources/PrivateGdomTextEvent.cpp \
+	DerivedSources/PrivateGdomTextEvent.h \
+	DerivedSources/PrivateGdomTreeWalker.cpp \
+	DerivedSources/PrivateGdomTreeWalker.h \
+	DerivedSources/PrivateGdomUIEvent.cpp \
+	DerivedSources/PrivateGdomUIEvent.h \
+	DerivedSources/PrivateGdomWebKitAnimationEvent.cpp \
+	DerivedSources/PrivateGdomWebKitAnimationEvent.h \
+	DerivedSources/PrivateGdomWebKitCSSTransformValue.cpp \
+	DerivedSources/PrivateGdomWebKitCSSTransformValue.h \
+	DerivedSources/PrivateGdomWebKitTransitionEvent.cpp \
+	DerivedSources/PrivateGdomWebKitTransitionEvent.h \
+	DerivedSources/PrivateGdomWheelEvent.cpp \
+	DerivedSources/PrivateGdomWheelEvent.h \
+	DerivedSources/PrivateGdomXMLHttpRequest.cpp \
+	DerivedSources/PrivateGdomXMLHttpRequest.h \
+	DerivedSources/PrivateGdomXMLHttpRequestException.cpp \
+	DerivedSources/PrivateGdomXMLHttpRequestException.h \
+	DerivedSources/PrivateGdomXMLHttpRequestProgressEvent.cpp \
+	DerivedSources/PrivateGdomXMLHttpRequestUpload.cpp \
+	DerivedSources/PrivateGdomXMLHttpRequestUpload.h \
+	DerivedSources/PrivateGdomXMLSerializer.cpp \
+	DerivedSources/PrivateGdomXMLSerializer.h \
+	DerivedSources/PrivateGdomXSLTProcessor.cpp \
+	DerivedSources/PrivateGdomXSLTProcessor.h  \
+	WebCore/bindings/gdom/GDOMHTMLElementWrapperFactory.cpp \
+	WebCore/bindings/gdom/GDOMHTMLElementWrapperFactory.h 
 
 IDL_BINDINGS +=  \
 	WebCore/css/Counter.idl \
@@ -701,6 +1284,16 @@
 	WebCore/bindings/js/ScriptController.cpp \
 	WebCore/bindings/js/ScriptController.h \
 	WebCore/bindings/js/StringSourceProvider.h \
+	WebCore/bindings/gdom/GDOMBinding.cpp \
+	WebCore/bindings/gdom/GDOMBinding.h \
+	WebCore/bindings/gdom/GdomDOMObject.cpp \
+	WebCore/bindings/gdom/GdomDOMObject.h \
+	WebCore/bindings/gdom/PrivateGdomDOMObject.cpp \
+	WebCore/bindings/gdom/PrivateGdomDOMObject.h \
+	WebCore/bindings/gdom/GdomEventTargetNode.cpp \
+	WebCore/bindings/gdom/GdomEventTargetNode.h \
+	WebCore/bindings/gdom/PrivateGdomEventTargetNode.cpp \
+	WebCore/bindings/gdom/PrivateGdomEventTargetNode.h \
 	WebCore/bridge/NP_jsobject.cpp \
 	WebCore/bridge/NP_jsobject.h \
 	WebCore/bridge/c/c_class.cpp \
@@ -2008,9 +2601,12 @@
 # ----
 if ENABLE_OFFLINE_WEB_APPLICATIONS
 FEATURE_DEFINES_JAVASCRIPT += ENABLE_OFFLINE_WEB_APPLICATIONS=1
+FEATURE_DEFINES_GDOM += ENABLE_OFFLINE_WEB_APPLICATIONS=1
 
 webcore_built_sources += \
-	DerivedSources/JSDOMApplicationCache.cpp
+	DerivedSources/JSDOMApplicationCache.cpp \
+	DerivedSources/GdomDOMApplicationCache.cpp \
+	DerivedSources/PrivateGdomDOMApplicationCache.cpp
 
 IDL_BINDINGS += \
 	WebCore/loader/appcache/DOMApplicationCache.idl
@@ -2052,6 +2648,7 @@
 # ----
 if ENABLE_DATABASE
 FEATURE_DEFINES_JAVASCRIPT += ENABLE_DATABASE=1
+FEATURE_DEFINES_GDOM += ENABLE_DATABASE=1
 
 webcore_built_sources += \
 	DerivedSources/JSDatabase.cpp \
@@ -2063,7 +2660,27 @@
 	DerivedSources/JSSQLResultSetRowList.cpp \
 	DerivedSources/JSSQLResultSetRowList.h \
 	DerivedSources/JSSQLTransaction.cpp \
-	DerivedSources/JSSQLTransaction.h
+	DerivedSources/JSSQLTransaction.h \
+	DerivedSources/GdomDatabase.cpp \
+	DerivedSources/GdomDatabase.h \
+	DerivedSources/GdomSQLError.cpp \
+	DerivedSources/GdomSQLError.h \
+	DerivedSources/GdomSQLResultSet.cpp \
+	DerivedSources/GdomSQLResultSet.h \
+	DerivedSources/GdomSQLResultSetRowList.cpp \
+	DerivedSources/GdomSQLResultSetRowList.h \
+	DerivedSources/GdomSQLTransaction.cpp \
+	DerivedSources/GdomSQLTransaction.h \
+	DerivedSources/PrivateGdomDatabase.cpp \
+	DerivedSources/PrivateGdomDatabase.h \
+	DerivedSources/PrivateGdomSQLError.cpp \
+	DerivedSources/PrivateGdomSQLError.h \
+	DerivedSources/PrivateGdomSQLResultSet.cpp \
+	DerivedSources/PrivateGdomSQLResultSet.h \
+	DerivedSources/PrivateGdomSQLResultSetRowList.cpp \
+	DerivedSources/PrivateGdomSQLResultSetRowList.h \
+	DerivedSources/PrivateGdomSQLTransaction.cpp \
+	DerivedSources/PrivateGdomSQLTransaction.h
 
 IDL_BINDINGS += \
 	WebCore/storage/Database.idl \
@@ -2138,12 +2755,21 @@
 # ----
 if ENABLE_DOM_STORAGE
 FEATURE_DEFINES_JAVASCRIPT += ENABLE_DOM_STORAGE=1
+FEATURE_DEFINES_GDOM += ENABLE_DOM_STORAGE=1
 
 webcore_built_sources += \
 	DerivedSources/JSStorage.cpp \
 	DerivedSources/JSStorage.h \
 	DerivedSources/JSStorageEvent.cpp \
-	DerivedSources/JSStorageEvent.h
+	DerivedSources/JSStorageEvent.h \
+	DerivedSources/GdomStorage.cpp \
+	DerivedSources/GdomStorage.h \
+	DerivedSources/GdomStorageEvent.cpp \
+	DerivedSources/GdomStorageEvent.h \
+	DerivedSources/PrivateGdomStorage.cpp \
+	DerivedSources/PrivateGdomStorage.h \
+	DerivedSources/PrivateGdomStorageEvent.cpp \
+	DerivedSources/PrivateGdomStorageEvent.h
 
 IDL_BINDINGS += \
 	WebCore/storage/Storage.idl \
@@ -2203,6 +2829,7 @@
 # ----
 if ENABLE_VIDEO
 FEATURE_DEFINES_JAVASCRIPT += ENABLE_VIDEO=1
+FEATURE_DEFINES_GDOM += ENABLE_VIDEO=1
 
 HTML_FEATURES += ENABLE_VIDEO=1
 webcore_cppflags += -DENABLE_VIDEO=1
@@ -2225,7 +2852,35 @@
 	DerivedSources/JSTimeRanges.cpp \
 	DerivedSources/JSTimeRanges.h \
 	DerivedSources/JSVoidCallback.cpp \
-	DerivedSources/JSVoidCallback.h
+	DerivedSources/JSVoidCallback.h \
+	DerivedSources/GdomHTMLAudioElement.cpp \
+	DerivedSources/GdomHTMLAudioElement.h \
+	DerivedSources/GdomHTMLMediaElement.cpp \
+	DerivedSources/GdomHTMLMediaElement.h \
+	DerivedSources/GdomHTMLSourceElement.cpp \
+	DerivedSources/GdomHTMLSourceElement.h \
+	DerivedSources/GdomHTMLVideoElement.cpp \
+	DerivedSources/GdomHTMLVideoElement.h \
+	DerivedSources/GdomMediaError.cpp \
+	DerivedSources/GdomMediaError.h \
+	DerivedSources/GdomTimeRanges.cpp \
+	DerivedSources/GdomTimeRanges.h \
+	DerivedSources/GdomVoidCallback.cpp \
+	DerivedSources/GdomVoidCallback.h \
+	DerivedSources/PrivateGdomHTMLAudioElement.cpp \
+	DerivedSources/PrivateGdomHTMLAudioElement.h \
+	DerivedSources/PrivateGdomHTMLMediaElement.cpp \
+	DerivedSources/PrivateGdomHTMLMediaElement.h \
+	DerivedSources/PrivateGdomHTMLSourceElement.cpp \
+	DerivedSources/PrivateGdomHTMLSourceElement.h \
+	DerivedSources/PrivateGdomHTMLVideoElement.cpp \
+	DerivedSources/PrivateGdomHTMLVideoElement.h \
+	DerivedSources/PrivateGdomMediaError.cpp \
+	DerivedSources/PrivateGdomMediaError.h \
+	DerivedSources/PrivateGdomTimeRanges.cpp \
+	DerivedSources/PrivateGdomTimeRanges.h \
+	DerivedSources/PrivateGdomVoidCallback.cpp \
+	DerivedSources/PrivateGdomVoidCallback.h
 
 IDL_BINDINGS += \
 	WebCore/html/HTMLAudioElement.idl \
@@ -2269,6 +2924,7 @@
 # ----
 if ENABLE_XPATH
 FEATURE_DEFINES_JAVASCRIPT += ENABLE_XPATH=1
+FEATURE_DEFINES_GDOM += ENABLE_XPATH=1
 
 webcore_cppflags += -DENABLE_XPATH=1
 
@@ -2284,7 +2940,27 @@
 	DerivedSources/JSXPathResult.cpp \
 	DerivedSources/JSXPathResult.h \
 	DerivedSources/XPathGrammar.cpp \
-	DerivedSources/XPathGrammar.h
+	DerivedSources/XPathGrammar.h \
+	DerivedSources/GdomXPathEvaluator.cpp \
+	DerivedSources/GdomXPathEvaluator.h \
+	DerivedSources/GdomXPathException.cpp \
+	DerivedSources/GdomXPathException.h \
+	DerivedSources/GdomXPathExpression.cpp \
+	DerivedSources/GdomXPathExpression.h \
+	DerivedSources/GdomXPathNSResolver.cpp \
+	DerivedSources/GdomXPathNSResolver.h \
+	DerivedSources/GdomXPathResult.cpp \
+	DerivedSources/GdomXPathResult.h \
+	DerivedSources/PrivateGdomXPathEvaluator.cpp \
+	DerivedSources/PrivateGdomXPathEvaluator.h \
+	DerivedSources/PrivateGdomXPathException.cpp \
+	DerivedSources/PrivateGdomXPathException.h \
+	DerivedSources/PrivateGdomXPathExpression.cpp \
+	DerivedSources/PrivateGdomXPathExpression.h \
+	DerivedSources/PrivateGdomXPathNSResolver.cpp \
+	DerivedSources/PrivateGdomXPathNSResolver.h \
+	DerivedSources/PrivateGdomXPathResult.cpp \
+	DerivedSources/PrivateGdomXPathResult.h
 
 IDL_BINDINGS += \
 	WebCore/xml/XPathEvaluator.idl \
@@ -2349,6 +3025,7 @@
 # ----
 if ENABLE_XSLT
 FEATURE_DEFINES_JAVASCRIPT += ENABLE_XSLT=1
+FEATURE_DEFINES_GDOM += ENABLE_XSLT=1
 
 webcore_cppflags += -DENABLE_XSLT=1
 
@@ -2372,6 +3049,7 @@
 # ----
 if ENABLE_SVG
 FEATURE_DEFINES_JAVASCRIPT += ENABLE_SVG=1
+#FEATURE_DEFINES_GDOM += ENABLE_SVG=1 - big TODO! :)
 
 WEBCORE_CSS_PROPERTY_NAMES += $(WebCore)/css/SVGCSSPropertyNames.in 
 WEBCORE_CSS_VALUE_KEYWORDS += $(WebCore)/css/SVGCSSValueKeywords.in
@@ -2649,6 +3327,273 @@
 	DerivedSources/SVGNames.cpp \
 	DerivedSources/XLinkNames.cpp
 
+not-yet:
+	DerivedSources/GdomSVGAElement.cpp \
+	DerivedSources/GdomSVGAElement.h \
+	DerivedSources/GdomSVGAltGlyphElement.cpp \
+	DerivedSources/GdomSVGAltGlyphElement.h \
+	DerivedSources/GdomSVGAngle.cpp \
+	DerivedSources/GdomSVGAngle.h \
+	DerivedSources/GdomSVGAnimateColorElement.cpp \
+	DerivedSources/GdomSVGAnimateColorElement.h \
+	DerivedSources/GdomSVGAnimateElement.cpp \
+	DerivedSources/GdomSVGAnimateElement.h \
+	DerivedSources/GdomSVGAnimateTransformElement.cpp \
+	DerivedSources/GdomSVGAnimateTransformElement.h \
+	DerivedSources/GdomSVGAnimatedAngle.cpp \
+	DerivedSources/GdomSVGAnimatedAngle.h \
+	DerivedSources/GdomSVGAnimatedBoolean.cpp \
+	DerivedSources/GdomSVGAnimatedBoolean.h \
+	DerivedSources/GdomSVGAnimatedEnumeration.cpp \
+	DerivedSources/GdomSVGAnimatedEnumeration.h \
+	DerivedSources/GdomSVGAnimatedInteger.cpp \
+	DerivedSources/GdomSVGAnimatedInteger.h \
+	DerivedSources/GdomSVGAnimatedLength.cpp \
+	DerivedSources/GdomSVGAnimatedLength.h \
+	DerivedSources/GdomSVGAnimatedLengthList.cpp \
+	DerivedSources/GdomSVGAnimatedLengthList.h \
+	DerivedSources/GdomSVGAnimatedNumber.cpp \
+	DerivedSources/GdomSVGAnimatedNumber.h \
+	DerivedSources/GdomSVGAnimatedNumberList.cpp \
+	DerivedSources/GdomSVGAnimatedNumberList.h \
+	DerivedSources/GdomSVGAnimatedPreserveAspectRatio.cpp \
+	DerivedSources/GdomSVGAnimatedPreserveAspectRatio.h \
+	DerivedSources/GdomSVGAnimatedRect.cpp \
+	DerivedSources/GdomSVGAnimatedRect.h \
+	DerivedSources/GdomSVGAnimatedString.cpp \
+	DerivedSources/GdomSVGAnimatedString.h \
+	DerivedSources/GdomSVGAnimatedTransformList.cpp \
+	DerivedSources/GdomSVGAnimatedTransformList.h \
+	DerivedSources/GdomSVGAnimationElement.cpp \
+	DerivedSources/GdomSVGAnimationElement.h \
+	DerivedSources/GdomSVGCircleElement.cpp \
+	DerivedSources/GdomSVGCircleElement.h \
+	DerivedSources/GdomSVGClipPathElement.cpp \
+	DerivedSources/GdomSVGClipPathElement.h \
+	DerivedSources/GdomSVGColor.cpp \
+	DerivedSources/GdomSVGColor.h \
+	DerivedSources/GdomSVGComponentTransferFunctionElement.cpp \
+	DerivedSources/GdomSVGComponentTransferFunctionElement.h \
+	DerivedSources/GdomSVGCursorElement.cpp \
+	DerivedSources/GdomSVGCursorElement.h \
+	DerivedSources/GdomSVGDefinitionSrcElement.cpp \
+	DerivedSources/GdomSVGDefinitionSrcElement.h \
+	DerivedSources/GdomSVGDefsElement.cpp \
+	DerivedSources/GdomSVGDefsElement.h \
+	DerivedSources/GdomSVGDescElement.cpp \
+	DerivedSources/GdomSVGDescElement.h \
+	DerivedSources/GdomSVGDocument.cpp \
+	DerivedSources/GdomSVGDocument.h \
+	DerivedSources/GdomSVGElement.cpp \
+	DerivedSources/GdomSVGElement.h \
+	DerivedSources/GdomSVGElementInstance.cpp \
+	DerivedSources/GdomSVGElementInstance.h \
+	DerivedSources/GdomSVGElementInstanceList.cpp \
+	DerivedSources/GdomSVGElementInstanceList.h \
+	DerivedSources/GdomSVGElementWrapperFactory.cpp \
+	DerivedSources/GdomSVGEllipseElement.cpp \
+	DerivedSources/GdomSVGEllipseElement.h \
+	DerivedSources/GdomSVGException.cpp \
+	DerivedSources/GdomSVGException.h \
+	DerivedSources/GdomSVGFEBlendElement.cpp \
+	DerivedSources/GdomSVGFEBlendElement.h \
+	DerivedSources/GdomSVGFEColorMatrixElement.cpp \
+	DerivedSources/GdomSVGFEColorMatrixElement.h \
+	DerivedSources/GdomSVGFEComponentTransferElement.cpp \
+	DerivedSources/GdomSVGFEComponentTransferElement.h \
+	DerivedSources/GdomSVGFECompositeElement.cpp \
+	DerivedSources/GdomSVGFECompositeElement.h \
+	DerivedSources/GdomSVGFEDiffuseLightingElement.cpp \
+	DerivedSources/GdomSVGFEDiffuseLightingElement.h \
+	DerivedSources/GdomSVGFEDisplacementMapElement.cpp \
+	DerivedSources/GdomSVGFEDisplacementMapElement.h \
+	DerivedSources/GdomSVGFEDistantLightElement.cpp \
+	DerivedSources/GdomSVGFEDistantLightElement.h \
+	DerivedSources/GdomSVGFEFloodElement.cpp \
+	DerivedSources/GdomSVGFEFloodElement.h \
+	DerivedSources/GdomSVGFEFuncAElement.cpp \
+	DerivedSources/GdomSVGFEFuncAElement.h \
+	DerivedSources/GdomSVGFEFuncBElement.cpp \
+	DerivedSources/GdomSVGFEFuncBElement.h \
+	DerivedSources/GdomSVGFEFuncGElement.cpp \
+	DerivedSources/GdomSVGFEFuncGElement.h \
+	DerivedSources/GdomSVGFEFuncRElement.cpp \
+	DerivedSources/GdomSVGFEFuncRElement.h \
+	DerivedSources/GdomSVGFEGaussianBlurElement.cpp \
+	DerivedSources/GdomSVGFEGaussianBlurElement.h \
+	DerivedSources/GdomSVGFEImageElement.cpp \
+	DerivedSources/GdomSVGFEImageElement.h \
+	DerivedSources/GdomSVGFEMergeElement.cpp \
+	DerivedSources/GdomSVGFEMergeElement.h \
+	DerivedSources/GdomSVGFEMergeNodeElement.cpp \
+	DerivedSources/GdomSVGFEMergeNodeElement.h \
+	DerivedSources/GdomSVGFEOffsetElement.cpp \
+	DerivedSources/GdomSVGFEOffsetElement.h \
+	DerivedSources/GdomSVGFEPointLightElement.cpp \
+	DerivedSources/GdomSVGFEPointLightElement.h \
+	DerivedSources/GdomSVGFESpecularLightingElement.cpp \
+	DerivedSources/GdomSVGFESpecularLightingElement.h \
+	DerivedSources/GdomSVGFESpotLightElement.cpp \
+	DerivedSources/GdomSVGFESpotLightElement.h \
+	DerivedSources/GdomSVGFETileElement.cpp \
+	DerivedSources/GdomSVGFETileElement.h \
+	DerivedSources/GdomSVGFETurbulenceElement.cpp \
+	DerivedSources/GdomSVGFETurbulenceElement.h \
+	DerivedSources/GdomSVGFilterElement.cpp \
+	DerivedSources/GdomSVGFilterElement.h \
+	DerivedSources/GdomSVGFontElement.cpp \
+	DerivedSources/GdomSVGFontElement.h \
+	DerivedSources/GdomSVGFontFaceElement.cpp \
+	DerivedSources/GdomSVGFontFaceElement.h \
+	DerivedSources/GdomSVGFontFaceFormatElement.cpp \
+	DerivedSources/GdomSVGFontFaceFormatElement.h \
+	DerivedSources/GdomSVGFontFaceNameElement.cpp \
+	DerivedSources/GdomSVGFontFaceNameElement.h \
+	DerivedSources/GdomSVGFontFaceSrcElement.cpp \
+	DerivedSources/GdomSVGFontFaceSrcElement.h \
+	DerivedSources/GdomSVGFontFaceUriElement.cpp \
+	DerivedSources/GdomSVGFontFaceUriElement.h \
+	DerivedSources/GdomSVGForeignObjectElement.cpp \
+	DerivedSources/GdomSVGForeignObjectElement.h \
+	DerivedSources/GdomSVGGElement.cpp \
+	DerivedSources/GdomSVGGElement.h \
+	DerivedSources/GdomSVGGlyphElement.cpp \
+	DerivedSources/GdomSVGGlyphElement.h \
+	DerivedSources/GdomSVGGradientElement.cpp \
+	DerivedSources/GdomSVGGradientElement.h \
+	DerivedSources/GdomSVGImageElement.cpp \
+	DerivedSources/GdomSVGImageElement.h \
+	DerivedSources/GdomSVGLength.cpp \
+	DerivedSources/GdomSVGLength.h \
+	DerivedSources/GdomSVGLengthList.cpp \
+	DerivedSources/GdomSVGLengthList.h \
+	DerivedSources/GdomSVGLineElement.cpp \
+	DerivedSources/GdomSVGLineElement.h \
+	DerivedSources/GdomSVGLinearGradientElement.cpp \
+	DerivedSources/GdomSVGLinearGradientElement.h \
+	DerivedSources/GdomSVGMarkerElement.cpp \
+	DerivedSources/GdomSVGMarkerElement.h \
+	DerivedSources/GdomSVGMaskElement.cpp \
+	DerivedSources/GdomSVGMaskElement.h \
+	DerivedSources/GdomSVGMatrix.cpp \
+	DerivedSources/GdomSVGMatrix.h \
+	DerivedSources/GdomSVGMetadataElement.cpp \
+	DerivedSources/GdomSVGMetadataElement.h \
+	DerivedSources/GdomSVGMissingGlyphElement.cpp \
+	DerivedSources/GdomSVGMissingGlyphElement.h \
+	DerivedSources/GdomSVGNumber.cpp \
+	DerivedSources/GdomSVGNumber.h \
+	DerivedSources/GdomSVGNumberList.cpp \
+	DerivedSources/GdomSVGNumberList.h \
+	DerivedSources/GdomSVGPaint.cpp \
+	DerivedSources/GdomSVGPaint.h \
+	DerivedSources/GdomSVGPathElement.cpp \
+	DerivedSources/GdomSVGPathElement.h \
+	DerivedSources/GdomSVGPathSeg.cpp \
+	DerivedSources/GdomSVGPathSeg.h \
+	DerivedSources/GdomSVGPathSegArcAbs.cpp \
+	DerivedSources/GdomSVGPathSegArcAbs.h \
+	DerivedSources/GdomSVGPathSegArcRel.cpp \
+	DerivedSources/GdomSVGPathSegArcRel.h \
+	DerivedSources/GdomSVGPathSegClosePath.cpp \
+	DerivedSources/GdomSVGPathSegClosePath.h \
+	DerivedSources/GdomSVGPathSegCurvetoCubicAbs.cpp \
+	DerivedSources/GdomSVGPathSegCurvetoCubicAbs.h \
+	DerivedSources/GdomSVGPathSegCurvetoCubicRel.cpp \
+	DerivedSources/GdomSVGPathSegCurvetoCubicRel.h \
+	DerivedSources/GdomSVGPathSegCurvetoCubicSmoothAbs.cpp \
+	DerivedSources/GdomSVGPathSegCurvetoCubicSmoothAbs.h \
+	DerivedSources/GdomSVGPathSegCurvetoCubicSmoothRel.cpp \
+	DerivedSources/GdomSVGPathSegCurvetoCubicSmoothRel.h \
+	DerivedSources/GdomSVGPathSegCurvetoQuadraticAbs.cpp \
+	DerivedSources/GdomSVGPathSegCurvetoQuadraticAbs.h \
+	DerivedSources/GdomSVGPathSegCurvetoQuadraticRel.cpp \
+	DerivedSources/GdomSVGPathSegCurvetoQuadraticRel.h \
+	DerivedSources/GdomSVGPathSegCurvetoQuadraticSmoothAbs.cpp \
+	DerivedSources/GdomSVGPathSegCurvetoQuadraticSmoothAbs.h \
+	DerivedSources/GdomSVGPathSegCurvetoQuadraticSmoothRel.cpp \
+	DerivedSources/GdomSVGPathSegCurvetoQuadraticSmoothRel.h \
+	DerivedSources/GdomSVGPathSegLinetoAbs.cpp \
+	DerivedSources/GdomSVGPathSegLinetoAbs.h \
+	DerivedSources/GdomSVGPathSegLinetoHorizontalAbs.cpp \
+	DerivedSources/GdomSVGPathSegLinetoHorizontalAbs.h \
+	DerivedSources/GdomSVGPathSegLinetoHorizontalRel.cpp \
+	DerivedSources/GdomSVGPathSegLinetoHorizontalRel.h \
+	DerivedSources/GdomSVGPathSegLinetoRel.cpp \
+	DerivedSources/GdomSVGPathSegLinetoRel.h \
+	DerivedSources/GdomSVGPathSegLinetoVerticalAbs.cpp \
+	DerivedSources/GdomSVGPathSegLinetoVerticalAbs.h \
+	DerivedSources/GdomSVGPathSegLinetoVerticalRel.cpp \
+	DerivedSources/GdomSVGPathSegLinetoVerticalRel.h \
+	DerivedSources/GdomSVGPathSegList.cpp \
+	DerivedSources/GdomSVGPathSegList.h \
+	DerivedSources/GdomSVGPathSegMovetoAbs.cpp \
+	DerivedSources/GdomSVGPathSegMovetoAbs.h \
+	DerivedSources/GdomSVGPathSegMovetoRel.cpp \
+	DerivedSources/GdomSVGPathSegMovetoRel.h \
+	DerivedSources/GdomSVGPatternElement.cpp \
+	DerivedSources/GdomSVGPatternElement.h \
+	DerivedSources/GdomSVGPoint.cpp \
+	DerivedSources/GdomSVGPoint.h \
+	DerivedSources/GdomSVGPointList.cpp \
+	DerivedSources/GdomSVGPointList.h \
+	DerivedSources/GdomSVGPolygonElement.cpp \
+	DerivedSources/GdomSVGPolygonElement.h \
+	DerivedSources/GdomSVGPolylineElement.cpp \
+	DerivedSources/GdomSVGPolylineElement.h \
+	DerivedSources/GdomSVGPreserveAspectRatio.cpp \
+	DerivedSources/GdomSVGPreserveAspectRatio.h \
+	DerivedSources/GdomSVGRadialGradientElement.cpp \
+	DerivedSources/GdomSVGRadialGradientElement.h \
+	DerivedSources/GdomSVGRect.cpp \
+	DerivedSources/GdomSVGRect.h \
+	DerivedSources/GdomSVGRectElement.cpp \
+	DerivedSources/GdomSVGRectElement.h \
+	DerivedSources/GdomSVGRenderingIntent.cpp \
+	DerivedSources/GdomSVGRenderingIntent.h \
+	DerivedSources/GdomSVGSVGElement.cpp \
+	DerivedSources/GdomSVGSVGElement.h \
+	DerivedSources/GdomSVGScriptElement.cpp \
+	DerivedSources/GdomSVGScriptElement.h \
+	DerivedSources/GdomSVGSetElement.cpp \
+	DerivedSources/GdomSVGSetElement.h \
+	DerivedSources/GdomSVGStopElement.cpp \
+	DerivedSources/GdomSVGStopElement.h \
+	DerivedSources/GdomSVGStringList.cpp \
+	DerivedSources/GdomSVGStringList.h \
+	DerivedSources/GdomSVGStyleElement.cpp \
+	DerivedSources/GdomSVGStyleElement.h \
+	DerivedSources/GdomSVGSwitchElement.cpp \
+	DerivedSources/GdomSVGSwitchElement.h \
+	DerivedSources/GdomSVGSymbolElement.cpp \
+	DerivedSources/GdomSVGSymbolElement.h \
+	DerivedSources/GdomSVGTRefElement.cpp \
+	DerivedSources/GdomSVGTRefElement.h \
+	DerivedSources/GdomSVGTSpanElement.cpp \
+	DerivedSources/GdomSVGTSpanElement.h \
+	DerivedSources/GdomSVGTextContentElement.cpp \
+	DerivedSources/GdomSVGTextContentElement.h \
+	DerivedSources/GdomSVGTextElement.cpp \
+	DerivedSources/GdomSVGTextElement.h \
+	DerivedSources/GdomSVGTextPathElement.cpp \
+	DerivedSources/GdomSVGTextPathElement.h \
+	DerivedSources/GdomSVGTextPositioningElement.cpp \
+	DerivedSources/GdomSVGTextPositioningElement.h \
+	DerivedSources/GdomSVGTitleElement.cpp \
+	DerivedSources/GdomSVGTitleElement.h \
+	DerivedSources/GdomSVGTransform.cpp \
+	DerivedSources/GdomSVGTransform.h \
+	DerivedSources/GdomSVGTransformList.cpp \
+	DerivedSources/GdomSVGTransformList.h \
+	DerivedSources/GdomSVGUnitTypes.cpp \
+	DerivedSources/GdomSVGUnitTypes.h \
+	DerivedSources/GdomSVGUseElement.cpp \
+	DerivedSources/GdomSVGUseElement.h \
+	DerivedSources/GdomSVGViewElement.cpp \
+	DerivedSources/GdomSVGViewElement.h \
+	DerivedSources/GdomSVGZoomEvent.cpp \
+	DerivedSources/GdomSVGZoomEvent.h 
+
 IDL_BINDINGS += \
 	WebCore/svg/ElementTimeControl.idl \
 	WebCore/svg/SVGAElement.idl \
@@ -3228,36 +4173,42 @@
 # SVG Features
 if ENABLE_SVG_USE
 FEATURE_DEFINES_JAVASCRIPT += ENABLE_SVG_USE=1
+#FEATURE_DEFINES_GDOM += ENABLE_SVG_USE=1 # big TODO!
 SVG_FEATURES += ENABLE_SVG_USE=1
 webcore_cppflags += -DENABLE_SVG_USE=1
 endif
 
 if ENABLE_SVG_FOREIGN_OBJECT
 FEATURE_DEFINES_JAVASCRIPT += ENABLE_SVG_FOREIGN_OBJECT=1
+#FEATURE_DEFINES_GDOM += ENABLE_SVG_FOREIGN_OBJECT=1 
 SVG_FEATURES += ENABLE_SVG_FOREIGN_OBJECT=1
 webcore_cppflags += -DENABLE_SVG_FOREIGN_OBJECT=1
 endif
 
 if ENABLE_SVG_FONTS
 FEATURE_DEFINES_JAVASCRIPT += ENABLE_SVG_FONTS=1
+#FEATURE_DEFINES_GDOM += ENABLE_SVG_FONTS=1
 SVG_FEATURES += ENABLE_SVG_FONTS=1
 webcore_cppflags += -DENABLE_SVG_FONTS=1
 endif
 
 if ENABLE_SVG_FILTERS
 FEATURE_DEFINES_JAVASCRIPT += ENABLE_SVG_FILTERS=1
+#FEATURE_DEFINES_GDOM += ENABLE_SVG_FILTERS=1
 SVG_FEATURES += ENABLE_SVG_FILTERS=1
 webcore_cppflags += -DENABLE_SVG_FILTERS=1
 endif
 
 if ENABLE_SVG_AS_IMAGE
 FEATURE_DEFINES_JAVASCRIPT += ENABLE_SVG_AS_IMAGE=1
+#FEATURE_DEFINES_GDOM += ENABLE_SVG_AS_IMAGE=1
 SVG_FEATURES += ENABLE_SVG_AS_IMAGE=1
 webcore_cppflags += -DENABLE_SVG_AS_IMAGE=1
 endif
 
 if ENABLE_SVG_ANIMATION
 FEATURE_DEFINES_JAVASCRIPT += ENABLE_SVG_ANIMATION=1
+#FEATURE_DEFINES_GDOM += ENABLE_SVG_ANIMATION=1
 SVG_FEATURES += ENABLE_SVG_ANIMATION=1
 webcore_cppflags += -DENABLE_SVG_ANIMATION=1
 endif
@@ -3265,13 +4216,14 @@
 # SVG tag and attribute names (need to pass an extra flag if svg experimental features are enabled)
 DerivedSources/SVGNames.cpp: DerivedSources/SVGElementFactory.cpp;
 DerivedSources/JSSVGElementWrapperFactory.cpp: DerivedSources/SVGElementFactory.cpp
+DerivedSources/GdomSVGElementWrapperFactory.cpp: DerivedSources/SVGElementFactory.cpp
 
 if SVG_FLAGS
 DerivedSources/SVGElementFactory.cpp: $(WebCore)/dom/make_names.pl $(WebCore)/svg/svgtags.in $(WebCore)/svg/svgattrs.in
-	$(PERL) -I$(WebCore)/bindings/scripts $< --tags $(WebCore)/svg/svgtags.in --attrs $(WebCore)/svg/svgattrs.in --extraDefines "$(SVG_FEATURES)" --outputDir "$(GENSOURCES)"
+	$(PERL) -I$(WebCore)/bindings/scripts $< --tags $(WebCore)/svg/svgtags.in --attrs $(WebCore)/svg/svgattrs.in --extraDefines "$(SVG_FEATURES)" --outputDir "$(GENSOURCES)" 
 else
 DerivedSources/SVGElementFactory.cpp: $(WebCore)/dom/make_names.pl $(WebCore)/svg/svgtags.in $(WebCore)/svg/svgattrs.in
-	$(PERL) -I$(WebCore)/bindings/scripts $< --tags $(WebCore)/svg/svgtags.in --attrs $(WebCore)/svg/svgattrs.in --outputDir "$(GENSOURCES)"
+	$(PERL) -I$(WebCore)/bindings/scripts $< --tags $(WebCore)/svg/svgtags.in --attrs $(WebCore)/svg/svgattrs.in --outputDir "$(GENSOURCES)" 
 
 endif # SVG_FLAGS
 
@@ -3280,7 +4232,7 @@
 DerivedSources/XLinkNames.h: DerivedSources/XLinkNames.cpp;
 
 DerivedSources/XLinkNames.cpp : $(WebCore)/dom/make_names.pl $(WebCore)/svg/xlinkattrs.in
-	$(PERL) -I$(WebCore)/bindings/scripts $< --attrs $(WebCore)/svg/xlinkattrs.in --outputDir "$(GENSOURCES)"
+	$(PERL) -I$(WebCore)/bindings/scripts $< --attrs $(WebCore)/svg/xlinkattrs.in --outputDir "$(GENSOURCES)" 
 
 endif # END ENABLE_SVG
 
@@ -3361,16 +4313,16 @@
 
 if HTML_FLAGS
 DerivedSources/HTMLNames.cpp: $(WebCore)/dom/make_names.pl $(WebCore)/html/HTMLTagNames.in $(WebCore)/html/HTMLAttributeNames.in
-	$(PERL) -I$(WebCore)/bindings/scripts $< --tags $(WebCore)/html/HTMLTagNames.in --attrs $(WebCore)/html/HTMLAttributeNames.in --extraDefines "$(HTML_FEATURES)" --outputDir "$(GENSOURCES)"
+	$(PERL) -I$(WebCore)/bindings/scripts $< --tags $(WebCore)/html/HTMLTagNames.in --attrs $(WebCore)/html/HTMLAttributeNames.in --extraDefines "$(HTML_FEATURES)" --outputDir "$(GENSOURCES)" 
 else
 DerivedSources/HTMLNames.cpp: $(WebCore)/dom/make_names.pl $(WebCore)/html/HTMLTagNames.in $(WebCore)/html/HTMLAttributeNames.in
-	$(PERL) -I$(WebCore)/bindings/scripts $< --tags $(WebCore)/html/HTMLTagNames.in --attrs $(WebCore)/html/HTMLAttributeNames.in --outputDir "$(GENSOURCES)"
+	$(PERL) -I$(WebCore)/bindings/scripts $< --tags $(WebCore)/html/HTMLTagNames.in --attrs $(WebCore)/html/HTMLAttributeNames.in --outputDir "$(GENSOURCES)" 
 endif # HTML_FLAGS
 
 DerivedSources/XMLNames.h: DerivedSources/XMLNames.cpp;
 
 DerivedSources/XMLNames.cpp: $(WebCore)/dom/make_names.pl $(WebCore)/xml/xmlattrs.in
-	$(PERL) -I$(WebCore)/bindings/scripts $< --attrs $(WebCore)/xml/xmlattrs.in --outputDir "$(GENSOURCES)"
+	$(PERL) -I$(WebCore)/bindings/scripts $< --attrs $(WebCore)/xml/xmlattrs.in --outputDir "$(GENSOURCES)" 
 
 vpath %.idl = \
     $(WebCore) \
@@ -3386,6 +4338,15 @@
     $(WebCore)/xml \
     $(WebCore)/plugins
 
+DerivedSources/PrivateGdom%.h: DerivedSources/Gdom%.h;
+
+DerivedSources/PrivateGdom%.cpp: DerivedSources/Gdom%.cpp;
+
+DerivedSources/Gdom%.h: DerivedSources/Gdom%.cpp;
+
+DerivedSources/Gdom%.cpp: %.idl $(SCRIPTS_BINDINGS) $(WebCore)/bindings/scripts/CodeGeneratorGObject.pm
+	$(PERL) -I$(WebCore)/bindings/scripts $(WebCore)/bindings/scripts/generate-bindings.pl --include $(WebCore)/dom --include $(WebCore)/html --include $(WebCore)/css --include $(WebCore)/page --include $(WebCore)/xml --include $(WebCore)/svg --outputDir "$(GENSOURCES)" --defines "$(FEATURE_DEFINES_GDOM)" --generator GObject $<
+
 DerivedSources/JS%.h: DerivedSources/JS%.cpp;
 
 DerivedSources/JS%.cpp: %.idl $(SCRIPTS_BINDINGS) $(WebCore)/bindings/scripts/CodeGeneratorJS.pm
@@ -3401,6 +4362,7 @@
 	WebCore/bindings/scripts/InFilesParser.pm \
 	WebCore/bindings/scripts/generate-bindings.pl \
 	WebCore/bindings/scripts/CodeGeneratorJS.pm \
+	WebCore/bindings/scripts/CodeGeneratorGObject.pm \
 	WebCore/css/html4.css \
 	WebCore/css/quirks.css \
 	WebCore/css/view-source.css \
Index: WebCore/bindings/gdom/PrivateGdomEventTargetNode.cpp
===================================================================
--- WebCore/bindings/gdom/PrivateGdomEventTargetNode.cpp	(revision 0)
+++ WebCore/bindings/gdom/PrivateGdomEventTargetNode.cpp	(revision 0)
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2008 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
+ * Copyright (C) 2008 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2008 Apple Inc.
+ */
+
+
+#include "config.h"
+#include "glib-object.h"
+#include "Node.h"
+#include "GdomEventTargetNode.h"
+#include "PrivateGdomEventTargetNode.h"
+#include "PrivateIntGdomEventTargetNode.h"
+#include "PrivateGdomDOMObject.h" /* yukk: TODO - make this optional */
+#include "webkitmarshal.h"
+#include "GdomEvent.h"
+enum {
+    BROWSER_EVENT,
+    LAST_SIGNAL
+};
+
+static guint event_signals[LAST_SIGNAL] = { 0, };
+
+
+WebCore::Node *
+gdom_event_target_node_get_private(GdomEventTargetNode *request)
+{
+    GDOMEventTargetNode *res;
+    res = static_cast<GDOMEventTargetNode*>(gdom_dom_object_get_private(GDOM_DOM_OBJECT(request)));
+    return reinterpret_cast<WebCore::Node*>(res->impl());
+}
+
+
+extern "C" {
+
+G_DEFINE_TYPE(GdomEventTargetNode, gdom_event_target_node, GDOM_TYPE_NODE);
+
+/*
+struct _GdomEventTargetNodePrivate {
+    class WebCore::EventTargetNode *item;
+};  
+*/
+
+#define GDOM_EVENT_TARGET_NODE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), GDOM_TYPE_EVENT_TARGET_NODE, GdomEventTargetNodePrivate))
+
+/*
+void
+gdom_event_target_node_set_private(GdomEventTargetNode *request, WebCore::EventTargetNode * item)
+{
+    GdomEventTargetNodePrivate* priv = GDOM_EVENT_TARGET_NODE_GET_PRIVATE(request);
+    priv->item = item;
+}
+*/
+
+static void gdom_event_target_node_finalize(GObject* object)
+{
+    /*GdomEventTargetNode* request = GDOM_EVENT_TARGET_NODE(object);
+    GdomEventTargetNodePrivate* priv = request->priv;*/
+    
+    G_OBJECT_CLASS(gdom_event_target_node_parent_class)->finalize(object);
+}
+
+static void gdom_event_target_node_class_init(GdomEventTargetNodeClass* requestClass)
+{
+    event_signals[BROWSER_EVENT] = g_signal_new("browser-event",
+        G_TYPE_FROM_CLASS(requestClass),
+        (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
+        0,
+        NULL,
+        NULL,
+        webkit_marshal_VOID__OBJECT_BOOLEAN,
+        G_TYPE_NONE, 2,
+        GDOM_TYPE_EVENT, G_TYPE_BOOLEAN);
+
+    G_OBJECT_CLASS(requestClass)->finalize = gdom_event_target_node_finalize;
+
+    /*g_type_class_add_private(requestClass, sizeof(GdomEventTargetNodePrivate));*/
+}
+
+static void gdom_event_target_node_init(GdomEventTargetNode* request)
+{
+    /*GdomEventTargetNodePrivate* priv = GDOM_EVENT_TARGET_NODE_GET_PRIVATE(request);
+    request->priv = priv;*/
+}   
+
+} /* extern "C" */
+
Index: WebCore/bindings/gdom/PrivateGdomEventTargetNode.h
===================================================================
--- WebCore/bindings/gdom/PrivateGdomEventTargetNode.h	(revision 0)
+++ WebCore/bindings/gdom/PrivateGdomEventTargetNode.h	(revision 0)
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2008 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
+ * Copyright (C) 2008 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2008 Apple Inc.
+ */
+
+
+#ifndef __GDOMEventTargetNode_H___PRIV_
+#define __GDOMEventTargetNode_H___PRIV_
+#include "glib-object.h"
+#include "PrivateGdomNode.h"
+class WebCore::Node;
+
+typedef struct _GdomEventTargetNode GdomEventTargetNode;
+
+WEBKIT_API WebCore::Node *
+gdom_event_target_node_get_private(GdomEventTargetNode *request);
+
+#endif
+
Index: WebCore/bindings/gdom/GdomEventTargetNode.cpp
===================================================================
--- WebCore/bindings/gdom/GdomEventTargetNode.cpp	(revision 0)
+++ WebCore/bindings/gdom/GdomEventTargetNode.cpp	(revision 0)
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2008 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
+ * Copyright (C) 2008 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2008 Apple Inc.
+ */
+
+#include "config.h"
+
+#include <wtf/GetPtr.h>
+#include "CString.h"
+#include "PlatformString.h"
+#include "AtomicString.h"
+#include "EventTargetNode.h"
+#include "GdomEventTargetNode.h"
+#include "PrivateGdomEventTargetNode.h"
+#include "glib-object.h"
+
+class GStringConvert {
+    public:
+    const gchar *m_str;
+    GStringConvert(WebCore::String const& s) { m_str = g_strdup(s.utf8().data()); }
+    GStringConvert(WebCore::AtomicString const&s) { m_str = g_strdup(s.string().utf8().data()); }
+};
+
+extern "C" {
+
+#define _G_GET_UTF8(str) (GStringConvert(str).m_str)
+
+void
+gdom_event_target_node_init_event_target_node (GdomEventTargetNode *thiz)
+{
+    g_return_if_fail (thiz);
+    /*
+    WebCore::EventTargetNode * item = gdom_event_target_node_get_private(thiz);
+    WebCore::String _g_event_target_node_type_arg = WebCore::String(event_target_node_type_arg);
+    item->initEventTargetNode(_g_event_target_node_type_arg);
+    */
+}
+
+} /* extern "C" */
+
Index: WebCore/bindings/gdom/PrivateGdomDOMObject.cpp
===================================================================
--- WebCore/bindings/gdom/PrivateGdomDOMObject.cpp	(revision 0)
+++ WebCore/bindings/gdom/PrivateGdomDOMObject.cpp	(revision 0)
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2008 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
+ * Copyright (C) 2008 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2008 Apple Inc.
+ */
+
+
+#include "config.h"
+#include "glib-object.h"
+#include "Node.h"
+#include "GdomDOMObject.h"
+#include "GDOMObject.h"
+#include "PrivateGdomDOMObject.h"
+
+extern "C" {
+
+G_DEFINE_TYPE(GdomDOMObject, gdom_dom_object, G_TYPE_OBJECT);
+
+struct _GdomDOMObjectPrivate {
+     GDOMObject *m_node;
+};  
+
+#define GDOM_DOM_OBJECT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), GDOM_TYPE_DOM_OBJECT, GdomDOMObjectPrivate))
+
+void
+gdom_dom_object_set_private(GdomDOMObject *request, GDOMObject * item)
+{
+    GdomDOMObjectPrivate* priv = GDOM_DOM_OBJECT_GET_PRIVATE(request);
+    priv->m_node = item;
+    /*priv->m_node->impl()->ref();*/
+}
+
+GDOMObject *
+gdom_dom_object_get_private(GdomDOMObject *request)
+{
+    GdomDOMObjectPrivate* priv = GDOM_DOM_OBJECT_GET_PRIVATE(request);
+    return priv->m_node;
+}
+
+static void gdom_dom_object_finalize(GObject* object)
+{
+    GdomDOMObject* request = GDOM_DOM_OBJECT(object);
+    GdomDOMObjectPrivate* priv = request->priv;
+    
+    /*priv->m_node->impl()->deref();*/
+    delete priv->m_node; /* calls m_impl->deref() */
+
+    G_OBJECT_CLASS(gdom_dom_object_parent_class)->finalize(object);
+}
+
+static void gdom_dom_object_class_init(GdomDOMObjectClass* requestClass)
+{
+    G_OBJECT_CLASS(requestClass)->finalize = gdom_dom_object_finalize;
+    
+    g_type_class_add_private(requestClass, sizeof(GdomDOMObjectPrivate));
+}
+
+static void gdom_dom_object_init(GdomDOMObject* request)
+{
+    GdomDOMObjectPrivate* priv = GDOM_DOM_OBJECT_GET_PRIVATE(request);
+    request->priv = priv;
+}   
+
+} /* extern "C" */
+
Index: WebCore/bindings/gdom/GdomEventTargetNode.h
===================================================================
--- WebCore/bindings/gdom/GdomEventTargetNode.h	(revision 0)
+++ WebCore/bindings/gdom/GdomEventTargetNode.h	(revision 0)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2008 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
+ * Copyright (C) 2008 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2008 Apple Inc.
+ */
+
+#ifndef __GdomEventTargetNode_H__
+#define __GdomEventTargetNode_H__
+#include "glib-object.h"
+#include <webkit/webkitdefines.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GdomEventTargetNode GdomEventTargetNode;
+typedef struct _GdomEventTargetNodeClass GdomEventTargetNodeClass;
+
+#define GDOM_TYPE_EVENT_TARGET_NODE            (gdom_event_target_node_get_type())
+#define GDOM_EVENT_TARGET_NODE(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), GDOM_TYPE_EVENT_TARGET_NODE, GdomEventTargetNode))
+#define GDOM_EVENT_TARGET_NODE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),  GDOM_TYPE_EVENT_TARGET_NODE, GdomEventTargetNodeClass))
+#define GDOM_IS_EVENT_TARGET_NODE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), GDOM_TYPE_EVENT_TARGET_NODE))
+#define GDOM_IS_EVENT_TARGET_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),  GDOM_TYPE_EVENT_TARGET_NODE))
+#define GDOM_EVENT_TARGET_NODE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),  GDOM_TYPE_EVENT_TARGET_NODE, GdomEventTargetNodeClass))
+
+typedef struct _GdomEventTargetNodePrivate GdomEventTargetNodePrivate;
+
+#include "GdomNode.h"
+
+struct _GdomEventTargetNode {
+    GdomNode parent_instance;
+
+    GdomEventTargetNodePrivate *priv;
+};
+
+struct _GdomEventTargetNodeClass {
+    GdomNodeClass parent_class;
+};
+
+WEBKIT_API GType
+gdom_event_target_node_get_type (void);
+
+WEBKIT_API void
+gdom_event_target_node_init_event_target_node (GdomEventTargetNode *thiz);
+
+G_END_DECLS
+
+#endif /* __GdomEventTargetNode_H__ */
+
Index: WebCore/bindings/gdom/GdomDOMObject.cpp
===================================================================
--- WebCore/bindings/gdom/GdomDOMObject.cpp	(revision 0)
+++ WebCore/bindings/gdom/GdomDOMObject.cpp	(revision 0)
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2008 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
+ * Copyright (C) 2008 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2008 Apple Inc.
+ */
+
+#include "config.h"
+
+#include <wtf/GetPtr.h>
+#include "CString.h"
+#include "PlatformString.h"
+#include "AtomicString.h"
+#include "GdomDOMObject.h"
+#include "glib-object.h"
+
+extern "C" {
+
+void
+gdom_dom_object_init_dom_object (GdomDOMObject *thiz)
+{
+    g_return_if_fail (thiz);
+	/*
+    WebCore::DOMObject * item = gdom_dom_object_get_private(thiz);
+    WebCore::String _g_dom_object_type_arg = WebCore::String(dom_object_type_arg);
+    item->initDOMObject(_g_dom_object_type_arg);
+	*/
+}
+
+} /* extern "C" */
+
Index: WebCore/bindings/gdom/PrivateGdomDOMObject.h
===================================================================
--- WebCore/bindings/gdom/PrivateGdomDOMObject.h	(revision 0)
+++ WebCore/bindings/gdom/PrivateGdomDOMObject.h	(revision 0)
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2008 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
+ * Copyright (C) 2008 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2008 Apple Inc.
+ */
+
+
+#ifndef __GDOMDOMObject_H___PRIV_
+#define __GDOMDOMObject_H___PRIV_
+#include "glib-object.h"
+#include "GdomDOMObject.h"
+G_BEGIN_DECLS
+
+class GDOMObject;
+WEBKIT_API GDOMObject*
+gdom_dom_object_get_private(GdomDOMObject *request);
+
+WEBKIT_API void
+gdom_dom_object_set_private(GdomDOMObject *request, GDOMObject* item);
+
+G_END_DECLS
+#endif
+
Index: WebCore/bindings/gdom/GDOMHTMLElementWrapperFactory.cpp
===================================================================
--- WebCore/bindings/gdom/GDOMHTMLElementWrapperFactory.cpp	(revision 0)
+++ WebCore/bindings/gdom/GDOMHTMLElementWrapperFactory.cpp	(revision 0)
@@ -0,0 +1,582 @@
+/*
+ * THIS FILE IS DERIVED FROM AN AUTOMATICALLY GENERATED FILE.
+ *  keeping it up-to-date could potentially be done by adding
+ *  a make_names.pl generator, or by writing a separate
+ *  generater which takes JSHTMLElementWrapperFactory.h as input.
+ *
+ * Copyright (C) 2008 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
+ *
+ *
+ * Copyright (C) 2005 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+
+#include "config.h"
+
+#include "GdomNode.h"
+#include "GDOMHTMLElementWrapperFactory.h"
+#include "GdomHTMLAnchorElement.h"
+#include "GdomHTMLAppletElement.h"
+#include "GdomHTMLAreaElement.h"
+#include "GdomHTMLBaseElement.h"
+#include "GdomHTMLBaseFontElement.h"
+#include "GdomHTMLBlockquoteElement.h"
+#include "GdomHTMLBodyElement.h"
+#include "GdomHTMLBRElement.h"
+#include "GdomHTMLButtonElement.h"
+#include "GdomHTMLCanvasElement.h"
+#include "GdomHTMLTableCaptionElement.h"
+#include "GdomHTMLTableColElement.h"
+#include "GdomHTMLModElement.h"
+#include "GdomHTMLDirectoryElement.h"
+#include "GdomHTMLDivElement.h"
+#include "GdomHTMLDListElement.h"
+#include "GdomHTMLEmbedElement.h"
+#include "GdomHTMLFieldSetElement.h"
+#include "GdomHTMLFontElement.h"
+#include "GdomHTMLFormElement.h"
+#include "GdomHTMLFrameElement.h"
+#include "GdomHTMLFrameSetElement.h"
+#include "GdomHTMLHeadingElement.h"
+#include "GdomHTMLHeadElement.h"
+#include "GdomHTMLHRElement.h"
+#include "GdomHTMLHtmlElement.h"
+#include "GdomHTMLIFrameElement.h"
+#include "GdomHTMLImageElement.h"
+#include "GdomHTMLInputElement.h"
+#include "GdomHTMLIsIndexElement.h"
+#include "GdomHTMLLabelElement.h"
+#include "GdomHTMLLegendElement.h"
+#include "GdomHTMLLIElement.h"
+#include "GdomHTMLLinkElement.h"
+#include "GdomHTMLMapElement.h"
+#include "GdomHTMLMarqueeElement.h"
+#include "GdomHTMLMenuElement.h"
+#include "GdomHTMLMetaElement.h"
+#include "GdomHTMLObjectElement.h"
+#include "GdomHTMLOListElement.h"
+#include "GdomHTMLOptGroupElement.h"
+#include "GdomHTMLOptionElement.h"
+#include "GdomHTMLParagraphElement.h"
+#include "GdomHTMLParamElement.h"
+#include "GdomHTMLPreElement.h"
+#include "GdomHTMLQuoteElement.h"
+#include "GdomHTMLScriptElement.h"
+#include "GdomHTMLSelectElement.h"
+#include "GdomHTMLStyleElement.h"
+#include "GdomHTMLTableElement.h"
+#include "GdomHTMLTableSectionElement.h"
+#include "GdomHTMLTableCellElement.h"
+#include "GdomHTMLTextAreaElement.h"
+#include "GdomHTMLTitleElement.h"
+#include "GdomHTMLTableRowElement.h"
+#include "GdomHTMLUListElement.h"
+
+#include "PrivateIntGdomHTMLAnchorElement.h"
+#include "PrivateIntGdomHTMLAppletElement.h"
+#include "PrivateIntGdomHTMLAreaElement.h"
+#include "PrivateIntGdomHTMLBaseElement.h"
+#include "PrivateIntGdomHTMLBaseFontElement.h"
+#include "PrivateIntGdomHTMLBlockquoteElement.h"
+#include "PrivateIntGdomHTMLBodyElement.h"
+#include "PrivateIntGdomHTMLBRElement.h"
+#include "PrivateIntGdomHTMLButtonElement.h"
+#include "PrivateIntGdomHTMLCanvasElement.h"
+#include "PrivateIntGdomHTMLTableCaptionElement.h"
+#include "PrivateIntGdomHTMLTableColElement.h"
+#include "PrivateIntGdomHTMLModElement.h"
+#include "PrivateIntGdomHTMLDirectoryElement.h"
+#include "PrivateIntGdomHTMLDivElement.h"
+#include "PrivateIntGdomHTMLDListElement.h"
+#include "PrivateIntGdomHTMLEmbedElement.h"
+#include "PrivateIntGdomHTMLFieldSetElement.h"
+#include "PrivateIntGdomHTMLFontElement.h"
+#include "PrivateIntGdomHTMLFormElement.h"
+#include "PrivateIntGdomHTMLFrameElement.h"
+#include "PrivateIntGdomHTMLFrameSetElement.h"
+#include "PrivateIntGdomHTMLHeadingElement.h"
+#include "PrivateIntGdomHTMLHeadElement.h"
+#include "PrivateIntGdomHTMLHRElement.h"
+#include "PrivateIntGdomHTMLHtmlElement.h"
+#include "PrivateIntGdomHTMLIFrameElement.h"
+#include "PrivateIntGdomHTMLImageElement.h"
+#include "PrivateIntGdomHTMLInputElement.h"
+#include "PrivateIntGdomHTMLIsIndexElement.h"
+#include "PrivateIntGdomHTMLLabelElement.h"
+#include "PrivateIntGdomHTMLLegendElement.h"
+#include "PrivateIntGdomHTMLLIElement.h"
+#include "PrivateIntGdomHTMLLinkElement.h"
+#include "PrivateIntGdomHTMLMapElement.h"
+#include "PrivateIntGdomHTMLMarqueeElement.h"
+#include "PrivateIntGdomHTMLMenuElement.h"
+#include "PrivateIntGdomHTMLMetaElement.h"
+#include "PrivateIntGdomHTMLObjectElement.h"
+#include "PrivateIntGdomHTMLOListElement.h"
+#include "PrivateIntGdomHTMLOptGroupElement.h"
+#include "PrivateIntGdomHTMLOptionElement.h"
+#include "PrivateIntGdomHTMLParagraphElement.h"
+#include "PrivateIntGdomHTMLParamElement.h"
+#include "PrivateIntGdomHTMLPreElement.h"
+#include "PrivateIntGdomHTMLQuoteElement.h"
+#include "PrivateIntGdomHTMLScriptElement.h"
+#include "PrivateIntGdomHTMLSelectElement.h"
+#include "PrivateIntGdomHTMLStyleElement.h"
+#include "PrivateIntGdomHTMLTableElement.h"
+#include "PrivateIntGdomHTMLTableSectionElement.h"
+#include "PrivateIntGdomHTMLTableCellElement.h"
+#include "PrivateIntGdomHTMLTextAreaElement.h"
+#include "PrivateIntGdomHTMLTitleElement.h"
+#include "PrivateIntGdomHTMLTableRowElement.h"
+#include "PrivateIntGdomHTMLUListElement.h"
+
+#include "HTMLNames.h"
+
+#include "HTMLAnchorElement.h"
+#include "HTMLAppletElement.h"
+#include "HTMLAreaElement.h"
+#include "HTMLBaseElement.h"
+#include "HTMLBaseFontElement.h"
+#include "HTMLBlockquoteElement.h"
+#include "HTMLBodyElement.h"
+#include "HTMLBRElement.h"
+#include "HTMLButtonElement.h"
+#include "HTMLCanvasElement.h"
+#include "HTMLTableCaptionElement.h"
+#include "HTMLTableColElement.h"
+#include "HTMLModElement.h"
+#include "HTMLDirectoryElement.h"
+#include "HTMLDivElement.h"
+#include "HTMLDListElement.h"
+#include "HTMLEmbedElement.h"
+#include "HTMLFieldSetElement.h"
+#include "HTMLFontElement.h"
+#include "HTMLFormElement.h"
+#include "HTMLFrameElement.h"
+#include "HTMLFrameSetElement.h"
+#include "HTMLHeadingElement.h"
+#include "HTMLHeadElement.h"
+#include "HTMLHRElement.h"
+#include "HTMLHtmlElement.h"
+#include "HTMLIFrameElement.h"
+#include "HTMLImageElement.h"
+#include "HTMLInputElement.h"
+#include "HTMLIsIndexElement.h"
+#include "HTMLLabelElement.h"
+#include "HTMLLegendElement.h"
+#include "HTMLLIElement.h"
+#include "HTMLLinkElement.h"
+#include "HTMLMapElement.h"
+#include "HTMLMarqueeElement.h"
+#include "HTMLMenuElement.h"
+#include "HTMLMetaElement.h"
+#include "HTMLObjectElement.h"
+#include "HTMLOListElement.h"
+#include "HTMLOptGroupElement.h"
+#include "HTMLOptionElement.h"
+#include "HTMLParagraphElement.h"
+#include "HTMLParamElement.h"
+#include "HTMLPreElement.h"
+#include "HTMLQuoteElement.h"
+#include "HTMLScriptElement.h"
+#include "HTMLSelectElement.h"
+#include "HTMLStyleElement.h"
+#include "HTMLTableElement.h"
+#include "HTMLTableSectionElement.h"
+#include "HTMLTableCellElement.h"
+#include "HTMLTextAreaElement.h"
+#include "HTMLTitleElement.h"
+#include "HTMLTableRowElement.h"
+#include "HTMLUListElement.h"
+#include "CString.h"
+
+namespace WebCore {
+
+using namespace HTMLNames;
+
+typedef GDOMNode* (*CreateHTMLElementWrapperFunction)(PassRefPtr<HTMLElement>);
+
+static GDOMNode* createAnchorWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLAnchorElement(static_cast<HTMLAnchorElement*>(element.get()));
+}
+
+static GDOMNode* createAppletWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLAppletElement(static_cast<HTMLAppletElement*>(element.get()));
+}
+
+static GDOMNode* createAreaWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLAreaElement(static_cast<HTMLAreaElement*>(element.get()));
+}
+
+static GDOMNode* createBaseWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLBaseElement(static_cast<HTMLBaseElement*>(element.get()));
+}
+
+static GDOMNode* createBaseFontWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLBaseFontElement(static_cast<HTMLBaseFontElement*>(element.get()));
+}
+
+static GDOMNode* createBlockquoteWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLBlockquoteElement(static_cast<HTMLBlockquoteElement*>(element.get()));
+}
+
+static GDOMNode* createBodyWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLBodyElement(static_cast<HTMLBodyElement*>(element.get()));
+}
+
+static GDOMNode* createBRWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLBRElement(static_cast<HTMLBRElement*>(element.get()));
+}
+
+static GDOMNode* createButtonWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLButtonElement(static_cast<HTMLButtonElement*>(element.get()));
+}
+
+static GDOMNode* createCanvasWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLCanvasElement(static_cast<HTMLCanvasElement*>(element.get()));
+}
+
+static GDOMNode* createTableCaptionWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLTableCaptionElement(static_cast<HTMLTableCaptionElement*>(element.get()));
+}
+
+static GDOMNode* createTableColWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLTableColElement(static_cast<HTMLTableColElement*>(element.get()));
+}
+
+static GDOMNode* createModWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLModElement(static_cast<HTMLModElement*>(element.get()));
+}
+
+static GDOMNode* createDirectoryWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLDirectoryElement(static_cast<HTMLDirectoryElement*>(element.get()));
+}
+
+static GDOMNode* createDivWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLDivElement(static_cast<HTMLDivElement*>(element.get()));
+}
+
+static GDOMNode* createDListWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLDListElement(static_cast<HTMLDListElement*>(element.get()));
+}
+
+static GDOMNode* createEmbedWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLEmbedElement(static_cast<HTMLEmbedElement*>(element.get()));
+}
+
+static GDOMNode* createFieldSetWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLFieldSetElement(static_cast<HTMLFieldSetElement*>(element.get()));
+}
+
+static GDOMNode* createFontWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLFontElement(static_cast<HTMLFontElement*>(element.get()));
+}
+
+static GDOMNode* createFormWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLFormElement(static_cast<HTMLFormElement*>(element.get()));
+}
+
+static GDOMNode* createFrameWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLFrameElement(static_cast<HTMLFrameElement*>(element.get()));
+}
+
+static GDOMNode* createFrameSetWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLFrameSetElement(static_cast<HTMLFrameSetElement*>(element.get()));
+}
+
+static GDOMNode* createHeadingWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLHeadingElement(static_cast<HTMLHeadingElement*>(element.get()));
+}
+
+static GDOMNode* createHeadWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLHeadElement(static_cast<HTMLHeadElement*>(element.get()));
+}
+
+static GDOMNode* createHRWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLHRElement(static_cast<HTMLHRElement*>(element.get()));
+}
+
+static GDOMNode* createHtmlWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLHtmlElement(static_cast<HTMLHtmlElement*>(element.get()));
+}
+
+static GDOMNode* createIFrameWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLIFrameElement(static_cast<HTMLIFrameElement*>(element.get()));
+}
+
+static GDOMNode* createImageWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLImageElement(static_cast<HTMLImageElement*>(element.get()));
+}
+
+static GDOMNode* createInputWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLInputElement(static_cast<HTMLInputElement*>(element.get()));
+}
+
+static GDOMNode* createIsIndexWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLIsIndexElement(static_cast<HTMLIsIndexElement*>(element.get()));
+}
+
+static GDOMNode* createLabelWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLLabelElement(static_cast<HTMLLabelElement*>(element.get()));
+}
+
+static GDOMNode* createLegendWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLLegendElement(static_cast<HTMLLegendElement*>(element.get()));
+}
+
+static GDOMNode* createLIWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLLIElement(static_cast<HTMLLIElement*>(element.get()));
+}
+
+static GDOMNode* createLinkWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLLinkElement(static_cast<HTMLLinkElement*>(element.get()));
+}
+
+static GDOMNode* createMapWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLMapElement(static_cast<HTMLMapElement*>(element.get()));
+}
+
+static GDOMNode* createMarqueeWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLMarqueeElement(static_cast<HTMLMarqueeElement*>(element.get()));
+}
+
+static GDOMNode* createMenuWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLMenuElement(static_cast<HTMLMenuElement*>(element.get()));
+}
+
+static GDOMNode* createMetaWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLMetaElement(static_cast<HTMLMetaElement*>(element.get()));
+}
+
+static GDOMNode* createObjectWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLObjectElement(static_cast<HTMLObjectElement*>(element.get()));
+}
+
+static GDOMNode* createOListWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLOListElement(static_cast<HTMLOListElement*>(element.get()));
+}
+
+static GDOMNode* createOptGroupWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLOptGroupElement(static_cast<HTMLOptGroupElement*>(element.get()));
+}
+
+static GDOMNode* createOptionWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLOptionElement(static_cast<HTMLOptionElement*>(element.get()));
+}
+
+static GDOMNode* createParagraphWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLParagraphElement(static_cast<HTMLParagraphElement*>(element.get()));
+}
+
+static GDOMNode* createParamWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLParamElement(static_cast<HTMLParamElement*>(element.get()));
+}
+
+static GDOMNode* createPreWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLPreElement(static_cast<HTMLPreElement*>(element.get()));
+}
+
+static GDOMNode* createQuoteWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLQuoteElement(static_cast<HTMLQuoteElement*>(element.get()));
+}
+
+static GDOMNode* createScriptWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLScriptElement(static_cast<HTMLScriptElement*>(element.get()));
+}
+
+static GDOMNode* createSelectWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLSelectElement(static_cast<HTMLSelectElement*>(element.get()));
+}
+
+static GDOMNode* createStyleWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLStyleElement(static_cast<HTMLStyleElement*>(element.get()));
+}
+
+static GDOMNode* createTableWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLTableElement(static_cast<HTMLTableElement*>(element.get()));
+}
+
+static GDOMNode* createTableSectionWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLTableSectionElement(static_cast<HTMLTableSectionElement*>(element.get()));
+}
+
+static GDOMNode* createTableCellWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLTableCellElement(static_cast<HTMLTableCellElement*>(element.get()));
+}
+
+static GDOMNode* createTextAreaWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLTextAreaElement(static_cast<HTMLTextAreaElement*>(element.get()));
+}
+
+static GDOMNode* createTitleWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLTitleElement(static_cast<HTMLTitleElement*>(element.get()));
+}
+
+static GDOMNode* createTableRowWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLTableRowElement(static_cast<HTMLTableRowElement*>(element.get()));
+}
+
+static GDOMNode* createUListWrapper(PassRefPtr<HTMLElement> element)
+{   
+    return new GDOMHTMLUListElement(static_cast<HTMLUListElement*>(element.get()));
+}
+
+GDOMNode* createGDOMHTMLWrapper(PassRefPtr<HTMLElement> element)
+{   
+    static HashMap<WebCore::AtomicStringImpl*, CreateHTMLElementWrapperFunction> map;
+    if (map.isEmpty()) {
+       map.set(aTag.localName().impl(), createAnchorWrapper);
+       map.set(appletTag.localName().impl(), createAppletWrapper);
+       map.set(areaTag.localName().impl(), createAreaWrapper);
+       map.set(baseTag.localName().impl(), createBaseWrapper);
+       map.set(basefontTag.localName().impl(), createBaseFontWrapper);
+       map.set(blockquoteTag.localName().impl(), createBlockquoteWrapper);
+       map.set(bodyTag.localName().impl(), createBodyWrapper);
+       map.set(brTag.localName().impl(), createBRWrapper);
+       map.set(buttonTag.localName().impl(), createButtonWrapper);
+       map.set(canvasTag.localName().impl(), createCanvasWrapper);
+       map.set(captionTag.localName().impl(), createTableCaptionWrapper);
+       map.set(colTag.localName().impl(), createTableColWrapper);
+       map.set(delTag.localName().impl(), createModWrapper);
+       map.set(dirTag.localName().impl(), createDirectoryWrapper);
+       map.set(divTag.localName().impl(), createDivWrapper);
+       map.set(dlTag.localName().impl(), createDListWrapper);
+       map.set(embedTag.localName().impl(), createEmbedWrapper);
+       map.set(fieldsetTag.localName().impl(), createFieldSetWrapper);
+       map.set(fontTag.localName().impl(), createFontWrapper);
+       map.set(formTag.localName().impl(), createFormWrapper);
+       map.set(frameTag.localName().impl(), createFrameWrapper);
+       map.set(framesetTag.localName().impl(), createFrameSetWrapper);
+       map.set(h1Tag.localName().impl(), createHeadingWrapper);
+       map.set(headTag.localName().impl(), createHeadWrapper);
+       map.set(hrTag.localName().impl(), createHRWrapper);
+       map.set(htmlTag.localName().impl(), createHtmlWrapper);
+       map.set(iframeTag.localName().impl(), createIFrameWrapper);
+       map.set(imgTag.localName().impl(), createImageWrapper);
+       map.set(inputTag.localName().impl(), createInputWrapper);
+       map.set(isindexTag.localName().impl(), createIsIndexWrapper);
+       map.set(labelTag.localName().impl(), createLabelWrapper);
+       map.set(legendTag.localName().impl(), createLegendWrapper);
+       map.set(liTag.localName().impl(), createLIWrapper);
+       map.set(linkTag.localName().impl(), createLinkWrapper);
+       map.set(mapTag.localName().impl(), createMapWrapper);
+       map.set(marqueeTag.localName().impl(), createMarqueeWrapper);
+       map.set(menuTag.localName().impl(), createMenuWrapper);
+       map.set(metaTag.localName().impl(), createMetaWrapper);
+       map.set(objectTag.localName().impl(), createObjectWrapper);
+       map.set(olTag.localName().impl(), createOListWrapper);
+       map.set(optgroupTag.localName().impl(), createOptGroupWrapper);
+       map.set(optionTag.localName().impl(), createOptionWrapper);
+       map.set(pTag.localName().impl(), createParagraphWrapper);
+       map.set(paramTag.localName().impl(), createParamWrapper);
+       map.set(preTag.localName().impl(), createPreWrapper);
+       map.set(qTag.localName().impl(), createQuoteWrapper);
+       map.set(scriptTag.localName().impl(), createScriptWrapper);
+       map.set(selectTag.localName().impl(), createSelectWrapper);
+       map.set(styleTag.localName().impl(), createStyleWrapper);
+       map.set(tableTag.localName().impl(), createTableWrapper);
+       map.set(tbodyTag.localName().impl(), createTableSectionWrapper);
+       map.set(tdTag.localName().impl(), createTableCellWrapper);
+       map.set(textareaTag.localName().impl(), createTextAreaWrapper);
+       map.set(titleTag.localName().impl(), createTitleWrapper);
+       map.set(trTag.localName().impl(), createTableRowWrapper);
+       map.set(ulTag.localName().impl(), createUListWrapper);
+       map.set(colgroupTag.localName().impl(), createTableColWrapper);
+       map.set(h2Tag.localName().impl(), createHeadingWrapper);
+       map.set(h3Tag.localName().impl(), createHeadingWrapper);
+       map.set(h4Tag.localName().impl(), createHeadingWrapper);
+       map.set(h5Tag.localName().impl(), createHeadingWrapper);
+       map.set(h6Tag.localName().impl(), createHeadingWrapper);
+       map.set(imageTag.localName().impl(), createImageWrapper);
+       map.set(insTag.localName().impl(), createModWrapper);
+       map.set(keygenTag.localName().impl(), createSelectWrapper);
+       map.set(listingTag.localName().impl(), createPreWrapper);
+       map.set(tfootTag.localName().impl(), createTableSectionWrapper);
+       map.set(thTag.localName().impl(), createTableCellWrapper);
+       map.set(theadTag.localName().impl(), createTableSectionWrapper);
+       map.set(xmpTag.localName().impl(), createPreWrapper);
+    }
+    printf("createGDOMHTMLWrapper: %s\n", element->localName().string().utf8().data());
+    CreateHTMLElementWrapperFunction createWrapperFunction = map.get(element->localName().impl());
+    if (createWrapperFunction)
+        return createWrapperFunction(element);
+    return new GDOMHTMLElement(element.get());
+}
+
+}
+
Index: WebCore/bindings/gdom/PrivateIntGdomEventTargetNode.h
===================================================================
--- WebCore/bindings/gdom/PrivateIntGdomEventTargetNode.h	(revision 0)
+++ WebCore/bindings/gdom/PrivateIntGdomEventTargetNode.h	(revision 0)
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2008 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
+ * Copyright (C) 2008 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2008 Apple Inc.
+ */
+
+
+#ifndef __GDOMEventTargetNode_H___INT_
+#define __GDOMEventTargetNode_H___INT_
+#include "glib-object.h"
+#include "PrivateIntGdomNode.h"
+G_BEGIN_DECLS
+
+class GDOMEventTargetNode : public GDOMNode {
+
+public:
+    GDOMEventTargetNode(PassRefPtr<WebCore::Node> impl) : GDOMNode(impl) {}
+    int get_gobj_type() { return GDOM_TYPE_EVENT_TARGET_NODE; }
+};
+
+
+G_END_DECLS
+#endif
+
Index: WebCore/bindings/gdom/GDOMBinding.cpp
===================================================================
--- WebCore/bindings/gdom/GDOMBinding.cpp	(revision 0)
+++ WebCore/bindings/gdom/GDOMBinding.cpp	(revision 0)
@@ -0,0 +1,801 @@
+/*
+ *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
+ *  Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ *  Copyright (C) 2007 Samuel Weinig <sam@webkit.org>
+ *  Copyright (C) 2008 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+// gcc 3.x can't handle including the HashMap pointer specialization in this file
+#if defined __GNUC__ && !defined __GLIBCXX__ // less than gcc 3.4
+#define HASH_MAP_PTR_SPEC_WORKAROUND 1
+#endif
+
+#include "config.h"
+#include "glib-object.h"
+#include "CString.h"
+#include "GdomDOMObject.h"
+#include "PrivateGdomDOMObject.h"
+#include "GDOMBinding.h"
+#include "GDOMHTMLElementWrapperFactory.h"
+
+#include "CSSStyleSheet.h"
+#include "GdomCSSStyleSheet.h"
+#include "PrivateIntGdomCSSStyleSheet.h"
+
+#include "Document.h"
+#include "EventException.h"
+#include "ExceptionCode.h"
+#include "Frame.h"
+#include "HTMLImageElement.h"
+#include "HTMLNames.h"
+#include "GdomNode.h"
+
+#include "config.h"
+#include "PrivateIntGdomNode.h"
+
+#include "Attr.h"
+#include "CDATASection.h"
+#include "CSSValue.h"
+#include "Comment.h"
+#include "Document.h"
+#include "DocumentFragment.h"
+#include "DocumentType.h"
+#include "Entity.h"
+#include "EntityReference.h"
+#include "HTMLElement.h"
+#include "GdomEventTargetNode.h"
+#include "GdomAttr.h"
+#include "PrivateIntGdomAttr.h"
+#include "GdomCharacterData.h"
+#include "GdomText.h"
+#include "GdomCDATASection.h"
+#include "GdomComment.h"
+#include "GdomDocument.h"
+#include "GdomDocumentFragment.h"
+#include "GdomDocumentType.h"
+#include "GdomEntity.h"
+#include "GdomElement.h"
+#include "GdomCSSValueList.h"
+#include "GdomCSSPrimitiveValue.h"
+#include "GdomEntityReference.h"
+#include "GdomNotation.h"
+#include "GdomHTMLDocument.h"
+#include "GdomProcessingInstruction.h"
+#include "Node.h"
+#include "Notation.h"
+#include "ProcessingInstruction.h"
+#include "Text.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
+
+#include "GdomCSSRule.h"
+#include "CSSCharsetRule.h"
+#include "CSSFontFaceRule.h"
+#include "CSSImportRule.h"
+#include "CSSMediaRule.h"
+#include "CSSPageRule.h"
+#include "CSSStyleRule.h"
+#include "CSSVariablesRule.h"
+#include "GdomCSSCharsetRule.h"
+#include "GdomCSSFontFaceRule.h"
+#include "GdomCSSImportRule.h"
+#include "GdomCSSMediaRule.h"
+#include "GdomCSSPageRule.h"
+#include "GdomCSSStyleRule.h"
+#include "GdomCSSVariablesRule.h"
+
+#include "config.h"
+#include "PrivateIntGdomEvent.h"
+
+#include "Clipboard.h"
+#include "Event.h"
+#include "GdomClipboard.h"
+#include "GdomKeyboardEvent.h"
+#include "GdomMessageEvent.h"
+#include "GdomMouseEvent.h"
+#include "GdomMutationEvent.h"
+#include "GdomOverflowEvent.h"
+#include "GdomProgressEvent.h"
+#include "GdomTextEvent.h"
+#include "GdomUIEvent.h"
+#include "GdomWebKitAnimationEvent.h"
+#include "GdomWebKitTransitionEvent.h"
+#include "GdomWheelEvent.h"
+#include "GdomXMLHttpRequestProgressEvent.h"
+#include "KeyboardEvent.h"
+#include "MessageEvent.h"
+#include "MouseEvent.h"
+#include "MutationEvent.h"
+#include "OverflowEvent.h"
+#include "ProgressEvent.h"
+#include "TextEvent.h"
+#include "UIEvent.h"
+#include "WebKitAnimationEvent.h"
+#include "WebKitTransitionEvent.h"
+#include "WheelEvent.h"
+#include "XMLHttpRequestProgressEvent.h"
+
+#include "GdomHTMLCollection.h"
+
+#include "AtomicString.h"
+#include "HTMLCollection.h"
+#include "HTMLOptionsCollection.h"
+// TODO #include "PrivateIntGdomHTMLAllCollection.h"
+// TODO #include "GdomHTMLAllCollection.h"
+#include "GdomHTMLOptionsCollection.h"
+// err... #include "PrivateIntGdomNamedNodesCollection.h"
+// err... #include "GdomNamedNodesCollection.h"
+
+#if ENABLE(DOM_STORAGE)
+#include "GdomStorageEvent.h"
+#include "StorageEvent.h"
+#endif
+
+#if ENABLE(SVG)
+#if 0 /* TODO */
+#include "PrivateIntGdomSVGZoomEvent.h"
+#include "GdomSVGZoomEvent.h"
+#include "SVGZoomEvent.h"
+#endif
+#endif
+
+#if ENABLE(SVG)
+#if 0 /* XXX TODO */
+#include "PrivateIntGdomSVGElementWrapperFactory.h"
+#include "GdomSVGElementWrapperFactory.h"
+#include "SVGElement.h"
+#endif
+#endif
+
+#if 0
+#if ENABLE(SVG)
+#include "GdomSVGException.h"
+#include "SVGException.h"
+#endif
+#endif
+
+#include "PrivateIntGdomClipboard.h"
+#include "PrivateIntGdomCSSRule.h"
+#include "PrivateIntGdomCDATASection.h"
+#include "PrivateIntGdomComment.h"
+#include "PrivateIntGdomDocument.h"
+#include "PrivateIntGdomDocumentFragment.h"
+#include "PrivateIntGdomDocumentType.h"
+#include "PrivateIntGdomEntity.h"
+#include "PrivateIntGdomElement.h"
+#include "PrivateIntGdomCSSValueList.h"
+#include "PrivateIntGdomCSSPrimitiveValue.h"
+#include "PrivateIntGdomEntityReference.h"
+#include "PrivateIntGdomNotation.h"
+#include "PrivateIntGdomHTMLDocument.h"
+#include "PrivateIntGdomProcessingInstruction.h"
+#include "PrivateIntGdomText.h"
+#include "PrivateIntGdomCSSCharsetRule.h"
+#include "PrivateIntGdomCSSFontFaceRule.h"
+#include "PrivateIntGdomCSSImportRule.h"
+#include "PrivateIntGdomCSSMediaRule.h"
+#include "PrivateIntGdomCSSPageRule.h"
+#include "PrivateIntGdomCSSStyleRule.h"
+#include "PrivateIntGdomCSSVariablesRule.h"
+#include "PrivateIntGdomKeyboardEvent.h"
+#include "PrivateIntGdomMessageEvent.h"
+#include "PrivateIntGdomMouseEvent.h"
+#include "PrivateIntGdomMutationEvent.h"
+#include "PrivateIntGdomOverflowEvent.h"
+#include "PrivateIntGdomProgressEvent.h"
+#include "PrivateIntGdomTextEvent.h"
+#include "PrivateIntGdomUIEvent.h"
+#include "PrivateIntGdomWebKitAnimationEvent.h"
+#include "PrivateIntGdomWebKitTransitionEvent.h"
+#include "PrivateIntGdomWheelEvent.h"
+#include "PrivateIntGdomXMLHttpRequestProgressEvent.h"
+#include "PrivateIntGdomStorageEvent.h"
+#include "PrivateIntGdomHTMLOptionsCollection.h"
+#include "PrivateIntGdomHTMLCollection.h"
+
+namespace WebCore {
+
+using namespace HTMLNames;
+
+typedef HashMap<void*, gpointer> DOMObjectMap;
+typedef HashMap<void*, gpointer> GdomWrapperCache; /* ARG! UNFAIR! JSWrapperCache is in Document!! */
+
+// For debugging, keep a set of wrappers currently registered, and check that
+// all are unregistered before they are destroyed. This has helped us fix at
+// least one bug.
+
+#if 0
+static void addWrapper(GDOMObject* wrapper);
+static void removeWrapper(GDOMObject* wrapper);
+static void removeWrappers(const GdomWrapperCache& wrappers);
+
+#ifdef NDEBUG
+
+static inline void addWrapper(GDOMObject*)
+{
+}
+
+static inline void removeWrapper(GDOMObject*)
+{
+}
+
+static inline void removeWrappers(const GdomWrapperCache&)
+{
+}
+
+#else
+
+static HashSet<GDOMObject*>& wrapperSet()
+{
+    static HashSet<GDOMObject*> staticWrapperSet;
+    return staticWrapperSet;
+}
+
+static void addWrapper(GDOMObject* wrapper)
+{
+    ASSERT(!wrapperSet().contains(wrapper));
+    wrapperSet().add(wrapper);
+}
+
+static void removeWrapper(GDOMObject* wrapper)
+{
+    if (!wrapper)
+        return;
+    ASSERT(wrapperSet().contains(wrapper));
+    wrapperSet().remove(wrapper);
+}
+
+static void removeWrappers(const GdomWrapperCache& wrappers)
+{
+    for (GdomWrapperCache::const_iterator it = wrappers.begin(); it != wrappers.end(); ++it)
+        removeWrapper(it->second);
+}
+
+GDOMObject::~GDOMObject()
+{
+    ASSERT(!wrapperSet().contains(this));
+}
+
+#endif
+#endif /* commented out for now */
+
+static GdomWrapperCache& wrapperCache()
+{ 
+    // UNFAIR! i want one of these per Document, too!
+    // Don't use malloc here. Calling malloc from a mark function can deadlock.
+    static GdomWrapperCache staticGdomWrapperCache;
+    return staticGdomWrapperCache;
+}
+
+static DOMObjectMap& domObjects()
+{ 
+    // Don't use malloc here. Calling malloc from a mark function can deadlock.
+    static DOMObjectMap staticDOMObjects;
+    return staticDOMObjects;
+}
+
+gpointer GDOMScriptInterpreter::getDOMObject(void* objectHandle) 
+{
+    gpointer ret = domObjects().get(objectHandle);
+    printf("getDOMObject: %p %p\n", objectHandle, ret);
+    return ret;
+}
+
+static gpointer create_gdom_object(GDOMObject *dob)
+{
+    gpointer res = g_object_new(dob->get_gobj_type(), NULL);
+    gdom_dom_object_set_private(GDOM_DOM_OBJECT(res), dob);
+    return res;
+}
+
+gpointer GDOMScriptInterpreter::putDOMObject(void* objectHandle, GDOMObject* wrapper) 
+{
+    // addWrapper(wrapper);
+    gpointer obj = create_gdom_object(wrapper);
+    printf("putDOMObject: %p %p %p\n", objectHandle, wrapper, obj);
+    domObjects().set(objectHandle, obj);
+    return obj;
+}
+
+void GDOMScriptInterpreter::forgetDOMObject(void* objectHandle)
+{
+    domObjects().take(objectHandle);
+    //removeWrapper(domObjects().take(objectHandle));
+}
+
+gpointer GDOMScriptInterpreter::getDOMNodeForDocument(Document* document, Node* node)
+{
+    if (!document)
+        return static_cast<gpointer >(domObjects().get(node));
+    return /* XXX grrr document-> */wrapperCache().get(node);
+}
+
+void GDOMScriptInterpreter::forgetDOMNodeForDocument(Document* document, Node* node)
+{
+    if (!document) {
+        forgetDOMObject(node);
+        return;
+    }
+    //removeWrapper(/* XXX grr document->*/wrapperCache().take(node));
+}
+
+gpointer GDOMScriptInterpreter::putDOMNodeForDocument(Document* document, Node* node, GDOMNode *wrapper)
+{
+    //addWrapper(wrapper);
+    if (!document) {
+        node->ref();
+        return GDOMScriptInterpreter::putDOMObject(node, wrapper) ;
+    }
+    gpointer obj = create_gdom_object(wrapper);
+    /* XXX grrr document->*/wrapperCache().set(node, obj);
+    return obj;
+}
+
+void GDOMScriptInterpreter::forgetAllDOMNodesForDocument(Document* document)
+{
+    ASSERT(document);
+    //removeWrappers(document->wrapperCache());
+}
+
+#if 0
+void GDOMScriptInterpreter::markDOMNodesForDocument(Document* doc)
+{
+#if 0 /*XXX TODO*/
+    // If a node's Gdom wrapper holds custom properties, those properties must
+    // persist every time the node is fetched from the DOM. So, we keep Gdom
+    // wrappers like that from being garbage collected.
+
+    GdomWrapperCache& nodeDict = /*doc->*/wrapperCache();
+    GdomWrapperCache::iterator nodeEnd = nodeDict.end();
+    for (GdomWrapperCache::iterator nodeIt = nodeDict.begin(); nodeIt != nodeEnd; ++nodeIt) {
+        gpointer gNode = nodeIt->second;
+        Node* node = gNode->impl();
+
+        if (gNode->marked())
+            continue;
+
+        // No need to preserve a wrapper that has no custom properties or is no
+        // longer fetchable through the DOM.
+        if (!gNode->hasCustomProperties() || !node->inDocument())
+            //... unless the wrapper wraps a loading image, since the "new Image"
+            // syntax allows an orphan image wrapper to be the last reference
+            // to a loading image, whose load event might have important side-effects.
+            if (!node->hasTagName(imgTag) || static_cast<HTMLImageElement*>(node)->haveFiredLoadEvent())
+                continue;
+
+        gNode->mark();
+    }
+#endif
+}
+
+/* XXX - requires looking up object - call to G_OBJECT() macro in arg
+ * "wrapper" to putDOMNodeForDocument?*/
+gpointer GDOMScriptInterpreter::updateDOMNodeDocument(Node* node, Document* oldDoc, Document* newDoc)
+{
+    ASSERT(oldDoc != newDoc);
+    styleSheet->ref();
+    gpointer wrapper = getDOMNodeForDocument(oldDoc, node);
+    if (wrapper) {
+        //removeWrapper(wrapper);
+        gpointer obj = putDOMNodeForDocument(newDoc, node, wrapper);
+        forgetDOMNodeForDocument(oldDoc, node);
+        //addWrapper(wrapper);
+        return obj;
+    }
+    return NULL; /* err... */
+}
+#endif
+
+gpointer toGDOM(Document* doc)
+{
+    if (!doc)
+        return NULL; /* XXX hmmm... */
+
+    gpointer gobj = GDOMScriptInterpreter::getDOMObject(doc);
+    if (gobj)
+        return gobj;
+
+    GDOMObject *ret;
+
+    if (doc->isHTMLDocument())
+        ret = new GDOMHTMLDocument(static_cast<HTMLDocument*>(doc));
+#if ENABLE(SVG)
+    else if (doc->isSVGDocument())
+    {
+        return NULL; /* XXX TODO */
+#if 0
+        ret = new GDOMSVGDocument(static_cast<SVGDocument*>(doc));
+#endif
+    }
+#endif
+    else
+        ret = new GDOMDocument(doc);
+
+    doc->ref();
+    return GDOMScriptInterpreter::putDOMObject(doc, ret);
+}
+
+static gpointer createWrapper(Node* node);
+
+gpointer toGDOMNewlyCreated(Node* node)
+{
+    if (!node)
+        return NULL; /* hmmm.... */
+    
+    return createWrapper(node);
+}
+    
+gpointer toGDOM(Node* node)
+{
+    if (!node)
+        return NULL; /* hmmm.... */
+
+    Document* doc = node->document();
+    gpointer ret = GDOMScriptInterpreter::getDOMNodeForDocument(doc, node);
+    if (ret)
+        return ret;
+
+    return createWrapper(node);
+}
+
+gpointer toGDOM(CSSValue* value)
+{
+    if (!value)
+        return NULL; /* hmmm... */
+
+    gpointer gobj = GDOMScriptInterpreter::getDOMObject(value);
+
+    if (gobj)
+        return gobj;
+
+    GDOMObject *ret;
+
+    if (value->isValueList())
+        ret = new GDOMCSSValueList(static_cast<CSSValueList*>(value));
+#if ENABLE(SVG)
+    else if (value->isSVGPaint())
+    {
+        return NULL; /* TODO */
+        //ret = new GDOMSVGPaint(static_cast<SVGPaint*>(value));
+    }
+    else if (value->isSVGColor())
+    {
+        return NULL; /* TODO */
+        //ret = new GDOMSVGColor(static_cast<SVGColor*>(value));
+    }
+#endif
+    else if (value->isPrimitiveValue())
+        ret = new GDOMCSSPrimitiveValue(static_cast<CSSPrimitiveValue*>(value));
+    else
+        ret = new GDOMCSSValue(value);
+
+    value->ref();
+    return GDOMScriptInterpreter::putDOMObject(value, ret);
+}
+
+static ALWAYS_INLINE gpointer createWrapper(Node* node)
+{
+    ASSERT(node);
+    ASSERT(!ScriptInterpreter::getDOMNodeForDocument(node->document(), node));
+    
+    Document* doc = node->document();
+    GDOMNode *ret = NULL;
+    
+    printf("createWrapper nodeType %d\n", node->nodeType());
+
+    switch (node->nodeType()) {
+        case Node::ELEMENT_NODE:
+            if (node->isHTMLElement())
+                ret = createGDOMHTMLWrapper(static_cast<HTMLElement*>(node));
+#if ENABLE(SVG)
+            else if (node->isSVGElement())
+                return NULL;
+#if 0 /* XXX TODO */
+                ret = createGDOMSVGWrapper(static_cast<SVGElement*>(node));
+#endif
+#endif
+            else
+                ret = new GDOMElement(static_cast<Element*>(node));
+            break;
+        case Node::ATTRIBUTE_NODE:
+            ret = new GDOMAttr(static_cast<Attr*>(node));
+            break;
+        case Node::TEXT_NODE:
+            ret = new GDOMText(static_cast<Text*>(node));
+            break;
+        case Node::CDATA_SECTION_NODE:
+            ret = new GDOMCDATASection(static_cast<CDATASection*>(node));
+            break;
+        case Node::ENTITY_NODE:
+            ret = new GDOMEntity(static_cast<Entity*>(node));
+            break;
+        case Node::PROCESSING_INSTRUCTION_NODE:
+            ret = new GDOMProcessingInstruction(static_cast<ProcessingInstruction*>(node));
+            break;
+        case Node::COMMENT_NODE:
+            ret = new GDOMComment(static_cast<Comment*>(node));
+            break;
+        case Node::DOCUMENT_NODE:
+            // we don't want to cache the document itself in the per-document dictionary
+            return toGDOM(static_cast<Document*>(node));
+        case Node::DOCUMENT_TYPE_NODE:
+            ret = new GDOMDocumentType(static_cast<DocumentType*>(node));
+            break;
+        case Node::NOTATION_NODE:
+            ret = new GDOMNotation(static_cast<Notation*>(node));
+            break;
+        case Node::DOCUMENT_FRAGMENT_NODE:
+            ret = new GDOMDocumentFragment(static_cast<DocumentFragment*>(node));
+            break;
+        case Node::ENTITY_REFERENCE_NODE:
+            ret = new GDOMEntityReference(static_cast<EntityReference*>(node));
+            break;
+        default:
+            ret = new GDOMNode(node);
+    }
+
+    doc->ref();
+    return GDOMScriptInterpreter::putDOMNodeForDocument(doc, node, ret);
+}
+ 
+gpointer toGDOM(HTMLCollection* collection)
+{
+    if (!collection)
+        return NULL; /* hmmm.... */
+
+    gpointer gobj = GDOMScriptInterpreter::getDOMObject(collection);
+
+    if (gobj)
+        return gobj;
+
+    GDOMObject *ret;
+    switch (collection->type()) {
+        case HTMLCollection::SelectOptions:
+            ret = new GDOMHTMLOptionsCollection(static_cast<HTMLOptionsCollection*>(collection));
+            break;
+#if 0
+        case HTMLCollection::DocAll:
+            ret = new GDOMHTMLAllCollection(static_cast<HTMLCollection*>(collection));
+            break;
+#endif
+        default:
+            ret = new GDOMHTMLCollection(static_cast<HTMLCollection*>(collection));
+            break;
+    }
+
+    collection->ref();
+    return GDOMScriptInterpreter::putDOMObject(collection, ret);
+}
+
+gpointer toGDOM(Event* event)
+{
+    if (!event)
+        return NULL; /* hmmm.... */
+
+    printf("toGDOM Event type %s\n", event->type().string().utf8().data());
+
+    gpointer gobj = GDOMScriptInterpreter::getDOMObject(event);
+    if (gobj)
+        return gobj;
+
+    GDOMObject *ret;
+    if (event->isUIEvent()) {
+        if (event->isKeyboardEvent())
+            ret = new GDOMKeyboardEvent(static_cast<KeyboardEvent*>(event));
+        else if (event->isTextEvent())
+            ret = new GDOMTextEvent(static_cast<TextEvent*>(event));
+        else if (event->isMouseEvent())
+            ret = new GDOMMouseEvent(static_cast<MouseEvent*>(event));
+        else if (event->isWheelEvent())
+            ret = new GDOMWheelEvent(static_cast<WheelEvent*>(event));
+#if ENABLE(SVG)
+        else if (event->isSVGZoomEvent())
+        {
+            return NULL; /* TODO */
+            //ret = new GDOMSVGZoomEvent(static_cast<SVGZoomEvent*>(event), 0);
+        }
+#endif
+        else
+            ret = new GDOMUIEvent(static_cast<UIEvent*>(event));
+    } else if (event->isMutationEvent())
+        ret = new GDOMMutationEvent(static_cast<MutationEvent*>(event));
+    else if (event->isOverflowEvent())
+        ret = new GDOMOverflowEvent(static_cast<OverflowEvent*>(event));
+    else if (event->isMessageEvent())
+        ret = new GDOMMessageEvent(static_cast<MessageEvent*>(event));
+    else if (event->isProgressEvent()) {
+        if (event->isXMLHttpRequestProgressEvent())
+            ret = new GDOMXMLHttpRequestProgressEvent(static_cast<XMLHttpRequestProgressEvent*>(event));
+        else
+            ret = new GDOMProgressEvent(static_cast<ProgressEvent*>(event));
+    }
+#if ENABLE(DOM_STORAGE)
+    else if (event->isStorageEvent())
+        ret = new GDOMStorageEvent(static_cast<StorageEvent*>(event));
+#endif
+    else if (event->isWebKitAnimationEvent())
+        ret = new GDOMWebKitAnimationEvent(static_cast<WebKitAnimationEvent*>(event));
+    else if (event->isWebKitTransitionEvent())
+        ret = new GDOMWebKitTransitionEvent(static_cast<WebKitTransitionEvent*>(event));
+    else
+        ret = new GDOMEvent(event);
+
+    event->ref();
+    return GDOMScriptInterpreter::putDOMObject(event, ret);
+}
+
+/* TODO XXX hmmm... not so happy about this - should be "newly created" */
+gpointer toGDOM(Text* text)
+{
+    if (!text)
+        return NULL;
+
+    gpointer gobj = GDOMScriptInterpreter::getDOMNodeForDocument(text->document(), text);
+    if (gobj)
+        return gobj;
+
+    GDOMNode *ret = new GDOMText(text);
+    text->document()->ref();
+    return GDOMScriptInterpreter::putDOMNodeForDocument(text->document(), text, ret);
+}
+
+gpointer toGDOM(CSSRule* rule)
+{
+    if (!rule)
+        return NULL; /* XXX hmmm... */
+
+    gpointer gobj = GDOMScriptInterpreter::getDOMObject(rule);
+
+    if (gobj)
+        return gobj;
+
+    GDOMObject *ret;
+    switch (rule->type()) {
+        case CSSRule::STYLE_RULE:
+            ret = new GDOMCSSStyleRule(static_cast<CSSStyleRule*>(rule));
+            break;
+        case CSSRule::MEDIA_RULE:
+            ret = new GDOMCSSMediaRule(static_cast<CSSMediaRule*>(rule));
+            break;
+        case CSSRule::FONT_FACE_RULE:
+            ret = new GDOMCSSFontFaceRule(static_cast<CSSFontFaceRule*>(rule));
+            break;
+        case CSSRule::PAGE_RULE:
+            ret = new GDOMCSSPageRule(static_cast<CSSPageRule*>(rule));
+            break;
+        case CSSRule::IMPORT_RULE:
+            ret = new GDOMCSSImportRule(static_cast<CSSImportRule*>(rule));
+            break;
+        case CSSRule::CHARSET_RULE:
+            ret = new GDOMCSSCharsetRule(static_cast<CSSCharsetRule*>(rule));
+            break;
+        case CSSRule::VARIABLES_RULE:
+            ret = new GDOMCSSVariablesRule(static_cast<CSSVariablesRule*>(rule));
+            break;
+        default:
+            ret = new GDOMCSSRule(rule);
+            break;
+    }
+
+    rule->ref();
+    GDOMScriptInterpreter::putDOMObject(rule, ret);
+    return ret;
+}
+
+/* TODO: should be toGDOMNewlyCreated */
+gpointer toGDOM(Element* element)
+{
+    if (!element)
+        return NULL;
+
+    // shouldn't be one? ASSERT(!ScriptInterpreter::getDOMNodeForDocument(element->document(), element));
+    gpointer gobj = GDOMScriptInterpreter::getDOMNodeForDocument(element->document(), element);
+    if (gobj)
+        return gobj; // huh? err...
+
+    GDOMNode *ret;
+    Document* doc = element->document();
+
+    if (element->isHTMLElement())
+        ret = createGDOMHTMLWrapper(static_cast<HTMLElement*>(element));
+#if ENABLE(SVG)
+    else if (element->isSVGElement())
+    {
+        return NULL; /* TODO */
+        //ret = createGDOMSVGWrapper(static_cast<SVGElement*>(element));
+    }
+#endif
+    else
+        ret = new GDOMElement(element);
+
+    doc->ref();
+    return GDOMScriptInterpreter::putDOMNodeForDocument(doc, element, ret);
+}
+
+gpointer toGDOM(StyleSheet* styleSheet)
+{
+    if (!styleSheet)
+        return NULL; /* err... */
+
+    gpointer gobj = GDOMScriptInterpreter::getDOMObject(styleSheet);
+    if (gobj)
+        return gobj;
+
+    GDOMObject *ret;
+    if (styleSheet->isCSSStyleSheet())
+        ret = new GDOMCSSStyleSheet(static_cast<CSSStyleSheet*>(styleSheet));
+    else
+        ret = new GDOMStyleSheet(styleSheet);
+
+    styleSheet->ref();
+    return GDOMScriptInterpreter::putDOMObject(styleSheet, ret);
+}
+
+/* derived sources auto-generated */
+gpointer toGDOM(XMLHttpRequestUpload* obj);
+
+gpointer toGDOM(EventTarget* target)
+{
+    if (!target)
+        return NULL;
+    
+#if 0
+#if ENABLE(SVG)
+    // SVGElementInstance supports both toSVGElementInstance and toNode since so much mouse handling code depends on toNode returning a valid node.
+    SVGElementInstance* instance = target->toSVGElementInstance();
+    if (instance)
+        return toGDOM(exec, instance);
+#endif
+#endif
+
+    Node* node = target->toNode();
+    if (node)
+        return toGDOM(node);
+    
+    if (XMLHttpRequest* xhr = target->toXMLHttpRequest())
+        // XMLHttpRequest is always created via GDOM, so we don't need to use cacheDOMObject() here.
+        return GDOMScriptInterpreter::getDOMObject(xhr);
+
+    if (XMLHttpRequestUpload* upload = target->toXMLHttpRequestUpload())
+        return toGDOM(upload);
+    
+#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+    if (DOMApplicationCache* cache = target->toDOMApplicationCache())
+        // DOMApplicationCache is always created via GDOM, so we don't need to use cacheDOMObject() here.
+        return GDOMScriptInterpreter::getDOMObject(cache);
+#endif
+
+    // There are two kinds of EventTargets: EventTargetNode and XMLHttpRequest.
+    // If SVG support is enabled, there is also SVGElementInstance.
+    ASSERT_NOT_REACHED();
+    return NULL;
+}   
+
+gpointer toGDOM(EventTargetNode* target)
+{
+    if (!target)
+        return NULL;
+    
+    Node* node = target->toNode();
+    if (node)
+        return toGDOM(node);
+    
+    return toGDOM(static_cast<EventTarget*>(target));
+}
+
+} // namespace WebCore
+
Index: WebCore/bindings/gdom/GdomDOMObject.h
===================================================================
--- WebCore/bindings/gdom/GdomDOMObject.h	(revision 0)
+++ WebCore/bindings/gdom/GdomDOMObject.h	(revision 0)
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2008 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
+ * Copyright (C) 2008 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2008 Apple Inc.
+ */
+
+#ifndef __GdomDOMObject_H__
+#define __GdomDOMObject_H__
+#include "glib-object.h"
+#include <webkit/webkitdefines.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GdomDOMObject GdomDOMObject;
+typedef struct _GdomDOMObjectClass GdomDOMObjectClass;
+
+#define GDOM_TYPE_DOM_OBJECT            (gdom_dom_object_get_type())
+#define GDOM_DOM_OBJECT(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), GDOM_TYPE_DOM_OBJECT, GdomDOMObject))
+#define GDOM_DOM_OBJECT_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),  GDOM_TYPE_DOM_OBJECT, GdomDOMObjectClass))
+#define GDOM_IS_DOM_OBJECT(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), GDOM_TYPE_DOM_OBJECT))
+#define GDOM_IS_DOM_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),  GDOM_TYPE_DOM_OBJECT))
+#define GDOM_DOM_OBJECT_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),  GDOM_TYPE_DOM_OBJECT, GdomDOMObjectClass))
+
+typedef struct _GdomDOMObjectPrivate GdomDOMObjectPrivate;
+
+struct _GdomDOMObject {
+    GObject parent_instance;
+
+    GdomDOMObjectPrivate *priv;
+};
+
+struct _GdomDOMObjectClass {
+    GObjectClass parent_class;
+};
+
+WEBKIT_API GType
+gdom_dom_object_get_type (void);
+
+WEBKIT_API void
+gdom_dom_object_init_dom_object (GdomDOMObject *thiz);
+
+G_END_DECLS
+
+#endif /* __GdomDOMObject_H__ */
+
Index: WebCore/bindings/gdom/GDOMObject.h
===================================================================
--- WebCore/bindings/gdom/GDOMObject.h	(revision 0)
+++ WebCore/bindings/gdom/GDOMObject.h	(revision 0)
@@ -0,0 +1,14 @@
+#ifndef __DOMObject_h__
+#define __DOMObject_h__
+
+// namespace WebCore {
+
+class GDOMObject {
+public:
+    virtual ~GDOMObject() {}
+    virtual int get_gobj_type() = 0;
+};
+
+// } // namespace WebCore
+
+#endif
Index: WebCore/bindings/gdom/GDOMHTMLElementWrapperFactory.h
===================================================================
--- WebCore/bindings/gdom/GDOMHTMLElementWrapperFactory.h	(revision 0)
+++ WebCore/bindings/gdom/GDOMHTMLElementWrapperFactory.h	(revision 0)
@@ -0,0 +1,48 @@
+/*
+ * THIS FILE IS DERIVED FROM AN AUTOMATICALLY GENERATED FILE.
+ * keeping it up-to-date could potentially be done by adding
+ * a make_names.pl generator, or by writing a separate
+ * generater which takes JSHTMLElementWrapperFactory.h as input.
+ *
+ *
+ * Copyright (C) 2005 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+
+#ifndef GDOMHTMLElementWrapperFactory_h
+#define GDOMHTMLElementWrapperFactory_h
+
+#include "PrivateIntGdomNode.h"
+
+#include <wtf/Forward.h>
+
+namespace WebCore {
+
+    class HTMLElement;
+
+    GDOMNode* createGDOMHTMLWrapper(PassRefPtr<HTMLElement>);
+
+}
+ 
+#endif // GDOMHTMLElementWrapperFactory_h
Index: WebCore/bindings/gdom/GDOMBinding.h
===================================================================
--- WebCore/bindings/gdom/GDOMBinding.h	(revision 0)
+++ WebCore/bindings/gdom/GDOMBinding.h	(revision 0)
@@ -0,0 +1,91 @@
+/*
+ *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
+ *  Copyright (C) 2003, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
+ *  Copyright (C) 2007 Samuel Weinig <sam@webkit.org>
+ *  Copyright (C) 2008 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef GdomDOMBinding_h
+#define GdomDOMBinding_h
+
+#include <kjs/interpreter.h>
+#include <kjs/lookup.h>
+#include <wtf/Noncopyable.h>
+
+#include "GdomNode.h"
+#include "GDOMObject.h"
+#include "PrivateIntGdomNode.h"
+
+namespace WebCore {
+
+    class AtomicString;
+    class Document;
+    class Event;
+    class Frame;
+    class KURL;
+    class Node;
+    class String;
+
+#if ENABLE(SVG)
+    class SVGElement;
+#endif
+
+    class GDOMScriptInterpreter {
+    public:
+        static void* getDOMObject(void* objectHandle);
+        static void* putDOMObject(void* objectHandle, GDOMObject*);
+        static void forgetDOMObject(void* objectHandle);
+
+        static void* getDOMNodeForDocument(Document*, Node*);
+        static void* putDOMNodeForDocument(Document*, Node*, GDOMNode* nodeWrapper);
+        static void forgetDOMNodeForDocument(Document*, Node*);
+        static void forgetAllDOMNodesForDocument(Document*);
+		#if 0
+        static void updateDOMNodeDocument(Node*, Document* oldDoc, Document* newDoc);
+        static void markDOMNodesForDocument(Document*);
+		#endif
+    };
+
+    // Retrieve from cache, or create, a Gdom wrapper for a DOM object.
+    template<class DOMObj, class GdomDOMObj> inline void* cacheDOMObject(DOMObj* domObj)
+    {
+        if (!domObj)
+            return NULL; /* XXX hmmm... */
+        if (void* ret = GDOMScriptInterpreter::getDOMObject(domObj))
+            return ret;
+        GDOMObject* ret = new GdomDOMObj(domObj);
+		domObj->ref();
+        return GDOMScriptInterpreter::putDOMObject(domObj, ret);
+    }
+
+#if ENABLE(SVG)
+    // Retrieve from cache, or create, a Gdom wrapper for an SVG DOM object.
+    template<class DOMObj, class GdomDOMObj> inline void* cacheSVGDOMObject(DOMObj* domObj, SVGElement* context)
+    {
+        if (!domObj)
+            return NULL; /* XXX hmmm... */
+        if (void* ret = GDOMScriptInterpreter::getDOMObject(domObj))
+            return ret;
+        GDOMObject* ret = new GdomDOMObj(domObj, context);
+		domObj->ref();
+        return GDOMScriptInterpreter::putDOMObject(domObj, ret);
+    }
+#endif
+
+} // namespace WebCore
+
+#endif // GdomDOMBinding_h
Index: WebCore/bindings/gdom/PrivateIntGdomDOMObject.h
===================================================================
--- WebCore/bindings/gdom/PrivateIntGdomDOMObject.h	(revision 0)
+++ WebCore/bindings/gdom/PrivateIntGdomDOMObject.h	(revision 0)
@@ -0,0 +1,8 @@
+/*
+ * Copyright (C) 2008 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
+ * Copyright (C) 2008 Alp Toker <alp@atoker.com>
+ * Copyright (C) 2008 Apple Inc.
+ */
+
+#include "GDOMObject.h"
+
Index: WebCore/bindings/scripts/CodeGeneratorGObject.pm
===================================================================
--- WebCore/bindings/scripts/CodeGeneratorGObject.pm	(revision 0)
+++ WebCore/bindings/scripts/CodeGeneratorGObject.pm	(revision 0)
@@ -0,0 +1,1678 @@
+#
+# Copyright (C) 2008 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
+# Copyright (C) 2008 Alp Toker <alp@atoker.com>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public License
+# aint with this library; see the file COPYING.LIB.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+package CodeGeneratorGObject;
+
+# Default Licence Templates
+my $licenceTemplate = << "EOF";
+/*
+ * Copyright (C) 2008 Luke Kenneth Casson Leighton <lkcl\@lkcl.net>
+ * Copyright (C) 2008 Alp Toker <alp\@atoker.com>
+ * Copyright (C) 2008 Apple Inc.
+ */
+EOF
+
+my %implIncludes = ();
+my %hdrIncludes = ();
+my %hdrPropIncludes = ();
+my %implTypedefs = ();
+
+# Default constructor
+sub new
+{
+    my $object = shift;
+    my $reference = { };
+
+    $codeGenerator = shift;
+    $outputDir = shift;
+
+    bless($reference, $object);
+    return $reference;
+}
+
+sub finish
+{
+    my $object = shift;
+}
+
+# Params: 'domClass' struct
+sub GenerateInterface
+{
+    my $object = shift;
+    my $dataNode = shift;
+    my $defines = shift;
+
+    my $name = $dataNode->name;
+
+    print "$name\n";
+
+    $object->Generate($dataNode);
+
+    # Write changes
+    my $fname = "Gdom_" . $name; #decamelize($name);
+    $fname =~ s/_//g;
+    $object->WriteData($fname);
+}
+
+# Params: 'idlDocument' struct
+sub GenerateModule
+{
+    my $object = shift;
+    my $dataNode = shift;
+
+    $module = $dataNode->module;
+}
+
+sub ClsToGObjType
+{
+    my $className = shift;
+    return uc(decamelize($className))
+}
+
+sub GetParentClassName
+{
+    my $dataNode = shift;
+
+    # ?? que??
+    #return $dataNode->extendedAttributes->{"LegacyParent"} if $dataNode->extendedAttributes->{"LegacyParent"};
+    return "GdomDOMObject" if @{$dataNode->parents} eq 0;
+    return "Gdom" . $codeGenerator->StripModule($dataNode->parents(0));
+}
+sub GetParentGObjType
+{
+    my $dataNode = shift;
+
+    # ?? que??
+    #return $dataNode->extendedAttributes->{"LegacyParent"} if $dataNode->extendedAttributes->{"LegacyParent"};
+    return "GDOM_TYPE_DOM_OBJECT" if @{$dataNode->parents} eq 0;
+    return "GDOM_TYPE_" . ClsToGObjType($codeGenerator->StripModule($dataNode->parents(0)));
+}
+
+
+# Algorithm taken from String::CamelCase 0.01
+sub camelize
+{
+    my $s = shift;
+    join('', map{ ucfirst $_ } split(/(?<=[A-Za-z])_(?=[A-Za-z])|\b/, $s));
+}
+
+# Algorithm taken from String::CamelCase 0.01
+sub decamelize
+{
+    my $s = shift;
+    $s =~ s{([^a-zA-Z]?)([A-Z]*)([A-Z])([a-z]?)}{
+        my $fc = pos($s)==0;
+        my ($p0,$p1,$p2,$p3) = ($1,lc$2,lc$3,$4);
+        my $t = $p0 || $fc ? $p0 : '_';
+        $t .= $p3 ? $p1 ? "${p1}_$p2$p3" : "$p2$p3" : "$p1$p2";
+        $t;
+    }ge;
+    $s;
+}
+
+sub GetHdrName
+{
+        my $name = $codeGenerator->StripModule(shift);
+
+    return "Gdom$name";
+}
+
+sub GetClassName
+{
+        my $name = $codeGenerator->StripModule(shift);
+
+    return "Gdom$name";
+}
+
+sub GetGIncludeHdr
+{
+    my $type = shift;
+        my $name = GetHdrName($type);
+        #my $name = camelize(GetClassName($type));
+
+        return "" if $type eq "int";
+        return "" if $type eq "long";
+        return "" if $type eq "short";
+        return "" if $type eq "char";
+        return "" if $type eq "float";
+        return "" if $type eq "double";
+        return "" if $type eq "unsigned";
+        return "" if $type eq "unsigned int";
+        return "" if $type eq "unsigned long";
+        return "" if $type eq "unsigned long long";
+        return "" if $type eq "unsigned short";
+        return "" if $type eq "DOMTimeStamp";
+        return "" if $type eq "EventListener";
+        return "Range.h" if $type eq "CompareHow";
+        return "GdomCanvasRenderingContext2D.h" if $type eq "DOMObject";
+        return "" if $type eq "unsigned char";
+        return "" if $type eq "RGBColor"; # XXX TODO - DOM class wrapper
+        return "glib-object.h" if $type eq "DOMString";
+        return "GdomEventTargetNode.h" if $type eq "EventTarget";
+
+        return "glib-object.h" if $type eq "float";
+
+        return "glib-object.h" if $type eq "boolean";
+
+        return "glib-object.h" if $type eq "void";
+
+    return "$name.h";
+}
+
+# returns 1 if we need to create a gobject wrapper around the return result
+sub IsGDOMClassType
+{
+    my $type = shift;
+        my $name = GetClassName($type);
+
+        return 0 if $type eq "DOMTimeStamp";
+        return 0 if $type eq "DOMString";
+        return 0 if $type eq "EventListener";
+        return 0 if $type eq "CompareHow";
+        return 0 if $type eq "float";
+        return 0 if $type eq "double";
+        return 0 if $type eq "boolean";
+        return 0 if $type eq "char";
+        return 0 if $type eq "long";
+        return 0 if $type eq "short";
+        return 0 if $type eq "uchar";
+        return 0 if $type eq "unsigned";
+        return 0 if $type eq "int";
+        return 0 if $type eq "unsigned int";
+        return 0 if $type eq "unsigned long";
+        return 0 if $type eq "unsigned long long";
+        return 0 if $type eq "unsigned short";
+        return 0 if $type eq "RGBColor"; # XXX TODO - DOM class wrapper
+
+        return 0 if $type eq "void";
+
+    return 1;
+}
+
+sub GetPropGType
+{
+    my $type = shift;
+    my $name = GetClassName($type);
+
+    return "string" if $type eq "DOMString";
+    return "float" if $type eq "float";
+    return "notyetsupported" if $type eq "CompareHow";
+    return "double" if $type eq "double";
+    return "boolean" if $type eq "boolean";
+    return "char" if $type eq "char";
+    return "long" if $type eq "long";
+    return "int" if $type eq "short";
+    return "uchar" if $type eq "uchar";
+    return "uint" if $type eq "unsigned";
+    return "int" if $type eq "int";
+    return "uint" if $type eq "unsigned int";
+    return "uint64" if $type eq "unsigned long long";
+    return "ulong" if $type eq "unsigned long";
+    return "ushort" if $type eq "unsigned short";
+    return "ulong" if $type eq "RGBColor"; # XXX TODO - DOM class wrapper
+
+    return "object";
+}
+
+sub GetGType
+{
+    my $type = shift;
+        my $name = GetClassName($type);
+        #my $name = camelize(GetClassName($type));
+
+        return "GdomEventTargetNode *" if $type eq "EventTarget";
+        return "const gchar *" if $type eq "DOMString";
+        return "gfloat " if $type eq "float";
+        return "WebCore::Range::CompareHow " if $type eq "CompareHow";
+        return "gdouble " if $type eq "double";
+        return "gboolean " if $type eq "boolean";
+        return "gchar " if $type eq "char";
+        return "glong " if $type eq "long";
+        return "gshort " if $type eq "short";
+        return "guchar " if $type eq "uchar";
+        return "guint " if $type eq "unsigned";
+        return "gint " if $type eq "int";
+        return "guint " if $type eq "unsigned int";
+        return "gulong " if $type eq "unsigned long";
+        return "guint64 " if $type eq "unsigned long long";
+        return "gushort " if $type eq "unsigned short";
+        return "gulong" if $type eq "RGBColor"; # XXX TODO - DOM class wrapper
+
+        return "void" if $type eq "void";
+
+    return "$name *";
+}
+
+sub getIncHdr
+{
+    my $type = shift;
+
+    my $includeHdr = GetGIncludeHdr($type);
+    if ($includeHdr) {
+        if ($type eq "EventTarget") {
+            return "GdomEventTargetNode.h";
+        }
+        elsif ($type eq "DOMObject") {
+            # XXX ???? wtf?? :) copied from jsgenerator.
+            return "GdomCanvasRenderingContext2D.h";
+        } else {
+            return $includeHdr;
+        }
+    }
+    return "";
+}
+
+sub addPropIncHdr
+{
+    my $type = shift;
+
+    my $hdr = getIncHdr($type);
+    if ($hdr ne "") {
+        $hdrPropIncludes{$hdr} = 1;
+        if (IsGDOMClassType($type)) {
+            $hdrPropIncludes{"Private".$hdr} = 1;
+            $hdrPropIncludes{"PrivateInt".$hdr} = 1;
+        }
+    }
+
+}
+
+sub addIncHdr
+{
+    my $type = shift;
+
+    my $hdr = getIncHdr($type);
+    if ($hdr ne "") {
+        $hdrIncludes{$hdr} = 1;
+    }
+
+}
+
+sub addIncBody
+{
+    my $type = shift;
+
+    my $hdr = getIncHdr($type);
+    if ($hdr ne "") {
+        $implIncludes{$hdr} = 1;
+    }
+}
+
+sub GetPrivFn
+{
+    my $interfaceName = shift;
+    my $lcase_ifacename = shift;
+    my $res = shift;
+    my $parm = shift;
+
+    if ($interfaceName eq "EventTarget") {
+        return "WebCore::EventTargetNode * $res = static_cast<WebCore::EventTargetNode*>(gdom_event_target_node_get_private(self));";
+    }
+    return "WebCore::${interfaceName} * $res = (${lcase_ifacename}_get_private($parm));";
+}
+
+sub skipPropTemporarily
+{
+    my $type = shift;
+    my $prop_type = shift;
+
+    # skip MediaList
+    if ($prop_type eq "stylesheets::MediaList") {
+        return 1;
+    }
+
+    #if ($prop_type eq "EventTarget") {
+    #    return 1;
+    #}
+
+    # skip CSSVariablesDeclaration
+    if ($prop_type eq "CSSVariablesDeclaration") {
+        return 1;
+    }
+
+    # skip CSSMutableStyleDeclaration
+    #if ($prop_type eq "CSSStyleDeclaration") {
+    #    return 1;
+    #}
+
+    # skip CSSMutableStyleDeclaration
+    #if ($prop_type eq "CSSMutableStyleDeclaration") {
+    #    return 1;
+    #}
+
+    # skip EventListener
+    #if ($prop_type eq "EventListener") {
+    #    return 1;
+    #}
+
+    # skip DOMWindow
+    #if ($prop_type eq "DOMWindow") {
+    #    return 1;
+    #}
+
+    # skip Constructors (whatever they are) for now.
+    if ($prop_type =~ /Constructor$/) {
+        return 1;
+    }
+
+    # canvas2d....
+    if ($prop_type eq "custom") {
+        return 1;
+    }
+
+    if ($prop_type eq "Array") {
+        return 1;
+    }
+
+    if ($prop_type eq "DOMTimeStamp") {
+        return 1;
+    }
+
+    # TODO: SVG
+    if ($codeGenerator->IsPodType($type) || $codeGenerator->IsSVGAnimatedType($type)) {
+        return 1;
+    }
+    return 0;
+}
+
+sub UsesManualToJSImplementation
+{
+    my $type = shift;
+
+    # skipped out CanvasPixelArray - see JSCanvasPixelArrayCustom.cpp for why.
+    return 1 if $type eq "Node" or $type eq "Document" or $type eq "HTMLCollection" or $type eq "SVGPathSeg" or $type eq "StyleSheet" or $type eq "CSSRule" or $type eq "CSSValue" or $type eq "Event" or $type eq "Element" or $type eq "Text";
+    return 0;
+}
+
+
+# Generate header and impl
+sub Generate
+{
+    my $object = shift;
+    my $dataNode = shift;
+
+    my $hasLegacyParent = $dataNode->extendedAttributes->{"LegacyParent"};
+    my $hasRealParent = @{$dataNode->parents} > 0;
+    my $hasParent = $hasLegacyParent || $hasRealParent;
+    my $parentClassName = GetParentClassName($dataNode);
+    my $parentGObjType = GetParentGObjType($dataNode);
+    my $interfaceName = $dataNode->name;
+    my $className = GetClassName($interfaceName);
+    my $hdrName = GetHdrName($interfaceName);
+
+    # Add the default impl header template
+    @cPrefix = split("\r", $licenceTemplate);
+    push(@cPrefix, "\n");
+
+    $implIncludes{"GDOMBinding.h"} = 1;
+    $implIncludes{"$hdrName.h"} = 1;
+    $implIncludes{"Private${hdrName}.h"} = 1;
+
+    my $parentInterfaceName = "DOMObject";
+    my $parentGIfaceName = "GDOMObject";
+    my $parentHdrName = "GdomDOMObject";
+    if ($parentClassName ne "GObject")
+    {
+        $parentInterfaceName = substr($parentClassName, 4);
+        if ($parentInterfaceName ne "DOMObject") {
+            $parentGIfaceName = "GDOM".substr($parentClassName, 4);
+            $parentHdrName = GetHdrName($parentInterfaceName);
+        }
+        else
+        {
+            $parentGIfaceName = "GDOMObject";
+        }
+        $implIncludes{"${parentHdrName}.h"} = 1;
+        $implIncludes{"Private${parentHdrName}.h"} = 1;
+        $hdrIncludes{"${parentHdrName}.h"} = 1;
+        #$hdrIncludes{"Private${parentHdrName}.h"} = 0;
+    }
+
+    # TODO - make these only include where needed, likewise the
+    # function declarations toGDOM, too
+    $implIncludes{"Node.h"} = 1;
+    $implIncludes{"Element.h"} = 1;
+    $implIncludes{"CSSValue.h"} = 1;
+    $implIncludes{"CSSRule.h"} = 1;
+    $implIncludes{"HTMLCollection.h"} = 1;
+    #$implIncludes{"SVGPathSeg.h"} = 1;
+    $implIncludes{"StyleSheet.h"} = 1;
+    $implIncludes{"Event.h"} = 1;
+    $implIncludes{"CanvasPixelArray.h"} = 1;
+    $implIncludes{"DOMWindow.h"} = 1;
+    $implIncludes{"Text.h"} = 1;
+
+    # XXX TODO: make this optional or in a header file.  or find a better way.
+    my $hackDecls = << "EOF";
+namespace WebCore {
+    gpointer toGDOM(Node* node);
+    gpointer toGDOM(CSSValue* node);
+    gpointer toGDOM(CSSRule* node);
+    gpointer toGDOM(Element* node);
+    gpointer toGDOM(Document* node);
+    gpointer toGDOM(HTMLCollection* node); 
+    //gpointer toGDOM(SVGPathSeg* node); 
+    gpointer toGDOM(StyleSheet* node); 
+    gpointer toGDOM(EventTargetNode* node); 
+    gpointer toGDOM(EventTarget* node); 
+    gpointer toGDOM(Event* node); 
+    gpointer toGDOM(CanvasPixelArray* node); 
+    gpointer toGDOM(DOMWindow* node); 
+    gpointer toGDOM(Text* node); 
+} // namespace WebCore
+
+EOF
+
+    push(@cBody, $hackDecls);
+
+    # XXX TODO: make this optional or in a header file.  or find a better way.
+    my $stringConvert = << "EOF";
+class GStringConvert {
+    public:
+    const gchar *m_str;
+    GStringConvert(WebCore::String const& s) { m_str = g_strdup(s.utf8().data()); }
+    GStringConvert(WebCore::KURL const& s) { m_str = g_strdup(s.string().utf8().data()); }
+    GStringConvert(const KJS::UString & s) { m_str = g_strdup(s.UTF8String().c_str()); }
+    GStringConvert(WebCore::AtomicString const&s) { m_str = g_strdup(s.string().utf8().data()); }
+};
+
+EOF
+
+    push(@cBody, $stringConvert);
+
+    push(@cBody, "namespace WebCore {\n");
+
+    # Get correct pass/store types respecting PODType flag
+    my $podType = $dataNode->extendedAttributes->{"PODType"};
+    my $passType = $podType ? "JSSVGPODTypeWrapper<$podType>*" : "$interfaceName*";
+
+    if (${interfaceName} eq "DOMWindow" || (!$hasParent or $dataNode->extendedAttributes->{"GenerateToJS"}) and !UsesManualToJSImplementation($interfaceName)) {
+        #if ($podType) {
+        #    push(@cBody, "KJS::JSValue* toJS(KJS::ExecState* exec, JSSVGPODTypeWrapper<$podType>* obj, SVGElement* context)\n");
+        #} elsif (IsSVGTypeNeedingContextParameter($implClassName)) {
+        #     push(@cBody, "KJS::JSValue* toJS(KJS::ExecState* exec, $passType obj, SVGElement* context)\n");
+        #} else {
+            push(@cBody, "gpointer toGDOM(WebCore::$passType obj)\n");
+        #}
+
+        push(@cBody, "{\n");
+        #if ($podType) {
+        #    push(@cBody, "    return cacheSVGDOMObject<JSSVGPODTypeWrapper<$podType>, $className, ${className}Prototype>(exec, obj, context);\n");
+        #} elsif (IsSVGTypeNeedingContextParameter($implClassName)) {
+        #    push(@cBody, "    return cacheSVGDOMObject<$implClassName, $className, ${className}Prototype>(exec, obj, context);\n");
+        #} else {
+            push(@cBody, "    return WebCore::cacheDOMObject<WebCore::$interfaceName, GDOM$interfaceName>(obj);\n");
+        #}
+        push(@cBody, "}\n");
+    }
+
+    push(@cBody, "} /* namespace WebCore */ \n");
+    my $implContent = "";
+
+    # XXX TODO push(@cBody, "using namespace WebCore;\n\n");
+    push(@cBody, "extern \"C\" {\n\n");
+    push(@cBody, "#define _G_GET_UTF8(str) (GStringConvert(str).m_str)\n");
+
+    # Add the default header template
+    @hPrefix = split("\r", $licenceTemplate);
+        #push(@hPrefix, "\n");
+
+    # Header guard
+        my $guard = "__" . $className . "_H__";
+
+    my $clsCaps = substr(ClsToGObjType($className), 5);
+    my $lcase_ifacename = "gdom_" . decamelize($interfaceName);
+    #my $parentClsCaps = "GDOM_" . ClsToGObjType($parentInterfaceName);
+
+    @hPrefixGuard = << "EOF";
+#ifndef $guard
+#define $guard
+EOF
+
+    $implContent = << "EOF";
+G_BEGIN_DECLS
+
+EOF
+
+    push(@hBodyPre, $implContent);
+
+    $implContent = << "EOF";
+
+#define GDOM_TYPE_${clsCaps}            (${lcase_ifacename}_get_type())
+#define GDOM_${clsCaps}(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), GDOM_TYPE_${clsCaps}, ${className}))
+#define GDOM_${clsCaps}_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),  GDOM_TYPE_${clsCaps}, $className)Class)
+#define GDOM_IS_${clsCaps}(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), GDOM_TYPE_${clsCaps}))
+#define GDOM_IS_${clsCaps}_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),  GDOM_TYPE_${clsCaps}))
+#define GDOM_${clsCaps}_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),  GDOM_TYPE_${clsCaps}, ${className}Class))
+
+typedef struct _${className}Private ${className}Private;
+
+struct _${className} {
+    ${parentClassName} parent_instance;
+
+    ${className}Private *priv;
+};
+
+struct _${className}Class {
+    GObjectClass parent_class;
+};
+
+WEBKIT_API GType
+${lcase_ifacename}_get_type (void);
+
+EOF
+
+    push(@hBody, $implContent);
+
+    $implContent = << "EOF";
+#ifndef ${guard}_PROP_
+#define ${guard}_PROP_
+EOF
+
+    push(@hBodyPropPre, $implContent);
+
+    push(@hBodyProp, "G_BEGIN_DECLS\n");
+
+    $hdrPropInclude{"glib-object.h"} = 1;
+    $hdrPropInclude{"PrivateInt${parentHdrName}.h"} = 1;
+    $hdrPropInclude{"GDOMObject.h"} = 1;
+    $hdrPropInclude{"${interfaceName}.h"} = 1;
+
+    $implContent = << "EOF";
+#ifndef ${guard}_INT_
+#define ${guard}_INT_
+#include "glib-object.h"
+#include "PrivateInt${parentHdrName}.h"
+#include "GDOMObject.h"
+#include "${interfaceName}.h"
+EOF
+
+    push(@hBodyInternal, $implContent);
+
+     if (${interfaceName} eq "DOMWindow" || (!$hasParent or $dataNode->extendedAttributes->{"GenerateToJS"}) and !UsesManualToJSImplementation($interfaceName)) {
+        $implContent = << "EOF";
+namespace WebCore {
+    gpointer toGDOM(${interfaceName}* node);
+} /* namespace WebCore */ 
+EOF
+    push(@hBodyInternal, $implContent);
+    }
+    push(@hBodyInternal, "G_BEGIN_DECLS\n");
+
+    #Class declaration
+    #if ($interfaceName eq "DOMWindow") {
+    #    push(@hBodyInternal, "class GDOM$interfaceName {\n");
+    #} else {
+        push(@hBodyInternal, "class GDOM$interfaceName : public $parentGIfaceName {\n");
+        push(@hBodyInternal, "    typedef $parentGIfaceName Base;\n");
+    #}
+    push(@hBodyInternal, "public:\n");
+
+    push(@hBodyInternal, "    int get_gobj_type() { return GDOM_TYPE_${clsCaps}; }\n");
+
+    my $needsSVGContext = 0;
+    # Constructor
+    push(@hBodyInternal, "    GDOM$interfaceName(PassRefPtr<WebCore::$interfaceName> impl" . ($needsSVGContext ? ", SVGElement* context" : "") . ");\n");
+
+    # Destructor
+    push(@hBodyInternal, "    virtual ~GDOM$interfaceName();\n") if (!$hasParent or $interfaceName eq "Document") or $interfaceName eq "DOMWindow";
+
+    if (!$hasParent || ($interfaceName eq "DOMWindow")) {
+        #if ($podType) {
+        #    push(@hBodyInternal, "    JSSVGPODTypeWrapper<$podType>* impl() const { return m_impl.get(); }\n");
+        #    push(@hBodyInternal, "    SVGElement* context() const { return m_context.get(); }\n\n");
+        #    push(@hBodyInternal, "private:\n");
+        #    push(@hBodyInternal, "    RefPtr<SVGElement> m_context;\n");
+        #    push(@hBodyInternal, "    RefPtr<JSSVGPODTypeWrapper<$podType> > m_impl;\n");
+        #} elsif (IsSVGTypeNeedingContextParameter($implClassName)) {
+        #    push(@hBodyInternal, "    $implClassName* impl() const { return m_impl.get(); }\n");
+        #    push(@hBodyInternal, "    SVGElement* context() const { return m_context.get(); }\n\n");
+        #    push(@hBodyInternal, "private:\n");
+        #    push(@hBodyInternal, "    RefPtr<SVGElement> m_context;\n");
+        #    push(@hBodyInternal, "    RefPtr<$implClassName > m_impl;\n");
+        #} else {
+            push(@hBodyInternal, "    WebCore::$interfaceName* impl() const { return m_impl.get(); }\n\n");
+            push(@hBodyInternal, "private:\n");
+            push(@hBodyInternal, "    RefPtr<WebCore::$interfaceName> m_impl;\n");
+        #}
+    } elsif ($dataNode->extendedAttributes->{"GenerateNativeConverter"}) {
+        push(@hBodyInternal, "    WebCore::$interfaceName* impl() const\n");
+        push(@hBodyInternal, "    {\n");
+        push(@hBodyInternal, "        return static_cast<WebCore::$interfaceName*>(Base::impl());\n");
+        push(@hBodyInternal, "    }\n");
+    }
+    push(@hBodyInternal, "};\n");
+
+    # Constructor
+    push(@cBody, "GDOM${interfaceName}::GDOM$interfaceName(PassRefPtr<WebCore::$interfaceName> impl" . ($needsSVGContext ? ", SVGElement* context" : "") . ")\n");
+    if ($interfaceName eq "DOMWindow") {
+        push(@cBody, "    :m_impl(impl)\n");
+    } elsif ($hasParent) {
+        push(@cBody, "    : $parentGIfaceName(impl" . ($parentNeedsSVGContext ? ", context" : "") . ")\n") if ($interfaceName ne "DOMWindow");
+    } else {
+        push(@cBody, "    : $parentGIfaceName()\n") ;
+        push(@cBody, "    , m_context(context)\n") if $needsSVGContext;
+        push(@cBody, "    , m_impl(impl)\n");
+    }
+
+    push(@cBody, "{\n");
+    push(@cBody, "}\n\n");
+
+    # Destructor
+    if (!$hasParent or ($interfaceName eq "DOMWindow")) {
+        push(@cBody, "GDOM${interfaceName}::~GDOM$interfaceName()\n");
+        push(@cBody, "{\n");
+
+        push(@cBody, "    m_impl.get()->deref();\n");
+        if ($interfaceName eq "Node") {
+            push(@cBody, "    WebCore::GDOMScriptInterpreter::forgetDOMNodeForDocument(m_impl->document(), m_impl.get());\n");
+        } else {
+            #if ($podType) {
+            #    my $animatedType = $implClassName;
+            #    $animatedType =~ s/SVG/SVGAnimated/;
+
+            #    # Special case for JSSVGNumber
+            #    if ($codeGenerator->IsSVGAnimatedType($animatedType) and $podType ne "float") {
+            #        push(@cBody, "    JSSVGDynamicPODTypeWrapperCache<$podType, $animatedType>::forgetWrapper(m_impl.get());\n");
+            #    }
+            #}
+            push(@cBody, "    WebCore::GDOMScriptInterpreter::forgetDOMObject(m_impl.get());\n");
+        }
+
+        push(@cBody, "\n}\n\n");
+    }
+
+    # Document needs a special destructor because it's a special case for caching. It needs
+    # its own special handling rather than relying on the caching that Node normally does.
+    if ($interfaceName eq "Document") {
+        push(@cBody, "GDOM${interfaceName}::~GDOM$interfaceName()\n");
+        push(@cBody, "{\n    WebCore::GDOMScriptInterpreter::forgetDOMObject(static_cast<WebCore::${interfaceName}*>(impl()));\n}\n\n");
+    }
+
+    $implIncludes{"${parentHdrName}.h"} = 1;
+    $implIncludes{"${interfaceName}.h"} = 1;
+    $implIncludes{"GDOMObject.h"} = 1;
+
+    $implTypedefs{"$className"} = 1;
+    $implTypedefs{"${className}Class"} = 1;
+
+    $implContent = << "EOF";
+#include "config.h"
+#include "glib-object.h"
+#include <webkit/webkitdefines.h>
+#include "DOMWindow.h" /* yukk: TODO - make this optional */
+#include "Node.h" /* yukk: TODO - make this optional */
+#include "NamedNodeMap.h" /* yukk: TODO - make this optional */
+#include "CanvasPattern.h" /* yukk: TODO - make this optional */
+#include "CanvasGradient.h" /* yukk: TODO - make this optional */
+#include "CanvasStyle.h" /* yukk: TODO - make this optional */
+#include "CanvasRenderingContext2D.h" /* yukk: TODO - make this optional */
+#include "PrivateGdomDOMObject.h" /* yukk: TODO - make this optional */
+#include "GdomEventTargetNode.h" /* yukk: TODO - make this optional */
+#include "PrivateGdomEventTargetNode.h" /* yukk: TODO - make this optional on EventTarget*/
+#include "${interfaceName}.h"
+#include "${hdrName}.h"
+#include "Private${hdrName}.h"
+#include "PrivateInt${hdrName}.h"
+#include "${hdrName}props.h"
+#include "CString.h"
+#include "PlatformString.h"
+#include "AtomicString.h"
+#include "ustring.h"
+#include "KURL.h"
+
+#include "CanvasPixelArray.h"
+#include "Event.h"
+#include "Text.h"
+#include "CSSValue.h"
+#include "CSSRule.h"
+#include "HTMLCollection.h"
+#include "StyleSheet.h"
+#include "Document.h"
+#include "webkitmarshal.h"
+#include "GdomEvent.h"
+
+
+EOF
+
+    push(@cBodyPriv, $implContent);
+
+    $implContent = << "EOF";
+
+${hackDecls}
+
+G_BEGIN_DECLS
+
+${stringConvert}
+
+G_DEFINE_TYPE(${className}, ${lcase_ifacename}, ${parentGObjType});
+
+#define _G_GET_UTF8(str) (GStringConvert(str).m_str)
+
+/*
+struct _${className}Private {
+    class WebCore::${interfaceName} *item;
+};  
+
+#define GDOM_${clsCaps}_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), GDOM_TYPE_${clsCaps}, ${className}Private))
+*/
+G_END_DECLS
+WebCore::${interfaceName} *
+${lcase_ifacename}_get_private(${className} *request)
+{
+EOF
+
+    push(@cBodyPriv, $implContent);
+
+    if (($interfaceName eq "DOMWindow")) {
+        $implContent = << "EOF";
+        return NULL; /* XXX TODO */
+EOF
+    } else {
+        $implContent = << "EOF";
+    GDOM${interfaceName} *res;
+    res = static_cast<GDOM${interfaceName}*>(gdom_dom_object_get_private(GDOM_DOM_OBJECT(request)));
+    return static_cast<WebCore::${interfaceName}*>(res->impl());
+EOF
+    }
+    push(@cBodyPriv, $implContent);
+
+    # Properties
+    my $functionNamePrefix = $lcase_ifacename; 
+    SKIPPROP: foreach my $attribute (@{$dataNode->attributes}) {
+        my $propName = decamelize($attribute->signature->name);
+        my $prop_type = $attribute->signature->type;
+        my $type = GetGType($prop_type);
+        my $functionSig = "$className *thiz";
+        my $custom = $attribute->signature->extendedAttributes->{"Custom"};
+
+        if ($attribute->signature->extendedAttributes->{"CustomGetter"}) {
+            next SKIPPROP;
+        }
+            
+        $implIncludes{"CSSMutableStyleDeclaration.h"} = 1 if $type eq "CSSStyleDeclaration";
+
+        if (skipPropTemporarily($type, $prop_type)) {
+            next SKIPPROP;
+        }
+            
+        addPropIncHdr($prop_type);
+
+        #push(@hBodyProp, "WEBKIT_API $type\n$functionNamePrefix" . "_prop_get_" . "$propName ($functionSig);\n\n");
+
+        #push(@hBodyProp, "WEBKIT_API void\n$functionNamePrefix" . "_prop_set_" . "$propName ($functionSig, $type" . "value);\n\n");
+    }
+
+    # Properties
+    $implContent = << "EOF";
+}
+
+G_BEGIN_DECLS
+
+enum {
+    BROWSER_EVENT,
+    LAST_SIGNAL
+};
+
+static guint event_signals[LAST_SIGNAL] = { 0, };
+
+enum {
+    PROP_0,
+EOF
+    push(@cBodyPriv, $implContent);
+
+    my @txt_install_props = ();
+    my @txt_set_props = ();
+    my @txt_get_props = ();
+
+    my $priv_fn = GetPrivFn($interfaceName, ${lcase_ifacename}, "gself", "self");
+
+    my $txt_get_prop = << "EOF";
+static void ${lcase_ifacename}__get_property_fn(GObject * object, guint prop_id,
+                     GValue * value,
+                     GParamSpec * pspec)
+{
+    ${className} *self = GDOM_${clsCaps}(object);
+    $priv_fn
+    switch (prop_id) {
+EOF
+    push(@txt_get_props, $txt_get_prop);
+
+    my $txt_set_prop = << "EOF";
+static void ${lcase_ifacename}__set_property_fn(GObject * object, guint prop_id,
+                     const GValue * value,
+                     GParamSpec * pspec)
+{
+    ${className} *self = GDOM_${clsCaps}(object);
+    $priv_fn
+    switch (prop_id) {
+EOF
+    push(@txt_set_props, $txt_set_prop);
+
+    SKIPENUM: foreach my $attribute (@{$dataNode->attributes}) {
+        my $prop_name = $attribute->signature->name;
+        my $setprop_name_fn = $codeGenerator->WK_ucfirst($prop_name);
+        my $getprop_name_fn = $codeGenerator->WK_lcfirst($prop_name);
+
+        my $propName = decamelize($prop_name);
+        my $propCaps = uc($propName);
+        my $prop_type = $attribute->signature->type;
+        my $type = GetGType($prop_type);
+        my ${propEnum} = "PROP_${propCaps}";
+        my ${prop_gtype} = decamelize($prop_type);
+        if ($prop_gtype eq "event_target") {
+            $prop_gtype = "event_target_node";
+        }
+        my ${propGType} = uc($prop_gtype);
+        my $lcase_gtypename = "gdom_" . $prop_gtype;
+
+        my $custom = $attribute->signature->extendedAttributes->{"Custom"};
+
+        if ($attribute->signature->extendedAttributes->{"CustomGetter"}) {
+            next SKIPENUM;
+        }
+            
+        $implIncludes{"CSSMutableStyleDeclaration.h"} = 1 if $type eq "CSSStyleDeclaration";
+        if (skipPropTemporarily($type, $prop_type)) {
+            next SKIPENUM;
+        }
+            
+        push(@cBodyPriv, "    ${propEnum},\n");
+
+        my $gtype = GetPropGType($prop_type);
+        my $gparamflag = "G_PARAM_READABLE";
+        my $writeable = $attribute->type !~ /^readonly/;
+        my $const = "read-only ";
+        if ($writeable && $custom) {
+            $const = "read-only (due to custom functions needed in gdomwebkit)";
+            next SKIPENUM;
+        }
+        if ($writeable && !$custom) {
+            $gparamflag = "G_PARAM_READWRITE";
+            $const = "read-write ";
+        }
+
+        my $_gtype = $gtype;
+        if ($gtype eq "ushort") {
+            $_gtype = "uint"; # yuk.
+        }
+        my $txt_install_prop = << "EOF";
+    g_object_class_install_property (g_klass, ${propEnum}, 
+            g_param_spec_${_gtype} ("${propName}", /* name */
+                "${interfaceName}.${propName}", /* short description */
+                "${const} ${type} ${interfaceName}.${propName}", /* longer */
+EOF
+        push(@txt_install_props, $txt_install_prop);
+        $txt_install_prop = "/* TODO! $gtype */\n";
+
+        if ($writeable) {
+
+            my $ok = 0;
+            my $convert_fn = "";
+            if ($gtype eq "string") {
+                $convert_fn = "WebCore::String";
+                $ok = 1;
+            }
+            elsif ($gtype eq "boolean") {
+                if (${interfaceName} ne "DOMWindow") { #XXX TODO: skip "putDirect" stuff - no idea what it's about yet
+                    $ok = 1;
+                }
+            } elsif ($gtype eq "float") {
+                $ok = 1;
+            } elsif ($gtype eq "double") {
+                if (${interfaceName} ne "DOMWindow") { #XXX TODO: skip "putDirect" stuff - no idea what it's about yet
+                    $ok = 1;
+                }
+            } elsif ($gtype eq "uint64") {
+                $ok = 1;
+            } elsif ($gtype eq "ulong") {
+                if (${interfaceName} ne "DOMWindow") { #XXX TODO: skip "putDirect" stuff - no idea what it's about yet
+                    $ok = 1;
+                }
+            } elsif ($gtype eq "long") {
+                if (${interfaceName} ne "DOMWindow") { #XXX TODO: skip "putDirect" stuff - no idea what it's about yet
+                    $ok = 1;
+                }
+            } elsif ($gtype eq "uint") {
+                $ok = 1;
+            } elsif ($gtype eq "ushort") {
+                $ok = 1;
+            } elsif ($gtype eq "uchar") {
+                $ok = 1;
+            } elsif ($gtype eq "char") {
+                $ok = 1;
+            }
+            # XXX TODO - skip Location
+            if ($interfaceName eq "Location") {
+                $ok = 0;
+            }
+
+            if ($ok) {
+                push(@txt_set_props, "    case ${propEnum}:\n    {\n");
+                push(@txt_set_props, "        WebCore::ExceptionCode ec = 0;\n") if @{$attribute->setterExceptions};
+                push(@txt_set_props, "        gself->set${setprop_name_fn}(${convert_fn}(g_value_get_$gtype (value))");
+
+                push(@txt_set_props, ", ec") if @{$attribute->setterExceptions};
+                push(@txt_set_props, ");\n");
+
+                push(@txt_set_props, "        break;\n    }\n");
+            }
+        }
+
+        push(@txt_get_props, "    case ${propEnum}:\n    {\n");
+
+        my $exception = "";
+        if (@{$attribute->getterExceptions}) {
+            $exception = "ec";
+            push(@txt_get_props, "        WebCore::ExceptionCode ec = 0;\n");
+        }
+
+        my $convert_fn = "";
+        my $post_convert_fn = "";
+        my $done = 0;
+        if ($gtype eq "string") {
+            $convert_fn = "_G_GET_UTF8(";
+            $post_convert_fn = ")";
+        }
+        elsif ($gtype eq "object") {
+            #$convert_fn = "WTF::getPtr(${lcase_gtypename}_get_private(";
+            #$convert_fn = GetPrivFn($interfaceName, ${lcase_gtypename}, "gself", "self");
+            #$convert_fn = "${lcase_gtypename}_get_private(PassRefPtr<WebCore::${prop_type}>(";
+            #$post_convert_fn = ")";
+            my $domobjType = "GDOM".$prop_type;
+            $txt_get_prop = << "EOF";
+        PassRefPtr<WebCore::${prop_type}> ptr = gself->${getprop_name_fn}(${exception});
+        g_value_set_object (value, WebCore::toGDOM(ptr.get()));
+EOF
+            push(@txt_get_props, $txt_get_prop);
+            $done = 1;
+        }
+
+        if (!$done) {
+            push(@txt_get_props, "        g_value_set_$_gtype (value, ${convert_fn}gself->${getprop_name_fn}(${exception})${post_convert_fn});\n");
+        }
+
+        push(@txt_get_props, "        break;\n    }\n");
+
+        # is this _entirely_ necessary???
+        # can it be done with generic g_param_spec_gtype
+        # and getting a few things, ignoring the min-max for example?
+        if ($gtype eq "int") {
+            $txt_install_prop = << "EOF";
+                G_MININT,        /* min */
+                G_MAXINT, /* max */
+                0,        /* default */
+EOF
+        } elsif ($gtype eq "boolean") {
+            $txt_install_prop = << "EOF";
+                FALSE, /* default */
+EOF
+        } elsif ($gtype eq "float") {
+            $txt_install_prop = << "EOF";
+                G_MINFLOAT,        /* min */
+                G_MAXFLOAT, /* max */
+                0,        /* default */
+EOF
+        } elsif ($gtype eq "double") {
+            $txt_install_prop = << "EOF";
+                G_MINDOUBLE,        /* min */
+                G_MAXDOUBLE, /* max */
+                0,        /* default */
+EOF
+        } elsif ($gtype eq "uint64") {
+            $txt_install_prop = << "EOF";
+                0,        /* min */
+                G_MAXUINT64, /* max */
+                0,        /* default */
+EOF
+        } elsif ($gtype eq "ulong") {
+            $txt_install_prop = << "EOF";
+                0,        /* min */
+                G_MAXULONG, /* max */
+                0,        /* default */
+EOF
+        } elsif ($gtype eq "long") {
+            $txt_install_prop = << "EOF";
+                G_MINLONG,        /* min */
+                G_MAXLONG, /* max */
+                0,        /* default */
+EOF
+        } elsif ($gtype eq "uint") {
+            $txt_install_prop = << "EOF";
+                0,        /* min */
+                G_MAXUINT, /* max */
+                0,        /* default */
+EOF
+        } elsif ($gtype eq "ushort") {
+            $txt_install_prop = << "EOF";
+                0,        /* min */
+                G_MAXUINT16, /* max */
+                0,        /* default */
+EOF
+        } elsif ($gtype eq "uchar") {
+            $txt_install_prop = << "EOF";
+                G_MININT8,        /* min */
+                G_MAXINT8, /* max */
+                0,        /* default */
+EOF
+        } elsif ($gtype eq "char") {
+            $txt_install_prop = << "EOF";
+                0,        /* min */
+                G_MAXUINT8, /* max */
+                0,        /* default */
+EOF
+        } elsif ($gtype eq "string") {
+            $txt_install_prop = << "EOF";
+                "", /* default */
+EOF
+        } elsif ($gtype eq "object") {
+            $txt_install_prop = << "EOF";
+                GDOM_TYPE_${propGType}, /* gobject type */
+EOF
+        }
+        push(@txt_install_props, $txt_install_prop);
+        $txt_install_prop = << "EOF";
+                (GParamFlags)${gparamflag}));                   
+
+EOF
+        push(@txt_install_props, $txt_install_prop);
+
+
+    }
+
+    push(@cBodyPriv, "};\n\n");
+
+
+    $txt_get_prop = << "EOF";
+    default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+        break;
+    }
+}
+EOF
+    push(@txt_get_props, $txt_get_prop);
+
+    $txt_set_prop = << "EOF";
+    default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+        break;
+    }
+}
+EOF
+    push(@txt_set_props, $txt_set_prop);
+
+    my $txt_set_get_props = << "EOF";
+    case PROP_AGE:
+        self->age = g_value_get_int (value);
+        break;
+
+    case PROP_AGE:
+        g_value_set_int(value, self->age);
+        break;
+
+        +   g_value_init(&params[0], G_TYPE_FROM_INSTANCE(object));
+        +   g_value_set_instance(&params[0], (gpointer)object);
+
+EOF
+
+    # TODO: work out if it's appropriate to split this into many different
+    # signals e.g. "click" etc.
+    my $txt_install_signals = "";
+
+    if ($interfaceName eq "DOMWindow" or
+        $interfaceName eq "XMLHttpRequest") {
+        $txt_install_signals = << "EOF";
+    event_signals[BROWSER_EVENT] = g_signal_new("browser-event",
+        G_TYPE_FROM_CLASS(requestClass),
+        (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION),
+        0,
+        NULL,
+        NULL,
+        webkit_marshal_VOID__OBJECT_BOOLEAN,
+        G_TYPE_NONE, 2,
+        GDOM_TYPE_EVENT, G_TYPE_BOOLEAN);
+EOF
+    }
+
+    $implContent = << "EOF";
+
+static void ${lcase_ifacename}_finalize(GObject* object)
+{
+    /*${className}* request = GDOM_${clsCaps}(object);*/
+    /*${className}Private* priv = request->priv;*/
+    
+    /*GObjectClass *parent_class = g_type_class_peek (g_type_peek_parent (${parentGObjType}));*/
+
+    /* Free any memory or close any files */ 
+
+    /*parent_class-> finalize (object);*/
+
+    G_OBJECT_CLASS(${lcase_ifacename}_parent_class)->finalize(object);
+}
+
+@txt_set_props
+
+@txt_get_props
+
+static void ${lcase_ifacename}_class_init(${className}Class* requestClass)
+{
+    GObjectClass *g_klass = G_OBJECT_CLASS (requestClass);
+    g_klass->finalize = ${lcase_ifacename}_finalize;
+    g_klass->set_property = ${lcase_ifacename}__set_property_fn;
+    g_klass->get_property = ${lcase_ifacename}__get_property_fn;
+    
+@txt_install_props
+
+$txt_install_signals
+
+    /*g_type_class_remove_private(requestClass, sizeof(${className}Private));*/
+}
+
+static void ${lcase_ifacename}_init(${className}* request)
+{
+    /*${className}Private* priv = GDOM_${clsCaps}_GET_PRIVATE(request);
+    request->priv = priv;*/
+}   
+
+EOF
+
+    push(@cBodyPriv, $implContent);
+
+    $implIncludes{"PrivateIntGdom${interfaceName}.h"} = 1;
+    $implContent = << "EOF";
+
+#ifndef ${guard}_PRIV_
+#define ${guard}_PRIV_
+#include "glib-object.h"
+#include "${parentHdrName}.h"
+#include "GDOMObject.h"
+/*#include "Private${parentHdrName}.h"*/
+/*G_BEGIN_DECLS*/
+/*class WebCore::${interfaceName};*/
+#include "${interfaceName}.h"
+EOF
+
+    push(@hBodyPriv, $implContent);
+
+    $implContent = << "EOF";
+//namespace WebCore {
+
+class GDOM${interfaceName} : public ${parentGIfaceName} {
+
+public:
+    GDOM${interfaceName}(WebCore::${interfaceName}* impl) : $parentGIfaceName}(impl)
+    { impl->ref(); }
+    ~GDOM${interfaceName}() { m_impl->deref(); }
+
+    WebCore::${interfaceName}* impl() const { return m_impl; }
+
+
+private:
+    WebCore::${interfaceName} *m_impl;
+};
+
+EOF
+
+        #push(@hBodyPriv, $implContent);
+
+    $implContent = << "EOF";
+//} // namespace WebCore
+
+typedef struct _${className} ${className};
+
+WebCore::${interfaceName} *
+${lcase_ifacename}_get_private(${className} *request);
+
+/*G_END_DECLS*/
+
+#endif /* ${guard}_PRIV_ */
+
+EOF
+
+    #return reinterpret_cast<WebCore::${interfaceName}*>((WebCore::Node*)(res));
+        push(@hBodyPriv, $implContent);
+
+        #if ($paramIDLType eq "DOMObject") {
+            # XXX ???? wtf?? :) copied from jsgenerator.
+        #    $implIncludes{"JSCanvasRenderingContext2D.h"} = 1;
+        #} else {
+        #    $implIncludes{$includeHdr} = 1;
+        #}
+        $implIncludes{"${interfaceName}.h"} = 1;
+        $implIncludes{"PrivateGdomDOMObject.h"} = 1;
+
+        LOOP: foreach my $function (@{$dataNode->functions}) {
+            #my $functionName = decamelize($className) . "_" . decamelize($function->signature->name);
+                my $fn_sig_name = $function->signature->name;
+                my $fn_sig_type = $function->signature->type;
+                my $functionName = "gdom_" . decamelize($interfaceName) . "_" . decamelize($fn_sig_name);
+                my $returnType = GetGType($fn_sig_type);
+                my $ret_is_cls_type = IsGDOMClassType($fn_sig_type);
+
+                my $functionSig = "$className *thiz";
+
+                my $call_impl_params = "";
+                my $gdom_fn_prefix = "gdom_" . decamelize($fn_sig_type);
+
+                if ($functionName eq "gdom_css_style_declaration_set_property") {
+                    # reserved name clash in glib!
+                    $functionName = "gdom_css_style_declaration_set_css_property";
+                }
+                # XXX skip CompareHow functions for now
+                if ($functionName eq "gdom_range_compare_boundary_points") {
+                    push(@hBody, "\n/* XXX TODO: skipping CompareHow function ${functionName} */\n\n");
+                    push(@cBody, "\n/* XXX TODO: skipping CompareHow function ${functionName} */\n\n");
+                    next LOOP;
+                }
+
+                # XXX skip SVGDocument functions for now
+                if ($returnType eq "GdomSVGDocument *") {
+                    push(@hBody, "\n/* XXX TODO: skipping SVGDocument function ${functionName} */\n\n");
+                    push(@cBody, "\n/* XXX TODO: skipping SVGDocument function ${functionName} */\n\n");
+                    next LOOP;
+                }
+
+                # XXX skip some custom functions for now
+                my $is_custom_fn = $function->signature->extendedAttributes->{"Custom"};
+                if ($functionName eq "gdom_html_collection_item" ||
+                    $functionName eq "gdom_html_collection_named_item" ||
+                    $functionName eq "gdom_xml_http_request_open" ||
+                    $functionName eq "gdom_xml_http_request_set_request_header" ||
+                    $functionName eq "gdom_xml_http_request_send" ||
+                    $functionName eq "gdom_xml_http_request_get_response_header" ||
+                    $functionName eq "gdom_xml_http_request_override_mime_type" ||
+                    $functionName eq "gdom_xml_http_request_dispatch_event" ||
+                    $functionName eq "gdom_element_set_attribute") {
+                    $is_custom_fn = 0;
+                }
+                    #$functionName eq "gdom_xml_http_request_add_event_listener" ||
+                    #$functionName eq "gdom_xml_http_request_remove_event_listener" ||
+                if ($is_custom_fn && 
+                    $functionName ne "gdom_node_iterator_next_node" && 
+                    $functionName ne "gdom_node_append_child" && 
+                    $functionName ne "gdom_node_remove_child" && 
+                    $functionName ne "gdom_node_insert_before" &&
+                    $functionName ne "gdom_node_replace_child" &&
+                    $functionName ne "gdom_tree_walker_parent_node" && 
+                    $functionName ne "gdom_tree_walker_first_child" && 
+                    $functionName ne "gdom_tree_walker_last_child" && 
+                    $functionName ne "gdom_tree_walker_previous_sibling" && 
+                    $functionName ne "gdom_tree_walker_next_sibling" && 
+                    $functionName ne "gdom_tree_walker_previous_node" && 
+                    $functionName ne "gdom_tree_walker_next_node" && 
+                    $functionName ne "gdom_node_iterator_previous_node") {
+                    push(@hBody, "\n/* XXX TODO: custom function ${functionName} */\n\n");
+                    push(@cBody, "\n/* XXX TODO: custom function ${functionName} */\n\n");
+                    next LOOP;
+                }
+
+                foreach my $param (@{$function->parameters}) {
+                    my $paramIDLType = $param->type;
+                    addIncBody($paramIDLType);
+                    addIncHdr($paramIDLType);
+                    my $paramType = GetGType($paramIDLType);
+                    my $paramName = decamelize($param->name);
+
+                    $functionSig .= ", $paramType$paramName";
+
+                    my $param_is_cls_type = IsGDOMClassType($paramIDLType);
+                    if ($param_is_cls_type) {
+                        if ($paramIDLType ne "DOMObject" &&
+                            $paramIDLType ne "EventTarget") {
+                            $implIncludes{"PrivateIntGdom${paramIDLType}.h"} = 1;
+                            $implIncludes{"PrivateGdom${paramIDLType}.h"} = 1;
+                            $implIncludes{"${paramIDLType}.h"} = 1; # this isn't strictly necessary but one of the auto-generated files needed it so....
+                        }
+                    }
+                    if ($param_is_cls_type || ($paramIDLType eq "DOMString")) {
+                        $paramName = "_g_" . $paramName;
+                    }
+                    if ($call_impl_params) {
+                        $call_impl_params .= ", $paramName";
+                    }
+                    else {
+                        $call_impl_params = "$paramName";
+                    }
+                }
+
+                addIncHdr($fn_sig_type);
+                if ($ret_is_cls_type) {
+                #    $implTypedefs{"Gdom${fn_sig_type}"} = 1;
+                }
+
+                if ($returnType ne "void") {
+
+                    if ($ret_is_cls_type) {
+                        if ($fn_sig_type eq "DOMObject") {
+                            # XXX ???? wtf?? :) copied from jsgenerator.
+                            $implIncludes{"GdomCanvasRenderingContext2D.h"} = 1;
+                        } else {
+                            if ($fn_sig_type ne "EventTarget") {
+                                $implIncludes{"PrivateIntGdom${fn_sig_type}.h"} = 1;
+                                $implIncludes{"PrivateGdom${fn_sig_type}.h"} = 1;
+                                $implIncludes{"Gdom${fn_sig_type}.h"} = 1;
+                            }
+                            $implIncludes{"${fn_sig_type}.h"} = 1;
+                        }
+                    }
+                }
+
+                # XXX skip custom functions for now
+                # but skip from here to allow some headers to be created
+                # for a successful compile.
+                if ($is_custom_fn &&
+                    $functionName ne "gdom_node_remove_child" && 
+                    $functionName ne "gdom_node_insert_before" &&
+                    $functionName ne "gdom_node_replace_child" &&
+                    $functionName ne "gdom_node_append_child") {
+                    push(@hBody, "\n/* XXX TODO: custom function ${functionName} */\n\n");
+                    push(@cBody, "\n/* XXX TODO: custom function ${functionName} */\n\n");
+                    next LOOP;
+                }
+
+                my $_returnType = $returnType;
+                my $domobjType = "GDOM".$fn_sig_type;
+                if ($fn_sig_type eq 'DOMObject' &&
+                    $functionName eq 'gdom_html_canvas_element_get_context') {
+                    # XXX HACK!
+                    $_returnType = 'GdomCanvasRenderingContext *';
+                    $domobjType = 'GDOMCanvasRenderingContext';
+                    $gdom_fn_prefix = 'gdom_canvas_rendering_context';
+                    next LOOP; # XXX - too involved for now.  skip it.
+                    # must convert to a DOMObject (TODO: browse JS code to find out how)
+                    # better: work out how to create a GDOMDomObject
+                }
+                     
+                if ($fn_sig_type eq 'DOMObject' &&
+                    $functionName eq 'gdom_document_get_css_canvas_context') {
+                    # XXX HACK!
+                    $_returnType = 'GdomCanvasRenderingContext2D *';
+                    $domobjType = 'GDOMCanvasRenderingContext2D';
+                    $gdom_fn_prefix = 'gdom_canvas_rendering_context2d';
+                    next LOOP; # XXX - too involved for now.  skip it.
+                    # must convert to a DOMObject (TODO: browse JS code to find out how)
+                    # better: work out how to create a GDOMDomObject
+                }
+                     
+
+                push(@hBody, "WEBKIT_API $_returnType\n$functionName ($functionSig);\n\n");
+
+                push(@cBody, "$_returnType\n$functionName ($functionSig)\n{\n");
+
+                if ($returnType ne "void") {
+                    # XXX TODO: return proper default result
+                    push(@cBody, "    g_return_val_if_fail (thiz, 0);\n");
+                } else {
+                    push(@cBody, "    g_return_if_fail (thiz);\n");
+                }
+
+                push(@cBody, "    WebCore::${interfaceName} * item = (${lcase_ifacename}_get_private(thiz));\n");
+                if ($returnType ne "void") {
+                    # XXX TODO: return proper default result
+                    push(@cBody, "    g_return_val_if_fail (item, 0);\n");
+                } else {
+                    push(@cBody, "    g_return_if_fail (item);\n");
+                }
+
+            foreach my $param (@{$function->parameters}) {
+                    my $paramName = decamelize($param->name);
+                    my $paramIDLType = $param->type;
+                    my $paramTypeIsPrimitive = $codeGenerator->IsPrimitiveType($paramIDLType);
+                    my $param_is_cls_type = IsGDOMClassType($paramIDLType);
+                    addIncHdr($paramIDLType);
+                    if ($param_is_cls_type) {
+                    #    $implTypedefs{"Gdom${paramIDLType}"} = 1;
+                    }
+                    if (!$paramTypeIsPrimitive) {
+                        if ($returnType ne "void") {
+                            # XXX TODO: return proper default result
+                            push(@cBody, "    g_return_val_if_fail ($paramName, 0);\n");
+                        } else {
+                            push(@cBody, "    g_return_if_fail ($paramName);\n");
+                        }
+                    }
+                }
+
+                $returnParamName = "";
+                foreach my $param (@{$function->parameters}) {
+                    my $paramIDLType = $param->type;
+                    my $paramType = GetGType($paramIDLType);
+                    my $paramName = decamelize($param->name);
+
+                    my $param_is_cls_type = IsGDOMClassType($paramIDLType);
+                    # HACK!
+                    if ($functionName eq "gdom_xml_http_request_open" &&
+                         $param->name eq "url") {
+
+                        #$implIncludes{"KURL.h"} = 1;
+                        push(@cBody, "    WebCore::KURL _g_${paramName} = WebCore::KURL($paramName);\n");
+                    }
+                    elsif ($paramIDLType eq "DOMString") {
+                        push(@cBody, "    WebCore::String _g_${paramName} = WebCore::String($paramName);\n");
+                    }
+                    if ($param_is_cls_type) {
+                        my $param_gdom_fn = "gdom_" . decamelize($paramIDLType);
+                        #push(@cBody, "    WTF::PassRefPtr<WebCore::${paramIDLType}> * _g_${paramName} = WTF::RefPtr<${param_gdom_fn}_get_private($paramName)>;\n");
+                        if ($paramIDLType eq "EventTarget") {
+                            $implIncludes{"PrivateGdomEventTargetNode.h"} = 1;
+                            push(@cBody, "    WebCore::EventTargetNode * _g_${paramName} = static_cast<WebCore::EventTargetNode*>(gdom_event_target_node_get_private($paramName));\n");
+                        } else {
+                            push(@cBody, "    WebCore::${paramIDLType} * _g_${paramName} = (${param_gdom_fn}_get_private($paramName));\n");
+                        }
+                        if ($returnType ne "void") {
+                            # XXX TODO: return proper default result
+                            push(@cBody, "    g_return_val_if_fail (_g_${paramName}, 0);\n");
+                        } else {
+                            push(@cBody, "    g_return_if_fail (_g_${paramName});\n");
+                        }
+
+                    }
+                    $returnParamName = "_g_".$paramName if $param->extendedAttributes->{"Return"};
+                }
+
+                my $assign = "";
+                my $assign_pre = "";
+                my $assign_post = "";
+                $g_res = 0;
+                if ($returnType ne "void" && !$is_custom_fn) {
+
+                    if ($ret_is_cls_type) {
+                        $assign = "PassRefPtr<WebCore::${fn_sig_type}> g_res = ";
+                        $assign_pre = "WTF::getPtr(";
+                        $assign_post = ")";
+                    } else {
+                        $assign = "${_returnType} res = ";
+                    }
+                }
+                my $exceptions = "";
+                if (@{$function->raisesExceptions}) {
+                    push(@cBody, "    WebCore::ExceptionCode ec = 0;\n");
+                    if (${call_impl_params} ne "") {
+                        $exceptions = ", ec";
+                    } else {
+                        $exceptions = "ec";
+                    }
+                }
+
+                # need this for including ... _something_ - for the class args
+                #if ($ret_is_cls_type) {
+                #    $implIncludes{"gdom${fn_sig_type}.h"} = 1;
+                #}
+                if ($functionName eq "gdom_node_append_child" ||
+                    $functionName eq "gdom_node_insert_before" ||
+                    $functionName eq "gdom_node_replace_child" ||
+                    $functionName eq "gdom_node_remove_child") {
+                    my $custom_gdom_node_append_child = << "EOF";
+    bool ok = item->${fn_sig_name}(${call_impl_params}${exceptions});
+    if (ok)
+    {
+        ${_returnType} res = static_cast<${_returnType}>(WebCore::toGDOM($returnParamName)); 
+        return res;
+    }
+    return NULL;
+EOF
+                    push(@cBody, $custom_gdom_node_append_child);
+                } elsif ($fn_sig_type eq "DOMObject" &&
+                    $functionName ne 'gdom_document_get_css_canvas_context') {
+                    push(@cBody, "    /* XXX TODO - get canvas object (item->${fn_sig_name}(${call_impl_params}${exceptions}));*/\n" );
+                    
+                } elsif ($fn_sig_type eq "DOMString") {
+                    push(@cBody, "    ${assign}_G_GET_UTF8(item->${fn_sig_name}(${call_impl_params}${exceptions}));\n" );
+                } else {
+                    if ($g_res) {
+                        $g_res = "${assign}${assign_pre}item->${fn_sig_name}(${call_impl_params}${exceptions}${assign_post})" ;
+                    } else {
+                        push(@cBody, "    ${assign}${assign_pre}item->${fn_sig_name}(${call_impl_params}${exceptions}${assign_post});\n" );
+                    }
+                }
+                if ($returnType ne "void" && !$is_custom_fn) {
+
+                    if ($fn_sig_type ne "DOMObject") {
+                        if ($ret_is_cls_type) {
+                            push(@cBody, "    ${_returnType} res = static_cast<${_returnType}>(WebCore::toGDOM(g_res.get())); \n");
+                        }
+                    }
+                    if ($fn_sig_type eq "DOMObject") {
+                        push(@cBody, "    return NULL; /* XXX TODO: return canvas object */\n");
+                    } else {
+                        push(@cBody, "    return res;\n");
+                    }
+                }
+                push(@cBody, "\n");
+
+                push(@cBody, "}\n\n");
+        }
+
+    push(@cBody, "} /* extern \"C\" */\n\n");
+    push(@cBodyPriv, "} /* extern \"C\" */\n\n");
+
+    push(@hBodyInternal, "G_END_DECLS\n\n");
+    push(@hBodyInternal, "#endif /* ${guard}_INT_*/\n");
+
+    push(@hBody, "G_END_DECLS\n\n");
+    push(@hBody, "#endif /* $guard */\n");
+
+    push(@hBodyProp, "G_END_DECLS\n\n");
+    push(@hBodyProp, "#endif /* ${guard}_PROP_*/\n");
+}
+
+# Internal helper
+sub WriteData
+{
+    my ($object, $name) = @_;
+
+
+    # Write Internal header
+    my $hdrFNameInternal = "$outputDir/PrivateInt" . $name . ".h";
+    open(INTHEADER, ">$hdrFNameInternal") or die "Couldn't open file $hdrFNameInternal";
+
+    print INTHEADER @hPrefix;
+    print INTHEADER "\n";
+    print INTHEADER @hBodyInternal;
+    close(INTHEADER);
+
+    # Write Private header
+    my $hdrFNamePriv = "$outputDir/Private" . $name . ".h";
+    open(PRIVHEADER, ">$hdrFNamePriv") or die "Couldn't open file $hdrFNamePriv";
+
+    print PRIVHEADER @hPrefix;
+    print PRIVHEADER "\n";
+    print PRIVHEADER @hBodyPriv;
+    close(PRIVHEADER);
+
+    # Write Private Implementation
+    my $implFileNamePriv = "$outputDir/Private" . $name . ".cpp";
+    open(PRIVIMPL, ">$implFileNamePriv") or die "Couldn't open file $implFileNamePriv";
+
+    print PRIVIMPL @cPrefix;
+    print PRIVIMPL "\n";
+    print PRIVIMPL @cBodyPriv;
+
+    close(PRIVIMPL);
+
+    # Write properties header (avoids recursive nightmare)
+    my $hdrPropFName = "$outputDir/" . $name . "props.h";
+    open(PROPHEADER, ">$hdrPropFName") or die "Couldn't open file $hdrPropFName";
+
+    $hdrPropIncludes{"glib-object.h"} = 1;
+
+    print PROPHEADER @hPrefix;
+    print PROPHEADER "/* recursive includes / defines issue forces separate header for properties.\nperhaps - better - all gdom gtk functions should be in here!*/\n";
+    print PROPHEADER @hBodyPropPre;
+    print PROPHEADER "#include <webkit/webkitdefines.h>\n";
+    print PROPHEADER map { "#include \"$_\"\n" } sort keys(%hdrPropIncludes);
+    print PROPHEADER "\n" if keys(%hdrPropIncludes);
+    print PROPHEADER "\n";
+    print PROPHEADER @hBodyProp;
+
+    close(HEADER);
+
+    # Write public header.
+    my $hdrFName = "$outputDir/" . $name . ".h";
+    open(HEADER, ">$hdrFName") or die "Couldn't open file $hdrFName";
+
+    $hdrIncludes{"glib-object.h"} = 1;
+
+    print HEADER @hPrefix;
+    print HEADER @hPrefixGuard;
+    print HEADER "#include <webkit/webkitdefines.h>\n";
+    print HEADER map { "#include \"$_\"\n" } sort keys(%hdrIncludes);
+    print HEADER "\n" if keys(%hdrIncludes);
+    print HEADER "\n";
+    print HEADER @hBodyPre;
+    print HEADER map { "typedef struct _$_ $_;\n" } sort keys(%implTypedefs);
+    print HEADER "\n" if keys(%implTypedefs);
+    print HEADER @hBody;
+
+    close(HEADER);
+
+    # Write the implementation sources
+    my $implFileName = "$outputDir/" . $name . ".cpp";
+    open(IMPL, ">$implFileName") or die "Couldn't open file $implFileName";
+
+    print IMPL @cPrefix;
+    print IMPL "#include \"config.h\"\n\n";
+    print IMPL "#include <wtf/GetPtr.h>\n";
+    print IMPL "#include \"CString.h\"\n";
+    print IMPL "#include \"PlatformString.h\"\n";
+    print IMPL "#include \"AtomicString.h\"\n";
+    print IMPL "#include \"ustring.h\"\n";
+    print IMPL "#include \"KURL.h\"\n";
+    print IMPL map { "#include \"$_\"\n" } sort keys(%implIncludes);
+    print IMPL "\n" if keys(%implIncludes);
+    print IMPL @cBody;
+
+    close(IMPL);
+
+    %implIncludes = ();
+    %implTypedefs = ();
+    %hdrIncludes = ();
+    @hPrefix = ();
+    @hBody = ();
+    @hBodyPriv = ();
+    @hBodyInternal = ();
+    @hBodyProp = ();
+    @hBodyPropPre = ();
+
+    @cPrefix = ();
+    @cBody = ();
+    @cBodyPriv = ();
+}
+
+1;
Index: WebCore/html/HTMLOptionElement.idl
===================================================================
--- WebCore/html/HTMLOptionElement.idl	(revision 35758)
+++ WebCore/html/HTMLOptionElement.idl	(working copy)
@@ -27,7 +27,7 @@
     ] HTMLOptionElement : HTMLElement {
         readonly attribute  HTMLFormElement      form;
                  attribute  boolean              defaultSelected;
-#if defined(LANGUAGE_JAVASCRIPT)
+#if defined(LANGUAGE_JAVASCRIPT) || defined(LANGUAGE_GOBJECT)
                  attribute  [ConvertNullToNullString] DOMString            text
                      setter raises(DOMException);
 #else
Index: WebCore/html/HTMLAnchorElement.idl
===================================================================
--- WebCore/html/HTMLAnchorElement.idl	(revision 35758)
+++ WebCore/html/HTMLAnchorElement.idl	(working copy)
@@ -47,7 +47,7 @@
         readonly attribute DOMString search;
         readonly attribute DOMString text;
 
-#if defined(LANGUAGE_JAVASCRIPT)
+#if defined(LANGUAGE_JAVASCRIPT) || defined(LANGUAGE_GOBJECT)
         [DontEnum] DOMString toString();
 #endif
 
Index: WebCore/html/HTMLAppletElement.idl
===================================================================
--- WebCore/html/HTMLAppletElement.idl	(revision 35758)
+++ WebCore/html/HTMLAppletElement.idl	(working copy)
@@ -35,14 +35,14 @@
                  attribute [ConvertNullToNullString] DOMString code;
                  attribute [ConvertNullToNullString] DOMString codeBase;
                  attribute [ConvertNullToNullString] DOMString height;
-#if defined(LANGUAGE_JAVASCRIPT)
+#if defined(LANGUAGE_JAVASCRIPT) || defined(LANGUAGE_GOBJECT)
                  attribute [ConvertNullToNullString] DOMString hspace;
 #else
                  attribute [ConvertFromString] long hspace;
 #endif
                  attribute [ConvertNullToNullString] DOMString name;
                  attribute [ConvertNullToNullString] DOMString object;
-#if defined(LANGUAGE_JAVASCRIPT)
+#if defined(LANGUAGE_JAVASCRIPT) || defined(LANGUAGE_GOBJECT)
                  attribute [ConvertNullToNullString] DOMString vspace;
 #else
                  attribute [ConvertFromString] long vspace;
Index: WebCore/html/HTMLEmbedElement.idl
===================================================================
--- WebCore/html/HTMLEmbedElement.idl	(revision 35758)
+++ WebCore/html/HTMLEmbedElement.idl	(working copy)
@@ -30,7 +30,7 @@
         ImplementationUUID=93e0407a-8380-4ff0-978d-f773f2dee6a3
     ] HTMLEmbedElement : HTMLElement {
                  attribute [ConvertNullToNullString] DOMString align;
-#if defined(LANGUAGE_JAVASCRIPT)
+#if defined(LANGUAGE_JAVASCRIPT) || defined(LANGUAGE_GOBJECT)
                  attribute [ConvertNullToNullString] DOMString height;
 #else
                  attribute [ConvertFromString] long height;
@@ -38,7 +38,7 @@
                  attribute [ConvertNullToNullString] DOMString name;
                  attribute [ConvertNullToNullString] DOMString src;
                  attribute [ConvertNullToNullString] DOMString type;
-#if defined(LANGUAGE_JAVASCRIPT)
+#if defined(LANGUAGE_JAVASCRIPT) || defined(LANGUAGE_GOBJECT)
                  attribute [ConvertNullToNullString] DOMString width;
 #else
                  attribute [ConvertFromString] long width;
Index: WebCore/dom/Document.idl
===================================================================
--- WebCore/dom/Document.idl	(revision 35758)
+++ WebCore/dom/Document.idl	(working copy)
@@ -156,7 +156,7 @@
 
                  attribute [ConvertNullToNullString] DOMString title;
         readonly attribute DOMString referrer;
-#if defined(LANGUAGE_JAVASCRIPT)
+#if (defined(LANGUAGE_JAVASCRIPT) || defined(LANGUAGE_GOBJECT))
                  attribute [ConvertNullToNullString] DOMString domain;
 #else
         readonly attribute DOMString domain;
@@ -182,7 +182,7 @@
 
         NodeList getElementsByName(in DOMString elementName);
 
-#if defined(LANGUAGE_JAVASCRIPT)
+#if (defined(LANGUAGE_JAVASCRIPT) || defined(LANGUAGE_GOBJECT))
                  attribute [Custom] Location location;
 #endif
 
@@ -195,7 +195,7 @@
         Element            elementFromPoint(in long x, in long y);
 
         // Mozilla extensions
-#if defined(LANGUAGE_JAVASCRIPT)
+#if (defined(LANGUAGE_JAVASCRIPT) || defined(LANGUAGE_GOBJECT))
         DOMSelection       getSelection();
 #endif
         readonly attribute [ConvertNullStringTo=Null] DOMString characterSet;
@@ -236,7 +236,7 @@
         NodeList getElementsByClassName(in DOMString tagname);
 
         // NodeSelector - Selector API
-#if defined(LANGUAGE_JAVASCRIPT)
+#if (defined(LANGUAGE_JAVASCRIPT) || defined(LANGUAGE_GOBJECT))
         [Custom] Element querySelector(in [ConvertUndefinedOrNullToNullString] DOMString selectors, in NSResolver resolver)
             raises(DOMException);
         [Custom] NodeList querySelectorAll(in [ConvertUndefinedOrNullToNullString] DOMString selectors, in NSResolver resolver)
Index: WebCore/dom/RangeException.idl
===================================================================
--- WebCore/dom/RangeException.idl	(revision 35758)
+++ WebCore/dom/RangeException.idl	(working copy)
@@ -27,7 +27,7 @@
         readonly attribute DOMString        name;
         readonly attribute DOMString        message;
 
-#if defined(LANGUAGE_JAVASCRIPT)
+#if defined(LANGUAGE_JAVASCRIPT) || defined(LANGUAGE_GOBJECT)
         [DontEnum] DOMString toString();
 #endif
 
Index: WebCore/dom/DOMCoreException.h
===================================================================
--- WebCore/dom/DOMCoreException.h	(revision 35758)
+++ WebCore/dom/DOMCoreException.h	(working copy)
@@ -27,7 +27,7 @@
  */
 
 #ifndef DOMCoreException_h
-#define DOMCodeException_h
+#define DOMCoreException_h
 
 #include "ExceptionBase.h"
 
Index: WebCore/dom/EventException.idl
===================================================================
--- WebCore/dom/EventException.idl	(revision 35758)
+++ WebCore/dom/EventException.idl	(working copy)
@@ -37,7 +37,7 @@
         readonly attribute DOMString        name;
         readonly attribute DOMString        message;
 
-#if defined(LANGUAGE_JAVASCRIPT)
+#if defined(LANGUAGE_JAVASCRIPT) || defined(LANGUAGE_GOBJECT)
         // Override in a Mozilla compatible format
         [DontEnum] DOMString toString();
 #endif
Index: WebCore/dom/KeyboardEvent.idl
===================================================================
--- WebCore/dom/KeyboardEvent.idl	(revision 35758)
+++ WebCore/dom/KeyboardEvent.idl	(working copy)
@@ -59,7 +59,7 @@
                                in boolean altGraphKey);
 
         // WebKit Extensions
-#if !defined(LANGUAGE_JAVASCRIPT)
+#if ((!defined(LANGUAGE_JAVASCRIPT)) && (!defined(LANGUAGE_GOBJECT)))
         readonly attribute long             keyCode;
         readonly attribute long             charCode;
         
Index: WebCore/dom/DOMCoreException.idl
===================================================================
--- WebCore/dom/DOMCoreException.idl	(revision 35758)
+++ WebCore/dom/DOMCoreException.idl	(working copy)
@@ -36,7 +36,7 @@
         readonly attribute DOMString        name;
         readonly attribute DOMString        message;
 
-#if defined(LANGUAGE_JAVASCRIPT)
+#if defined(LANGUAGE_JAVASCRIPT) || defined(LANGUAGE_GOBJECT)
         // Override in a Mozilla compatible format
         [DontEnum] DOMString toString();
 #endif
Index: WebCore/xml/XPathException.idl
===================================================================
--- WebCore/xml/XPathException.idl	(revision 35758)
+++ WebCore/xml/XPathException.idl	(working copy)
@@ -37,7 +37,7 @@
         readonly attribute DOMString        name;
         readonly attribute DOMString        message;
 
-#if defined(LANGUAGE_JAVASCRIPT)
+#if defined(LANGUAGE_JAVASCRIPT) || defined(LANGUAGE_GOBJECT)
         // Override in a Mozilla compatible format
         [DontEnum] DOMString toString();
 #endif
Index: WebCore/xml/XMLHttpRequestException.idl
===================================================================
--- WebCore/xml/XMLHttpRequestException.idl	(revision 35758)
+++ WebCore/xml/XMLHttpRequestException.idl	(working copy)
@@ -36,7 +36,7 @@
         readonly attribute DOMString        name;
         readonly attribute DOMString        message;
 
-#if defined(LANGUAGE_JAVASCRIPT)
+#if defined(LANGUAGE_JAVASCRIPT) || defined(LANGUAGE_GOBJECT)
         // Override in a Mozilla compatible format
         [DontEnum] DOMString toString();
 #endif
Index: WebCore/page/DOMWindow.idl
===================================================================
--- WebCore/page/DOMWindow.idl	(revision 35758)
+++ WebCore/page/DOMWindow.idl	(working copy)
@@ -155,7 +155,7 @@
         [DoNotCheckDomainSecurity, Custom] void postMessage(in DOMString message, in DOMString targetOrigin)
             raises(DOMException);
 
-#if defined(LANGUAGE_JAVASCRIPT)
+#if defined(LANGUAGE_JAVASCRIPT) || defined(LANGUAGE_GOBJECT)
         // Global constructors
         attribute StyleSheetConstructor StyleSheet;
         attribute CSSStyleSheetConstructor CSSStyleSheet;
Index: WebCore/page/DOMSelection.idl
===================================================================
--- WebCore/page/DOMSelection.idl	(revision 35758)
+++ WebCore/page/DOMSelection.idl	(working copy)
@@ -62,7 +62,7 @@
         void removeAllRanges();
         void addRange(in Range range);
 
-#if defined(LANGUAGE_JAVASCRIPT)
+#if defined(LANGUAGE_JAVASCRIPT) || defined(LANGUAGE_GOBJECT)
         [DontEnum] DOMString toString();
 #endif
     };
Index: WebKitTools/GNUmakefile.am
===================================================================
--- WebKitTools/GNUmakefile.am	(revision 35758)
+++ WebKitTools/GNUmakefile.am	(working copy)
@@ -5,6 +5,7 @@
 # GtkLauncher
 Programs_GtkLauncher_CPPFLAGS = \
 	-I$(srcdir)/WebKit/gtk \
+	-I$(srcdir)/WebKit/gtk/webkit \
 	-I$(top_builddir)/WebKit/gtk \
 	$(global_cppflags) \
 	$(javascriptcore_cppflags)
