コード例 #1
0
ファイル: utility.cs プロジェクト: modulexcite/IL2JS
        /// <summary>
        /// Check if one element is a descendant of another
        /// </summary>
        /// <param name="parent">
        /// The ancestor element
        /// </param>
        /// <param name="child">
        /// The child element in question
        /// </param>
        /// <returns>
        /// True if child is a descendant of parent, false otherwise
        /// </returns>
        public static bool IsDescendantOf(DomNode parent, DomNode child)
        {
            while (!CUIUtility.IsNullOrUndefined(child))
            {
                try
                {
                    if (child.NodeName.ToLower() == "body")
                    {
                        break;
                    }
                }
                catch
                {
                    // Firefox will sometimes start trying to iterate its own chrome nodes such as
                    // the scrollbar which causes an access denied exception. If we get here, there's
                    // nothing we can do, so just check the condition and break out of the loop
                    if (child == parent)
                        return true;
                    break;
                }

                if (child == parent)
                    return true;
                child = child.ParentNode;
            }
            return false;
        }
コード例 #2
0
 extern public void AppendChild(DomNode newChild);
コード例 #3
0
ファイル: utility.cs プロジェクト: modulexcite/IL2JS
 /// <summary>
 /// Removes all the child nodes from a DOMElement the slow way.
 /// Don't use this unless you have to (see remarks)
 /// </summary>
 /// <param name="elm">A pointer to the node to remove children from</param>
 /// <remarks>
 /// This method should only be used when we can't replace elm in the DOM tree.
 /// If you don't need this guarantee, please use RemoveChildNodes(DOMElement elm) instead.
 /// </remarks>
 /// <owner alias="JKern" />
 public static void RemoveChildNodesSlow(DomNode elm)
 {
     while (elm.HasChildNodes())
     {
         elm.RemoveChild(elm.FirstChild);
     }
 }
コード例 #4
0
 extern public DomNode SwapNode(DomNode otherNode);
コード例 #5
0
 extern public DomNode ReplaceNode(DomNode replacement);
コード例 #6
0
 extern public DomNode RemoveChild(DomNode oldChild);
コード例 #7
0
 extern public DomNode ReplaceChild(DomNode newChild, DomNode oldChild);
コード例 #8
0
 extern public void Add(DomNode child);
コード例 #9
0
 extern public DomNode InsertBefore(DomNode newChild, DomNode child);
コード例 #10
0
ファイル: DomNode.cs プロジェクト: modulexcite/IL2JS
 extern public DomNode ReplaceNode(DomNode replacement);
コード例 #11
0
ファイル: DomNode.cs プロジェクト: modulexcite/IL2JS
 extern public void AppendChild(DomNode newChild);
コード例 #12
0
ファイル: DomNode.cs プロジェクト: modulexcite/IL2JS
 extern public DomNode SwapNode(DomNode otherNode);
コード例 #13
0
ファイル: DomNode.cs プロジェクト: modulexcite/IL2JS
 extern public DomNode ReplaceChild(DomNode newChild, DomNode oldChild);
コード例 #14
0
ファイル: DomNode.cs プロジェクト: modulexcite/IL2JS
 extern public DomNode RemoveChild(DomNode oldChild);
コード例 #15
0
ファイル: DomNode.cs プロジェクト: modulexcite/IL2JS
 extern public DomNode InsertBefore(DomNode newChild, DomNode child);
コード例 #16
0
ファイル: DomNode.cs プロジェクト: modulexcite/IL2JS
 extern public void Add(DomNode child);