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 2006-07-21 00:12:26 +00:00
Родитель b577d1f18d
Коммит bae4fbcd3c
1 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@ -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,