Re: Access element test pages

Hallo Richard,
I'm pleased to give more details, because I wrote that notes "on the fly",
along the call.  Now I've changed the access key to "x", to avoid conflicts
for the english version of the browsers (usually the "t" key is reserved to
the "Tools" menu).

Talking about the test: I've placed an <access> element with his "key" and
"targetid" attributes in the head of the document and then verified it in
the DOM tree; page was served as xml to IE6/7, FF 2, Opera 9.2 and Safari
1.3.
Then, to see effectively the access key working at least in FF and IE I've
tried the following separate ways, according to several aspects of Sjoerd
Visscher's implementations [1, 2].

Firefox is capable of rendering with css plus a Mozilla XBL binding
structure; so <access> is replaced by an <a> element, "key" and
"targetid" (or "targetrole") attributes are replaced by the supported
"accesskey" and "href" set for an internal anchor ("#id"):

<xbl:binding id="access">
    <xbl:implementation>
         <xbl:constructor>
              a = this.ownerDocument.createElementNS("
http://www.w3.org/1999/xhtml", "a");
              a.setAttribute("href", "#" + this.getAttribute("targetid") ||
"#" + this.getAttribute("targetrole"));
              a.setAttribute("accesskey", this.getAttribute("key"));
              this.appendChild(a);
         </xbl:constructor>
    </xbl:implementation>
</xbl:binding>

The <a> support have been set previously in another constructor, with XLINK
behaviors, on the same xbl structure.
While the document has XHTML2 declaration and namespace, to work correctly
in FF the <access> element and the linked <section> have their namespace
switched to xhtml.


IE, as I wrote, shows the element in the DOM, but the key events seem not to
work at all without external aid. Trasforming the document via XSLT in
XHTML1.0 Strict <access> (like in FF) can be replaced by an <a> element:

<xsl:template match="x:access">
    <a href="#{@targetid}" title="{@title}" accesskey="{@key}"></a>
</xsl:template>


I prepared also a single server-side (php) test page [3], that uses a
content negotiation to serve the document: to IE as application/xml, to FF
(Opera, etc.) as application/xhtml+xml. I hope this could be useful.

Best regards,
Alessio


[1]  http://w3future.com/weblog/gems/xhtml2.xml
[2]  http://w3future.com/weblog/gems/xhtml2b.xml
[3]  http://terrafertile.ch/w3/xhtml2/


Alessio Cartocci
International Webmasters Association / The HTML Writers Guild
http://www.iwanet.org



2007/5/30, Richard Schwerdtfeger <schwer@us.ibm.com>:
>
>  Alessio,
>
> You said you passed an access an element, in a docuement, to IE after
> passing it through an XSLT and you say that it worked. Please be more
> explicit. ... Did it just show up in the DOM or did you also do something to
> add keyboard support for the access key "t."
>
> Rich
>
>
> Rich Schwerdtfeger
> Distinguished Engineer, SWG Accessibility Architect/Strategist
> Chair, IBM Accessibility Architecture Review Board
> blog: http://www.ibm.com/developerworks/blogs/page/schwer
>

Received on Friday, 1 June 2007 01:33:34 UTC