make the microsummary service support <link> tags with rel=space-separated list of words and ignore case of "microsummary" rel value

Patch by Justin Dolske.
bug=342228
r=myk
This commit is contained in:
myk@mozilla.org
2007-01-14 05:38:12 +00:00
parent d6cf99e575
commit 191065c2ff

View File

@@ -1414,9 +1414,18 @@ MicrosummarySet.prototype = {
for ( var i = 0; i < links.length; i++ ) {
var link = links[i];
if (link.getAttribute("rel") != "microsummary")
if(!link.hasAttribute("rel"))
continue;
var relAttr = link.getAttribute("rel");
// The attribute's value can be a space-separated list of link types,
// check to see if "microsummary" is one of them.
var linkTypes = relAttr.split(/\s+/);
if (!linkTypes.some( function(v) { return v.toLowerCase() == "microsummary"; }))
continue;
// Unlike the "href" attribute, the "href" property contains
// an absolute URI spec, so we use it here to create the URI.
var generatorURI = this._ios.newURI(link.href,