みんな、accesskeyってどうしてる? tabindexは?

このエントリーをはてなブックマークに追加
315Name_Not_Found
>>290のXHTML版を作ってみました。需要はないでしょうけど

var keys = new Array();
keys["start"] = "S";
keys["sext"] = "N";
keys["srev"] = "P";
keys["sontents"] = "C";
keys["index"] = "I";
keys["glossary"] = "G";
var xhtml="http://www.w3.org/1999/xhtml";
function navi()
{
    var links=document.getElementsByTagNameNS(xhtml, "link");
    var navi=document.createElementNS(xhtml, "ul");
    navi.className="navigation";
    navi.title="navigation";
    var panel=document.getElementById("NavigatorPanel");
    for (var i = 0; i < links.length; i++) {
        var item=navigatorItem(links.item(i));
        if(item==null) continue;
        navi.appendChild(item);
    }
    panel.appendChild(navi);
}
function navigatorItem(linkElement)
{
    if(linkElement.hasAttributeNS(xhtml, "href")==false) return null;
    if(linkElement.hasAttributeNS(xhtml, "rel")==false) return null;
    if(linkElement.getAttributeNS(xhtml, "rel").toLowerCase().indexOf("stylesheet")>=0) return null;
    var listItem=document.createElementNS(xhtml, "li");
    var anchor=document.createElementNS(xhtml, "a");
    if(linkElement.hasAttributeNS(xhtml, "type")==true) anchor.setAttributeNS(xhtml, "type", linkElement.getAttributeNS(xhtml, "type"));
    if(linkElement.hasAttributeNS(xhtml, "charset")==true) anchor.setAttributeNS(xhtml, "charset", linkElement.getAttributeNS(xhtml, "charset"));
    if(linkElement.hasAttributeNS(xhtml, "hreflang")==true) anchor.setAttributeNS(xhtml, "hreflang", linkElement.getAttributeNS(xhtml, "hreflang"));
    if(linkElement.hasAttributeNS(xhtml, "rev")==true) anchor.setAttributeNS(xhtml, "rev", linkElement.getAttributeNS(xhtml, "rev"));
    anchor.setAttributeNS(xhtml, "rel", linkElement.getAttributeNS(xhtml, "rel"));
    anchor.setAttributeNS(xhtml, "href", linkElement.getAttributeNS(xhtml, "href"));
    var key=getAccessKey(linkElement.getAttributeNS(xhtml, "rel"));
    if(key!=null) anchor.setAttributeNS(xhtml, "accesskey", key);
    if(linkElement.hasAttributeNS(xhtml, "title")==true) anchor.appendChild( document.createTextNode(linkElement.getAttributeNS(xhtml, "title")) );
    else anchor.appendChild( document.createTextNode(linkElement.getAttributeNS(xhtml, "rel")) );
    listItem.appendChild(anchor);
    return listItem;
}
function getAccessKey(relString)
{
    return keys[relString.toLowerCase()];
}
function Initializer()
{
    function Initializer_handleEvent(e)
    {
        navi();
    }
    this.handleEvent=Initializer_handleEvent;
    return this;
}
window.addEventListener("load", new Initializer(), true);