From d62bacfed35e17b8ad940409625707fc5a5587e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Mon, 6 Jun 2011 08:07:57 +0000 Subject: [PATCH] fix GeoRSS test_leading_space test in IE (References #2780) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12049 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- tests/Format/GeoRSS.html | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/Format/GeoRSS.html b/tests/Format/GeoRSS.html index 5cea1ae627..6e82f058ab 100644 --- a/tests/Format/GeoRSS.html +++ b/tests/Format/GeoRSS.html @@ -80,7 +80,15 @@ var parser = new OpenLayers.Format.GeoRSS(); var items = parser.read(' '); t.eq(items.length, 1, "item created"); - t.eq(items[0].attributes.description, " foo", "description value is ok"); + + // when parsing a node composed of both spaces and a cdata section + // (e.g. IE8 ignores + // the leading white spaces, and reports that the node does not + // include a text node. For that reason, we need to trim the + // string value resulting from the parsing. + + var description = OpenLayers.String.trim(items[0].attributes.description); + t.eq(description, "foo", "description value is ok"); } var shell_start = '\n scribble\n http://featureserver.org/featureserver.cgi/scribble?format=atom\n FeatureServer\n';