Bug 1344976 - Remove xml:base usage in FeedWriter. r?Gijs
MozReview-Commit-ID: HYYTMUqrJzN
--- a/browser/components/feeds/FeedWriter.js
+++ b/browser/components/feeds/FeedWriter.js
@@ -174,19 +174,16 @@ FeedWriter.prototype = {
},
_setContentText(id, text) {
let element = this._document.getElementById(id);
let textNode = text.createDocumentFragment(element);
while (element.hasChildNodes())
element.removeChild(element.firstChild);
element.appendChild(textNode);
- if (text.base) {
- element.setAttributeNS(XML_NS, "base", text.base.spec);
- }
},
/**
* Safely sets the href attribute on an anchor tag, providing the URI
* specified can be loaded according to rules.
* @param element
* The element to set a URI attribute on
* @param attribute
@@ -381,18 +378,16 @@ FeedWriter.prototype = {
let entryContainer = this._document.createElementNS(HTML_NS, "div");
entryContainer.className = "entry";
// If the entry has a title, make it a link
if (entry.title) {
let a = this._document.createElementNS(HTML_NS, "a");
let span = this._document.createElementNS(HTML_NS, "span");
a.appendChild(span);
- if (entry.title.base)
- span.setAttributeNS(XML_NS, "base", entry.title.base.spec);
span.appendChild(entry.title.createDocumentFragment(a));
// Entries are not required to have links, so entry.link can be null.
if (entry.link)
this._safeSetURIAttribute(a, "href", entry.link.spec);
let title = this._document.createElementNS(HTML_NS, "h3");
title.appendChild(a);
@@ -407,20 +402,16 @@ FeedWriter.prototype = {
entryContainer.appendChild(title);
}
let body = this._document.createElementNS(HTML_NS, "div");
let summary = entry.summary || entry.content;
let docFragment = null;
if (summary) {
- if (summary.base)
- body.setAttributeNS(XML_NS, "base", summary.base.spec);
- else
- LOG("no base?");
docFragment = summary.createDocumentFragment(body);
if (docFragment)
body.appendChild(docFragment);
// If the entry doesn't have a title, append a # permalink
// See http://scripting.com/rss.xml for an example
if (!entry.title && entry.link) {
let a = this._document.createElementNS(HTML_NS, "a");