internal static GeckoNode CreateWrapper(nsIDOMNode domObject) { if (domObject == null) { return(null); } nsIDOMHTMLElement element = Xpcom.QueryInterface <nsIDOMHTMLElement>(domObject); if (element != null) { return(GeckoElement.Create(element)); } nsIDOMAttr attr = Xpcom.QueryInterface <nsIDOMAttr>(domObject); if (attr != null) { return(GeckoAttribute.Create(attr)); } nsIDOMComment comment = domObject as nsIDOMComment; if (comment != null) { return(GeckoComment.Create(comment)); } return(new GeckoNode(domObject)); }