From 197ffe4af0b5e91e9e8628eb8c39fb94ac585dd0 Mon Sep 17 00:00:00 2001 From: "sayrer@gmail.com" Date: Tue, 11 Mar 2008 13:05:09 -0700 Subject: [PATCH] Bug 381357. Live bookmarks for feeds served as text/html don't load. r=gavin --- toolkit/components/feeds/src/FeedProcessor.js | 3 + .../places/tests/chrome/Makefile.in | 3 + .../places/tests/chrome/rss_as_html.rss | 27 +++++++ .../tests/chrome/rss_as_html.rss^headers^ | 2 + .../places/tests/chrome/test_381357.xul | 80 +++++++++++++++++++ 5 files changed, 115 insertions(+) create mode 100644 toolkit/components/places/tests/chrome/rss_as_html.rss create mode 100644 toolkit/components/places/tests/chrome/rss_as_html.rss^headers^ create mode 100644 toolkit/components/places/tests/chrome/test_381357.xul diff --git a/toolkit/components/feeds/src/FeedProcessor.js b/toolkit/components/feeds/src/FeedProcessor.js index 8df8eec3712..e23858550c0 100644 --- a/toolkit/components/feeds/src/FeedProcessor.js +++ b/toolkit/components/feeds/src/FeedProcessor.js @@ -1421,6 +1421,9 @@ FeedProcessor.prototype = { // The XMLReader will throw sensible exceptions if these get called // out of order. onStartRequest: function FP_onStartRequest(request, context) { + var channel = request.QueryInterface(Ci.nsIChannel); + if (channel) + channel.contentType = "application/xml"; this._reader.onStartRequest(request, context); }, diff --git a/toolkit/components/places/tests/chrome/Makefile.in b/toolkit/components/places/tests/chrome/Makefile.in index 1b2a4585dfb..4c987aa4bdb 100644 --- a/toolkit/components/places/tests/chrome/Makefile.in +++ b/toolkit/components/places/tests/chrome/Makefile.in @@ -47,12 +47,15 @@ include $(topsrcdir)/config/rules.mk _HTTP_FILES = \ sample_feed.atom \ bad_links.atom \ + rss_as_html.rss \ + rss_as_html.rss^headers^ \ $(NULL) _CHROME_FILES = \ test_371798.xul \ test_342484.xul \ test_341972a.xul \ + test_381357.xul \ $(NULL) libs:: $(_HTTP_FILES) diff --git a/toolkit/components/places/tests/chrome/rss_as_html.rss b/toolkit/components/places/tests/chrome/rss_as_html.rss new file mode 100644 index 00000000000..e8230503533 --- /dev/null +++ b/toolkit/components/places/tests/chrome/rss_as_html.rss @@ -0,0 +1,27 @@ + + + +sadfasdfasdfasfasdf +http://www.example.com +asdfasdfasdf.example.com +de +asdfasdfasdfasdf +Tue, 11 Mar 2008 18:52:52 +0100 +http://blogs.law.harvard.edu/tech/rss +10 + +The First Title +http://www.example.com/index.html +Tue, 11 Mar 2008 18:24:43 +0100 + + +askdlfjas;dfkjas;fkdj +

+]]> +
+aklsjdhfasdjfahasdfhj +http://foo.example.com/asdfasdf +
+
+
diff --git a/toolkit/components/places/tests/chrome/rss_as_html.rss^headers^ b/toolkit/components/places/tests/chrome/rss_as_html.rss^headers^ new file mode 100644 index 00000000000..04fbaa08fe9 --- /dev/null +++ b/toolkit/components/places/tests/chrome/rss_as_html.rss^headers^ @@ -0,0 +1,2 @@ +HTTP 200 OK +Content-Type: text/html diff --git a/toolkit/components/places/tests/chrome/test_381357.xul b/toolkit/components/places/tests/chrome/test_381357.xul new file mode 100644 index 00000000000..ac7aa0f8b8d --- /dev/null +++ b/toolkit/components/places/tests/chrome/test_381357.xul @@ -0,0 +1,80 @@ + + + + + + + + + + + +