From dddfa36fbbb1f4837e9f964cb5634ad202bd46d3 Mon Sep 17 00:00:00 2001 From: Jan Hesse Date: Mon, 23 Sep 2013 12:59:01 +0200 Subject: [PATCH] DOM 2 Traversal support To meet the .Net behaviour in modern browsers. We could also use [ScriptName] since NextSibling etc. is a IE8 only thingy, see: http://www.quirksmode.org/dom/w3c_traversal.html from http://www.w3.org/TR/ElementTraversal/#introduction "The DOM Level 1 Node interface defines 11 node types, but most commonly authors wish to operate solely on nodeType 1, the Element node. Other node types include the Document element and Text nodes, which include whitespace and line breaks [and comments]. DOM 1 node traversal includes all of these node types..." --- src/Libraries/Web/Xml/XmlNode.cs | 42 ++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/Libraries/Web/Xml/XmlNode.cs b/src/Libraries/Web/Xml/XmlNode.cs index e1fb1a90e..61e694779 100644 --- a/src/Libraries/Web/Xml/XmlNode.cs +++ b/src/Libraries/Web/Xml/XmlNode.cs @@ -42,6 +42,13 @@ public XmlNode FirstChild { } } + [ScriptField] + public XmlNode FirstElementChild { + get { + return null; + } + } + [ScriptField] public XmlNode LastChild { get { @@ -49,6 +56,13 @@ public XmlNode LastChild { } } + [ScriptField] + public XmlNode LastElementChild { + get { + return null; + } + } + [ScriptField] public XmlNode NextSibling { get { @@ -56,6 +70,13 @@ public XmlNode NextSibling { } } + [ScriptField] + public XmlNode NextElementSibling { + get { + return null; + } + } + [ScriptField] [ScriptName("nodeName")] public virtual string Name { @@ -109,6 +130,13 @@ public XmlNode PreviousSibling { } } + [ScriptField] + public XmlNode PreviousElementSibling { + get { + return null; + } + } + [ScriptField] [ScriptName("text")] public string InnerText { @@ -145,6 +173,10 @@ public bool HasChildNodes() { return false; } + public int ChildElementCount() { + return 0; + } + public XmlNode InsertBefore(XmlNode child, XmlNode refChild) { return null; } @@ -164,5 +196,15 @@ public XmlNode RemoveChild(XmlNode child) { public XmlNode ReplaceChild(XmlNode child, XmlNode oldChild) { return null; } + + public string GetAttribute(string attributename) { + return null; + } + + public void SetAttribute(string attributename, string attributevalue) { + } + + public void RemoveAttribute(string attributename) { + } } }