From 84053d7d848205d0fff2ca2b3bdbe9e29107c6ae Mon Sep 17 00:00:00 2001 From: Tobias Gummesson Date: Mon, 8 Jul 2013 02:37:11 -0700 Subject: [PATCH] Removed Ignore attribute from WhitespaceTests so the tests in the class will be executed. Made some modifications to XamlParser so it aligns with the official XamlReader and the WhitespaceTests will pass. --- .../Tests/XamlDom/WhitespaceTests.cs | 1 - .../WpfDesign.XamlDom/Project/XamlParser.cs | 15 +-------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/WhitespaceTests.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/WhitespaceTests.cs index a1bfd201d0..71d3d4b6be 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/WhitespaceTests.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/WhitespaceTests.cs @@ -7,7 +7,6 @@ using NUnit.Framework; namespace ICSharpCode.WpfDesign.Tests.XamlDom { [TestFixture] - [Ignore("Broken on .NET 4")] public class WhitespaceTests : TestHelper { [Test] diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlParser.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlParser.cs index 3c1288e2a0..ecd0839c40 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlParser.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlParser.cs @@ -275,15 +275,6 @@ namespace ICSharpCode.WpfDesign.XamlDom } foreach (XmlNode childNode in GetNormalizedChildNodes(element)) { - - // I don't know why the official XamlReader runs the property getter - // here, but let's try to imitate it as good as possible - if (defaultProperty != null && !defaultProperty.IsCollection) { - for (; combinedNormalizedChildNodes > 0; combinedNormalizedChildNodes--) { - defaultProperty.GetValue(obj.Instance); - } - } - XmlElement childElement = childNode as XmlElement; if (childElement != null) { if (childElement.NamespaceURI == XamlConstants.XamlNamespace) @@ -314,9 +305,7 @@ namespace ICSharpCode.WpfDesign.XamlDom } } } - - int combinedNormalizedChildNodes; - + IEnumerable GetNormalizedChildNodes(XmlElement element) { XmlNode node = element.FirstChild; @@ -334,8 +323,6 @@ namespace ICSharpCode.WpfDesign.XamlDom && (node.NodeType == XmlNodeType.Text || node.NodeType == XmlNodeType.CDATA || node.NodeType == XmlNodeType.SignificantWhitespace)) { - combinedNormalizedChildNodes++; - if (text != null) text.Value += node.Value; else cData.Value += node.Value; XmlNode nodeToDelete = node;