Esempio n. 1
0
        public GeckoElement CreateElement(string tagName, string qualifiedName)
        {
            if (string.IsNullOrEmpty(tagName))
            {
                throw new ArgumentException("tagName");
            }
            if (string.IsNullOrEmpty(qualifiedName))
            {
                throw new ArgumentException("qualifiedName");
            }

            return(GeckoElement.Create((nsIDOMHTMLElement)DomDocument.CreateElementNS(new nsAString(tagName), new nsAString(qualifiedName))));
        }
        internal static GeckoNode Create(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));
            }

            return(new GeckoNode(domObject));
        }
Esempio n. 3
0
 /// <summary>
 /// Returns the element visible at the given point, relative to the upper-left-most visible point in the document.
 /// </summary>
 /// <param name="x"></param>
 /// <param name="y"></param>
 /// <returns></returns>
 public GeckoElement ElementFromPoint(int x, int y)
 {
     return(GeckoElement.Create((nsIDOMHTMLElement)((nsIDOMNSDocument)DomDocument).ElementFromPoint(x, y)));
 }