internal static GeckoHtmlElement GetClassFor(mozIDOMWindowProxy window, /* nsIDOMHTMLElement*/ nsIDOMElement element) { GeckoHtmlElement ret = GetClassFor <GeckoHtmlElement>(window, (nsISupports)element); if (ret == null) { ret = new GeckoHtmlElement(window, element); } return(ret); }
internal static GeckoHtmlElement GetClassFor(nsIDOMHTMLElement element) { GeckoHtmlElement ret = GetClassFor <GeckoHtmlElement>(element); if (ret == null) { ret = new GeckoHtmlElement(element); } return(ret); }
/// <summary> /// Creates wrapper for nsIDOMNode object /// </summary> /// <param name="domObject"></param> /// <returns></returns> internal static GeckoNode CreateDomNodeWrapper(mozIDOMWindowProxy window, nsIDOMNode domObject) { // if null -> return null if (domObject == null) { return(null); } var nodeType = (NodeType) new WebIDL.Node((mozIDOMWindowProxy)window, (nsISupports)domObject).NodeType; // by nodeType we can find proper wrapper faster, than perform QueryInterface switch (nodeType) { case NodeType.Element: /* /* nsIDOMHTMLElement*/ nsIDOMElement htmlElement = Xpcom.QueryInterface </* /* nsIDOMHTMLElement*/ nsIDOMElement>(domObject); if (htmlElement != null) { return(GeckoHtmlElement.Create(window, htmlElement)); } nsIDOMElement element = Xpcom.QueryInterface <nsIDOMElement>(domObject); if (element != null) { return(GeckoElement.CreateDomElementWrapper(window, element)); } break; case NodeType.Attribute: #if PORTFF60 nsIDOMAttr attr = Xpcom.QueryInterface <nsIDOMAttr>(domObject); if (attr != null) { return(GeckoAttribute.CreateAttributeWrapper(attr)); } #endif break; case NodeType.Comment: nsIDOMComment comment = Xpcom.QueryInterface <nsIDOMComment>(domObject); if (comment != null) { return(GeckoComment.CreateCommentWrapper(window, comment)); } break; case NodeType.DocumentFragment: nsIDOMDocumentFragment fragment = Xpcom.QueryInterface <nsIDOMDocumentFragment>(domObject); if (fragment != null) { return(DOM.DocumentFragment.CreateDocumentFragmentWrapper(window, fragment)); } break; } // if we don't handle this type - just create GeckoNode return(new GeckoNode(window, domObject)); }
/// <summary> /// Creates wrapper for nsIDOMNode object /// </summary> /// <param name="domObject"></param> /// <returns></returns> internal static GeckoNode CreateDomNodeWrapper(nsIDOMNode domObject) { // if null -> return null if (domObject == null) { return(null); } var nodeType = (NodeType)domObject.GetNodeTypeAttribute(); // by nodeType we can find proper wrapper faster, than perform QueryInterface switch (nodeType) { case NodeType.Element: nsIDOMHTMLElement htmlElement = Xpcom.QueryInterface <nsIDOMHTMLElement>(domObject); if (htmlElement != null) { return(GeckoHtmlElement.Create(htmlElement)); } nsIDOMElement element = Xpcom.QueryInterface <nsIDOMElement>(domObject); if (element != null) { return(GeckoElement.CreateDomElementWrapper(element)); } break; case NodeType.Attribute: nsIDOMAttr attr = Xpcom.QueryInterface <nsIDOMAttr>(domObject); if (attr != null) { return(GeckoAttribute.CreateAttributeWrapper(attr)); } break; case NodeType.Comment: nsIDOMComment comment = Xpcom.QueryInterface <nsIDOMComment>(domObject); if (comment != null) { return(GeckoComment.CreateCommentWrapper(comment)); } break; case NodeType.DocumentFragment: nsIDOMDocumentFragment fragment = Xpcom.QueryInterface <nsIDOMDocumentFragment>(domObject); if (fragment != null) { return(DOM.DocumentFragment.CreateDocumentFragmentWrapper(fragment)); } break; } // if we don't handle this type - just create GeckoNode return(new GeckoNode(domObject)); }
internal static GeckoHtmlElement CreateDomHtmlElementWrapper(nsIDOMHTMLElement instance) { var lowerTagName = nsString.Get(instance.GetTagNameAttribute).ToLowerInvariant(); GeckoClassDesc desc; if (_dictionary.TryGetValue(lowerTagName, out desc)) { object HTMLElement = Xpcom.QueryInterface(instance, desc.InterfaceType.GUID); if (HTMLElement != null) { GeckoHtmlElement e = desc.CreationMethod(HTMLElement); return(e); } } return(null); }
internal static GeckoHtmlElement CreateDomHtmlElementWrapper(mozIDOMWindowProxy window, /* /* nsIDOMHTMLElement*/ nsISupports instance) { var lowerTagName = new WebIDL.Element((mozIDOMWindowProxy)window, instance).TagName.ToLowerInvariant(); GeckoClassDesc desc; if (_dictionary.TryGetValue(lowerTagName, out desc)) { object HTMLElement = Xpcom.QueryInterface(instance, desc.InterfaceType.GUID); if (HTMLElement != null) { GeckoHtmlElement e = desc.CreationMethod(window, HTMLElement); return(e); } } return(null); }
/// <summary> /// Check if any ThebesLayer painting has been done for this element, /// clears the painted flags if they have. /// </summary> public bool CheckAndClearPaintedState(GeckoHtmlElement aElement) { throw new NotImplementedException(); }
/// <summary> /// Method for testing nsStyleAnimation::ComputeDistance. /// /// Returns the distance between the two values as reported by /// nsStyleAnimation::ComputeDistance for the given element and /// property. /// </summary> public double ComputeAnimationDistance(GeckoHtmlElement element, string property, string value1, string value2) { throw new NotImplementedException(); }
/// <summary> /// Perform the equivalent of: /// window.getComputedStyle(aElement, aPseudoElement). /// getPropertyValue(aPropertyName) /// except that, when the link whose presence in history is allowed to /// influence aElement's style is visited, get the value the property /// would have if allowed all properties to change as a result of /// :visited selectors (except for cases where getComputedStyle uses /// data from the frame). /// /// This is easier to implement than adding our property restrictions /// to this API, and is sufficient for the present testing /// requirements (which are essentially testing 'color'). /// </summary> public string GetVisitedDependentComputedStyle(GeckoHtmlElement aElement, string aPseudoElement, string aPropertyName) { throw new NotImplementedException(); }
/// <summary> /// Focus the element aElement. The element should be in the same document /// that the window is displaying. Pass null to blur the element, if any, /// that currently has focus, and focus the document. /// /// Cannot be accessed from unprivileged context (not content-accessible) /// Will throw a DOM security error if called without UniversalXPConnect /// privileges. /// /// @param aElement the element to focus /// /// Do not use this method. Just use element.focus if available or /// nsIFocusManager::SetFocus instead. /// /// </summary> public void Focus(GeckoHtmlElement aElement) { throw new NotImplementedException(); }
public void add(GeckoHtmlElement element, GeckoHtmlElement before) { DOMHTMLElement.Add(element.DomObject as nsIDOMHTMLElement, before.DomObject as nsIVariant); }